Search completed in 1.04 seconds.
1675 results for "Functions":
Your results are loading. Please wait...
Functions — reusable blocks of code - Learn web development
previous overview: building blocks next another essential concept in coding is functions, which allow you to store a piece of code that does a single task inside a defined block, and then call that code whenever you need it using a single short command — rather than having to type out the same code multiple times.
... in this article we'll explore fundamental concepts behind functions such as basic syntax, how to invoke and define them, scope, and parameters.
... objective: to understand the fundamental concepts behind javascript functions.
...And 31 more matches
Functions - JavaScript
« previousnext » functions are one of the fundamental building blocks in javascript.
... see also the exhaustive reference chapter about javascript functions to get to know the details.
... defining functions function declarations a function definition (also called a function declaration, or function statement) consists of the function keyword, followed by: the name of the function.
...And 28 more matches
Functions - JavaScript
in javascript, functions are first-class objects, because they can have properties and methods just like any other object.
... what distinguishes them from other objects is that functions can be called.
... for more examples and explanations, see also the javascript guide about functions.
...And 18 more matches
NSS functions
this page lists all exported functions in nss 3.11.7 it was ported from here.
... ssl functions the public functions listed here are used to configure sockets for communication via the ssl and tls protocols.
... in addition to the functions listed here, applications that support ssl use some of the certificate functions, crypto functions, and utility functions described below on this page.
...And 10 more matches
I/O Functions
this chapter describes the nspr functions used to perform operations such as system access, normal file i/o, and socket (network) i/o.
...for information about the types most commonly used with the functions described in this chapter, see i/o types.
... functions that operate on pathnames functions that act on file descriptors directory i/o functions socket manipulation functions converting between host and network addresses memory-mapped i/o functions anonymous pipe function polling functions pollable events manipulating layers functions that operate on pathnames a file or directory in a file system is specified by its pathname.
...And 7 more matches
JS_DefineFunctions
syntax bool js_definefunctions(jscontext *cx, js::handle<jsobject*> obj, const jsfunctionspec *fs, propertydefinitionbehavior behavior = defineallproperties); in spidermonkey versions prior to spidermonkey 24, fs was not const.
... name type description cx jscontext * the context in which to define functions.
... obj js::handle&lt;jsobject*&gt; the object on which functions are to be defined.
...And 7 more matches
Exported WebAssembly functions - WebAssembly
exported webassembly functions are how webassembly functions are represented in javascript.
... exported webassembly functions are basically just javascript wrappers that represent webassembly functions in javascript.
... you can retrieve exported webassembly functions in two ways: by calling table.prototype.get() on an existing table.
...And 6 more matches
NSPR functions
however, a small number of nspr functions are required for using the certificate verification and ssl functions in nss.
... these nspr functions are listed in this section.
...the nss functions port_geterror and port_seterror are simply wrappers of pr_geterror and pr_seterror.
...And 5 more matches
Functions
(but note that objects of other classes can be callable and can even have typeof obj == "function".) script functions functions written in javascript and compiled to bytecode.
...if we can prove at compile time that a function does not refer to any locals or arguments of enclosing functions, it is a null closure.
...barring with and eval, all outermost functions are null closures.
...And 5 more matches
Test your skills: Functions - Learn web development
this aim of this skill test is to assess whether you've understood our functions — reusable blocks of code, build your own function, and function return values articles.
... functions 1 for the first task, you have to create a simple function — choosename() — that prints a random name from the provided array (names) to the provided paragraph (para), and then run it once.
... functions 2 for our second functions-related task, you need to create a function that draws a rectangle on the provided <canvas> (reference variable canvas, context available in ctx), based on the five provided input variables: x — the x coordinate of the rectangle.
...And 2 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.
... in particular, these functions are used for obtaining certificates, keys, and passwords.
... this was converted from "chapter 7: pkcs #11 functions".
...And 2 more matches
JSFunctionSpec
syntax struct jsfunctionspec { const char *name; jsnativewrapper call; uint16_t nargs; uint16_t flags; const char *selfhostedname; }; typedef struct jsnativewrapper { jsnative op; const jsjitinfo *info; } jsnativewrapper; name type description name const char * the function's name.
... description jsfunctionspec defines the attributes for a single js function to associate with an object.
... an application typically has an array of jsfunctionspec to define all the functions for an object and calls js_definefunctions or js_initclass to create the functions and assign them to an object.
...And 2 more matches
FC_GetFunctionStatus
name fc_getfunctionstatus - get the status of a function running in parallel syntax ck_rv fc_getfunctionstatus( ck_session_handle hsession ); parameters hsession [in] session handle.
... description fc_getfunctionstatus is a legacy function that simply returns ckr_function_not_parallel.
... return value fc_getfunctionstatus always returns ckr_function_not_parallel.
... examples see also nsc_getfunctionstatus ...
JS_SetICUMemoryFunctions
sets the memory allocation and deallocation functions used by the icu internationalization library.
... syntax bool js_seticumemoryfunctions(js_icuallocfn allocfn, js_icureallocfn reallocfn, js_icufreefn freefn); type description allocfn js_icuallocfn an allocation function.
... description js_seticumemoryfunctions sets the allocator functions used by the icu internationalization library.
...mxr id search for js_seticumemoryfunctions.
Deprecated SSL functions
the following ssl functions have been replaced with newer versions.
... the deprecated functions are not supported by the new ssl shared libraries.
... applications that want to use the ssl shared libraries must convert to calling the new replacement functions listed below.
SSL functions
the public functions listed here are used to configure sockets for communication via the ssl and tls protocols.
... in addition to the functions listed here, applications that support ssl use some of the certificate functions, crypto functions, and utility functions described below on this page.
... other sources of information: the nss_reference documents the functions most commonly used by applications to support ssl.
JS_GetFunctionScript
syntax jsscript * js_getfunctionscript(jscontext *cx, js::handlefunction fun); name type description cx jscontext * pointer to a js context from which to derive runtime information.
... description js_getfunctionscript returns a pointer to jsscript for the specified function, fun.
... see also mxr id search for js_getfunctionscript bug 1069694 ...
CSS numeric factory functions - Web APIs
the css numeric factory functions, such as css.em() and css.turn() are methods that return cssunitvalues with the value being the numeric argument and the unit being the name of the method used.
... these functions create new numeric values less verbosely than using the cssunitvalue.cssunitvalue() constructor.
...in this example, we set the margin on our element using the css.px() factory function: myelement.attributestylemap.set('margin', css.px(40)); let currentmargin = myelement.attributestylemap.get('margin'); console.log(currentmargin.value, currentmargin.unit); // 40, 'px' specification specification status comment css object model (cssom)the definition of 'numeric factory functions' in that specification.
Functions and classes available to Web Workers - Web APIs
in addition to the standard javascript set of functions (such as string, array, object, json, etc), there are a variety of functions available from the dom to workers.
... (yes) (yes) (yes) (yes) promise javascript objects that allow you to write asynchronous functions.
...this objects defines worker-specific functions.
NSS Key Functions
this chapter describes two functions used to manipulate private keys and key databases such as the key3.db database provided with nss.
... this was converted from "chapter 6: key functions".
Declaring and Calling Functions
functions are declared using the library object's declare() method.
... once declared, functions can be called using standard function syntax.
Functions - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the following is an annotated list of core xpath functions and xslt-specific additions to xpath, including a description, syntax, a list of arguments, result-type, source in the appropriate w3c recommendation, and degree of present gecko support.
... for further information on using xpath/xslt functions, please see the for further reading page.
Signature (functions) - MDN Web Docs Glossary: Definitions of Web-related terms
a function signature (or type signature, or method signature) defines input and output of functions or methods.
Certificate functions
the public functions listed here are used to interact with certificate databases.
Cryptography functions
the public functions listed here perform cryptographic operations based on the pkcs #11 interface.
PKCS 12 functions
the public functions listed here perform pkcs #12 operations required by some of the nss tools and other applications.
PKCS 7 functions
the public functions listed here perform pkcs #7 operations required by mail and news applications and by some of the nss tools.
S/MIME functions
the public functions listed here perform s/mime operations using the s/mime toolkit.
Utility functions
the public functions listed here perform initialization tasks and other services.
Core XPCOM functions
xpcom provides a number of global functions which are used to initialize and shut down the xpcom library, as well as to allocate memory, get access to services, and to instantiate interfaces.
XPCOM string functions
xpcom provides these low-level string functions to let you work with strings; however, it's often better to use one of the string classes rather than directly using these functions.
NSS API Guidelines
the layering section explains how the nss code is layered, and how higher-level functions wrap low-level functions.
...the functions in these apis should never call api layers above them.
...that is, access to these functions should only be provided by the api directly above them.
...And 53 more matches
Index
MozillaTechXPCOMIndex
here is the interface, and a description of its use.</t> 10 how to pass an xpcom object to a new window needsexample, needshelp if you want to be able to call functions within an xpcom object from a xul window's code, you can do so if you pass the xpcom object as one of the arguments to the window creation method.
... 125 xpcom reference add-ons, extensions, landing, mozilla, reference, xpcom this reference describes the interfaces and functions provided by the xpcom library.
... in addition, it details the various helper classes and functions, as well as the components, provided by the xpcom glue library.
...And 50 more matches
sslfnc.html
upgraded documentation may be found in the current nss reference ssl functions chapter 4 ssl functions this chapter describes the core ssl functions.
... ssl initialization functions ssl export policy functions ssl configuration functions ssl communication functions ssl functions used by callbacks ssl handshake functions nss shutdown function deprecated functions ssl initialization functions this section describes the initialization functions that are specific to ssl.
... for a complete list of nss initialization functions, see initialization.
...And 47 more matches
JSAPI User Guide
what spidermonkey does the javascript engine compiles and executes scripts containing javascript statements and functions.
...it also makes it easy for each application to expose some of its own objects and functions to javascript code.
...the next section explains how to set them up, using jsapi functions.
...And 44 more matches
Index
22 js::add*root jsapi reference, needscontent, obsolete, reference, référence(2), spidermonkey these functions are obsoleted, use js::persistentrooted instead.
... 53 js::newfunctionfromspec jsapi reference, reference, référence(2), spidermonkey js::newfunctionfromspec creates a new function based on the given jsfunctionspec, *fs.
... 61 js::propertyspecnameequalsid jsapi reference, reference, référence(2), spidermonkey js::propertyspecnameequalsid determines if the given jspropertyspec::name or jsfunctionspec::name value equals the given jsid, and returns true if so.
...And 38 more matches
Index
a core element of nss is freebl, a base library providing hash functions, big number calculations, and cryptographic algorithms.
...instead, the programmer will use lookup functions, and nss will provide an access handle that will be subsequently used by the application's code.
...the application should always call the appropriate dereference (destroy) functions once a handle is no longer needed.
...And 29 more matches
Index - Archive of obsolete content
45 hotkeys add-on sdk assign hotkey combinations to functions in your add-on.
... 53 private-browsing add-on sdk check whether a given object is private, so an add-on can respect private browsing 54 querystring add-on sdk utility functions for working with query strings.
... 75 content/mod provides functions to modify a page content.
...And 26 more matches
A re-introduction to JavaScript (JS tutorial) - JavaScript
javascript also supports functional programming — because they are objects, functions may be stored in variables and passed around like any other object.
...and to be technically accurate, functions are just a special type of object.
...there's also a built-in object that we did not mention earlier called math that provides advanced mathematical functions and constants: math.sin(3.5); var circumference = 2 * math.pi * r; you can convert a string to an integer using the built-in parseint() function.
...And 26 more matches
Index - Web APIs
WebAPIIndex
in most dom methods, you will directly retrieve the attribute as a string (e.g., element.getattribute()), but certain functions (e.g., element.getattributenode()) or means of iterating return attr types.
... 386 css numeric factory functions api, css, css api, houdini, reference, factory function the css numeric factory functionsare methods that return cssunitvalues with the value being the numeric argument and the unit being the name of the method used.
... 397 css painting api api, css, css paint api, houdini, painting, reference the css painting api — part of the css houdini umbrella of apis — allows developers to write javascript functions that can draw directly into an element's background, border, or content.
...And 25 more matches
Understanding WebAssembly text format - WebAssembly
all code in a webassembly module is grouped into functions, which have the following pseudo-code structure: ( func <signature> <locals> <body> ) the signature declares what the function takes (parameters) and returns (return values).
... so this is similar to functions in other languages, even if it looks different because it is an s-expression.
...like in an es2015 module, wasm functions must be explicitly exported by an export statement inside the module.
...And 24 more matches
Shell global objects
note: this list overlaps with "built-in functions" in introduction to the javascript shell and is probably not complete.
... see js/src/shell/js.cpp (around shell_functions) for more.
... this page lists variables and functions available on spidermonkey 53.
...And 19 more matches
Bytecode Descriptions
functions creating functions lambda operands: (uint32_t funcindex) stack: ⇒ fn push a function object.
...used to create most js functions.
... notable exceptions are arrow functions and derived or default class constructors.
...And 18 more matches
Python binding for NSS
the design of python-nss follows these basic guiding principles: be a thin layer with almost a one-to-one mapping of nss/nspr calls to python methods and functions.
... nss/nspr functions which operate on a nss/nspr object (i.e.
...the python global interpreter lock (gil) is released prior to calling nss/nspr c functions and reaquired after the nss/nspr c function returns.
...And 17 more matches
JSAPI reference
rflagsandnumber js_reporterrorflagsandnumberuc js_reporterrornumberucarray added in spidermonkey 24 js_reportoutofmemory js_reportallocationoverflow added in spidermonkey 1.8 js_geterrorreporter js_seterrorreporterobsolete since jsapi 52 js_errorfromexception js_geterrorprototype jsreport_is_exception jsreport_is_strict jsreport_is_warning jsreport_is_strict_mode_error the following functions allow c/c++ functions to throw and catch javascript exceptions: js::createerror added in spidermonkey 38 js_isexceptionpending js_getpendingexception js_setpendingexception js_clearpendingexception js_throwstopiteration added in spidermonkey 1.8 js_isstopiteration added in spidermonkey 31 typedef jsexceptionstate js_saveexceptionstate js_restoreexceptionstate js_dropexceptionstate...
... these functions translate errors into exceptions and vice versa: js_reportpendingexception js_errorfromexception js_throwreportederror obsolete since jsapi 29 values and types typedef jsval js::value js::value constructors: js::nullvalue added in spidermonkey 24 js::undefinedvalue added in spidermonkey 24 js::booleanvalue added in spidermonkey 24 js::truevalue added in spidermonkey 24 js::falsevalue added in spidermonkey 24 js::numbervalue added in spidermonkey 24 js::int32value added in spidermonkey 24 js::doublevalue added in spidermonkey 24 js::float32value added in spidermonkey 24 js::stringvalue added in spidermonkey 24 js::objectvalue added in spidermonkey 24 js::objectornullvalue added in spidermonkey 24 js::symbolvalue added in spidermonkey 38 js::value...
... js_convertarguments obsolete since jsapi 38 js_convertargumentsva obsolete since jsapi 38 js_pusharguments obsolete since javascript 1.8.5 js_pushargumentsva obsolete since javascript 1.8.5 js_poparguments obsolete since javascript 1.8.5 js_addargumentformatter obsolete since jsapi 18 js_removeargumentformatter obsolete since jsapi 18 the following functions convert js values to various types.
...And 16 more matches
Function return values - Learn web development
previous overview: building blocks next there's one last essential concept about functions for us to discuss — return values.
... some functions don't return a significant value, but others do.
... it's important to understand what their values are, how to use them in your code, and how to make functions return useful values.
...And 14 more matches
Arrow function expressions - JavaScript
teral expression: params => ({foo: bar}) // rest parameters and default parameters are supported (param1, param2, ...rest) => { statements } (param1 = defaultvalue1, param2, …, paramn = defaultvaluen) => { statements } // destructuring within the parameter list is also supported var f = ([a, b] = [1, 2], {x: c} = {x: a + b}) => a + b + c; f(); // 6 description see also "es6 in depth: arrow functions" on hacks.mozilla.org.
... two factors influenced the introduction of arrow functions: the need for shorter functions and the behavior of the this keyword.
... shorter functions var elements = [ 'hydrogen', 'helium', 'lithium', 'beryllium' ]; // this statement returns the array: [8, 6, 7, 9] elements.map(function(element) { return element.length; }); // the regular function above can be written as the arrow function below elements.map((element) => { return element.length; }); // [8, 6, 7, 9] // when there is only one parameter, we can remove the surrounding parentheses elements.map(element => { return element.length; }); // [8, 6, 7, 9] // when the only statement in an arrow function is `return`, we can remove `return` and remove // the surrounding curly brackets elements.map(element => element.length); // [8, 6, 7, 9] // in this case, because we only need the length property, we can use destructuring parameter: // notice that the `l...
...And 14 more matches
sslintro.html
this chapter introduces some of the basic ssl functions.
... an ssl application typically includes five parts: initialization configuration communication functions used by callbacks cleanup although the details differ somewhat for client and server applications, the concepts and many of the functions are the same for both.
... initialization initialization includes setting up configuration files, setting global defaults, and setting up callback functions.
...And 13 more matches
WebIDL bindings
you will need to flag the functions that return your object as [newobject] in the webidl.
... if your object is not refcounted then the return value of functions that return it should return an nsautoptr.
... for example, this webidl: enum myenum { "something", "something-else", "", "another" }; would lead to this c++ enum declaration: enum class myenum : uint8_t { something, something_else, _empty, another }; namespace myenumvalues { extern const enumentry strings[10]; } // namespace myenumvalues callback function types callback functions are represented as an object, inheriting from mozilla::dom::callbackfunction, whose name, in the mozilla::dom namespace, matches the name of the callback function in the webidl.
...And 12 more matches
Closures - JavaScript
however, since inner functions have access to the variables of outer functions, displayname() can access the variable name declared in the parent function, init().
...this is an example of lexical scoping, which describes how a parser resolves variable names when functions are nested.
...nested functions have access to variables declared in their outer scope.
...And 12 more matches
Index - MDN Web Docs Glossary: Definitions of Web-related terms
it is a mnemonic for the four basic functions of persistent storage.
... crud typically refers to operations performed in a database or datastore, but it can also apply to higher level functions of an application such as soft deletes where data is not actually deleted but marked as deleted via a status.
... 62 call stack call stack, codingscripting, glossary, javascript a call stack is a mechanism for an interpreter (like the javascript interpreter in a web browser) to keep track of its place in a script that calls multiple functions — what function is currently being run and what functions are called from within that function, etc.
...And 11 more matches
Index - Learn web development
55 making asynchronous programming easier with async and await beginner, codingscripting, guide, javascript, learn, promises, async, asynchronous, await more recent additions to the javascript language are async functions and the await keyword, part of the so-called ecmascript 2017 javascript edition (see ecmascript next support in mozilla).
...you can even create your own objects to encapsulate related functions and variables into efficient packages and act as handy data containers.
...you should also appreciate that objects are very useful as structures for storing related data and functionality — if you tried to keep track of all the properties and methods in our person object as separate variables and functions, it would be inefficient and frustrating, and we'd run the risk of clashing with other variables and functions that have the same names.
...And 11 more matches
XPCOM Interfaces - Archive of obsolete content
an interface would need to be created which describes properties and functions that can be performed on files.
...functions of a file would include moving, copying and deleting it.
...thus, we can use a component by accessing it using the functions we know from the interface.
...And 10 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.
... functions for different kinds of tokens.
...how nss calls pkcs #11 functions this section is organized according to the categories used in pkcs #11: cryptographic token interface standard, version 2.0.
...And 10 more matches
SpiderMonkey Internals
therefore, almost all functions in spidermonkey, api or not, take a jscontext pointer as their first argument.
...the script also contains objects, including any functions defined in the source code, each of which has its own, nested script.
... only jit code really depends on the layout--everything else in the engine interacts with values through functions like val.isdouble().
...And 10 more matches
<easing-function> - CSS: Cascading Style Sheets
the easing functions in the cubic-bezier subset of easing functions are often called "smooth" easing functions, because they can be used to smooth down the start and end of the animation.
... syntax there are three types of easing function: linear, cubic bézier curves, and staircase functions.
... easing functions css supports three kinds of easing functions: linear, the subset of the cubic bézier curves that are functions, and staircase functions.
...And 10 more matches
OLD SSL Reference
this chapter introduces some of the basic ssl functions.
... initialization initializing caches configuration communication functions used by callbacks cleanup chapter 2 getting started with ssl this chapter describes how to set up your environment, including certificate and key databases, to run the nss sample code.
... setting up the ca db and certificate setting up the server db and certificate setting up the client db and certificate verifying the server and client certificates building nss programs chapter 3 selected ssl types and structures this chapter describes some of the most important types and structures used with the functions described in the rest of this document, and how to manage the memory used for them.
...And 9 more matches
Self-hosted builtins in SpiderMonkey
since firefox 17, spidermonkey has the ability to self-host built-in functions in javascript.
... differences from normal javascript all self-hosted code is strict, so self-hosted functions invoked in a null or undefined scope won't be run in the scope of the global object.
...this is to prevent accidentally calling content functions when assuming that content can't interfere with behavior.
...And 9 more matches
JS_InitClass
make a jsclass accessible to javascript code by creating its prototype, constructor, properties, and functions.
... syntax jsobject * js_initclass(jscontext *cx, js::handleobject obj, js::handleobject parent_proto, const jsclass *clasp, jsnative constructor, unsigned nargs, const jspropertyspec *ps, const jsfunctionspec *fs, const jspropertyspec *static_ps, const jsfunctionspec *static_fs); name type description cx jscontext * pointer to a js context from which to derive runtime information.
...this structure defines the class for use by other api functions.
...And 9 more matches
Low-Level APIs - Archive of obsolete content
content/mod provides functions to modify a page content.
... core/heritage helper functions for inheritance.
... frame/utils provides helper functions for working with platform internals like frames and browsers.
...And 8 more matches
Introduction to XPCOM for the DOM
pure virtual methods are declared with the following syntax: virtual nsresult functionfoo() = 0; an interface is thus simply a c++ class where all the member functions are declared as pure virtual functions.
... please note that all getter functions have to addref the returned pointer.
...the xpidl compiler turns the idl methods and attributes into c++ functions according to the following rules: the methods of the interface keep the same name in c++ .
...And 8 more matches
Debugger - Firefox Developer Tools
for example, an uncaught exception hook may have access to browser-level features like the alert function, which this api’s implementation does not, making it possible to present debugger errors to the developer in a way suited to the context.) debugger handler functions each debugger instance inherits accessor properties with which you can store handler functions for spidermonkey to call when given events occur in debuggee code.
...the handler functions receive the debugger instance as their this value.
... most handler functions can return a resumption value indicating how the debuggee’s execution should proceed.
...And 8 more matches
Using Web Workers - Web APIs
see functions and classes available to workers for more details.
...in this section we'll discuss the javascript found in our basic shared worker example (run shared worker): this is very similar to the basic dedicated worker example, except that it has two functions available handled by different script files: multiplying two numbers, or squaring a number.
... passing data examples example #1: advanced passing json data and creating a switching system if you have to pass some complex data and have to call many different functions both on the main page and in the worker, you can create a system which groups everything together.
...And 8 more matches
Chapter 4: Using XPCOM—Implementing advanced processes - Archive of obsolete content
introduction javascript lacks functions for opening files and character-code conversion, among other things.
... a different mechanism is needed to perform these functions.
... reference materials to get an idea of what kinds of functions embedded xpcom can handle, take a look at the api reference and the interface definitions from xpidl in the actual source code.
...And 7 more matches
NSS reference
the proposed chapters below are based on the chapters of the ssl reference and the categories of functions in nss public functions.
... nss initialization and shutdown nss_init nss_initreadwrite nss_nodb_init nss_initialize nss_shutdown utility functions based on "utility functions" in nss public functions.
... certificate functions based on certificate functions in the ssl reference and "certificate functions" in nss public functions.
...And 7 more matches
SpiderMonkey 1.8.5
many jsapi types, functions, and callback signatures have changed, though most of them still have the same names and do the same things.
... previous versions of spidermonkey supported two types of native functions: jsnative and jsfastnative.
...embeddings that defined jsnatives in previous versions must update all those functions to the new signature.
...And 7 more matches
Web Replay
recording a recording content process differs from a normal content process in the following ways: calls to certain functions are intercepted by hooking them (rewriting the machine code at their entry points to call a different function with the same signature), including the function used to dispatch mach messages.
... the functions which are intercepted are generally at the system call and the system library level.
... this mechanism requires intercepting mmap (or similar low level allocation functions) so that any newly addressable memory is known — anonymous mappings would not otherwise be intercepted or included in the recording, as heap allocation is non-deterministic while replaying.
...And 7 more matches
Detailed XPCOM hashtable guide
nsthashtable - low-level c++ wrapper around pldhash; generates callback functions and handles most casting automagically.
...this serves similarly to a vtable in c++, with pointers to appropriate user-defined functions that initialize, compare, and match entries.
... because pldhash does not know what datatype your key is, all functions that work with keys are declared using const void*, and your client code must cast these pointers to the appropriate type.
...And 7 more matches
filter - CSS: Cascading Style Sheets
WebCSSfilter
included in the css standard are several functions that achieve predefined effects.
... /* global values */ filter: inherit; filter: initial; filter: unset; with a function, use the following: filter: <filter-function> [<filter-function>]* | none for a reference to an svg <filter> element, use the following: filter: url(file.svg#filter-element-id) interpolation if both the beginning and end filters have a function list of the same length without <url>, each of their filter functions is interpolated according to its specific rules.
... if they have different lengths, the missing equivalent filter functions from the longer list are added to the end of the shorter list using their lacuna values, then all filter functions are interpolated according to their specific rules.
...And 7 more matches
Numbers and dates - JavaScript
« previousnext » this chapter introduces the concepts, objects and functions used to work with and perform calculations using numbers and dates in javascript.
... math object the built-in math object has properties and methods for mathematical constants and functions.
... for example, the math object's pi property has the value of pi (3.141...), which you would use in an application as math.pi similarly, standard mathematical functions are methods of math.
...And 7 more matches
Appendix C: Avoiding using eval in Add-ons - Archive of obsolete content
passing around functions/code as strings often you'll want to pass functions or code to other functions, most notoriously settimeout and addeventlistener.
... alternative: use (anonymous) functions you can always create a small anonymous function to pass around instead.
... var response = xhr.responsetext; settimeout(function() { alert(response); }, 100); } alternative: use function.bind() introduced in javascript 1.8.5 function.bind is a new utility function that you may use to (partially) bind parameters to functions.
...And 6 more matches
Drag and Drop JavaScript Wrapper - Archive of obsolete content
all you have to do is write some simpler functions which work with the data being dragged.
...the object contains a series of functions, one for each event handler (except for dragenter where it has nothing special to do).
... each of the functions takes two parameters, the first is the event object and the second is an observer object that you create.
...And 6 more matches
Install Scripts - Archive of obsolete content
the script will contain javascript code which calls a number of install functions.
...in an install script, there is no associated window, however the global object will be an install object which contains a number of functions to customize the install process.
... some of the install object's functions will be described below.
...And 6 more matches
Reference - Archive of obsolete content
we could also put in layman definitions there for js constructs like functions and variables.
...--nickolay 05:37, 31 aug 2005 (pdt) gonna follow mozilla's coding guides here: http://www.mozilla.org/hacking/mozil...de.html#visual --maian 00:30, 20 september 2005 (pdt) btoa() and atob() base64 encode and decode functions this documentation is missing the base64 encode (btoa) and decode (atob) functions.
...now if we create a prototype for object , and create instances of function and object we still see that the functions are still available in both instances.
...And 6 more matches
Making asynchronous programming easier with async and await - Learn web development
previous overview: asynchronous next more recent additions to the javascript language are async functions and the await keyword, part of the so-called ecmascript 2017 javascript edition (see ecmascript next support in mozilla).
...this is one of the traits of async functions — their return values are guaranteed to be converted to promises.
... you can also create an async function expression, like so: let hello = async function() { return "hello" }; hello(); and you can use arrow functions: let hello = async () => { return "hello" }; these all do basically the same thing.
...And 6 more matches
Handling common JavaScript problems - Learn web development
for a light introduction; you should also study examples like this one, which shows a typical pattern of saving a this scope to a separate variable, then using that variable in nested functions so you can be sure you are applying functionality to the correct this scope.
... incorrectly using functions inside loops — for example, in bad-for-loop.html (see source code), we loop through 10 iterations, each time creating a paragraph and adding an onclick event handler to it.
... when clicked, each one should alert a message containing its number (the value of i at the time it was created), however each one reports i as 11, because for loops do all their iterating before nested functions are invoked.
...And 6 more matches
PKCS11 FAQ
MozillaProjectsNSSPKCS11FAQ
nss typically holds one session read-only session per slot, in which some of the non-multipart functions are handled.
... multipart functions, such as bulk encryption, hashing, and mac functions (for example, c_digest and c_sign) and those that require overlapped operation (c_unwrap, c_decrypt) are handled by creating new sessions.
... can mozilla provide a list of all pkcs #11 functions that nss will use?
...And 6 more matches
FIPS mode of operation
general-purpose functions fc_getfunctionlist fc_initialize fc_finalize fc_getinfo slot and token management functions fc_getslotlist fc_getslotinfo fc_gettokeninfo fc_waitforslotevent fc_getmechanismlist fc_getmechanisminfo fc_inittoken fc_initpin fc_setpin session management functions fc_opensession fc_closesession fc_closeallsessions fc_getsessioninfo fc_getoperationstate fc_setoperationstate fc_login fc_logout object management functions these functions manage certificates and keys.
... fc_createobject fc_copyobject fc_destroyobject fc_getobjectsize fc_getattributevalue fc_setattributevalue fc_findobjectsinit fc_findobjects fc_findobjectsfinal encryption functions these functions support triple des and aes in ecb and cbc modes.
... fc_encryptinit fc_encrypt fc_encryptupdate fc_encryptfinal decryption functions these functions support triple des and aes in ecb and cbc modes.
...And 6 more matches
Plug-in Basics - Plugins
by convention, all of the plug-in specific functions have the prefix "npp", and all of the browser-specific functions have the prefix "npn".
...these functions are exported from the plug-in dll and accessed with a system table lookup, which means that they are not related to any particular plug-in instance.
...the plug-in application programming interface (api) is made up of two groups of functions and a set of shared data structures.
...And 6 more matches
Matrix math for the web - Web APIs
the live examples use a collection of utility functions available under a global object named mdn.
...this is a special transformation matrix which functions much like the number 1 does in scalar multiplication; just like n * 1 = n, multiplying any matrix by the identity matrix gives a resulting matrix whose values match the original matrix.
... result3[0], result3[1], result3[2], result3[3] ]; } let's look at this function in action: let somematrix = [ 4, 0, 0, 0, 0, 3, 0, 0, 0, 0, 5, 0, 4, 8, 4, 1 ] let identitymatrix = [ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ]; // returns a new array equivalent to somematrix let somematrixresult = multiplymatrices(identitymatrix, somematrix); important: these matrix functions are written for clarity of explanation, not for speed or memory management.
...And 6 more matches
EXSLT
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes exslt is a set of extensions to xslt.
... 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.
... </xsl:template> </xsl:stylesheet> common the exslt common package provides basic functions that expand upon the capabilities of xslt.
...And 6 more matches
Using Promises - JavaScript
imagine a function, createaudiofileasync(), which asynchronously generates a sound file given a configuration record and two callback functions, one called if the audio file is successfully created, and the other called if an error occurs.
... here's some code that uses createaudiofileasync(): function successcallback(result) { console.log("audio file ready at url: " + result); } function failurecallback(error) { console.error("error generating audio file: " + error); } createaudiofileasync(audiosettings, successcallback, failurecallback); modern functions return a promise that you can attach your callbacks to instead: if createaudiofileasync() were rewritten to return a promise, using it could be as simple as this: createaudiofileasync(audiosettings).then(successcallback, failurecallback); that's shorthand for: const promise = createaudiofileasync(audiosettings); promise.then(successcallback, failurecallback); we call this an asynchronous function call.
...new promise, different from the original: const promise = dosomething(); const promise2 = promise.then(successcallback, failurecallback); or const promise2 = dosomething().then(successcallback, failurecallback); this second promise (promise2) represents the completion not just of dosomething(), but also of the successcallback or failurecallback you passed in, which can be other asynchronous functions returning a promise.
...And 6 more matches
Strict mode - JavaScript
invoking strict mode strict mode applies to entire scripts or to individual functions.
...eval code, function code, event handler attributes, strings passed to windowtimers.settimeout(), and related functions are entire scripts, and invoking strict mode in them works as expected.
... strict mode for functions likewise, to invoke strict mode for a function, put the exact statement "use strict"; (or 'use strict';) in the function's body before any other statements.
...And 6 more matches
JavaScript Daemons Management - Archive of obsolete content
but the daemon constructor itself is nothing but a clone of minidaemon with an added support for init and onstart functions declarable during the instantiation of the daemon.
...it also offers an alternative way to pass the this object to the callback functions (see the "this" problem for details).
...the daemon constructor itself is nothing but a clone of the little framework minidaemon with added support for init and onstart functions (declarable during the instantiation of the daemon).
...And 5 more matches
JavaScript Object Management - Archive of obsolete content
you can include functions in any namespace, since namespaces are just regular js objects.
... that should come in handy when you have general utility functions or properties that you want to use across all objects within the namespace.
...〈namespace〉.hello.init(); 〈namespace〉.hello["init"](); this is very useful in cases where you have to set attributes or functions with dynamically generated names.
...And 5 more matches
Document Object Model - Archive of obsolete content
specific xul elements also provide additional functions which may be used.
...the various dom objects have functions which may be accessed in script, however, it is important to note that the dom is an api that is accessible by javascript.
... the window's open() method also returns a reference to the new window so you can call functions of the new window from the opener.
...And 5 more matches
Tree View Details - Archive of obsolete content
next, let's look at some additional functions that views may implement.
... containers there are also three functions, iscontainer, iscontainerempty and iscontaineropen that are used to handle a parent item in the tree.
...first, the simple functions: { treebox: null, selection: null, get rowcount() { return this.visibledata.length; }, settree: function(treebox) { this.treebox = treebox; }, getcelltext: function(idx, column) { return this.visibledata[idx][0]; }, iscontainer: function(idx) { return this.visibledata[idx][1]; }, iscontaineropen: function(idx) { return this.visibledata[idx][2...
...And 5 more matches
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.
... functions — reusable blocks of code another essential concept in coding is functions.
... functions allow you to store a piece of code that does a single task inside a defined block, and then call that code whenever you need it using a single short command — rather than having to type out the same code multiple times.
...And 5 more matches
Browser chrome tests
it currently allows you to run javascript code in the same scope as the main firefox browser window and report results using the same functions as the mochitest test framework.
...the test file can contain other functions, they will be ignored unless invoked by test().
... note: be careful when naming your functions and variables.
...And 5 more matches
NSS 3.24 release notes
nss 3.24 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_24_rtm/src/ new in nss 3.24 nss 3.24 includes two nss softoken updates, a new function to configure ssl/tls server sockets, and two functions to improve the use of temporary arenas.
... new functionality nss softoken has been updated with the latest national institute of standards and technology (nist) guidance (as of 2015): software integrity checks and post functions are executed on shared library load.
...separate functions for configuring online certificate status protocol (ocsp) responses or signed certificate timestamps are not needed, since these can be added to the optional sslextraservercertdata struct provided to ssl_configservercert.
...And 5 more matches
Introduction to the JavaScript shell
h to your firefox's run-mozilla.sh>/run-mozilla.sh ./js -- that worked for me] if you'd like to run the javascript code in the file foo.js, you can use this command: js foo.js to run foo.js then drop into the interactive shell, do this: js -f foo.js -i reference note: because the javascript shell is used as a test environment for the javascript engine, the available options and built-in functions can change over time.
... built-in functions to make the javascript shell more useful, there are a number of built-in functions provided that you can use either from javascript programs or in interactive mode.
...see js/src/shell/js.cpp (around shell_functions) for more.
...And 5 more matches
SpiderMonkey 1.8
native functions may implement the new callback signature jsfastnative instead of jsnative.
... new macros js_fs, js_fn, and js_fs_end are recommended for populating jsfunctionspec arrays.
... js_alreadyhasownproperty and friends are new functions for examining an object without triggering resolve hooks.
...And 5 more matches
Waterfall - Firefox Developer Tools
javascript functions executed in the page are labeled with the reason the function was called: script tag setinterval settimeout requestanimationframe promise callback promise init worker javascript uri event handler stack call stack, with links to functions.
... stack call stack, with links to functions.
... stack call stack, with links to functions.
...And 5 more matches
Drawing shapes with canvas - Web APIs
luckily, we have an assortment of path drawing functions which make it possible to compose very complex shapes.
...there are three functions that draw rectangles on the canvas: fillrect(x, y, width, height) draws a filled rectangle.
... each of these three functions takes the same parameters.
...And 5 more matches
EventTarget.addEventListener() - Web APIs
ble> javascript // function to change the content of t2 function modifytext(new_text) { const t2 = document.getelementbyid("t2"); t2.firstchild.nodevalue = new_text; } // add event listener to table with an arrow function const el = document.getelementbyid("outside"); el.addeventlistener("click", () => { modifytext("four"); }, false); result please note that while anonymous and arrow functions are similar, they have different this bindings.
... while anonymous (and all traditional javascript functions) create their own this bindings, arrow functions inherit the this binding of the containing function.
... note, however that when using an anonymous function as the handler, such listeners will not be identical, because anonymous functions are not identical even if defined using the same unchanging source-code simply called repeatedly, even if in a loop.
...And 5 more matches
SubtleCrypto - Web APIs
the subtlecrypto interface of the web crypto api provides a number of low-level cryptographic functions.
... even assuming you use the basic cryptographic functions correctly, secure key management and overall security system design are extremely hard to get right, and are generally the domain of specialist security experts.
... using subtlecrypto we can split the functions implemented by this api into two groups: cryptography functions and key management functions.
...And 5 more matches
Function.prototype.bind() - JavaScript
the second one is bigger and less performant, but it permits some usage of the new operator on bound functions.
... the partial implementation creates functions that do not have immutable "poison pill" caller and arguments properties that throw a typeerror upon get, set, or deletion.
... (this could be added if the implementation supports object.defineproperty, or partially implemented [without throw-on-delete behavior] if the implementation supports the __definegetter__ and __definesetter__ extensions.) the partial implementation creates functions that have a prototype property.
...And 5 more matches
Promise() constructor - JavaScript
the promise constructor is primarily used to wrap functions that do not already support promises.
...} at the time when the constructor generates the new promiseobj, it also generates a corresponding pair of functions for resolutionfunc and rejectionfunc; these are "tethered" to the promiseobj.
... the signatures of these two functions are simple, they accept a single parameter of any type.
...And 5 more matches
lang/functional - Archive of obsolete content
some of these functions implement apis from jeremy ashkenas's underscore.js and all credits go to him and his contributors.
... globals functions method(lambda) takes a function and returns a method associated with an object.
...this also enables you to use these functions as event listeners.
...And 4 more matches
Unit Testing - Archive of obsolete content
a simple base64 module in a web page, you can perform base64 encoding and decoding using the btoa() and atob() functions.
... unfortunately these functions are attached to the window object: since this object is not available in your main add-on code, atob() and btoa() aren't available either.
... so we'll create a base64 module to expose these functions from the platform (see creating reusable modules).
...And 4 more matches
Chapter 3: Introduction to XUL—How to build a more intuitive UI - Archive of obsolete content
ion="1.0" encoding="utf-8"?> <?xml-stylesheet href="chrome://global/skin/"?> <dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" title="my dialog" buttons="accept,cancel" ondialogaccept="savevalues(); window.close();" ondialogcancel="window.close();"> <checkbox label="my option"/> </dialog> listing 8: a dialog figure 5: output from listing 8 note: the functions behind the dialog elements discussed here require "xpconnect privileges," which are discussed in chapter 4, so this example will only run correctly if it can run as firefox code itself or installed extension code.
... menus hierarchically structured dropdown menus are the part of the user interface used for frequently accessed functions in an application or web service.
...but both these functions are handled by textbox as shown in listing 16, which produces output as shown in figure 13.
...And 4 more matches
Modularization techniques - Archive of obsolete content
however, a poor implementation of these functions can have negative results, such as memory leaks or inadvertent access of freed objects.
...the important things to notice are that the interface inherits from nsisupports, and all member functions are pure virtual methods.
...a dll that contains a factory need to define one or two exported functions: // returns the factory associated with the given class id extern "c" ns_export nsresult nsgetfactory(const nscid &acid, nsifactory **afactory); // returns whether the dll can be unloaded now.
...And 4 more matches
Object-oriented JavaScript for beginners - Learn web development
previous overview: objects next with the basics out of the way, we'll now focus on object-oriented javascript (oojs) — this article presents a basic view of object-oriented programming (oop) theory, then explores how javascript emulates object classes via constructor functions, and how to create object instances.
...object data (and often, functions too) can be stored neatly (the official word is encapsulated) inside an object package (which can be given a specific name to refer to, which is sometimes called a namespace), making it easy to structure and access; objects are also commonly used as data stores that can be easily sent across the network.
... constructors and object instances javascript uses special functions called constructor functions to define and initialize objects and their features.
...And 4 more matches
Working with Svelte stores - Learn web development
svelte provides functions for creating readable, writable, and derived stores in the svelte/store module.
...all of a store's active subscription functions must be called whenever the store's value changes.
... a store may optionally contain a set() method, which must accept as its argument a new value for the store, and which synchronously calls all of the store's active subscription functions.
...And 4 more matches
Message manager overview
its most important functions and attributes are: childcount : contains the number of children (typically, browser windows) getchildat() : get the child at the given index loadframescript() : load a frame script into every tab in the browser broadcastasyncmessage() : send a message to frame scripts addmessagelistener() : start listening to a specific message from all frame scripts removemessageli...
... its most important functions and attributes are: childcount : contains the number of children (typically, browser tabs) getchildat() : get the child at the given index loadframescript() : load a frame script into every tab in this window broadcastasyncmessage() : send a message to all frame scripts in this window addmessagelistener() : start listening to a specific message from frame scripts rem...
... its most important functions are: loadframescript() : load a frame script into this browser frame (tab) sendasyncmessage() : send a message to all frame scripts in this browser frame addmessagelistener() : start listening to a specific message from frame scripts removemessagelistener() : stop listening to a specific message interfaces nsiprocesschecker nsiframescriptloader n...
...And 4 more matches
Using the Browser API
MozillaGeckoChromeAPIBrowser APIUsing
tten some basic javascript (see the full javascript listing.) wiring up the back and forward buttons early on in the code we implement two simple event listeners to move the browser back and forward in history when the relevant buttons are pressed: back.addeventlistener('touchend',function() { browser.goback(); }); fwd.addeventlistener('touchend',function() { browser.goforward(); }); the functions can be handled using the browser api htmliframeelement.goback() and htmliframeelement.goforward() methods.
... you'll also notice that we're also firing these functions on the touchend event, which is effective as firefox os devices are generally touchscreen.
...we did this with the following functions: function canmovebwd() { var request = browser.getcangoback(); request.onsuccess = function() { if (request.result) { back.disabled = false; console.log("it's possible to navigate the history backward."); } else { back.disabled = true; console.log("it's not possible to navigate the history backward."); } } } function canmovefwd() { var request = browser.getcangoforward(); request.onsuccess = function() { if (request.result) { fwd.disabled = false; console.log("it's possible to navigate th...
...And 4 more matches
Promise
method overview promise then([optional] function onfulfill, [optional] function onreject); promise catch([optional] function onreject); constructor creates a new promise, initially in the pending state, and provides references to the resolving functions that can be used to change its state.
... new promise(executor); parameters executor this function is invoked immediately with the resolving functions as its two arguments: executor(resolve, reject); the constructor will not return until the executor has completed.
... the resolving functions can be used at any time, before or after the executor has completed, to control the final state of the promise.
...And 4 more matches
Mozilla DOM Hacking Guide
this is used in global resolve functions, when xpconnect has to find the member function to call.
... the nsixpcscriptable, nsisupports, and nsiclassinfo member functions, declared with ns_decl_x macros.
... static jsfunctionspec sdomjsclass_methods[];: help me!
...And 4 more matches
Memory reporting
} here are what the measurement functions (yes, functions) should look like for this class.
...that said, note that for some classes these methods may be virtual.) mfbt/memoryreporting.h defines mozilla::mallocsizeof as follows: typedef size_t (*mallocsizeof)(const void* p); functions with this signature measure the size of p by asking the heap allocator how big it is (via moz_malloc_usable_size).
... all this is probably not what you'd expect, but the above functions have the following crucial features.
...And 4 more matches
Date and Time
this chapter describes the date and time functions in nspr.
...nspr provides types and constants for both representations, and functions to convert time values between the two.
...for functions that deal with the measurement of elapsed time and with timeouts, see interval timing.
...And 4 more matches
Memory Management Operations
this chapter describes the global functions and macros you use to perform memory management.
... nspr provides heap-based memory management functions that map to the familiar malloc(), calloc(), realloc(), and free().
... memory allocation functions memory allocation macros memory allocation functions nspr has its own heap, and these functions act on that heap.
...And 4 more matches
HTTP delegation
instead of improving the simple http client in nss, the nss team has decided to provide an nss api to register application callback functions.
...in order to use the http delegation feature in your nss-based application, you need to implement several callback functions.
... your callback functions might be a full implementation of a http client.
...And 4 more matches
HTTP delegation
instead of improving the simple http client in nss, the nss team has decided to provide an nss api to register application callback functions.
...in order to use the http delegation feature in your nss-based application, you need to implement several callback functions.
... your callback functions might be a full implementation of a http client.
...And 4 more matches
NSS Developer Tutorial
multiple-line comments should be formatted as follows: /* * line1 * line2 */ or /* ** line 1 ** line 2 */ the following styles are also common, because they conserve vertical space: /* line1 * line2 */ or /* line1 ** line2 */ or /* line1 * line2 */ naming public functions are named foo_dooneaction.
... global, but unexported functions, are usually named foo_dooneaction.
... nss c abi backward compatibility functions exported functions cannot be removed.
...And 4 more matches
sslcrt.html
upgraded documentation may be found in the current nss reference certificate functions chapter 5 certificate functions this chapter describes the functions and related types used to work with a certificate database such as the cert7.db database provided with communicator.
...slserver certusagesslserverwithstepup certusagesslca certusageemailsigner certusageemailrecipient certusageobjectsigner certusageusercertimport certusageverifyca certusageprotectedobjectsigner wincx the pin argument value to pass to pk11 functions.
... description the cert_verifycertnow function must call one or more pk11 functions to obtain the services of a pkcs #11 module.
...And 4 more matches
JIT Optimization Strategies
unique (or "singleton") types are assigned to certain kinds of objects, like global objects, top-level functions, and object literals declared at the top-level of a script.
...for objects constructed by constructor functions, this means that the property needs to be defined in the constructor, before any complex logic occurs within the constructor.
...for objects constructed by constructor functions, this means that the property needs to be defined in the constructor, before any complex logic occurs within the constructor.
...And 4 more matches
SpiderMonkey 1.8.7
many jsapi types, functions, and callback signatures have changed, though most of them still have the same names and do the same things.
...jsnative, jsfastnative previous versions of jsapi supported two types of native functions -- jsnative and jsfastnative.
...embedders converting functions from old-jsnative to new-jsnative (jsfastnative) should study the jsfastnative documentation thoroughly, and pay particular that they do not reference negative indices of argv in spidermonkey 1.8.5; the js_callee, js_this, etc.
...And 4 more matches
Places utilities for JavaScript
utils.js is accessible at the following url: http://mxr.mozilla.org/mozilla-centr...ntent/utils.js this file includes utility functions used by a lot of the bookmarking, tagging, and annotation services that are built into firefox.
...its not an interface, and as such it will never be frozen, but it provides some easy to use functions that can save you from reinventing the wheel and cluttering up your own classes/functions when you need it.
... nodeis() there are a ton of nodeis(something) functions in here to check properties of a bookmark node.
...And 4 more matches
Components.utils.exportFunction
to understand what happens if the functions you export accept arguments, see exporting functions that take arguments below.
... exporting functions that take arguments until firefox 34, any arguments that the function takes are structured-cloned across the security boundary unless they are native objects such as dom nodes.
... because structured cloning does not clone functions, this meant that the function may not return a function, and by default, may not take any functions as arguments.
...And 4 more matches
nsACString
assign the assign family of functions sets the value of a string's internal buffer.
... replace the replace family of functions sets the value of a string's internal buffer.
... append the append family of functions appends a value to the end of a string's internal buffer.
...And 4 more matches
nsAString
assign the assign family of functions sets the value of a string's internal buffer.
... replace the replace family of functions sets the value of a string's internal buffer.
... append the append family of functions appends a value to the end of a string's internal buffer.
...And 4 more matches
Standard OS Libraries
the alternative to standard libraries is creating your own dll (for windows) or so (for linux) file with c functions that can be called from your add-on with js-ctypes.
...a list of all the functions available through this api can be found at the msdn winapi index.
... for finding out the values and types of arguments and returns of the functions you want to use from this api, you must visit the functions page on this linked msdn site; it will give you all that information.
...And 4 more matches
Debugger.Frame - Firefox Developer Tools
even though the debuggee and debugger share the same javascript stack, frames pushed for spidermonkey’s calls to handler methods to report events in the debuggee are never considered visible frames.) invocation functions and “debugger” frames aninvocation function is any function in this interface that allows the debugger to invoke code in the debuggee: debugger.object.prototype.call, debugger.frame.prototype.eval, and so on.
... while invocation functions differ in the code to be run and how to pass values to it, they all follow this general procedure: letolder be the youngest visible frame on the stack, or null if there is no such frame.
...(we may not be able to obtain frames for calls to host functions.) "eval": a frame running code passed to eval.
...And 4 more matches
Flame Chart - Firefox Developer Tools
but while the call tree organizes this data to show you where your program is spending most time in aggregate across the recording, the flame chart uses it to show you when in the recording particular functions are executing.
...along the y-axis are the functions on the call stack at that point in time, with the top-level at the top, and the leaf function at the bottom.
... functions are color-coded to make them easier to distinguish.
...And 4 more matches
Intensive JavaScript - Firefox Developer Tools
this means that long-running javascript functions can block the thread, leading to an unresponsive page and a bad user experience.
... you can use the frame rate and waterfall tools to see when javascript is causing performance problems, and to single out the particular functions that need attention.
...the first is to split long-running functions into pieces and use requestanimationframe to schedule each piece, and the second is to run the whole function in a separate thread using a web worker.
...And 4 more matches
<transform-function> - CSS: Cascading Style Sheets
transformation functions can rotate, resize, distort, or move an element in 2d or 3d space.
... syntax the <transform-function> data type is specified using one of the transformation functions listed below.
... transformation functions transformation functions alter the appearance of an element by manipulating the values of its coordinates.
...And 4 more matches
The arguments object - JavaScript
arguments is an array-like object accessible inside functions that contains the values of the arguments passed to that function.
... the arguments object is a local variable available within all non-arrow functions.
...= array.prototype.slice.call(arguments); // using an array literal is shorter than above but allocates an empty array var args = [].slice.call(arguments); as you can do with any array-like object, you can use es2015's array.from() method or spread syntax to convert arguments to a real array: let args = array.from(arguments); // or let args = [...arguments]; the arguments object is useful for functions called with more arguments than they are formally declared to accept.
...And 4 more matches
async function - JavaScript
async functions are instances of the asyncfunction constructor, and the await keyword is permitted within them.
... async functions may also be defined as expressions.
... description async functions can contain zero or more await expressions.
...And 4 more matches
Interacting with page scripts - Archive of obsolete content
with unsafewindow you can see javascript objects that have been defined by page scripts, and if a page script has modified the behavior of native dom functions, you'll get the modified version of them as well.
...t uses unsafewindow.foo instead of window.foo: // main.js var tabs = require("sdk/tabs"); var mod = require("sdk/page-mod"); var self = require("sdk/self"); var pageurl = self.data.url("page.html") var pagemod = mod.pagemod({ include: pageurl, contentscript: "console.log(unsafewindow.foo);" }) tabs.open(pageurl); be careful using unsafewindow: you can't rely on any of its properties or functions being, or doing, what you expect.
...clicking "i will not work" fails, and the following message is logged: permission denied to access property 'greeting' expose functions to page scripts the structured clone algorithm is a bit more powerful than simple json serialization, but not much: in particular, functions aren't cloned.
...And 3 more matches
core/heritage - Archive of obsolete content
helper functions for inheritance.
...to do that we need to freeze constructor's prototype chain to make sure functions are frozen: object.freeze(dog.prototype); object.freeze(pet.prototype); note: also, this is not quite enough as object.prototype stays mutable & in fact we do little bit more in sdk to address that, but it's not in the scope of this documentation.
...that is why sdk provides utility functions to make it more declarative and less verbose.
...And 3 more matches
core/promise - Archive of obsolete content
you can chain multiple then functions, because then returns a promise resolved to a return value of an operation and errors propagate through the promise chains.
...as a matter of fact it would be great if we could convert any synchronous functions to asynchronous by making it aware of promises.
... this technique is so powerful that it can replace most of the promise utility functions provided by other promise libraries.
...And 3 more matches
How to convert an overlay extension to restartless - Archive of obsolete content
a file:// uri to the install location, or .xpi file, is available in installpath property of the bootstrap data structure passed to the startup(), shutdown(), install(), and uninstall() functions in what will be your bootstrap.js file (see below).
... from there you can open nsiinputstreams, extract files, or perform some other functions.
...here are some functions to handle this: function getgenericpref(branch,prefname) { switch (branch.getpreftype(prefname)) { default: case 0: return undefined; // pref_invalid case 32: return getucharpref(prefname,branch); // pref_string case 64: return branch.getintpref(prefname); // pref_int case 128: return branch.getboolpref(prefname); // ...
...And 3 more matches
Migrating from Internal Linkage to Frozen Linkage - Archive of obsolete content
ring.truncate(4); + mystring.setlength(4); the frozen string api doesn't support the iterator or const_iterator classes, but you can use pointers the same way: nsstring mystring = somestring; - nsstring::const_iterator begin, end;- mystring.beginreading(begin); mystring.endreading(end); + const prunichar *begin, *end;+ mystring.beginreading(&begin, &end); the frozen string api uses comparator functions instead of a virtual comparator class.
...this means that the + operator is not implemented, nor are the promiseflatstring functions or classes around any more.
... someotherstring; - nsstring combostring = firststring + secondstring; + nsstring combostring = firststring;+ combostring += secondstring; // or: combostring.append(secondstring); - nsresult rv = somefunc(promiseflatstring(combostring)); + nsresult rv = somefunc(combostring); removing the nsreadableutils.h from the headers list also means that we would not have access to appendutf16toutf8 kind of functions.
...And 3 more matches
Chapter 5: Let's build a Firefox extension - Archive of obsolete content
source files represented through chrome urls run with universalxpconnect privileges; even if they haven’t been granted “use xpconnect as local file” privileges, as discussed in chapter 4, they will be able to use xpcom functions (figure 1).
... phase 2: implement functionality in phase 2, we’ll use javascript to implement the session save and restore functions using the session store api.
...take note that when using an extension to create an overlay on the browser window, any global variables and functions defined within javascript that get opened as overlays on top of browser.xul all become properties of the browser.xul window object.
...And 3 more matches
MCD, Mission Control Desktop, AKA AutoConfig - Archive of obsolete content
ref: bug 690370 available functions are (see prefcalls.js file for details): function getprefbranch() function pref(prefname, value) function defaultpref(prefname, value) function lockpref(prefname, value) function unlockpref(prefname) function getpref(prefname) function getldapattributes(host, base, filter, attribs) function getldapvalue(str, key) function displayerror(funcname, message) function getenv(name) configure autoco...
...ces]# grep enable-extensions /root/rpmbuild/sources/thunderbird-mozconfig ac_add_options --enable-extensions=pref it seems worse this time , as even after applying those compilation options mentioned above, i now get the following error message while stating thunderbird with autoconfig (autoconf.js having pref('general.config.filename','thunderbird.cfg'); ) and thunderbird.cfg calling getldap* functions to retrieve cn and mail address of the current user.
...also related post in newsgroups: mozilla.dev.tech.js-engine date: wed, 17 may 2006 19:06:28 +0200 from: jehan procaccia <jehan.procaccia@int-evry.fr> newsgroups: mozilla.dev.tech.js-engine subject: scope of js file functions in frefox/thunderbird autoconfig context firefox 2.x recently (2007/03/20), i've tested autoconfig support in firefox 2.0.0.2 on a linux fedora.
...And 3 more matches
Dehydra Object Reference - Archive of obsolete content
these types are used to represent variables, functions, assignments, etc.
...applicable when accessing member variables or nonstatic member functions of aggregate types, e.g.
...the following additional properties are available on functions: property type description .isvirtual true or "pure" true for virtual methods, or "pure" for pure virtuals (e.g.
...And 3 more matches
Manipulating Lists - Archive of obsolete content
although listboxes may be manipulated using the standard dom functions as well, it is recommended that the specialized listbox functions be used instead when possible.
... these functions are bit simpler and will do the right thing.
... for the tabs element, it is often more convenient to use functions of the tabbox element instead.
...And 3 more matches
Modifying a XUL Interface - Archive of obsolete content
« previousnext » the dom provides various functions to modify the document.
...for an html document, an html element will be created, so it will have the features and functions of an html element instead.
...three related functions are the insertbefore(), replacechild() and removechild functions.
...And 3 more matches
Tree Box Objects - Archive of obsolete content
in this case, there are other drawing functions that can be used.
... other redrawing functions are invalidatecell() to redraw only a single cell invalidatecolumn() to redraw a column invalidaterange() to redraw a range of rows invalidate() to redraw the entire tree.
...the functions of the more general box object are also available to trees.
...And 3 more matches
tree - Archive of obsolete content
ArchiveMozillaXULtree
dom treeitems are created, so you can access the data using rdf functions or dom functions.
...this results in a performance enhancement, but you will not be able to use the dom functions to retrieve the tree rows.
...for trees that are not built with a content builder, the functions of nsitreecontentview will not be available, since there are no dom nodes to retrieve.
...And 3 more matches
CSS values and units - Learn web development
this means that if you see <color> as valid you don't need to wonder which of the different types of color value can be used — keywords, hex values, rgb() functions, etc.
...try changing the above example's rgba() functions to rgb() and see if the colors still work!
... which style you use is up to you, but separating out non-transparent and transparent color definitions to use the different functions gives (very) slightly better browser support and can act as a visual indicator of where transparent colors are being defined in your code.
...And 3 more matches
JavaScript basics - Learn web development
functions functions are a way of packaging functionality that you wish to reuse.
...you have already seen some uses of functions previously.
... for example: let myvariable = document.queryselector('h1'); alert('hello!'); these functions, document.queryselector and alert, are built into the browser.
...And 3 more matches
Cooperative asynchronous JavaScript: Timeouts and intervals - Learn web development
introduction for a long time, the web platform has offered javascript programmers a number of functions that allow them to asynchronously execute code after a certain time interval has elapsed, and to repeatedly execute a block of code asynchronously until you tell it to stop.
... these functions are: settimeout() execute a specified block of code once after a specified time has elapsed.
... the asynchronous code set up by these functions runs on the main thread (after their specified timer has elapsed).
...And 3 more matches
Build your own function - Learn web development
along the way, we'll also explain some useful details of dealing with functions.
... prerequisites: basic computer literacy, a basic understanding of html and css, javascript first steps, functions — reusable blocks of code.
... const panel = document.createelement('div'); panel.setattribute('class', 'msgbox'); html.appendchild(panel); the next two sections make use of the same createelement() and appendchild() functions we've already seen to create two new elements — a <p> and a <button> — and insert them in the page as children of the panel <div>.
...And 3 more matches
Introduction to events - Learn web development
the node.js event model relies on listeners to listen for events and emitters to emit events periodically — it doesn't sound that different, but the code is quite different, making use of functions like on() to register an event listener, and once() to register an event listener that unregisters after it has run once.
...this functions in a similar way to the event handler properties, but the syntax is obviously different.
...this would work, however: myelement.addeventlistener('click', functiona); myelement.addeventlistener('click', functionb); both functions would now run when the element is selected.
...And 3 more matches
Solve common problems in your JavaScript code - Learn web development
some common built-in browser functions that cause problems are: correct wrong getelementsbytagname() getelementbytagname() getelementsbyname() getelementbyname() getelementsbyclassname() getelementbyclassname() getelementbyid() getelementsbyid() semi-colon position you need to make sure you don't place any semi-colons incorrectly.
... for example: correct wrong elem.style.color = 'red'; elem.style.color = 'red;' functions there are a number of things that can go wrong with functions.
...for example: function myfunction() { alert('this is my function.'); }; this code won't do anything unless you call it with the following statement: myfunction(); function scope remember that functions have their own scope — you can't access a variable value set inside a function from outside the function, unless you declared the variable globally (i.e.
...And 3 more matches
Advanced Svelte: Reactivity, lifecycle, accessibility - Learn web development
back over in todos.svelte, we are going to import our moreactions component and create two functions to handle the events emitted by the moreactions component.
... add the following import statement below the existing ones: import moreactions from './moreactions.svelte' then add the described functions at the end of the <script> section: const checkalltodos = (completed) => todos.foreach(t => t.completed = completed) const removecompletedtodos = () => todos = todos.filter(t => !t.completed) now go to the bottom of the todos.svelte markup section and replace the btn-group <div> that we copied into moreactions.svelte with a call to the moreactions component, like so: <!-- moreactions --> <moreactions on:checkall={e => checkalltodos(e.detail)} on:removecompleted={removecompletedtodos} /> ok, let's go back into the app and try it out!
... to implement all these features we'll need programmatic access to dom nodes to run functions like focus() and select().
...And 3 more matches
How Mozilla's build system works
moz.build files are limited to performing the following actions: calling functions that are explicitly made available to the moz.build environment.
... creating new variables whose name is not uppercase (this includes defining functions).
... reference many of python's built-in or global functions (they are not made available to the execution environment).
...And 3 more matches
Sqlite.jsm
sqlite.jsm exposes a transaction api built on top of task.jsm that allows transactions to be written as procedural javascript functions (as opposed to a series of callback driven operations).
... these functions receive the following arguments: readonly (optional) if true the clone will be read-only, default is false.
... indexexists(name) this functions determines whether a named index exists in the current database.
...And 3 more matches
Profiling with the Firefox Profiler
note that if some functions are not yet named properly, symbolication may not yet be finished.
...there are os-specific waiting functions like ntwaitformultipleobjects seen in the example above taken on windows or mach_msg_trap on macos.
...you can see the samples in the timeline get darker as you select different functions in the call tree; these are samples that were taken when the selected function was running.
...And 3 more matches
NSPR Types
other chapters describe more specialized types when describing the functions that use them.
... calling convention types are used for externally visible functions and globals.
... for information on naming conventions for nspr types, functions, and macros, see nspr naming conventions.
...And 3 more matches
Network Addresses
this chapter describes the nspr types and functions used to manipulate network addresses.
... network address types and constants network address functions the api described in this chapter recognizes the emergence of internet protocol version 6 (ipv6).
... to facilitate the transition to ipv6, it is recommended that clients treat all structures containing network addresses as transparent objects and use the functions documented here to manipulate the information.
...And 3 more matches
An overview of NSS Internals
a core element of nss is freebl, a base library providing hash functions, big number calculations, and cryptographic algorithms.
...instead, the programmer will use lookup functions, and nss will provide an access handle that will be subsequently used by the application's code.
...the application should always call the appropriate dereference (destroy) functions once a handle is no longer needed.
...And 3 more matches
NSS 3.35 release notes
the signatures of functions ssl_optionset, ssl_optionget, ssl_optionsetdefault and ssl_optiongetdefault have been modified, to take a printn argument rather than prbool.
... in order to ease transitions, experimental functions return secfailure and set the ssl_error_unsupported_experimental_api code if the selected api is not available.
... experimental functions will always return this result if they are disabled or removed from a later nss release.
...And 3 more matches
nss tech note7
these data types should be used as if they were opaque structures, that is, they should only be created by some nss functions and you always pass pointers to these data types to nss functions and never examine the members of these structures.
... functions rsa signing and encryption functions are provided by two layers of nss function: the sgn_ and vfy_ functions in cryptohi.h, and the pk11_ functions in pk11pub.h.
... for example, if you just need to generate or verify a signature, you can use the sgn_ and vfy_ functions in cryptohi.h.
...And 3 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.
...both modes of operation use the same data types but are implemented by different functions.
... the standard pkcs #11 function c_getfunctionlist or the equivalent nsc_getfunctionlist function returns pointers to the functions that implement the default mode of operation.
...And 3 more matches
ssltyp.html
upgraded documentation may be found in the current nss reference selected ssl types and structures chapter 3 selected ssl types and structures this chapter describes some of the most important types and structures used with the functions described in the rest of this document, and how to manage the memory used for them.
... additional types are described with the functions that use them or in the header files.
...some of these functions also use types defined by nspr and described in the nspr reference.
...And 3 more matches
Rhino scopes and contexts
any top-level functions or variables defined in the script will end up as properties of the instance scope.
...andard library passtrue for the sealed argument when calling context.initstandardobjects(scriptableobject, boolean): scriptableobject sealedsharedscope = cx.initstandardobjects(null, true); this seals only all standard library objects, it does not seal the shared scope itself thus after callinginitstandardobjects, sealedsharedscope can be farther populated with application-specific objects and functions.
...calls to functions in javascript use static scope, which means that variables are first looked up in the function and then, if not found there, in the lexically enclosing scope.
...And 3 more matches
Rhino serialization
beginning with rhino 1.5 release 3 it is possible to serialize javascript objects, including functions and scripts.
...simple serialization example the rhino shell has two new top-level functions, serialize and deserialize.
...rhino serialization in compilation mode serialization works well with objects and with functions and scripts in interpretive mode.
...And 3 more matches
Hacking Tips
debugging tips getting help (from js shell) use the help function to get the list of all primitive functions of the shell with their description.
... note that some functions have been moved under an 'os' object, and help(os) will give brief help on just the members of that "namespace".
...be aware that functions which are usually dumping some output will do it in the shell where valgrind is started and not in the shell where gdb is started.
...And 3 more matches
Garbage collection
freespan contains functions to allocate from the free span.
... source files gc/gc.{h,cpp} defines gc internal api functions, including entry points to trigger gc.
... gc/marking.{h,cpp} defines all marking functions for the various garbage-collected things.
...And 3 more matches
JS::NewFunctionFromSpec
create a new function based on the given jsfunctionspec.
... syntax jsfunction* js::newfunctionfromspec(jscontext* cx, const jsfunctionspec* fs, handleid id); name type description cx jscontext * the context in which to define functions.
... fs const jsfunctionspec * a pointer to function specification.
...And 3 more matches
JS_GetParent
each object is assigned a parent when it is created: the standard library objects and functions all have the global object as their parent.
... objects created by standard library functions, such as array.prototype.concat, have the global object as their parent.
... the initial parent of an object created via the jsapi depends on the particular jsapi function (of which there are many that create objects, including but not limited to js_newobject, js_constructobject, js_defineobject, js_valuetoobject, js_newarrayobject, js_newscriptobject, js_newfunction, js_compilefunction, js_definefunction, js_definefunctions, and js_initclass).
...And 3 more matches
Using js-ctypes
on windows, for example, you might load the system user32 library like this: var lib = ctypes.open("user32.dll"); on mac os x, you can load the core foundation library from the core foundation framework like this: var corefoundation = ctypes.open("/system/library/frameworks/corefoundation.framework/corefoundation"); the returned object is a library object that you use to declare functions and data types for use with the loaded library.
...instead, you'll need to create a shim library that uses c functions that then call into the c++ library for you.
...you will almost certainly need to declare one or more functions, so that you can call them.
...And 3 more matches
WindowOrWorkerGlobalScope.setInterval() - Web APIs
/*\ |*| |*| ie-specific polyfill that enables the passage of arbitrary arguments to the |*| callback functions of javascript timers (html5 standard syntax).
... a possible solution a possible way to solve the "this" problem is to replace the two native settimeout() or setinterval() global functions with two non-native ones that enable their invocation through the function.prototype.call method.
...function () { vcallback.apply(othis, aargs); } : vcallback, ndelay); }; these two replacements also enable the html5 standard passage of arbitrary arguments to the callback functions of timers in ie.
...And 3 more matches
<basic-shape> - CSS: Cascading Style Sheets
syntax the <basic-shape> data type is defined with one of the basic shape functions listed below.
... shape functions the following shapes are supported.
...the values in the shape functions interpolate as a simple list.
...And 3 more matches
Proxy Auto-Configuration (PAC) file - HTTP
(of course, the javascripts must be edited to reflect your site's domain name and/or subnets.) predefined functions and environment these functions can be used in building the pac file: hostname based conditions isplainhostname() dnsdomainis() localhostordomainis() isresolvable() isinnet() related utility functions dnsresolve() convert_addr() myipaddress() dnsdomainlevels() url/hostname based conditions shexpmatch() time based conditions weekda...
... note the order of the above exceptions for efficiency: localhostordomainis() functions only get executed for urls that are in local domain, not for every url.
... usage of isinnet(), isresolvable() and dnsresolve() functions should be carefully considered, as they require the dns server to be consulted.
...And 3 more matches
WebAssembly Concepts - WebAssembly
webassembly modules can be imported into a web (or node.js) app, exposing webassembly functions for use via javascript.
... the different code types can call each other as required — the webassembly javascript api wraps exported webassembly code with javascript functions that can be called normally, and webassembly code can import and synchronously call normal javascript functions.
...to functions) that could not otherwise be stored as raw bytes in memory (for safety and portability reasons).
...And 3 more matches
Compiling from Rust to WebAssembly - WebAssembly
calling external functions in javascript from rust the next part looks like this: #[wasm_bindgen] extern { pub fn alert(s: &str); } the bit inside the #[ ] is called an "attribute", and it modifies the next statement somehow.
... in this case, that statement is an extern, which tells rust that we want to call some externally defined functions.
... the attribute says "wasm-bindgen knows how to find these functions".
...And 3 more matches
Private Properties - Archive of obsolete content
a private property is a property that is only accessible to member functions of instances of the same class.
...consider the following example: function point(x, y) { this._x = x; this._y = y; } the properties _x and _y are intended to be private, and should only be accessed by member functions.
... to make a private property readable/writable from any function, it's common to define getter/setter functions for the property, respectively: point.prototype.getx = function () { return this._x; }; point.prototype.setx = function (x) { this._x = x; }; point.prototype.gety = function () { return this._y; }; point.prototype.sety = function (y) { this._y = y; }; the above technique is simple and clearly expresses intent.
...And 2 more matches
passwords - Archive of obsolete content
.example.com requested authentication with a response code like this: http/1.0 401 authorization required server: apache/1.3.27 www-authenticate: basic realm="exampleco login" the corresponding values for the credential (excluding username and password) should be: url: "http://www.example.com" realm: "exampleco login" oncomplete and onerror this api is explicitly asynchronous, so all its functions take two callback functions as additional options: oncomplete and onerror.
...because the other functions don't return a value in case of success their oncomplete options are optional.
... for all functions, onerror is optional.
...And 2 more matches
JavaScript crypto - Archive of obsolete content
cipherflags a bit vector indicating all ssl or s/mime cipher functions supported by the module (see below).
...setting these flags means you want your token to supply the default implementation for these functions.
... normally mozilla uses its own internal module to supply these functions.
...And 2 more matches
Venkman Internals - Archive of obsolete content
scriptwrapper newsgroup, 2002, rgrinda here is a bit more information about how venkman tracks files and functions...
...as you pointed out, there is a 1:1 relationship between scriptwrappers and functions.
...if you want to get at the pretty printed source text, instead of the actual source text, use scriptwrapper.jsdscript.functionsource.
...And 2 more matches
Adding Methods to XBL-defined Elements - Archive of obsolete content
methods are the functions of objects, such as window interface's open() method loads the specified resource into the browsing context (window, <iframe> or tab) with the specified name.
...these elements are created anonymously and are not accessible from the regular dom functions.
...to get elements below that, you can use the regular dom functions because they aren't hidden.
...And 2 more matches
Adobe Flash - Archive of obsolete content
this article explains how javascript can be used to access methods from within the flash plugin, as well as how a feature called fscommands can be used to access javascript functions from within the flash animation.
...most of its functions can be reproduced using modern web apis.
...however, if you wish to use fscommands with the flash plugin to call javascript functions in an html page, then you must use the embed element, as discussed further in the section on fscommands.
...And 2 more matches
Primitive - MDN Web Docs Glossary: Definitions of Web-related terms
the variable may be reassigned a new value, but the existing value can not be changed in the ways that objects, arrays, and functions can be altered.
...if so, read how this code runs: for both the addtwo and addtwo_v2 functions calls, javascript looks up the value for the identifier foo.
... it correctly finds our variable instantiated with our first statement after finding it, the expression is evaluated, foo is replaced by 5 and the javascript engine passes that value to the functions as an argument before executing the statements inside the functions' bodies, javascript takes a copy of the originally passed argument (which is a primitive) and creates a local copy.
...And 2 more matches
CSS and JavaScript accessibility best practices - Learn web development
simple content and functionality is arguably easy to make accessible — for example text, images, tables, forms and push button that activate functions.
...the idea of unobtrusive javascript is that it should be used wherever possible to enhance functionality, not build it in entirely — basic functions should ideally work without javascript, although it is appreciated that this is not always an option.
... mouse-specific events as you will be aware, most user interactions are implemented in client-side javascript using event handlers, which allow us to run functions in response to certain events happening.
...And 2 more matches
Graceful asynchronous programming with Promises - Learn web development
using arrow functions, you can simplify the code even further: choosetoppings() .then(toppings => placeorder(toppings) ) .then(order => collectorder(order) ) .then(pizza => eatpizza(pizza) ) .catch(failurecallback); or even this: choosetoppings() .then(toppings => placeorder(toppings)) .then(order => collectorder(order)) .then(pizza => eatpizza(pizza)) .catch(failurecallback); this works because with arrow f...
... you could even do this, since the functions just pass their arguments directly, so there isn't any need for that extra layer of functions: choosetoppings().then(placeorder).then(collectorder).then(eatpizza).catch(failurecallback); this is not quite as easy to read, however, and this syntax might not be usable if your blocks are more complex than what we've shown here.
... explaining basic promise syntax: a real example promises are important to understand because most modern web apis use them for functions that perform potentially lengthy tasks.
...And 2 more matches
A first splash into JavaScript - Learn web development
note: many of the code features you'll see in javascript are the same as in other programming languages — functions, loops, etc.
... functions next, add the following below your previous javascript: function checkguess() { alert('i am a placeholder'); } functions are reusable blocks of code that you can write once and run again and again, saving the need to keep repeating code all the time.
...there are a number of ways to define functions, but for now we'll concentrate on one simple type.
...And 2 more matches
Componentizing our Svelte app - Learn web development
next we'll create different functions to handle each user action.
... add the following set of functions below your previous function to handle these actions: function oncancel() { name = todo.name // restores name to its initial value and editing = false // and exit editing mode } function onsave() { update({ name: name }) // updates todo name editing = false // and exit editing mode } function onremove() { dispatch('remove', todo) // emit remove event } function onedit() { editing = true // enter editing mode } function ontoggle() { u...
...pdate({ completed: !todo.completed}) // updates todo status } updating the markup now we need to update our todo component's markup to call the above functions when the appropriate actions are taken.
...And 2 more matches
Multiprocess on Windows
the mscom library provides an api for doing this: the registerproxy and registertypelib functions in mozilla/mscom/registration.h.
... both of these functions return unique pointers and should be treated as opaque by the caller.
...if your interface contains two functions with those annotations, then you will need to add two arraydata entries.
...And 2 more matches
Performance
performance best practices declaring stateless functions once per process bad: // addon.js services.mm.loadframescript("framescript.js", true) // framescript.js const precomputedconstants = // ...
...because declared functions are also objects.
... while it may seem fairly innocencous in this toy example, real scripts often have a lot more functions and initialize some fairly heavyweight objects.
...And 2 more matches
IPDL Tutorial
enum type { tvoid_t, tbool, tint, tdouble, tnscstring, tpplugionscriptableobject }; type type(); void_t& get_void_t(); bool& get_bool(); int& get_int(); double& get_double(); nscstring& get_nscstring(); ppluginscriptableobject* get_ppluginscriptableobject(); }; aunion.type() can be used to determine the type of a union received in an ipdl message handler, with the remaining functions granting access to its contents.
... struct namevaluepair { nscstring name; nscstring value; }; in implementation code, these structs can be created and used like so: namevaluepair entry(astring, anotherstring); foo(entry.name(), entry.value()); // named accessor functions return references to the members arrays ipdl has simple syntax for arrays: invokemethod(nscstring[] args); in c++ this is translated into a nstarray reference: virtual bool recvinvokemethod(nstarray<nscstring>& args); ipdl's generated data structures can be used in several protocols if they are defined in a separate .ipdlh file.
...}; subprotocol actor lifetime allocpprotocol and deallocpprotocol are a matched pair of functions.
...And 2 more matches
Optimizing Applications For NSPR
interrupting threads (via <tt>pr_interrupt()</tt>) on threads blocked in i/o functions is implemented to various degrees on different platforms.
... the nspr process creation api functions return an error when invoked on windows 3.1.
... functions called in an application by a shared library require an additional function prolog.
...And 2 more matches
Atomic Operations
this chapter describes the global functions you use to perform atomic operations.
... the functions define a portable api that may be reliably used in any environment.
... since not all operating environments provide access to such functions, their performance may vary considerably.
...And 2 more matches
Logging
this chapter describes the global functions you use to perform logging.
... nspr provides a set of logging functions that conditionally write printf() style strings to the console or to a log file.
... nspr also provides "assert"-style macros and functions to aid in application debugging.
...And 2 more matches
NSPR API Reference
alling convention types algebraic types 8-, 16-, and 32-bit integer types signed integers unsigned integers 64-bit integer types floating-point integer type native os integer types miscellaneous types size type pointer difference types boolean types status type for return values threads 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 interpretation for seek functions i/o functions functions that operate on pathnames functions that act on file descriptors directory i/o functions socket manipulation functions converting between host and network addresses memory-mapped i/o functions anonymous pipe function polling functions pollable events manipulating layers network addresses network address types and constants network address functions atomic operations pr_atomic...
...increment pr_atomicdecrement pr_atomicset interval timing interval time type and constants interval functions date and time types and constants time parameter callback functions functions memory management operations memory allocation functions memory allocation macros string operations pl_strlen pl_strcpy pl_strdup pl_strfree floating point number to string conversion pr_strtod pr_dtoa pr_cnvtf long long (64-bit) integers bitmaps formatted printing linked lists linked list types prclist linked list macros pr_init_clist pr_init_static_clist pr_append_link pr_insert_link pr_next_link pr_prev_link pr_remove_link pr_remove_and_init_link pr_insert_before pr_insert_after dynamic library linking library li...
...And 2 more matches
NSS 3.12.4 release notes
cert_decodecrlissuingdistributionpoint cert_findcrlissuingdistpointexten the old documentation of the expression matching syntax rules was incorrect, and the new corrected documentation is as follows for public nssutil functions (see portreq.h): port_regexpvalid port_regexpsearch port_regexpcasesearch these functions will match a string with a shell expression.
... 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.
...ilds on linux bug 486698: facilitate the building of major components independently and in a chain manner by downstream distributions bug 486999: calling ssl_setsockpeerid a second time leaks the previous value bug 487007: make lib/jar conform to nss coding style bug 487162: ckfw/capi build failure on windows bug 487239: nssutil.rc doesn't compile on wince bug 487254: sftkmod.c uses posix file io functions on wince bug 487255: sdb.c uses posix file io functions on wince bug 487487: cert_nametoascii reports !invalid ava!
...And 2 more matches
NSS 3.12.5 release_notes
this default setting can also be changed within the application by using the following existing api functions: secstatus ssl_optionset(prfiledesc *fd, print32 option, prbool on) secstatus ssl_optionsetdefault(print32 option, prbool on) there is now a new value for "option", which is: ssl_enable_renegotiation the corresponding new values for ssl_enable_renegotiation are: ssl_renegotiate_never: never renegotiate at all (default).
...(see ssl.h) error codes: ssl_error_decompression_failure (see sslerr.h) ssl_error_renegotiation_not_allowed (see sslerr.h) new context initialization and shutdown functions see nss.h for details.
... the 2 new functions are: nss_initcontext nss_shutdowncontext parameters for these functions are used to initialize softoken.
...And 2 more matches
NSS_3.12_release_notes.html
nss 3.12 libraries have the following versions: sqlite3: 3.3.17 nssckbi: 1.70 softokn3 and freebl3: 3.12.0.3 other nss libraries: 3.12.0.3 new in nss 3.12 3 new shared library are shipped with nss 3.12: nssutil sqlite nssdbm 1 new include file is shipped with nss3.12: utilrename.h new functions in the nss shared library: cert_checknamespace (see cert.h) cert_encodecertpoliciesextension (see cert.h) cert_encodeinfoaccessextension (see cert.h) cert_encodeinhibitanyextension (see cert.h) cert_encodenoticereference (see cert.h) cert_encodepolicyconstraintsextension (see cert.h) cert_encodepolicymappingextension (see cert.h) cert_encodesubjectkeyid (see certdb/cert.h) cert_encodeusernotice ...
...ies to get certs using aia url with ocsp access method bug 390233: umbrella bug for libpkix cert validation failures discovered from running vfyserv bug 390499: libpkix does not check cached cert chain for revocation bug 390502: libpkix fails cert validation when no valid crl (nist validation policy is always enforced) bug 390530: libpkix does not support time override bug 390536: cert validation functions must validate leaf cert themselves bug 390554: all pkix_nullcheck_ errors are reported as pkix alloc error bug 390888: cert_verify* functions should be able to use libpkix bug 391457: libpkix does not check for object ref leak at shutdown bug 391774: pkix_shutdown is not called by nssinit.c bug 393174: memory leaks in ocspclnt/pkix.
...signature in libpkix without decoding and reencoding bug 390542: libpkix fails to validate a chain that consists only of one self issued, trusted cert bug 390728: pkix_pl_ocsprequest_create throws an error if it was not able to get aia location bug 397825: libpkix: ifdef code that uses user object types bug 397832: libpkix leaks memory if a macro calls a function that returns an error bug 402727: functions responsible for creating an object leak if subsequent function code produces an error bug 402731: pkix_pl_pk11certstore_crlquery will crash if fails to acquire dp cache.
...And 2 more matches
NSS 3.22 release notes
nss 3.22 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_22_rtm/src/ new in nss 3.22 new functionality rsa-pss signatures are now supported (bug 1215295) new functions pk11_signwithmechanism() and pk11_signwithmechanism() are provided to allow rsa keys to be used with pss.
... pseudorandom functions based on hashes other than sha-1 are now supported with pbkdf (bug 554827).
... new functions in pk11pub.h pk11_signwithmechanism - this function is an extended version pk11_sign().
...And 2 more matches
nss tech note8
background information on libssl's cache functions and sids nss technical note: 8 27 february 2006 nelson b.
... bolyard here is some background information on libssl's cache functions and sids.
... for servers these pointers point to sec->cache = ssl_sid_cache; sec->uncache = ssl_sid_uncache; which are functions defined in sslsnce.c, the server session cache source file.
...And 2 more matches
JS_THREADSAFE
most jsapi functions require the caller to be in a request.
... in this reference, these jsapi functions are marked with the words "requires request", like this: name type description cx jscontext * the context to use.
... most jsapi callback functions are always called from within a request.
...And 2 more matches
Using the Places annotation service
also, we may add functions to get all of "your" annotations matching a given namespace.
...pageannotationbinary(auri, aname, adata, adatalen, amimetype); getitemannotationstring(aitemid, aname); getitemannotationint32(aitemid, aname); getitemannotationint64(aitemid, aname); getitemannotationdouble(aitemid, aname); getitemannotationbinary(aitemid, aname, adata, adatalen, amimetype); from javascript: getpageannotation(auri, aname); getitemannotation(aitemid, aname); these functions will return/throw ns_error_not_available if the annotation requested does not exist.
... the getter functions return only the value of the annotation (with the exception of the c++ getpageannotationbinary and getitemannotationbinary methods which return the mimetype as well).
...And 2 more matches
Mozilla internal string guide
functions taking strings as parameters should generally take one of these four types.
... helper classes and functions converting cocoa strings use mozilla::copycocoastringtoxpcomstring() in mozilla/macstringhelpers.h to convert cocoa strings to xpcom strings.
... most of the functions that modify strings (assign(), setlength(), etc) also have a version that takes a "mozilla::fallible_t" parameter.
...And 2 more matches
Components.utils.cloneInto
options : object this optional parameter is an object with the following optional properties: clonefunctions: a boolean value that determines if functions should be cloned.
...cloned functions have the same semantics as functions exported using components.utils.exportfunction.
... see cloning objects that have functions below.
...And 2 more matches
XPCOM reference
this reference describes the interfaces and functions provided by the xpcom library.
... in addition, it details the various helper classes and functions, as well as the components, provided by the xpcom glue library.
... 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.
...And 2 more matches
Address Book examples
let card = collection.cardforemailaddress("foo@bar.invalid.com"); note: both of these functions may raise an ns_error_not_implemented exception if the collection has not implemented that function.
... use the setproperty/getproperty functions on nsiabcard to set your property in the same way as you would do with normal properties: card.setproperty("random1", "xyz"); card.setproperty("random2", "foo"); ...
...in either case, you'll need: a factory object implementing nsiabdirfactory a directory object implementing nsiabdirectory if you are using c++, you can inherit from nsabdirproperty and override functions for your specific implementation to save implementing all the functions on nsiabdirectory yourself.
...And 2 more matches
Working with data
these are javascript constructors; as such, they're callable functions that you can use to create new cdata objects of that type.
... example: checking the value of an integer if, for example, you need to see if the value of an integer is 5, you can do so like this: var t = ctypes.int32_t(5); if (t.tostring() == "ctypes.int32_t(5)") { // it's 5 } working with strings c functions expect strings to be arrays of characters, with the end of the string indicated by a null character.
... using strings with c functions you don't even need to convert strings when using them as input parameters to c functions.
...And 2 more matches
js-ctypes reference
the library object is used mostly to declare native functions provided by the library so that js-ctypes knows how to call them.
... see library.declare() for instructions on how to declare these functions.
... type constructors these are functions that define new types, and thus return a ctype object.
...And 2 more matches
Memory - Plugins
« previousnext » this chapter describes the plug-in api functions that allocate and free memory as needed by the plug-in.
...browser memory schemes may be more efficient than standard os memory functions, and can give the browser flexibility in the way it manages memory.
... in addition, the plug-in usually has the option of using its own memory functions.
...And 2 more matches
URLs - Plugins
getting urls posting urls getting urls to retrieve a url and display it on a specified target page, use the npn_geturl, npn_geturlnotify, and npp_urlnotify functions.
... both the npn_geturlnotify and npn_posturlnotify functions call the npp_urlnotify method to notify the plug-in of the result of a request.
... both functions pass the notifydata value to npp_urlnotify, which tells the plug-in that the url request was completed and the reason for completion.
...And 2 more matches
Debugger.Object - Firefox Developer Tools
spidermonkey creates exactly one debugger.object instance for each debuggee object it presents to a given debugger instance: if the debugger encounters the same object through two different routes (perhaps two functions are called on the same object), spidermonkey presents the same debugger.object instance to the debugger each time.
...this can return null if the promise was not resolved by calling its resolve or reject resolving functions from script.
... function properties of the debugger.object prototype the functions described below may only be called with a this value referring to a debugger.object instance; they may not be used as methods of other kinds of objects.
...And 2 more matches
Call Tree - Firefox Developer Tools
the call tree tells you which javascript functions the browser spent the most time in.
... samples is the number of samples that were taken when we were executing this particular function, including its children (the other functions called by this particular function).
...functions with a relatively high self cost are good candidates for optimization, either because they take a long time to run, or because they are called very often.
...And 2 more matches
WebGL model view projection - Web APIs
it also uses a collection of utility functions available under the mdn global object.
...this function is part of a collection of utility functions written for these tutorials and is not explained in depth here.
...it still represents a point in 3d space and it can easily be demonstrated how to construct this type of coordinate through a pair of simple functions.
...And 2 more matches
Movement, orientation, and motion: A WebXR example - Web APIs
this will help to solidify your understanding of how the geometry of 3d graphics and vr work, as well as to help ensure you understand the way the functions and data that are used during xr rendering work together.
... setup and utility functions next, we declare the variables and constants used throughout the application, starting with those used to store webgl and webxr specific information: let polyfill = null; let xrsession = null; let xrinputsources = null; let xrreferencespace = null; let xrbutton = null; let gl = null; let animationframerequestid = 0; let shaderprogram = null; let programinfo = null; let buffers = null; let textu...
... logging errors a function called logglerror() is implemented to provide an easily customized way to output logging information for errors that occur while executing webgl functions.
...And 2 more matches
CSS values and units - CSS: Cascading Style Sheets
functions can take multiple arguments, which are formatted similarly to a css property value.
...(but see notes regarding whitespace within pages for min(), max() and clamp() functions.) some legacy functional notations such as rgba() use commas, but generally commas are only used to separate items in a list.
... adds the min(), max() and clamp() functional notation adds toggle() css values and units module level 3 candidate recommendation adds calc(), ch, rem, vw, vw, vmin, vmax, q css color module level 4 working draft adds commaless syntaxes for the rgb(), rgba(), hsl(), and hsla() functions.
...And 2 more matches
transition-timing-function - CSS: Cascading Style Sheets
you may specify multiple timing functions; each one will be applied to the corresponding property as specified by the transition-property property, which acts as a transition-property list.
... if there are fewer timing functions specified than in the transition-property list, the user agent must calculate which value is used by repeating the list of values until there is one for each transition property.
... if there are more timing functions, the list is simply truncated to the right size.
...And 2 more matches
Details of the object model - JavaScript
this chapter assumes that you are already somewhat familiar with javascript and that you have used javascript functions to create simple objects.
... define and create a set of objects with constructor functions.
... creating the hierarchy there are several ways to define appropriate constructor functions to implement the employee hierarchy.
...And 2 more matches
Grammar and types - JavaScript
console.log(x); // referenceerror let x = 3; function hoisting in the case of functions, only function declarations are hoisted—but not the function expressions.
... and object although these data types are relatively few, they enable you to perform useful functions with your applications.
... objects and functions are the other fundamental elements in the language.
...And 2 more matches
Promise - JavaScript
promises in javascript represent processes that are already happening, which can be chained with callback functions.
... the signatures of these two functions are simple, they accept a single parameter of any type.
... these functions are written by you, the programmer.
...And 2 more matches
async function expression - JavaScript
the async function keyword can be used to define async functions inside expressions.
... you can also define async functions using an async function statement.
... syntax async function [name]([param1[, param2[, ..., paramn]]]) { statements } as of es2015, you can also use arrow functions.
...And 2 more matches
Function expression - JavaScript
you can also define functions using the function constructor and a function declaration.
... function [name]([param1[, param2[, ..., paramn]]]) { statements } as of es2015, you can also use arrow functions.
...the main difference between a function expression and a function declaration is the function name, which can be omitted in function expressions to create anonymous functions.
...And 2 more matches
this - JavaScript
es5 introduced the bind() method to set the value of a function's this regardless of how it's called, and es2015 introduced arrow functions which don't provide their own this binding (it retains the this value of the enclosing lexical context).
... class context the behavior of this in classes and functions is similar, since classes are functions under the hood.
...console.log(h()); // azerty var o = {a: 37, f: f, g: g, h: h}; console.log(o.a, o.f(), o.g(), o.h()); // 37,37, azerty, azerty arrow functions in arrow functions, this retains the value of the enclosing lexical context's this.
...And 2 more matches
Using the WebAssembly JavaScript API - WebAssembly
just like functions, linear memories can be defined inside a module or imported.
... memory imports work just like function imports, only memory objects are passed as values instead of javascript functions.
... in the current iteration of webassembly, there is only one type of reference needed by webassembly code — functions — and thus only one valid element type.
...And 2 more matches
Classes and Inheritance - Archive of obsolete content
data members are properties that allow each instance to have their own state, whereas member functions are properties that allow instances to have behavior.
... classes in javascript are defined using constructor functions.
...we will show how to define classes using constructors, and how to use prototypes to efficiently define member functions on each instance.
...constructors are just ordinary functions, however, so it is perfectly legal to perform ordinary function calls on them.
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.
... save() and search() are both asynchronous functions: they synchronously return a placesemitter object, which then asynchronously emits events as the operation progresses and completes.
... functions save(bookmarkitems, options) creating, saving, and deleting bookmarks are all done with the save() function.
... placesemitter the placesemitter is not exported from the module, but returned from the save and search functions.
util/deprecate - Archive of obsolete content
experimental functions to deprecate code.
... globals functions deprecatefunction(fun, msg) dump to the console the error message given in the second argument, prefixed with "deprecated:", and print the stacktrace; then execute the function passed as first argument and returns its value.
... this function is mostly used to flag usage of deprecated functions, that are still available but which we intend to remove in a future release.
... this function is mostly used to flag usage of deprecated functions that are no longer available.
Creating Event Targets - Archive of obsolete content
it duplicates the previous code, but with a few changes: import emit(), on(), once(), and off() from event/core replace listener functions with calls to emit(), passing the appropriate event type export its own event api.
... this consists of three functions: on(): start listening for events or a given type once(): listen for the next occurrence of a given event, and then stop removelistener(): stop listening for events of a given type the on() and once() exports delegate to the corresponding function from event/core, and use bind() to pass the exports object itself as the target argument to the underlying function.
...eventtarget provides an implementation of the functions needed to add and remove event listeners: on(), once(), and removelistener().
...izer use merge() to copy any supplied options into the newly created object call createobserver(), passing in the newly created object as the event target createobserver() is the same as in the previous example, except that in emit() we pass the newly created bookmarkmanager as the event target to use this event target we can create it and call the on(), once(), and removelistener() functions that it has inherited: var bookmarks = require("./bookmarks"); var bookmarkmanager = bookmarks.bookmarkmanager({}); function logadded(uri) { console.log("added: " + uri); } function logvisited(uri) { console.log("visited: " + uri); } exports.main = function() { bookmarkmanager.on("added", logadded); bookmarkmanager.on("visited", logvisited); }; exports.onunload = function() { bookm...
Bootstrapped extensions - Archive of obsolete content
this is done using a special script file that's included in the extension that contains functions the browser calls to command the extension to install, uninstall, start up, and shut down.
... creating a bootstrapped extension to mark an extension as bootstrappable, you need to add the following element to its install manifest: <em:bootstrap>true</em:bootstrap> then you need to add a bootstrap.js file that contains the required functions; this should be alongside the install.rdf file in the extension's package.
... bootstrap entry points the bootstrap.js script should contain several specific functions, which are called by the browser to manage the extension.
... reason constants the bootstrap functions accept a reason parameter, which explains to the extension why it's being called.
JavaScript timers - Archive of obsolete content
but there are some javascript native functions (timers) which allow us to delay the execution of arbitrary instructions: settimeout() setinterval() setimmediate() requestanimationframe() the settimeout() function is commonly used if you wish to have your function called once after the specified delay.
... the setinterval() function is commonly used to set a delay for functions that are executed again and again, such as animations.
... functions available to workers in addition to the standard javascript set of functions (such as string, array, object, json etc), there are a variety of functions available from the dom to workers.
... 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).
Appendix E: DOM Building and Insertion (HTML & XUL) - Archive of obsolete content
parse element namespace prefix (if none exists, default to defaultnamespace), and create element var elemns = namespace(elemnameorarray); var elem = doc.createelementns(elemns.namespace || jsontodom.defaultnamespace, elemns.shortname); // set element's attributes and/or callback functions (eg.
...event listeners can be defined on the given nodes by passing functions rather than strings to on* attributes: var href = "http://www.google.com/"; var text = "google"; var nodes = {}; document.documentelement.appendchild( jsontodom(["xul:hbox", {}, ["div", {}, ["a", { href: href, key: "link", onclick: function (event) { alert(event.target.href); } }, text], ["span", { class: "stuff" }, ...
... ['html:input', {type:'checkbox', id:'mycheck'}], ['html:label', {for:'mycheck'}, 'here is text of label, click this text will check the box' ] ] ] ]; document.body.appendchild(jsontodom(json, document, {})); jquery templating for extensions which already use jquery, it is possible to use its builtin dom building functions for templating, though care must be taken when passing non-static strings to methods such as .append() and .html().
...in these cases, multiple attributes should be used, one for each variable: function clickify(elem, address) { elem.setattribute("href", address); elem.setattribute("onclick", "openwindow(this.getattribute('href'))"); } escaping functions when the code fragment in question is not an event handler attribute and there is no feasible way to pass the data through other means, they must be escaped with functions such as uneval, string.quote, json.stringify, or number.
Dehydra Function Reference - Archive of obsolete content
gcc command line -fplugin=/path/to/gcc_dehydra.so -fplugin-arg-gcc_dehydra=/path/to/your/script.js callback functions the following functions may be provided by the analysis script and will be called by dehydra while compiling.
...process_type is called after process_function is called for all the member functions.
... process_function(decl, body) dehydra calls this for each function definition (declarations without bodies are not included), including both top-level functions, class member functions, and inline class member functions.
...builtin functions the following functions are provided by dehydra and may be called by the user: print(msg) print a string to stdout (or stderr if the compiler is piping output).
Metro browser chrome tests - Archive of obsolete content
it currently allows you to run javascript code in the same scope as the immersive browser and report results using the same functions as the mochitest test framework.
...the test file can contain other functions which will be ignored unless invoked by test().
...test comparison functions used in metro browser chrome tests are identical to those supported by mochitests, see how the comparison functions work in the mochitest documentation for more details.
... helper functions the eventutils helper functions are available on the eventutils object defined in the global scope.
Venkman Introduction - Archive of obsolete content
this column displays the size of functions, in lines.
...if you would like to have functions displayed, check the "include functions" menu item in the view's context menu.
...when the debugger is stopped, the call stack view displays the list of active functions.
...files and specific functions within them can be displayed by selecting the appropriate file or function name in the script view.
Styling a Tree - Archive of obsolete content
setting properties for the custom view for trees with a custom view script, you can set properties by supplying the functions getrowproperties(), getcolumnproperties() and getcellproperties() in the view.
...arguments to these functions indicate which row and/or column.
... prior to gecko 22 the last argument to each of these functions is a properties list which the view is expected to fill with a list of properties.
... getrowproperties : function(row,prop){} getcolumnproperties : function(column,columnelement,prop){} getcellproperties : function(row,column,prop){} from gecko 22 you can return a string of space-separated property names from these functions.
NPObject - Archive of obsolete content
to aid with the reference counting and ownership management in general, the functions npn_createobject(), npn_retainobject(), npn_releaseobject(), and npn_releasevariantvalue() are provided as part of this api.
... npobject behavior is implemented using the set of callback functions defined in npclass.
... warning: do not manipulate the _class and referencecount fields directly; use the functions below to manipulate the object.
... functions npn_createobject() npn_retainobject() npn_releaseobject() npn_invoke() npn_invokedefault() npn_evaluate() npn_getproperty() npn_setproperty() npn_removeproperty() npn_hasproperty() npn_hasmethod() npn_setexception() see also npclass ...
Expression closures - Archive of obsolete content
for future-facing usages, consider using arrow functions.
... expression closures are a shorthand function syntax for writing simple functions.
... description this addition is nothing more than a shorthand for writing simple functions, giving the language something similar to a typical lambda notation.
... examples a shorthand for binding event listeners: document.addeventlistener('click', function() false, true); using this notation with some of the array functions from javascript 1.6: elems.some(function(elem) elem.type == 'text'); ...
Desktop mouse and keyboard controls - Game development
the good thing about using phaser is that it offers helper variables and functions for easier and faster development, but it's totally up to you which approach you chose.
...to do that we'll hold the information on whether the keys we are interested in are pressed or not: var rightpressed = false; var leftpressed = false; var uppressed = false; var downpressed = false; then we will listen for the keydown and keyup events and act accordingly in both handler functions.
... we could write our own keycode object containing the key codes, for example: var keyboardhelper = { left: 37, up: 38, right: 39, down: 40 }; that way instead of using the codes to compare the input in the handler functions we could do something like this, which is arguably easier to remember: if(event.keycode == keyboardhelper.left) { leftpressed = true; } note: you can also find a list if the different keycodes and what keys they relate to in the keycode reference page.
... phaser approach as i mentioned before you can write everything on your own, but you can also take the advantage of built-in functions in frameworks like phaser — these will make your life easier and development a lot faster.
Function - MDN Web Docs Glossary: Definitions of Web-related terms
different types of functions an anonymous function is a function without a function name.
... only function expressions can be anonymous, function declarations must have a name: // when used as a function expression (function () {}); // or using the ecmascript 2015 arrow notation () => {}; the following terms are not used in the ecmascript language specification, they're jargon used to refer to different types of functions.
... // declared functions can't be called immediately this way // error (https://en.wikipedia.org/wiki/immediately-invoked_function_expression) /* ​function foo() { console.log('hello foo'); }(); */ // function expressions, named or anonymous, can be called immediately (function foo() { console.log("hello foo"); }()); (function food() { console.log("hello food"); })(); (() => console.log('hello world'))()...
...; if you'd like to know more about iifes, check out the following page on wikipedia : immediately invoked function expression learn more technical reference functions arrow functions ...
How to build custom form controls - Learn web development
we can now start to define all the functions that will be used each time the user interacts with our control.
... next, we bind these functions to the appropriate events: // we handle the event binding when the document is loaded.
...e control // it takes one parameter: // select : the dom node with the class `select` related to the native control function getindex(select) { // we need to access the native control for the given custom control // in our example, that native control is a sibling of the custom control var nativewidget = select.previouselementsibling; return nativewidget.selectedindex; }; with these two functions, we can bind the native controls to the custom ones: // we handle event binding when the document is loaded.
...two hints to help you in this: the first argument for all our functions is the same, which means those functions need the same context.
Introducing asynchronous JavaScript - Learn web development
async callbacks async callbacks are functions that are specified as arguments when calling a function which will start executing code in the background.
... callbacks are versatile — not only do they allow you to control the order in which functions are run and what data is passed between them, they also allow you to pass data to different functions depending on circumstance.
...they are essentially a returned object to which you attach callback functions, rather than having to pass callbacks into a function.
...but web browsers define functions and apis that allow us to register functions that should not be executed synchronously, and should instead be invoked asynchronously when some kind of event occurs (the passage of time, the user's interaction with the mouse, or the arrival of data over the network, for example).
Introduction to web APIs - Learn web development
in the same way, if you want to say, program some 3d graphics, it is a lot easier to do it using an api written in a higher-level language such as javascript or python, rather than try to directly write low level code (say c or c++) that directly controls the computer's gpu or other graphics functions.
... javascript libraries — usually one or more javascript files containing custom functions that you can attach to your web page to speed up or enable writing common functionality.
...the handler properties that allow us to run functions when events fire are generally listed in our reference material in separate "event handlers" sections.
...we know the response will be successfully returned and available after the load event has fired (unless an error occurred), so we save the response containing the returned json in the superheroes variable, then pass it to two different functions for further processing.
Video and Audio APIs - Learn web development
first of all, add the following two addeventlistener() lines below the previous ones: rwd.addeventlistener('click', mediabackward); fwd.addeventlistener('click', mediaforward); now on to the event handler functions — add the following code below your previous functions to define mediabackward() and mediaforward(): let intervalfwd; let intervalrwd; function mediabackward() { clearinterval(intervalfwd); fwd.classlist.remove('active'); if(rwd.classlist.contains('active')) { rwd.classlist.remove('active'); clearinterval(intervalrwd); media.play(); } else { rwd.classlist.add('activ...
... finally, we need to define the windbackward() and windforward() functions invoked in the setinterval() calls.
... add the following below your two previous functions: function windbackward() { if(media.currenttime <= 3) { rwd.classlist.remove('active'); clearinterval(intervalrwd); stopmedia(); } else { media.currenttime -= 3; } } function windforward() { if(media.currenttime >= media.duration - 3) { fwd.classlist.remove('active'); clearinterval(intervalfwd); stopmedia(); } else { media.currenttime += 3; } } again, we'll just run through the first one of these functions as they work almost identically, but in reverse to one another.
... at this point, you could delete the equivalent lines from the windbackward() and windforward() functions, as that functionality has been implemented in the stopmedia() function instead.
JavaScript object basics - Learn web development
object basics an object is a collection of related data and/or functionality (which usually consists of several variables and functions — which are called properties and methods when they are inside objects.) let's work through an example to understand what they look like.
...the syntax always follows this pattern: const objectname = { member1name: member1value, member2name: member2value, member3name: member3value }; the value of an object member can be pretty much anything — in our person object we've got a string, a number, two arrays, and two functions.
...the last two items are functions that allow the object to do something with that data, and are referred to as the object's methods.
...you should also appreciate that objects are very useful as structures for storing related data and functionality — if you tried to keep track of all the properties and methods in our person object as separate variables and functions, it would be inefficient and frustrating, and we'd run the risk of clashing with other variables and functions that have the same names.
Inheritance in JavaScript - Learn web development
but mostly this has involved built-in browser functions.
... unlike old-school constructor functions where the new operator does the initialization of this to a newly-allocated object, this isn't automatically initialized for a class defined by the extends keyword, i.e the sub-classes.
... ultimately, objects are just another form of code reuse, like functions or loops, with their own specific roles and advantages.
... if you find yourself creating a bunch of related variables and functions and want to track them all together and package them neatly, an object is a good idea.
Client-Server Overview - Learn web development
one of the most important operations they perform is providing simple mechanisms to map urls for different resources/pages to specific handler functions.
... for example, consider the following django (python) code that maps two url patterns to two view functions.
...import views urlpatterns = [ # example: /best/ url(r'^$', views.index), # example: /best/junior/ url(r'^junior/$', views.junior), ] note: the first parameters in the url() functions may look a bit odd (e.g.
...you don't need to know how regular expressions work at this point, other than that they allow us to match patterns in the url (rather than the hard coded values above) and use them as parameters in our view functions.
Debugging on Windows
avoiding stepping into certain functions you can avoid stepping into certain functions, such as nscomptr methods, using an undocumented feature of vc.
... see the blog post how to not step into functions using the visual c++ debugger for details.
... here are some wildcards you can use (tested with vc 8): nscomptr.*\:\:.*=nostepinto (nsg|g)etter_*addrefs.*=nostepinto ns_convertutf.* ; might be too broad: (ns|promise)[^\:]*[ss]tring.* ...add common functions to this list should probably make a .reg file for easy importing obtaining stdout and other file handles running the following command in the command window in visual studio returns the value of stdout, which can be used with various debugging methods (such as nsgenericelement::list) that take a file* param: debug.evaluatestatement {,,msvcr80d}(&__iob_func()[1]) (alternatively you can evaluate {,,msvcr80d}(&__iob_func()[1]) in the quickwatch window) similarly, you can open a file on the disk using fopen: >debug.evaluatestatement {,,msvcr80d}fopen("c:\\123", "w") 0x10311dc0 { ..sn...
... you can use helper functions from nsxpconnect.cpp to inspect and modify the state of javascript code from the msvs debugger.
Cross Process Object Wrappers
passing cpows from frame scripts frame scripts can send messages to chrome using one of two global functions: sendasyncmessage() or sendsyncmessage().
... the optional third parameter to each of these functions is an object whose properties are objects to wrap.
...the chrome script can get and set the wrapped object's properties and call its functions: // chrome script windowmm.addmessagelistener("my-e10s-extension-message", handlemessage); function handlemessage(message) { let wrapper = message.objects.clicked; console.log(wrapper.innerhtml); wrapper.innerhtml = "<h2>modified by chrome!</h2>" wrapper.setattribute("align", "center"); } auto-generated cpows add-ons that have not declared themselves multiprocess compatible are set up...
...this means that if content passes a cpow to the chrome process, the chrome process can synchronously pass objects (such as event listener functions) into functions defined in the cpow.
JNI.jsm
with this module, all of the android sdk functions that firefox has permissions for are at your fingertips.
...functions are declared similar to js-ctypes but in a very different syntax.
... unlike c from js-ctypes, defining constants is not a manual magic number method in jni, it is declared the same way we define functions, except in jni they are called fields.
...'removeview', sig: '(' + sig.view + ')' + sig.void }] }); var acontext = geckoappshell.getcontext(); var wm = acontext.getsystemservice(context.window_service); var wm_casted = jni.classes.android.view.windowmanager.__cast__(wm); } finally { if (my_jenv) { jni.unloadclasses(my_jenv); } } } // helper functions function genmethodsig(aparamsarr, aret) { // aparamsarr is an array of sig's for each param.
Localization and Plurals
for example, your extension localized for english with plural rule #1, which expects 2 plural forms, is installed on a localized version of firefox with plural rule #4, which expects 3 forms: /** * create a pair of plural form functions for the given plural rule number.
... * * @param arulenum * the plural rule number to create functions * @return a pair: [function that gets the right plural form, * function that returns the number of plural forms] */ [string pluralform get(int anum, string awords), int numforms numforms()] makegetter(int arulenum) here is an example usage of makegetter: components.utils.import("resource://gre/modules/pluralform.jsm"); // let's get irish (plural rule #11) let [get, numforms] = pluralform.makegetter(11); // make up some values to use with "get" let dummytext = "form 1;form 2;form 3;form 4;form 5"; let dummynum = 10; // in the case of irish, the value 10 uses plural form #4, so "form 4" is printed print(get(dummynum, dummytext)); in this example, the irish plural rule was hardcoded, but this could be...
...so for your extension, specify a pluralrule value in the .properties, and call pluralform.makegetter(pluralrulefromproperties), making sure to save the 2 returned functions.
... (you can use destructured assignment in javascript 1.7 to keep things clean.) the returned functions act just like pluralform.get() and pluralform.numforms(), except for the specified plural rule instead of the default plural rule.
Mozilla Style System Documentation
thus the parent style context is an argument to the functions that create style contexts.
...the functions that form the style context automatically adds the context to the tree correctly.
...for frames: const nsstyledisplay *display; ::getstyledata(frame, &display); or for style contexts: const nsstyledisplay *display; ::getstyledata(sc, &display); these functions cause an appropriate struct to be computed if it hasn't been computed already and then fill in the struct pointer.
...these functions should only fill in a null pointer on allocation failure.
Gecko Profiler FAQ
bug 1341811 suggests hooking platform thread spawning functions but nobody has looked at it yet.
... what's the best way to measure the cost of new compiler flags (that affect all or most functions)?
...some functions (reflow, painting, js excecution) insert the url of the associated document into the call stack frame, so you can get a rough idea, but we don’t have instrumentation at the tab/document/eventqueue level.
... if you have a rough idea of what the user was doing, try searching for functions that you’d expect in the call tree and see where they are in the thread timeline.
AsyncTestUtils extended framework
this allows you to write reasonably normal looking functions instead of having to chain together a whole bunch of functions and callbacks.
... your test functions need to agree to the following contract: the asynchronous function contract a function should yield false or return false when something asynchronous is going on.
... most of the things you will want to do already have helper functions that take care of all of this, so all you need to do is pass their return values through.
... creating / injecting messages all of these functions take synthetic set definitions.
Nonblocking IO In NSPR
the potentially-blocking io functions include <tt>pr_connect()</tt>, <tt>pr_accept()</tt>, <tt>pr_acceptread()</tt>, <tt>pr_read()</tt>, <tt>pr_write()</tt>, <tt>pr_writev()</tt>, <tt>pr_recv()</tt>, <tt>pr_send()</tt>, <tt>pr_recvfrom()</tt>, <tt>pr_sendto()</tt>, and <tt>pr_transmitfile(),</tt> and do not include <tt>pr_bind()</tt> and <tt>pr_listen()</tt>.
... in blocking mode, any of these potentially-blocking functions requires the use of the nt i/o completion port.
... differences from blocking io in nonblocking mode, the timeout argument for the io functions is ignored.
...also, native file descriptors (socket handles) cannot be added to <tt>pr_fd_set</tt>, i.e., the functions <tt>pr_fd_nset</tt>, <tt>pr_fd_nclr</tt>, <tt>pr_fd_nisset</tt> do not work.
Anonymous Shared Memory
anonymous memory protocol anonymous shared memory functions anonymous memory protocol nspr provides an anonymous shared memory based on nspr's prfilemap type.
... in the first protocol, the job of passing the inheritable shared memory is done via helper-functions with pr_createprocess.
...nspr provides helper functions for extracting data from the prfilemap object.
...pr_memunmap(addr); pr_closefilemap(fm); anonymous shared memory functions pr_openanonfilemap pr_processattrsetinheritablefilemap pr_getinheritedfilemap pr_exportfilemapasstring pr_importfilemapfromstring ...
Floating Point Number to String Conversion
nspr provides functions that convert double-precision floating point numbers to and from their character string representations.
... these conversion functions were originally written by david m.
... the header file prdtoa.h declares these functions.
... the functions are: pr_strtod pr_dtoa pr_cnvtf references gay's implementation is inspired by these two papers.
Hash Tables
this chapter describes the hash table functions in the plds (portable library — data structures) library of nspr.
... the hash table library functions are declared in the header file plhash.h.
... warning: the nspr hash table library functions are not thread safe.
... hash table types and constants hash table functions hash table types and constants plhashentry plhashtable plhashnumber plhashfunction plhashcomparator plhashenumerator plhashallocops hash table functions pl_newhashtable pl_hashtabledestroy pl_hashtableadd pl_hashtableremove pl_hashtablelookup pl_hashtableenumerateentries pl_hashstring pl_comparestrings pl_comparevalues see also xpcom hashtable guide ...
PL_NewHashTable
the arguments keycompare and valuecompare are functions of type plhashcomparator that the hash table library functions use to compare the keys and the values of entries.
...the hash table library functions do not make a copy of this structure.
... when the allocation functions in allocops are invoked, the allocation private data allocpriv is passed as the first argument (pool).
... you can specify a null value for allocops to use the default allocation functions.
Threads
threading types and constants threading functions a thread has a limited number of resources that it truly owns.
... threading types and constants prthread prthreadtype prthreadscope prthreadstate prthreadpriority prthreadprivatedtor threading functions most of the functions described here accept a pointer to the thread as an argument.
...the effects of these functions on invalid threads are undefined.
...after a thread has been created, you can get and set its priority with these functions: pr_getthreadpriority pr_setthreadpriority controlling per-thread private data you can use these functions to associate private data with each of the threads in a process: pr_newthreadprivateindex allocates a unique index.
NSS 3.12.6 release notes
new functions for sni (see ssl.h for more information): sslsnisocketconfig return values: ssl_sni_current_config_is_used: libssl must use the default cert and key.
... ssl_snisocketconfighook ssl_reconfigfd ssl_configserversessionidcachewithopt ssl_settrustanchors ssl_getnegotiatedhostinfo new enum for sni: sslsninametype (see sslt.h) new functions in cert.h certdistnames: duplicate distinguished name array.
... bug 275744: support for tls compression rfc 3749 bug 494603: update nss's copy of sqlite3 to 3.6.22 to get numerous bug fixes bug 496993: add accessor functions for ssl_implementedciphers bug 515279: cert_pkixverifycert considers a certificate revoked if cert_processocspresponse fails for any reason bug 515870: gcc compiler warnings in nss 3.12.4 bug 518255: the input buffer for sgn_update should be declared const bug 519550: allow the specification of an alternate library for sqlite bug 524167: crash in [[@ f...
... furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.28 release notes
new functions in ssl.h ssl_exportearlykeyingmaterial implements a key exporter based on the tls 1.3 early exporter secret.
... new functions to configure signature schemes are provided: ssl_signatureschemeprefset, ssl_signatureschemeprefget.
... the old ssl_signatureprefset and ssl_signatureprefset functions are now deprecated.
...furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
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.
... in particular, these functions are used for obtaining certificates, keys, and passwords.
... several functions in the nss libraries use the password callback function to obtain the password before performing operations that involve the protected information.
... see also for examples of password callback functions, see the samples in the samples directory.
JS::PropertySpecNameEqualsId
this article covers features introduced in spidermonkey 38 determine if the given jspropertyspec::name or jsfunctionspec::name value equals the given jsid.
... syntax bool js::propertyspecnameequalsid(const char *name, js::handleid id); name type description name const char * jspropertyspec::name or jsfunctionspec::name.
... description js::propertyspecnameequalsid determines if the given jspropertyspec::name or jsfunctionspec::name value equals the given jsid, and returns true if so.
... see also mxr id search for js::propertyspecnameequalsid js::propertyspecnameissymbol js::propertyspecnametopermanentid jspropertyspec jsfunctionspec bug 1082672 ...
JSFastNative
this article covers features introduced in spidermonkey 1.8 jsfastnative is the type of fast native functions in the jsapi.
... apis such as js_initclass and js_definefunctions can create custom methods that are implemented as c/c++ functions of this type, instead of jsnative.
... argc unsigned int the number of arguments supplied to the function by the caller (as opposed to, say, the number of arguments the function is specified to take in its jsfunctionspec).
... to create a jsfunctionspec that points to a jsfastnative, use js_fn.
JSPropertyOp
it is also called when the property's value is accessed via jsapi functions such as js_getproperty or (less obviously) js_callfunctionname.
...it is also called when the property is set via jsapi functions such as js_setproperty.
...it also happens in jsapi functions such as js_defineproperty.
...it is therefore dangerous for the callback to call jsapi functions, particularly if obj may have been visible to more than one thread.
JS_Add*Root
these functions are obsoleted, use js::persistentrooted instead.
... description the js_add*root and functions add a c/c++ variable to the garbage collector's root set, the set of variables used as starting points each time the collector checks to see what memory is reachable.
... do not pass a pointer to a js string or object to any of these functions—rp must point to a variable, the location of the pointer itself, and not an object or string.
... on success, these functions return js_true.
JS_BeginRequest
syntax void js_beginrequest(jscontext *cx); void js_endrequest(jscontext *cx); name type description cx jscontext * the context in which the calling thread intends to call jsapi functions.
... in a js_threadsafe build, many jsapi functions must only be called from within a request.
... in this reference, the cx parameter of such functions is documented with the phrase “requires request”, like this: name type description cx jscontext * the context to use.
...in spidermonkey 1.8 and later, these functions are present, but do nothing, in non-js_threadsafe builds.
JS_DefineProperty
js_defineproperty is the fundamental operation on which several more convenient, higher-level functions are based, including js_definefunction, js_definefunctions, js_defineproperties, js_defineconstdoubles, js_defineobject, and js_initclass.
...these functions can currently replace jsprop_permanent properties, but such usage is deprecated.
... the javascript engine will call the getter or setter callback each time the property is read or written, whether from javascript code or via jsapi functions like js_getproperty and js_setproperty.
...also note that certain jsapi functions, including js_lookupproperty, js_hasproperty, and property_attributes, can detect or examine a property without calling its getter.) if getter (or setter) is null, the new property will use the jsclass.getproperty (or jsclass.setproperty) callback from obj's class.
JS_GetFunctionObject
fun must be either a function implemented by a jsnative (or jsfastnative) or the result of a call to js_compilefunction or similar functions.
... in the javascript language, functions are objects.
...for certain functions, the two have a strictly one-to-one relationship, and for those functions it is safe to call js_getfunctionobject to move from the jsfunction to the jsobject.
... however, for other functions, and particularly for javascript closures, many jsobjects may share the same jsfunction.
Avoiding leaks in JavaScript XPCOM components
in javascript, as in many interpreted languages, functions have access to the variables that are in scope where they are created.
... to understand closures a little better before examining how they can cause leaks, consider the following example, in which there are two pairs of function objects, and each pair has an instance of the private_data variable: // this function returns an array containing two functions.
... function function_array() { // once this function is done running, this variable is still // accessible to the functions created here.
...(var declarations inside javascript functions are function-scope, including the part of the function before the declaration.) this means that the value of iterator, the wrapper for the native tree walker, is reachable from the function.
XPCOM changes in Gecko 2.0
totype-alias javascript global property javascript-global-property javascript global privileged property javascript-global-privileged-property javascript global static nameset javascript-global-static-nameset javascript global dynamic nameset javascript-global-dynamic-nameset javascript dom class javascript-dom-class javascript dom interface javascript-dom-interface xslt extension functions xslt-extension-functions but why?
...if your add-on depends upon xbl bindings attached to content objects—for example, the ability to call functions or get and set properties created by the xbl binding—you will need to use the xpcnativewrapper property wrappedjsobject to access wrapped objects.
... if you need to be able to call functions or access properties defined by web content, you'll need to do this as well.
...xpcom service getters a number of commonly used xpcom services now have service getter functions available in the mozilla::services namespace; these make it much easier to get access to these services from c++ code.
Building the WebLock UI
weblock.js provides javascript functions for both of the xul files.
...a boolean wlocked variable can do this: // initialize the wlocked variable as unlocked var wlocked = 0; then the functions that get called from the interface and call through to the lock and unlock methods of the weblock component must also adjust this variable accordingly: function wlock() { // check to see if locking is on or off weblock.lock(); wlocked = 1; } function wunlock() { // check to see if locking is on or off weblock.unlock(); wlocked = 0; } an important preliminary of these functions is ...
...as you can see, weblock is initialized as a global javascript variable, available in the scope of these functions and others: var weblock = components.classes["@dougt/weblock"] .getservice() .queryinterface(components.interfaces.iweblock); in addition to this basic setup, you must also write javascript that uses the addsite method to add new sites to the white list.
...this section describes the functions that are called from the interface and how they interact with the weblock component.
Starting WebLock
the two functions look like this: static ns_method weblockregistration(nsicomponentmanager *acompmgr, nsifile *apath, const char *registrylocation, const char *componenttype, const nsmodulecomponentinfo *info); static ns_method weblockunregistration(nsicomponentmanager *acompmgr, nsifile *apath, ...
... const char *registrylocation, const nsmodulecomponentinfo *info); the names of the functions can be anything you wish.
... both functions are passed the component manager and the path to the component, including the opaque registrylocation.
...in addition to these parameters, the callback functions are passed the nsmodulecomponentinfo struct, which is the same structure initially passed into ns_impl_nsgetmodule.
Components.utils.Sandbox
debug() for more information on the built-in sandbox functions, please consult the source code.
... importing functions or objects into the sandbox you can import functions or objects into the sandbox simply by assigning them to the sandbox object.
...}; complex objects can be cloned into the sandbox using components.utils.cloneinto: mysandbox.someobject = components.utils.cloneinto({ a: 'string', b: 21 }, mysandbox); obviously you need to consider the security implications of the functions you import.
... this technique isn't limited to functions - it can be used to import objects or values.
mozIRegistry
nsrepository is essentially a mapping from xpcom clsids to class factories, plus code to manage that mapping, including functions that create instances of a given clsid.
... the nsrepository functions are declared in nsrepository.h.
...the primary change to this component is that we will modify it to utilize the new moziregistry interface versus the nsreg.h functions it calls today.
...it is built as a simple c wrapper for the functions in nsreg.h.
nsIAbCard/Thunderbird3
these functions convert values in the same manner as the default implementation of nsivariant.
... these functions are marked <code>[noscript] since xpcconnect performs automatic type conversion on nsivariant such that they are not needed for scripts, only for c++ callers.
... these functions convert values in the same manner as the default implementation of nsivariant.
... the non-variant functions are marked [noscript] since xpconnect uses magic with nsivariant such that the other functions are not needed, although c++ does need them.
Using the Gecko SDK
the sdk contains headers for all of the frozen interfaces and functions, and it also contains headers for classes and functions defined in the glue libraries.
... when those classes or functions are used, the component must link with the corresponding static library.
...all nspr functions are frozen by default and are not marked as such in the respective header files.) the glue library exists to make common tasks easier.
...if your component does not use any of the glue classes or functions, then you do not need to link against the glue library.
Xray vision
in cases like this you can waive xray protection, but then you can no longer rely on any properties or functions being, or doing, what you expect.
... if a script has created a property on an object instance that shadows a property on the prototype, the shadowing property is not visible in the xray second, we want to prevent the chrome code from running content code, so functions and accessor properties of the object are not visible in the xray.
...: true,' + ' get: function() { return "wait, is this really a getter?"; }' + '});'; var sandbox = components.utils.sandbox("https://example.org/"); components.utils.evalinsandbox(sandboxscript, sandbox); // 1) trying to access properties in the prototype that have been redefined // (non-own properties) will show the original 'native' version // note that functions are not included in the output console.log("1) property redefined in the prototype:"); console.log(sandbox.me.tosource()); // -> "({firstname:"joe", address:{street:"main street"}, lastname:"smith"})" // 2) trying to access properties on the object that shadow properties // on the prototype will show the original 'native' version console.log("2) property that shadows the prototype:"); console.lo...
...d by defineproperty"); console.log(sandbox.me.lastname); // -> "smith" // 5) accessor properties are not visible console.log("5) accessor property"); console.log(sandbox.me.middlename); // -> undefined // 6) accessing a value property of a value-property object is fine console.log("6) value property of a value-property object"); console.log(sandbox.me.address.street); // -> "main street" // 7) functions defined on the sandbox-defined object are not visible in the xray console.log("7) call a function defined on the object"); try { console.log(sandbox.me.fullname()); } catch (e) { console.error(e); } // -> typeerror: sandbox.me.fullname is not a function // now with waived xrays console.log("now with waived xrays"); console.log("1) property redefined in the prototype:"); console.log(componen...
Using COM from js-ctypes
com types and functions needs com types (guid) and functions (coinitialize etc) description here.
...e': ctypes.voidptr_t }, { 'setvolume': ctypes.voidptr_t }, { 'getvolume': ctypes.voidptr_t }, { 'waituntildone': ctypes.voidptr_t }, { 'setsyncspeaktimeout': ctypes.voidptr_t }, { 'getsyncspeaktimeout': ctypes.voidptr_t }, { 'speakcompleteevent': ctypes.voidptr_t }, { 'isuisupported': ctypes.voidptr_t }, { 'displayui': ctypes.voidptr_t } // end ispvoice ]); // functions // http://msdn.microsoft.com/en-us/library/windows/desktop/ms695279%28v=vs.85%29.aspx let coinitializeex = lib.declare('coinitializeex', winabi, hresult, // result lpvoid, // pvreserved dword // dwcoinit ); // http://msdn.microsoft.com/en-us/library/windows/desktop/ms688715%28v=vs.85%29.aspx let couninitialize = lib.declare('couninitialize', winabi, void // return...
... ); // http://msdn.microsoft.com/en-us/library/windows/desktop/ms686615%28v=vs.85%29.aspx let cocreateinstance = lib.declare('cocreateinstance', winabi, hresult, // return refclsid, // rclsid lpunknown, // punkouter dword, // dwclscontext refiid, // riid lpvoid // *ppv ); // helper functions function checkhresult(hr /*primative hresult*/, funcname /*jsstr*/) { // primative because thats what is returned by declared functions that // return hresult hr = hr.tostring(); // makes it primative if (hr < 0) { console.error('hresult', hr, 'returned from function ', funcname /*, 'getstrofresult:', getstrofresult(hr)*/); throw new error('hresult ' + hr + ' returned from function ' + fun...
...oiceptr, atext, aflags, 0); checkhresult(primative_hr, "cocreateinstance"); } catch (ex) { console.error('ex occured:', ex); } finally { if (spvoice) { spvoice.release(spvoiceptr); } couninitialize(); } } main(); lib.close(); other examples shgetpropertystoreforwindow - this examples shows that coinit is not needed, some winapi functions return the interface.
Using Objective-C from js-ctypes
otherwise, the following functions can be used, depending on return type and architecture.
... types and functions in addition to the above code, we need to declare function and types.
... let id = ctypes.structtype("objc_object").ptr; let sel = ctypes.structtype("objc_selector").ptr; let bool = ctypes.signed_char; functions all functions in our example are exported by /usr/lib/libobjc.dylib.
... let objc_msgsend = lib.declare("objc_msgsend", ctypes.default_abi, id, id, sel, "..."); let objc_msgsend_bool = lib.declare("objc_msgsend", ctypes.default_abi, bool, id, sel, "..."); other functions can be declared fluently, using id instead of class as the return type of objc_getclass.
Debugger.Memory - Firefox Developer Tools
debugger.memory handler functions similar to debugger’s handler functions, debugger.memory inherits accessor properties that store handler functions for spidermonkey to call when given events occur in debuggee code.
...the handler functions receive the debugger.memory’s owning debugger instance as their this value.
... handler functions run in the same thread in which the event occurred.
...source is parsed into bytecode on demand; functions that are never called are never parsed.
Debugger.Script - Firefox Developer Tools
the code passed to a single call to eval, excluding the bodies of any functions that code defines.
... the debugger interface constructs debugger.script objects as scripts of debuggee code are uncovered by the debugger: via the onnewscript handler method; via debugger.frame’s script properties; via the functionscript method of debugger.object instances; and so on.
... note that spidermonkey may use the same debugger.script instances for equivalent functions or evaluated code—that is, scripts representing the same source code, at the same position in the same source file, evaluated in the same lexical environment.
... function properties of the debugger.script prototype object the functions described below may only be called with a this value referring to a debugger.script instance; they may not be used as methods of other kinds of objects.
Debugger.Object - Firefox Developer Tools
spidermonkey creates exactly one debugger.object instance for each debuggee object it presents to a given debugger instance: if the debugger encounters the same object through two different routes (perhaps two functions are called on the same object), spidermonkey presents the same debugger.object instance to the debugger each time.
... function properties of the debugger.object prototype the functions described below may only be called with a this value referring to a debugger.object instance; they may not be used as methods of other kinds of objects.
... unless otherwise specified, these methods are not invocation functions; if a call would cause debuggee code to run (say, because it gets or sets an accessor property whose handler is debuggee code, or because the referent is a proxy whose traps are debuggee code), the call throws a debugger.debuggeewouldrun exception.
...this makes unsafedereference more useful in producing values appropriate for direct use by debuggee code, without using invocation functions.
Migrating from Firebug - Firefox Developer Tools
command line api the command line api in firebug provides some special functions for your convenience.
... the developer tools command line has some functions in common, but also has some other functions and misses others.
...listeners wrapped in jquery functions).
...in there the functions are listed together with their call parameters.
Allocations - Firefox Developer Tools
the allocations view in the performance tool shows you which functions in your page are allocating the most memory over the course of the profile.
..."total" records samples taken in this function or in functions called by this function.
... at the top level, these are always the same, since the view presents "leaf" functions at the top level (that is, it presents an inverted view of the call stack).
...both these functions have 0 in self count, meaning that no allocations were seen directly in these functions.
Basic animations - Web APIs
controlling an animation shapes are drawn to the canvas by using the canvas methods directly or by calling custom functions.
... that means we need a way to execute our drawing functions over a period of time.
... scheduled updates first there's the window.setinterval(), window.settimeout(), and window.requestanimationframe() functions, which can be used to call a specific function over a set period of time.
...by setting eventlisteners, we catch any user interaction and execute our animation functions.
WindowOrWorkerGlobalScope.setTimeout() - Web APIs
just add this code to the top of your script: /*\ |*| |*| polyfill which enables the passage of arbitrary arguments to the |*| callback functions of javascript timers (html5 standard syntax).
...ype object" settimeout.call(myarray, myarray.mymethod, 2.5*1000, 2); // same error possible solutions a common way to solve the problem is to use a wrapper function that sets this to the required value: settimeout(function(){myarray.mymethod()}, 2.0*1000); // prints "zero,one,two" after 2 seconds settimeout(function(){myarray.mymethod('1')}, 2.5*1000); // prints "one" after 2.5 seconds arrow functions are a possible alternative, too: settimeout(() => {myarray.mymethod()}, 2.0*1000); // prints "zero,one,two" after 2 seconds settimeout(() => {myarray.mymethod('1')}, 2.5*1000); // prints "one" after 2.5 seconds another possible way to solve the "this" problem is to replace the host settimeout() and setinterval() global functions with ones that allow passing a this object and set it in the callb...
...function () { vcallback.apply(othis, aargs); } : vcallback, ndelay); }; note: these two replacements will also enable the html5 standard passage of arbitrary arguments to the callback functions of timers in ie.
...currently-executing code must complete before functions on the queue are executed, thus the resulting execution order may not be as expected.
@document - CSS: Cascading Style Sheets
WebCSS@document
@document url("https://www.example.com/") { h1 { color: green; } } syntax an @document rule can specify one or more matching functions.
... if any of the functions apply to a given url, the rule will take effect on that url.
... the functions available are: url(), which matches an exact url.
... the values provided to the url(), url-prefix(), domain(), and media-document() functions can be optionally enclosed by single or double quotes.
Using CSS gradients - CSS: Cascading Style Sheets
you can also create repeating gradients with the repeating-linear-gradient(), repeating-radial-gradient(), and repeating-conic-gradient() functions.
...the following are valid for all gradient functions: using more than two colors you don't have to limit yourself to two colors—you may use as many as you like!
...ou can position the center of the conic gradient with keyterms, percentage, or absolute lengths, with the keyword "at" <div class="conic-gradient"></div> div { width: 120px; height: 120px; } .conic-gradient { background: conic-gradient(from 45deg, red, orange, yellow, green, blue, purple); } using repeating gradients the linear-gradient(), radial-gradient(), and conic-gradient() functions don't support automatically repeated color stops.
... however, the repeating-linear-gradient(), repeating-radial-gradient(), and repeating-conic-gradient() functions are available to offer this functionality.
shape-outside - CSS: Cascading Style Sheets
the values in the shape functions interpolate as a simple list.
... if both shapes are the same type, that type is ellipse() or circle(), and none of the radii use the closest-side or farthest-side keywords, interpolate between each value in the shape functions.
... if both shapes are of type inset(), interpolate between each value in the shape functions.
... if both shapes are of type polygon(), both polygons have the same number of vertices, and use the same <fill-rule>, interpolate between each value in the shape functions.
Getting Started - Developer guides
alternatively, instead of giving a function name, you can use the javascript technique of defining functions on the fly (called "anonymous functions") to define the actions that will process the response, like this: httprequest.onreadystatechange = function(){ // process the server response here.
...you have two options to access that data: httprequest.responsetext – returns the server response as a string of text httprequest.responsexml – returns the response as an xmldocument object you can traverse with javascript dom functions note that the steps above are valid only if you used an asynchronous request (the third parameter of open() was unspecified or set to true).
...you can also add an always-different get parameter, like a timestamp or random number (see bypassing the cache) note 3: if the httprequest variable is used globally, competing functions calling makerequest() can overwrite each other, causing a race condition.
... declaring the httprequest variable local to a closure containing the ajax functions avoids this.
JavaScript data types and data structures - JavaScript
this is merely a special shorthand for functions, though every function constructor is derived from object constructor.
... accessor property associates a key with one of two accessor functions (get and set) to retrieve or store a value, and has the following attributes: attributes of an accessor property attribute type description default value [[get]] function object or undefined the function is called with an empty argument list and retrieves the property value whenever a get access to the value is performed.
... false "normal" objects, and functions a javascript object is a mapping between keys and values.
... functions are regular objects with the additional capability of being callable.
Iterators and generators - JavaScript
generator functions while custom iterators are a useful tool, their creation requires careful programming due to the need to explicitly maintain their internal state.
... generator functions provide a powerful alternative: they allow you to define an iterative algorithm by writing a single function whose execution is not continuous.
... generator functions are written using the function* syntax.
... when called, generator functions do not initially execute their code.
JavaScript modules - JavaScript
the modules directory's two modules are described below: canvas.js — contains functions related to setting up the canvas: create() — creates a canvas with a specified width and height inside a wrapper <div> with a specified id, which is itself appended inside a specified parent element.
... the easiest way to use it is to place it in front of any items you want exported out of the module, for example: export const name = 'square'; export function draw(ctx, length, x, y, color) { ctx.fillstyle = color; ctx.fillrect(x, y, length, length); return { length: length, x: x, y: y, color: color }; } you can export functions, var, let, const, and — as we'll see later — classes.
...these shapes would probably have associated functions like draw(), reportarea(), etc.
... too; if we tried to import different functions of the same name into the same top-level module file, we'd end up with conflicts and errors.
Inheritance and the prototype chain - JavaScript
it should not be confused with the func.prototype property of functions, which instead specifies the [[prototype]] to be assigned to all instances of objects created by the given function when used as a constructor.
... in javascript, as mentioned above, functions are able to have properties.
... all functions have a special property named prototype.
...// o ---> object.prototype ---> null var b = ['yo', 'whadup', '?']; // arrays inherit from array.prototype // (which has methods indexof, foreach, etc.) // the prototype chain looks like: // b ---> array.prototype ---> object.prototype ---> null function f() { return 2; } // functions inherit from function.prototype // (which has methods call, bind, etc.) // f ---> function.prototype ---> object.prototype ---> null with a constructor a "constructor" in javascript is "just" a function that happens to be called with the new operator.
Function - JavaScript
calling the constructor directly can create functions dynamically but suffers from security and similar (but far less significant) performance issues to eval.
... however, unlike eval, the function constructor creates functions that execute in the global scope only.
... this property is deprecated, and is only functional for some non-strict functions.
... examples difference between function constructor and function declaration functions created with the function constructor do not create closures to their creation contexts; they always are created in the global scope.
Intl - JavaScript
the intl object provides access to several constructors as well as functionality common to the internationalization constructors and other language sensitive functions.
...javascript internationalization functions use the "u" (unicode) extension, which can be used to request additional customization of collator, numberformat, or datetimeformat objects.
... options argument the options argument must be an object with properties that vary between constructors and functions.
... one property is supported by all language sensitive constructors and functions: the localematcher property, whose value must be a string "lookup" or "best fit" and which selects one of the locale matching algorithms described above.
Math - JavaScript
math is a built-in object that has properties and methods for mathematical constants and functions.
... note: many math functions have a precision that’s implementation-dependent.
... examples converting between degrees and radians the trigonometric functions sin(), cos(), tan(), asin(), acos(), atan(), and atan2() expect (and return) angles in radians.
... since humans tend to think in degrees, and some functions (such as css transforms) can accept degrees, it is a good idea to keep functions handy that convert between the two: function degtorad(degrees) { return degrees * (math.pi / 180); }; function radtodeg(rad) { return rad / (math.pi / 180); }; calculating the height of an equalateral triangle if we want to calculate the height of an equalateral triangle, and we know its side length is 100, we can use the formulae length of the adjacent multiplied by the tangent of the angle is equal to the opposite.
Proxy() constructor - JavaScript
handler an object whose properties are functions that define the behavior of the proxy when an operation is performed on it.
...by defining any of a set group of functions on the handler object, you can customise specific aspects of the proxy's behavior.
... handler functions this section lists all the handler functions you can define.
... handler functions are sometimes called traps, because they trap calls to the underlying target object.
new.target - JavaScript
in constructors and functions invoked using the new operator, new.target returns a reference to the constructor or function.
... the new.target pseudo-property is available in all functions.
... in ordinary functions, it refers to the function itself, assuming it was invoked via the new operator; otherwise new.target is undefined.
... in arrow functions, new.target is inherited from the surrounding scope.
function declaration - JavaScript
you can also define functions using the function constructor and a function expression.
...see function for detailed information on functions.
... by default, functions return undefined.
... conditionally created functions functions can be conditionally declared, that is, a function statement can be nested within an if statement, however the results are inconsistent across implementations and therefore this pattern should not be used in production code.
Statements and declarations - JavaScript
functions and classes function declares a function with the specified parameters.
... function* generator functions enable writing iterators more easily.
... 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.
/loader - Archive of obsolete content
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.
... other utilities the loader module exposes several other utility functions that are used internally and can also be handy while bootstrapping the loader itself.
...it is useful when working with object functions introduced in es5 (object.create, object.defineproperties, ..): // define properties of `source` on `target`.
frame/hidden-frame - Archive of obsolete content
usage the module exports a constructor function, hiddenframe, and two other functions, add and remove.
... parameters options : object required options: name type onready function,array functions to call when the frame is ready to load content.
... functions add(hiddenframe) register a hidden frame, preparing it to load content.
console - Archive of obsolete content
the console defines a number of logging levels, from "more verbose" to "less verbose", and a number of different logging functions that correspond to these levels, which are arranged in order of "severity" from informational messages, through warnings, to errors.
... at a given logging level, only calls to the corresponding functions and functions with a higher severity will have any effect.
... the complete set of logging levels is given in the table below, along with the set of functions that will result in output at each level: level will log calls to: all any console method debug debug(), error(), exception(), info(), log(), time(), timeend(), trace(), warn() info error(), exception(), info(), log(), time(), timeend(), trace(), warn() warn error(), exception(), warn() error error(), exception() of...
Adding windows and dialogs - Archive of obsolete content
read the article and its examples carefully, because there are many useful functions to use in the prompt service.
... there are some equivalent, simpler functions that are available in the window object, but those are meant for unprivileged html javascript code.
...the prompt service has a very rich set of functions that allow different kinds of inputs, such as text, passwords, usernames and passwords, and checkboxes that can be used for "never ask this again"-type dialogs.
Source code directories overview - Archive of obsolete content
the [#seamonkey-embedding embedding] code wraps this code with higher level browser functions like forward, back and history.
... embedding contains c interfaces and code for generic high-level browser functions (e.g.
...the "c" runtime library contains basic non-visual c functions to allocate and deallocate memory, get the time and date, read and write files, handle threads and handling and compare strings across all platforms.
Migrate apps from Internet Explorer to Mozilla - Archive of obsolete content
rather than multiple if() else() blocks, you increase efficiency by taking common tasks and abstracting them out into their own functions.
... quirks mode currently, the web is full of invalid html markup, as well as markup that only functions due to bugs in browsers.
...window.event : aevent; } </script> the properties and functions that the event object exposes are also often named differently in mozilla and internet explorer, as table 4 shows.
Treehydra Manual - Archive of obsolete content
"" : "_ipa")}); include('gcc_util.js'); // for function_decl_cfg function process_cgraph(cgraph) { // cgraph is a gcc structure representing a group of functions // within the call graph.
... iterate over the functions like this.
... let fn = node.decl; if (decl_struct_function(fn)) { // fn has a body print(fn); let cfg = function_decl_cfg(fn); } } gimple reference for a detailed description of gimple see gcc/tree.def and gcc/cp/operators.def see also treehydra.js, gcc_compat.js, gcc_util.js, and gcc_print.js in the treehydra libs directory, which have many ports of gcc macros and other functions for conveniently accessing gimple data in javascript.
Index - Archive of obsolete content
ArchiveMozillaXULIndex
1042 modifying a xul interface dom, tutorials, xul, xul_tutorial the dom provides various functions to modify the document.
... 1068 toolbars tutorials, xul, xul_tutorial a toolbar is usually placed along the top of a window and contains a number of buttons that perform common functions.
... 1172 scrollbox needscontent, reference, référence(2), xul elements, xul reference a box that has additional functions that can be used to scroll the content.
Creating a Wizard - Archive of obsolete content
these functions are called regardless of which page is currently displayed.
...they work in a similar way to the other functions except that you can use different code for each page.
...the following is a summary of attribute functions that are called when the user presses next, in the order that they will be checked.
Tree Selection - Archive of obsolete content
the tree provides a number of functions which can be used to determine whether an item is selected.
...because the selected items in a multiple selection tree are not necessarily contiguous, you can retrieve each block of contigous selections using the getrangecount() and getrangeat() functions.
...alert(tree.view.selection.isselected(3)); modifying the tree selection the selection object has a number of functions which may be used to change the selection.
E4X for templating - Archive of obsolete content
while it may be obvious after a study of the basics of e4x that it can be used for this purpose, if one adds a few common purpose functions (especially along with the convenience of javascript 1.8 expression closures), the templates can function more dynamically, offering the power and readability of templating languages such as smarty for php (though admittedly without the currently wider cross-browser support of xslt or the strictly-xml approach of phptal or seethrough templating).
...e useful to still be able to use an expression closure (i.e., without needing return statements and braces): {_if(elems.length(), function () <> <markup/> <markup/> </>)} note that, while it is convenient to store such e4x in separate file templates (to be eval()d at a later time, taking into account security considerations, such as escaping with the above), e4x content using such functions can also be easily serialized inline (and then perhaps converted to the dom) as needed: var list = <>{_if(elems.length(), function () <> <markup/> <markup/> </>)}</>.toxmlstring(); iterating functions such as the following foreach (which can work with arrays, objects, or e4x objects) are quite convenient in iterating over complex structures such as e4x would not normally allow.
...inline functions as explained in the tutorial, it is possible to use anonymous functions inline (returning the desired content, including potentially xmllist's) in order to execute more than a single related statement, keeping this logic together with the resulting xml.
Desktop gamepad controls - Game development
here's the gamepadapi object, which contains useful variables and functions: var gamepadapi = { active: false, controller: {}, connect: function(event) {}, disconnect: function(event) {}, update: function() {}, buttons: { layout: [], cache: [], status: [], pressed: function(button, state) {} } axes: { status: [] } }; the controller variable stores the information about the connected gamepad, an...
...the connect() and disconnect() functions are bound to the following events: window.addeventlistener("gamepadconnected", gamepadapi.connect); window.addeventlistener("gamepaddisconnected", gamepadapi.disconnect); they are fired when the gamepad is connected and disconnected respectively.
... implementation we now know what the gamepadapi object looks like and what variables and functions it contain, so let's learn how all this is actually used in the game.
Mobile touch controls - Game development
the good thing about using phaser is that it offers helper variables and functions for easier and faster development, but it's entirely up to you which approach you to choose.
... pure javascript approach we could implement touch events on our own — setting up event listeners and assigning relevant functions to them would be quite straightforward: var el = document.getelementsbytagname("canvas")[0]; el.addeventlistener("touchstart", handlestart); el.addeventlistener("touchmove", handlemove); el.addeventlistener("touchend", handleend); el.addeventlistener("touchcancel", handlecancel); this way, touching the game's <canvas> on the mobile screen would emit events, and thus we could manipulate the game in any way we want (for example, moving the space ship around).
...you can assign functions on input down and input up separately if you'd like to perform more complicated actions, but in this game touching the right side of the screen will simply fire the bullets to the right — this is all we need in this case.
Efficient animation for web games - Game development
try to keep unnecessary work outside your animation functions.
... measure performance there are some popular animation-related libraries and ui toolkits with animation functions that still do things like using settimeout to drive their animations, drive all their animations completely individually, or other similar things that aren’t conducive to maintaining a high frame-rate.
...it includes a handful of built-in tweening functions, the facility to add your own, and helper functions for animating object properties.
Paddle and keyboard controls - Game development
two functions handling the keydown and keyup events the code that will be run when the buttons are pressed.
... both functions take an event as a parameter, represented by the e variable.
... the paddle moving logic we've now set up the variables for storing the info about the pressed keys, event listeners, and relevant functions.
2D maze game with device orientation - Game development
note: you can read the building monster wants candy article for the in-depth introduction to the basic phaser-specific functions and methods.
...after that some functionality will require further code to control — we will write our own functions to handle more complicated tasks.
...l.game = function(game) {}; ball.game.prototype = { create: function() {}, initlevels: function() {}, showlevel: function(level) {}, updatecounter: function() {}, managepause: function() {}, manageaudio: function() {}, update: function() {}, wallcollision: function() {}, handleorientation: function(e) {}, finishlevel: function() {} }; the create and update functions are framework-specific, while others will be our own creations: initlevels initializes the level data.
Call stack - MDN Web Docs Glossary: Definitions of Web-related terms
a call stack is a mechanism for an interpreter (like the javascript interpreter in a web browser) to keep track of its place in a script that calls multiple functions — what function is currently being run and what functions are called from within that function, etc.
... any functions that are called by that function are added to the call stack further up, and run where their calls are reached.
... example function greeting() { // [1] some codes here sayhi(); // [2] some codes here } function sayhi() { return "hi!"; } // invoke the `greeting` function greeting(); // [3] some codes here the code above would be executed like this: ignore all functions, until it reaches the greeting() function invocation.
Image gallery - Learn web development
previous overview: building blocks now that we've looked at the fundamental building blocks of javascript, we'll test your knowledge of loops, functions, conditionals and events by getting you to build a fairly common item you'll see on a lot of websites — a javascript-powered image gallery.
... objective: to test comprehension of javascript loops, functions, conditionals, and events.
... 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 ...
Server-side web frameworks - Learn web development
handling these all in one function would be hard to maintain, so web frameworks provide simple mechanisms to map url patterns to specific handler functions.
...for example, the flask (python) web framework adds routes to view functions using a decorator.
... whether or not the framework encourages good development practices: for example, a framework that encourages a model-view-controller architecture to separate code into logical functions will result in more maintainable code than one that has no expectations on developers.
Creating our first Vue component - Learn web development
for installation, and to use some of the more advanced features of vue (like single file components or render functions), you'll need a terminal with node + npm installed.
...additionally, prop validation functions are invoked before the component instance is created, so they do not have access to the component state (or other props).
... note: because of the way that this works in arrow functions (binding to the parent’s context), you wouldn’t be able to access any of the necessary attributes from inside data if you used an arrow function.
Getting started with Vue - Learn web development
for installation, and to use some of the more advanced features of vue (like single file components or render functions), you'll need a terminal with node + npm installed.
...while the vue core team maintains suggested libraries for these functions, they are not directly bundled into vue.
...when you need more control than the html syntax allows, you can write jsx or plain javascript functions to define your components.
Mozilla's Section 508 Compliance
here are the section 508 requirements and how far along mozilla seamonkey rv1.8a4 is with each one: requirement windows linux/unix mac os requirement windows linux/unix mac os (a) when software is designed to run on a system that has a keyboard, product functions shall be executable from a keyboard where the function itself or the result of performing a function can be discerned textually.
... caveats: 1) although sidebar cannot be customized without a mouse, all sidebar functions that come with the browser are available through other means 2) java and in-page plugins cannot be used with the keyboard, so they must not be installed for keyboard-only users additional features for the keyboard: 1) find as you type allows for quick navigation to links and convenient text searching 2) browse with caret (f7 key toggles) allows users to select arbitrary content with the keyboard and move through content as if inside a readonly editor.
... requirement windows linux/unix mac os (f) textual information shall be provided through operating system functions for displaying text.
Creating JavaScript callbacks in components
javascript functions as callbacks another common use of the pattern is found in addeventlistener / removeeventlistener.
...so we could convert the example above to accept javascript functions in place of the stringparserobserver by making the following changes: [scriptable, function, uuid(...)] interface stringparserobserver : nsisupports { void onword(string word); }; [scriptable, uuid(...)] interface stringparser { void parse(string data); void addobserver(stringparserobserver observer); }; note the only change was adding function to the interface attributes of the callback...
...using javascript functions as callback handlers for components can be a nice convenience to developers and there is virtually zero work to expose the feature.
IPDL Best Practices
calling ipdl functions willy-nilly let's say you have an object that implements an ipdl interface, but it also outlives it (case in point: reference-counted).
... use a flag and the generated actordestroy function to control when ipdl functions can be called; see phttpchannelparent/child for an example.
... while this can be worked around with actordestroy, being explicit about deleting the protocol with send__delete__ is easier to maintain, with symmetric alloc/deallocpprotocol functions also being easier to reason about.
Task.jsm
tasks are built upon generator functions and promises.
...this reduces the syntax overhead of calling task.spawn() explicitly when you want to recurse into other task functions.
... we can easily loop while // calling asynchronous functions, and wait multiple times.
Memory Profiler
rank-list view and tree view the rank-list view shows top functions that are most memory eager.
... the tree view shows functions as call trees.
... each alloctaion root could be expanded to leaf functions that actually allocates memory.
About NSPR
time timing facilities are available in two forms: interval timing and calendar functions.
... memory management nspr provides api to perform the basic malloc, calloc, realloc and free functions.
... depending on the platform, the functions may be implemented almost entirely in the nspr runtime or simply shims that call immediately into the host operating system's offerings.
I/O Types
this chapter describes the most common nspr types, enumerations, and structures used with the functions described in i/o functions and network addresses.
... 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 interpretation for seek functions directory type prdir file descriptor types nspr represents i/o objects, such as open files and sockets, by file descriptors of type prfiledesc.
... file info types prfileinfo prfileinfo64 prfiletype network address types prnetaddr pripv6addr types used with socket options functions prsocketoptiondata prsockoption prlinger prmcastrequest type used with memory-mapped i/o prfilemap offset interpretation for seek functions prseekwhence ...
Interval Timing
this chapter describes printervaltime and the functions that allow you to use it for timing purposes: interval time type and constants interval functions interval time type and constants all timed functions in nspr require a parameter that depicts the amount of time allowed to elapse before the operation is declared failed.
...such parameters are common in nspr functions such as those used for i/o operations and operations on condition variables.
... printervaltime interval functions interval timing functions are divided into three groups: getting the current interval and ticks per second converting standard clock units to platform-dependent intervals converting platform-dependent intervals to standard clock units getting the current interval and ticks per second pr_intervalnow pr_tickspersecond converting standard clock units to platform-dependent intervals ...
Introduction to NSPR
nspr naming conventions naming of nspr types, functions, and macros follows the following conventions: types exported by nspr begin with pr and are followed by intercap-style declarations, like this: print, prfiledesc function definitions begin with pr_ and are followed by intercap-style declarations, like this: pr_read, pr_jointhread preprocessor macros begin with the letters pr and are followed by all uppercase characters separated with the und...
...(prthread and functions for creating and manipulating threads are described in detail in threads.) nspr threads are lightweight in the sense that they are cheaper than full-blown processes, but they are not free.
...it's usually not necessary to create a global thread explicitly unless you are planning to port your code only to platforms that provide threading services with which you are familiar or unless the thread will be executing code that might directly call blocking os functions.
Long Long (64-bit) Integers
« previousnext » this chapter describes the global functions you use to perform 64-bit integer operations.
... the functions define a portable api that can be used reliably in any environment.
... 64-bit integer types nspr provides two types to represent 64-bit integers: print64 pruint64 64-bit integer functions the api defined for the 64-bit integer functions is consistent across all supported platforms.
Monitors
monitor type monitor functions with a mutex of type prlock, a single thread may enter the monitor only once before it exits, and the mutex can have multiple associated condition variables.
... monitor type with the exception of pr_newmonitor, which creates a new monitor object, all monitor functions require a pointer to an opaque object of type prmonitor.
... monitor functions all monitor functions are thread-safe.
NSPR Error Handling
this chapter describes the functions for retrieving and setting errors and the error codes set by nspr.
... error type error functions error codes for information on naming conventions for nspr types, functions, and macros, see nspr naming conventions.
... error type prerrorcode error functions pr_seterror pr_seterrortext pr_geterror pr_getoserror pr_geterrortextlength pr_geterrortext error codes error codes defined in prerror.h: pr_out_of_memory_error insufficient memory to perform request.
PLHashAllocOps
*pool, prsize size); void (pr_callback *freetable)(void *pool, void *item); plhashentry *(pr_callback *allocentry)(void *pool, const void *key); void (pr_callback *freeentry)(void *pool, plhashentry *he, pruintn flag); } plhashallocops; #define ht_free_value 0 /* just free the entry's value */ #define ht_free_entry 1 /* free value and entire entry */ description users of the hash table functions can provide their own memory allocation functions.
... a pair of functions is used to allocate and tree the table, and another pair of functions is used to allocate and free the table entries.
... the first argument, pool, for all four functions is a void * pointer that is a piece of data for the memory allocator.
PRIOMethods
the i/o methods table provides procedural access to the functions of the file descriptor.
... it is the responsibility of a layer implementor to provide suitable functions at every entry point (that is, for every function in the i/o methods table).
... not all functions in the methods table are implemented for all types of files.
PR_CALLBACK
used to define pointers to functions that will be implemented by the client but called from a (different) shared library.
... syntax #include <prtypes.h>type pr_callbackimplementation description functions that are implemented in an application (or shared library) that are intended to be called from another shared library (such as nspr) must be declared with the pr_callback attribute.
... normally such functions are passed by reference (pointer to function).
String Operations
this chapter describes some of the key nspr functions for manipulating strings.
... libraries built on top of nspr, such as the netscape security libraries, use these functions to manipulate strings.
... if you are copying or examining strings for use by such libraries or freeing strings that were allocated by such libraries, you must use these nspr functions rather than the libc equivalents.
NSS_3.12.2_release_notes.html
new in nss 3.12.2 new functions in the nss shared library: sec_pkcs12addcertorchainandkey (see p12.h) new pkcs11 errors (see secerr.h) sec_error_pkcs11_general_error sec_error_pkcs11_function_failed sec_error_pkcs11_device_error bugs fixed the following bugs have been fixed in nss 3.12.2.
... bug 455424: nssilckt.h defines the enumeration constant 'lock' bug 456036: stubs for deprecated functions in lib/certdb/stanpcertdb.c should set the pr_not_implemented_error error.
... furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.14.1 release notes
new functions in ocspt.h cert_createocspsingleresponsegood cert_createocspsingleresponseunknown cert_createocspsingleresponserevoked cert_createencodedocspsuccessresponse cert_createencodedocsperrorresponse new types in ocspt.h ​certocspresponderidtype notable changes in nss 3.14.1 windows ce support has been removed from the code base.
... bug 611451 - when built with the current version of apple xcode on mac os x, the nss shared libraries will now only export the public nss functions.
...furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.14 release notes
these functions are intended to replace the now-deprecated use of the ssl_enable_ssl3 and ssl_enable_tls socket options.
... the following functions have been added to the libssl library included in nss 3.14 ssl_versionrangeget (in ssl.h) ssl_versionrangegetdefault (in ssl.h) ssl_versionrangegetsupported (in ssl.h) ssl_versionrangeset (in ssl.h) ssl_versionrangesetdefault (in ssl.h) to better ensure interoperability with peers that support tls 1.1, nss has altered how it handles certain ssl protocol layer events.
... 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.16.2 release notes
use the new pk11_privdecrypt and pk11_pubencrypt functions with the ckm_rsa_pkcs_oaep mechanism.
... new functions in cert.h ​cert_addextensionbyoid - adds an extension to a certificate.
... on linux, nss is built with the -ffunction-sections -fdata-sections compiler flags and the --gc-sections linker flag to allow unused functions to be discarded.
NSS 3.25 release notes
several functions have been added to the public api of the nss cryptoki framework.
... new functions in nssckfw.h nssckfwslot_getslotid nssckfwsession_getfwslot nssckfwinstance_destroysessionhandle nssckfwinstance_findsessionhandle notable changes in nss 3.25 an ssl socket can no longer be configured to allow both tls 1.3 and ssl v3.
...furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.30 release notes
support for callback functions that can be used to monitor ssl/tls alerts that are sent or received.
... new functions in cert.h cert_compareava - performs a comparison of two certava structures, and returns a seccomparison result.
...furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.42 release notes
new in nss 3.42 new functionality bug 818686 - support xdg basedir specification new functions none notable changes in nss 3.42 the following ca certificates were added: none the following ca certificates were removed: none added support for some of the testcases from the wycheproof project: bug 1508666 - added aes-gcm test cases bug 1508673 - added chacha20-poly1305 test cases bug 1514999 - added the ...
... bugs fixed in nss 3.42 bug 1490006 - reject invalid ch.legacy_version in tls 1.3 bug 1507135 and bug 1507174 - add additional null checks to several cms functions to fix a rare cms crash.
...furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.45 release notes
new in nss 3.45 new functionality new functions in pk11pub.h: pk11_findrawcertswithsubject - finds all certificates on the given slot with the given subject distinguished name and returns them as der bytes.
...tation with one from fiat-crypto bug 1551129 - support static linking on windows bug 1552262 - expose a function pk11_findrawcertswithsubject for finding certificates with a given subject on a given slot bug 1546229 - add ipsec ike support to softoken bug 1554616 - add support for the elbrus lcc compiler (<=1.23) bug 1543874 - expose an external clock for ssl this adds new experimental functions: ssl_settimefunc, ssl_createantireplaycontext, ssl_setantireplaycontext, and ssl_releaseantireplaycontext.
...furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.52 release notes
bug 1630721 - add softoken functions for fips.
... bug 1629105 - add pkcs11 v3.0 functions to module debug logger.
...furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
Utilities for nss samples
these utility functions are adapted from those found in the sectool library used by the nss security tools and other nss test applications.
...*/ #ifndef _util_h #define _util_h #include <prlog.h> #include <termios.h> #include <base64.h> #include <unistd.h> #include <sys/stat.h> #include "util.h" #include <prprf.h> #include <prerror.h> #include <nss.h> #include <pk11func.h> /* * these utility functions are adapted from those found in * the sectool library used by the nss security tools and * other nss test applications.
...*/ #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.
nss tech note4
some info is readily available cert->subjectname (char*) cert->issuername (char*) cert->emailaddr (char*) or char *cert_getcertificateemailaddress(certcertificate *cert); cert->keyusage (unsigned int) to break the issuer and subject names into components pass &(cert->issuer) or &(cert->subject) to the following functions char *cert_getcommonname(certname *name); char *cert_getcertemailaddress(certname *name); char *cert_getcountryname(certname *name); char *cert_getlocalityname(certname *name); char *cert_getstatename(certname *name); char *cert_getorgname(certname *name); char *cert_getorgunitname(certname *name); char *cert_getdomaincomponentname(certname *name)...
...secsuccess) { sec_asn1decodercontext * context = sec_asn1decoderstart(null, &data, mycertexttemplate); rv = sec_asn1decoderupdate( context, (const char *)(myextvalue.data), myextvalue.len); if (rv == secsuccess) { /* now you can extract info from secitem fields of your extension data structure */ /* see "misc helper functions" below */ .......
... secitem_freeitem(&data.maxusers, pr_false); } } some miscellaneous helper functions compare two secitems (e.g., two oids) prbool secitem_itemsareequal(const secitem *a, const secitem *b); interpreting a secitem value as an integer if secitem *item->len <=4, then int value = der_getinteger(item); interpreting a secitem value as a string use string copy functions to copy item->len bytes from item->data and null terminate explicitly some higher level extension functions ...
Tutorial: Embedding Rhino
in this document: runscript: a simple embedding entering a context initializing standard objects collecting the arguments evaluating a script printing the result exiting the context expose java apis using java apis implementing interfaces adding java objects using javascript objects from java using javascript variables calling javascript functions javascript host objects defining host objects counter example counter's constructors class name dynamic properties defining javascript "methods" adding counter to runscript runscript: a simple embedding about the simplest embedding of rhino possible is the runscript example.
...tra lines of code: object wrappedout = context.javatojs(system.out, scope); scriptableobject.putproperty(scope, "out", wrappedout); these lines add a global variable out that is a javascript reflection of the system.out variable: $ java runscript2 "out.println(42)" 42.0 undefined using javascript objects from java after evaluating a script it's possible to query the scope for variables and functions, extracting values and calling javascript functions.
...f("my args") = my arg using javascript variables to print out the value of x, we add the following code: object x = scope.get("x", scope); if (x == scriptable.not_found) { system.out.println("x is not defined."); } else { system.out.println("x = " + context.tostring(x)); } calling javascript functions to get the function f, call it, and print the result, we add this code: object fobj = scope.get("f", scope); if (!(fobj instanceof function)) { system.out.println("f is undefined or not a function."); } else { object functionargs[] = { "my arg" }; function f = (function)fobj; object result = f.call(cx, scope, scope, functionargs); string report = "f('my args') = " + context.
Scripting Java
javascript functions as java interfaces often we need to implement an interface with only one method, like in the previous runnable example or when providing various event listener implementations.
... here is the simplified runnable example: js> t = java.lang.thread(function () { print("\nrunning"); }); thread[thread-0,5,main] js> t.start() js> running rhino also allows use of javascript functions as implementations of java interfaces with more than one method if all the methods have the same signature.
...the class provides additional importpackage() and importclass() global functions for scripts but their extensive usage has tendency to pollute the global name space with names of java classes and prevents loaded classes from garbage collection.
GC Rooting Guide
gc things on the stack js::rooted<t> all gc thing pointers stored on the stack (i.e., local variables and parameters to functions) must use the js::rooted<t> class.
... like the other template classes, it functions as if it were the gc thing pointer itself.
... return raw pointers from functions.
How to embed the JavaScript engine
run the helloworld executable at the command line: ./helloworld how to call c functions from javascript say the c function is named doit and it would like at least two actual parameters when called (if the caller supplies fewer, the js engine should ensure that undefined is passed for the missing ones): #define doit_minargs 2 // [spidermonkey 24] use jsbool instead of bool.
... * args.rval().setint32(args[0].toint32() + args[1].toint32()); */ return true; } then to wire it up to js, you could write: ok = js_definefunction(cx, global, "doit", doit, doit_minargs, 0); or, if you had a bunch of native functions to define, you would probably put them in a table: static jsfunctionspec my_functions[] = { js_fn("doit", doit, doit_minargs, 0), /* etc...
...and say: ok = js_definefunctions(cx, global, my_functions); how to call javascript functions from c first, create arguments for the call, here i create arguments with 2 items: // [spidermonkey 24] js::autovaluearray is not defined.
JIT Optimization Outcomes
property accessors, function.prototype, and arrow (=>) functions cannot be called as constructors.
...the native callee function was called with an unsupported number of arguments, or calling non-constructing functions with new.
...for example, calling math functions on objects.
JSAPI Cookbook
*/ if (!js_definefunction(cx, global, "justforfun", &justforfun, 0, 0)) return false; to define many jsapi functions at once, use js_definefunctions.
... /* jsapi */ if (!js_defineproperty(cx, obj, "prop", int_to_jsval(123), js_propertystub, js_strictpropertystub, jsprop_readonly | jsprop_enumerate | jsprop_permanent)) { return false; } defining a property with a getter and setter object.defineproperty() can be used to define properties in terms of two accessor functions.
... // javascript object.defineproperty(obj, "prop", {get: getpropfunc, set: setpropfunc, enumerable: true}); in the jsapi version, getpropfunc and setpropfunc are c/c++ functions of type jsnative.
JS::Add*Root
these functions are obsoleted, use js::persistentrooted instead.
... description the js::add*root and functions add a c/c++ variable to the garbage collector's root set, the set of variables used as starting points each time the collector checks to see what memory is reachable.
... on success, these functions return true.
JS::PersistentRooted
rooted<jsobject*> persistentrootedobject; typedef persistentrooted<jsscript*> persistentrootedscript; typedef persistentrooted<jsstring*> persistentrootedstring; typedef persistentrooted<js::symbol*> persistentrootedsymbol; // added in spidermonkey 38 typedef persistentrooted<value> persistentrootedvalue; } example following example allocates persistentrootedvalue, and provides two functions for setting and getting it from javascript.
... js::rootedvalue val(cx, persistentval.ref()); // or // js::rootedvalue val(cx, *persistentval); // [spidermonkey 38] // js::rootedvalue val(cx, persistentval); args.rval().set(val); return true; } static const jsfunctionspec functions[] = { js_fn("getpersistent", getpersistent, 1, 0), js_fn("setpersistent", setpersistent, 0, 0), js_fs_end }; int main(int argc, const char* argv[]) { // initialize runtime // ...
... if (!js_definefunctions(cx, glob, functions)) return 1; // use those function in javascript.
JS::PropertySpecNameIsSymbol
this article covers features introduced in spidermonkey 38 determine if the given jspropertyspec::name or jsfunctionspec::name value is actually a symbol code and not a string.
... description js::propertyspecnameissymbol determines if the given jspropertyspec::name or jsfunctionspec::name value is actually a symbol code and not a string, and returns true if so.
... see also mxr id search for js::propertyspecnameissymbol js::propertyspecnameequalsid js::propertyspecnametopermanentid jspropertyspec jsfunctionspec bug 1082672 ...
JS::PropertySpecNameToPermanentId
name const char * jspropertyspec::name or jsfunctionspec::name.
... description js::propertyspecnametopermanentid creates a jsid that does not need to be marked for gc from jspropertyspec::name or jsfunctionspec::name.
... see also mxr id search for js::propertyspecnametopermanentid js::propertyspecnameissymbol js::propertyspecnameequalsid jspropertyspec jsfunctionspec bug 1082672 ...
JSFunction
for native functions and jsapi-compiled functions - that is, functions returned by the apis listed above-there is a simple one-to-one relationship between the jsfunction and the corresponding javascript function object.
...for other function objects - that is, functions created by running javascript code containing function declarations or function-expressions-the relationship between the jsfunction * and the jsobject * is not well-defined.
...as a result, some apis (such as js_callfunction) that operate on jsfunctions do not work properly with closures.
JSNative
in particular, apis such as js_initclass and js_definefunctions create custom methods on javascript objects that are implemented as jsnative callbacks provided by the application, written in c/c++ code.
... argc unsigned the number of arguments supplied to the function by the caller (as opposed to, say, the number of arguments the function is specified to take in its jsfunctionspec).
... description jsnative is the type of native implementations of javascript functions.
JS_AlreadyHasOwnProperty
description these functions attempt to determine whether a property already exists on a specific jsobject without modifying the object.
... by design, this search may not find a property that other property lookup functions, such as js_lookupproperty, would find.
... for native objects—objects whose properties are stored in the default data structure provided by spidermonkey—these functions simply check that data structure to see if the specified field is present.
JS_FS
macros for describing functions, for use with js_defineproperties and js_initclass.
... description use these macros to define an array of jsfunctionspecs to pass to js_definefunctions or js_initclass.
...see also mxr id search for js_fs mxr id search for js_fn mxr id search for js_sym_fn mxr id search for js_fninfo mxr id search for js_self_hosted_fn mxr id search for js_self_hosted_sym_fn mxr id search for js_sym_fnspec mxr id search for js_fnspec mxr id search for js_fs_end jsfunctionspec js_defineproperties js_initclass bug 775788 - added js_fninfo.
JS_InternString
if an interned string already exists with the desired value, these functions return the existing string.
...strings created with these functions are protected from garbage collection for the lifetime of the jsruntime.
... on success, these functions return a pointer to the interned string.
JS_PropertyStub
bool *succeeded); // obsolete since jsapi 37 bool js_enumeratestub(jscontext *cx, js::handleobject obj); // obsolete since jsapi 37 bool js_convertstub(jscontext *cx, js::handleobject obj, jstype type, js::mutablehandlevalue vp); // obsolete since jsapi 37 void js_finalizestub(jscontext *cx, jsobject *obj); // obsolete since jsapi 14 description the stub functions are not designed to be called directly by a jsapi application.
...examples at jsclass illustrate how stub functions can be used.
...it attempts to call the object's valueof and tostring functions, in the order determined by the specified type, in accordance with the default defaultvalue algorithm in es5 §8.12.8.
JS_malloc
if any of these three functions fails to allocate the required amount of memory, it reports an error as though by calling js_reportoutofmemory(cx) and returns null.
...implementation note: currently these four functions are implemented using the corresponding standard c functions.
...future releases may implement these functions differently.
JSDBGAPI
breakpoints js_settrap js_gettrapopcode js_cleartrap js_clearscripttraps js_clearalltraps js_handletrap js_setinterrupt js_clearinterrupt watchpoints js_setwatchpoint js_clearwatchpoint js_clearwatchpointsforobject js_clearallwatchpoints inspecting the stack js_pctolinenumber js_linenumbertopc js_getfunctionscript js_getfunctionnative js_getfunctionfastnative js_getscriptprincipals typedef jsstackframe js_frameiterator js_getframescript js_getframepc js_getscriptedcaller js_stackframeprincipals js_evalframeprincipals js_getframeannotation js_setframeannotation js_getframeprincipalarray js_isnativeframe js_getframeobject js_getframescopechain js_getframecallobject js_getframethis...
... js_setdebuggerhandler js_setsourcehandler js_setexecutehook js_setcallhook js_setobjecthook js_setthrowhook js_setdebugerrorhook js_setnewscripthook js_setdestroyscripthook js_getglobaldebughooks js_setcontextdebughooks memory usage js_getobjecttotalsize js_getfunctiontotalsize js_getscripttotalsize system objects js_issystemobject js_newsystemobject profiling these functions can be used to profile a spidermonkey application using the mac profiler, shark.
... js_connectshark js_disconnectshark js_startchudremote js_stopchudremote the following jsnative functions can be used to expose the above four apis to scripts.
Profiling SpiderMonkey
make -c my-obj-dir/js/src other ways to profile for linux, there are global jprof functions available.
...when we have js scriptable profiling options available for all tier 1 platforms, we'll look at adding global start/stop profiling functions.
... if you'd like to profile something at a higher level of detail than the js shark functions allow, there are corresponding c functions available at the bottom of jsdbgapi.h.
SpiderMonkey 31
many jsapi types, functions, and callback signatures have changed, though most functions that have changed still have the same names and implement essentially unchanged functionality.
... js_seticumemoryfunctions is a new function which can be used to set the allocation and deallocation functions used by the icu internationalization library.
...embedders still need to build with nspr, as the new wrappers require using spidermonkey internal functions which are not exposed to the public api.
SpiderMonkey 38
many jsapi types, functions, and callback signatures have changed, though most functions that have changed still have the same names and implement essentially unchanged functionality.
...g 645416) jsprop_define_late (bug 825199) jsprop_ignore_enumerate (bug 1037770) jsprop_ignore_permanent (bug 1037770) jsprop_ignore_readonly (bug 1037770) jsprop_ignore_value (bug 1037770) jsprop_propop_accessors (bug 1088002) jsprop_redefine_nonconfigurable (bug 1101123) js_addfinalizecallback (bug 996785) js_defineconstintegers (bug 1066020) js_getflatstringcharat (bug 1034627) js_getfunctionscript (bug 1069694) js_getlatin1flatstringchars (bug 1037869) js_getlatin1internedstringchars (bug 1037869) js_getlatin1stringcharsandlength (bug 1032726) js_getstringcharat (bug 1034627) js_gettwobyteexternalstringchars (bug 1034627) js_gettwobyteflatstringchars (bug 1037869) js_gettwobyteinternedstringchars (bug 1037869) js_gettwobytestringcharsandlength (bug 1032726) js_newplainobject ...
...jsapi functions that used jschar now use char16_t directly.
TPS Tests
each type of asset list has a number of built-in functions you can call, described in the section on asset lists; there are also some additional built-in functions.
... built-in functions sync(options) initiates a sync operation.
... custom functions you can also write your own functions to be called as actions.
Mozilla Projects
it provides a number of functions and capabilities, including: mccoy mccoy uses xulrunner which is bound to break, for details see this post.
... nspr netscape portable runtime (nspr) provides a platform-neutral api for system level and libc-like functions.
...these operations include setting up an ssl connection, object signing and signature verification, certificate management (including issuance and revocation), and other common pki functions.
Secure Development Guidelines
a/b : 0; } writing secure code: memory management string handling c-style strings are byte arrays that end with a \0 byte some string handling functions won’t perform any kind of length checking, so don’t use them ensure your string is always \0 terminated!
...y confusing banned api list examples of incorrect strncat usage buffer overflow strncat(buffer, string, sizeof(buffer)); off-by-one strncat(buffer, string, sizeof(buffer) – strlen(string)); correct usage strncat(buffer, string, sizeof(buffer) – strlen(string) – 1)); banned api list: recommendations create wrappers or replacements for standard functions with a bad design libc function name reason to ban it strcpy, strcat, gets, sprintf, vsprintf no bounds checking.
... using the mozilla api use c++ strings so c strings are possible mozilla c safe string handling apis similar to libc str*cpy and str*cat some are potentially dangerous function name comments pl_strcpy, pl_strcat these functions don't verify whether the destination buffer is large enough.
Using the Places history service
nsiglobalhistory3: adds extra functions for dealing with redirects and hints for rendering (gecko flags).
... nsibrowserhistory: adds functions used by the basic browser like marking pages as typed in the url bar, and removing pages as from the history interface.
... nsinavhistoryservice: complex query functions, more fine-grained getters and setters.
Getting Started Guide
to facilitate this, all interfaces inherit from an abstract base class that provides the member functions addref, and release.
...you still have to know which functions return interface pointers that have already been addrefed and which don't.
... nscomptrs in function signatures in general, you won't want to use nscomptr in the signature of xpcom (i.e., `scriptable') functions.
XPCOM
for more information on the workings of xpcom look elsewhere.how to pass an xpcom object to a new windowif you want to be able to call functions within an xpcom object from a xul window's code, you can do so if you pass the xpcom object as one of the arguments to the window creation method.interfacing with the xpcom cycle collectorthis is a quick overview of the cycle collector introduced into xpcom for firefox 3, including a description of the steps involved in modifying an existing c++ class to participate in xpcom cycle collection.
...if you create an object with a longer lifespan, you will own it until you give ownership away.xpcom referencethis reference describes the interfaces and functions provided by the xpcom library.
... in addition, it details the various helper classes and functions, as well as the components, provided by the xpcom glue library.
Creating a Custom Column
nsimsgcustomcolumnhandler extends (inherits from) nsitreeview and as such needs to implement functions from both.
... the following is a list of functions that must be implemented to ensure that your extension works well with thunderbird.
... rest assured that these functions will be called - so implement them, even with empty function.
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.convertc...
...hromeurl(chromeuri_mylib); var jarpath_mylib = localfile_mylib.spec; // "jar:file:///c:/users/vayeate/appdata/roaming/mozilla/firefox/profiles/aecgxse.unnamed%20profile%201/extensions/youraddon@jetpack.xpi!/mysubfolder/mycfunctionsforunix.so" var filepath_mylib = localfilemylib.path; // "file:///c:/users/vayeate/appdata/roaming/mozilla/firefox/profiles/aecgxse.unnamed%20profile%201/extensions/youraddon@jetpack.xpi!/mysubfolder/mycfunctionsforunix.so" if your add-on is a bootstrap add-on, then you don't need to use this method to convert a chrome:// path; instead, on startup procedure of the bootstrap add-on obtain the file and/or jar path from installpath from the adata parameter.
...ing/mozilla/firefox/profiles/aksozfjt.unnamed%20profile%2010/extensions/asynczip@jetpack!/" var filepath_folder = adata.installpath.path; // if unpacked is set to false in install.rdf this will look like: "c:\users\vayeate\appdata\roaming\mozilla\firefox\profiles\aksozfjt.unnamed profile 10\extensions\asynczip@jetpack" var filepath_mylib = os.path.join(filepath_folder, 'mysubfolder', 'mycfunctionsforunix.so'); var jarpath_mylib = jarpath_folder + 'mysubfolder/mycfunctionsforunix.so'; } this can then be opened and the c functions within can be used from js-ctypes.
ABI
ctypes.stdcall_abi used for calling functions declared with stdcall on windows.
... these functions' names are automatically mangled for you by js-ctypes.
... ctypes.winapi_abi used for calling windows system functions.
ctypes
stdcall_abi used for calling functions declared with stdcall on windows.
... these functions' names are automatically mangled for you by js-ctypes.
... winapi_abi used for calling windows system functions.
Mozilla
it currently allows you to run javascript code in the same scope as the main firefox browser window and report results using the same functions as the mochitest test framework.
... mozilla framework based on templates (mfbt) the mozilla framework based on templates ("mfbt") is the central repository for macros, functions, and data structures used throughout mozilla code, including in the javascript engine.
...the server functions like microsoft's symbol server so the documentation there can be useful.
Search - Firefox Developer Tools
the outline tab lists the functions in the current file.
...for example, if i enter "load" when viewing the above list, i get the following: only the functions with load in their name are shown.
... this feature may not seem terribly useful when searching a file with a handful of functions in it but when you are searching through a file with dozens of functions, it comes in handy.
Aggregate view - Firefox Developer Tools
you'll then see a list of all the functions that allocated objects, ordered by the size of the allocations they made: the structure of this view is very much like the structure of the call tree, only it shows allocations rather than processor samples.
... so, for example, the first entry says that: 4,832,592 bytes, comprising 93% of the total heap usage, were allocated in a function at line 35 of "alloc.js", or in functions called by that function we can use the disclosure triangle to drill down the call tree, to find the exact place your code made those allocations.
... let's get an allocation trace: open the memory tool check "record call stacks" load https://mdn.github.io/performance-scenarios/dom-allocs/alloc.html take a snapshot select "view/aggregate" select "group by/call stack" you should see something like this: this is telling us that 93% of the total heap snapshot was allocated in functions called from "alloc.js", line 35 (our initial createtoolbars() call).
Work with animations - Firefox Developer Tools
this article covers three tools you can use to visualize and edit animations: the animation inspector editing @keyframes editing timing functions animation inspector the page inspector's animations view displays animations in the page synchronized along a timeline, with a draggable widget you can use to move to any point in the timeline and see the page at that point.
...in this case, the message is "animations of 'transform' cannot be run on the compositor when geometric properties are animated on the same element at the same time." edit @keyframes any @keyframes rules associated with the currently selected element are displayed in the rules view and are editable: edit timing functions when you create a css animation you can specify a timing function: this determines the rate at which the animation progresses.
... timing functions defined as cubic bézier curves get an icon in the rules view.
How whitespace is handled by HTML, CSS, and in the DOM - Web APIs
whitespace helper functions the javascript code below defines several functions that make it easier to deal with whitespace in the dom: /** * throughout, whitespace is defined as one of the characters * "\t" tab \u0009 * "\n" lf \u000a * "\r" cr \u000d * " " spc \u0020 * * this does not use javascript's "\s" because that includes non-breaking * spaces (and also some other characters).
... */ function is_all_ws( nod ) { // use ecma-262 edition 3 string and regexp features return !(/[^\t\n\r ]/.test(nod.textcontent)); } /** * determine if a node should be ignored by the iterator functions.
... */ function data_of( txt ) { var data = txt.textcontent; // use ecma-262 edition 3 string and regexp features data = data.replace(/[\t\n\r ]+/g, " "); if (data.charat(0) == " ") data = data.substring(1, data.length); if (data.charat(data.length - 1) == " ") data = data.substring(0, data.length - 1); return data; } example the following code demonstrates the use of the functions above.
File and Directory Entries API - Web APIs
the asynchronous api will not block and functions and the api will not return values; instead, you will need to supply a callback function to handle the response whenever it arrives.
... there are also two global functions (which are not part of the specification at this time and are implemented only by google chrome).
... there are also two global functions (which are not part of the specification at this time and are implemented only by google chrome).
Keyboard API - Web APIs
interfaces keyboard provides functions that retrieve keyboard layout maps and toggle capturing of key presses from the physical keyboard.
... keyboardlayoutmap a map-like object with functions for retrieving the string associated with specific physical keys.
... navigator.keyboard read only returns a keyboard object which provides access to functions that retrieve keyboard layout maps and toggle capturing of key presses from the physical keyboard.
OES_standard_derivatives - Web APIs
the oes_standard_derivatives extension is part of the webgl api and adds the glsl derivative functions dfdx, dfdy, and fwidth.
... ext.fragment_shader_derivative_hint_oes a glenum indicating the accuracy of the derivative calculation for the glsl built-in functions: dfdx, dfdy, and fwidth.
... glsl built-in functions the following new functions can be used in glsl shader code, if this extension is enabled: gentype dfdx(gentype) gentype dfdy(gentype) gentype fwidth(gentype) examples enabling the extensions: gl.getextension('oes_standard_derivatives'); gl.getextension('ext_shader_texture_lod'); shader code that avoids artifacts when wrapping texture coordinates: <script type="x-shader/x-fragment"> #extension gl_ext_shader_texture_lod : enable #extension gl_oes_standard_derivatives : enable uniform sampler2d mytexture; varying vec2 texcoord; void main(){ gl_fragcolor = texture2dgradext(mytexture, mod(texcoord, vec2(0.1, 0.5)), dfdx(texcoord), dfdy(texcoord)); } </script> specifications specification status comment oe...
Multi-touch interaction - Web APIs
n:none"> <div id="target1"> tap, hold or swipe me 1</div> <div id="target2"> tap, hold or swipe me 2</div> <div id="target3"> tap, hold or swipe me 3</div> <!-- ui for logging/debugging --> <button id="log" onclick="enablelog(event);">start/stop event logging</button> <button id="clearlog" onclick="clearlog(event);">clear the log</button> <p></p> <output></output> </body> miscellaneous functions these functions support the application but aren't directly involved with the event flow.
... cache management these functions manage the global event caches evcache1, evcache2 and evcache3.
...s no touch points ev.target.style.background = "white"; break; case 1: // single touch point ev.target.style.background = "yellow"; break; case 2: // two simultaneous touch points ev.target.style.background = "pink"; break; default: // three or more simultaneous touches ev.target.style.background = "lightblue"; } } event logging these functions are used send to event activity to the application window (to support debugging and learning about the event flow).
Pinch zoom gestures - Web APIs
out.<br/> the background color will change to pink if the pinch is opening (zoom in) or changes to lightblue if the pinch is closing (zoom out).</div> <!-- ui for logging/debugging --> <button id="log" onclick="enablelog(event);">start/stop event logging</button> <button id="clearlog" onclick="clearlog(event);">clear the log</button> <p></p> <output></output> </body> miscellaneous functions these functions support the application but aren't directly involved in the event flow.
... function remove_event(ev) { // remove this event from the target's cache for (var i = 0; i < evcache.length; i++) { if (evcache[i].pointerid == ev.pointerid) { evcache.splice(i, 1); break; } } } event logging these functions are used to send event activity to the application's window (to support debugging and learning about the event flow).
... // log events flag var logevents = false; // logging/debugging functions function enablelog(ev) { logevents = logevents ?
Using Service Workers - Web APIs
f the code is a little different: let body = document.queryselector('body'); let myimage = new image(); imgload('mylittlevader.jpg').then((response) => { var imageurl = window.url.createobjecturl(response); myimage.src = imageurl; body.appendchild(myimage); }, (error) => { console.log(error); }); on to the end of the function call, we chain the promise then() method, which contains two functions — the first one is executed when the promise successfully resolves, and the second is called when the promise is rejected.
... enter service workers note : we're using the es6 arrow functions syntax in the service worker implementation now let’s get on to service workers!
... note: your service worker functions like a proxy server, allowing you to modify requests and responses, replace them with items from its own cache, and more.
Inputs and input sources - Web APIs
profile strings each input source can have zero or more input profile name strings, found in the array profiles, each of which describes a preferred visual representation of the input source within the 3d world as well as how the input source functions.
...the code presumes the existence of an avatar object representing the character, as used in several other eamples on this page, as well as the pickupobject() and dropobject() functions, which handle transferring an object from the world to a particular hand and releasing an object from the hand and placing it back into the world.
... this code presumes the existence of additional functions findtargetposition(), which follows the target ray until it collides with something, then returns the coordinates at which the collision occurred, and putobject(), which places the object held in the specified hand at the given position, removing it from the hand.
Advanced techniques: Creating and sequencing audio - Web APIs
let's create another async function to set up the sample — we can combine the two async functions in a nice promise pattern to perform further actions when this file is loaded and buffered: async function setupsample() { const filepath = 'dtmf.mp3'; const sample = await getfile(audioctx, filepath); return sample; } note: you can easily modify the above function to take an array of files and loop over them to load more than one sample.
... function nextnote() { const secondsperbeat = 60.0 / tempo; nextnotetime += secondsperbeat; // add beat length to last beat time // advance the beat number, wrap to zero currentnote++; if (currentnote === 4) { currentnote = 0; } } we want to create a reference queue for the notes that are to be played, and the functionality to play them using the functions we've previously created: const notesinqueue = []; function schedulenote(beatnumber, time) { // push the note on the queue, even if we're not playing.
... if (pads[2].queryselectorall('button')[currentnote].getattribute('aria-checked') === 'true') { playnoise() } if (pads[3].queryselectorall('button')[currentnote].getattribute('aria-checked') === 'true') { playsourcenode(audioctx, sample); } } here we look at the current time and compare it to the time for the next note; when the two match it will call the previous two functions.
Using CSS transitions - CSS: Cascading Style Sheets
timing functions determine how intermediate values of the transition are calculated.
... most timing functions can be specified by providing the graph of the corresponding function, as defined by four points defining a cubic bezier.
... you can also choose easing from easing functions cheat sheet.
color - CSS: Cascading Style Sheets
WebCSScolor
working draft adds commaless syntaxes for the rgb(), rgba(), hsl(), and hsla() functions.
... adds hwb(), device-cmyk(), and color() functions.
...adds the rgba(), hsl(), and hsla() functions.
max() - CSS: Cascading Style Sheets
WebCSSmax
the expressions can be math expressions (using arithmetic operators), literal values, or other expressions, such as attr(), that evaluate to a valid argument type (like <length>), or nested min() and max() functions.
... it is permitted to nest min() and other max() functions as expression values.
... formal syntax max( <calc-sum># )where <calc-sum> = <calc-product> [ [ '+' | '-' ] <calc-product> ]*where <calc-product> = <calc-value> [ '*' <calc-value> | '/' <number> ]*where <calc-value> = <number> | <dimension> | <percentage> | ( <calc-sum> ) examples setting a minimum size for a font another use case for css functions is allow a font size to grow while ensuring it is at least a mimum size, enabling responsive font sizes while ensuring legibility.
transform - CSS: Cascading Style Sheets
WebCSStransform
values <transform-function> one or more of the css transform functions to be applied.
... the transform functions are multiplied in order from left to right, meaning that composite transforms are effectively applied in order from right to left.
... editor's draft adds 3d transform functions.
HTTP Index - HTTP
WebHTTPIndex
104 csp: trusted-types the http content-security-policy (csp) trusted-types directive instructs user agents to restrict usage of known dom xss sinks to a predefined set of functions that only accept non-spoofable, typed values in place of strings.
...when this policy is enabled, calls to getcurrentposition() and watchposition() will cause those functions' callbacks to be invoked with a positionerror code of permission_denied.
...partial requests are useful for large media or downloading files with pause and resume functions, for example.
Expressions and operators - JavaScript
var1 <= var2 var2 <= 5 note: (=>) is not an operator, but the notation for arrow functions.
...g, the typeof operator returns the following results: typeof 62; // returns "number" typeof 'hello world'; // returns "string" for property values, the typeof operator returns the type of value the property contains: typeof document.lastmodified; // returns "string" typeof window.length; // returns "number" typeof math.ln2; // returns "number" for methods and functions, the typeof operator returns results as follows: typeof blur; // returns "function" typeof eval; // returns "function" typeof parseint; // returns "function" typeof shape.split; // returns "function" for predefined objects, the typeof operator returns results as follows: typeof date; // returns "function" typeof function; // returns "function" typeof math; // returns ...
...use new as follows: var objectname = new objecttype([param1, param2, ..., paramn]); super the super keyword is used to call functions on an object's parent.
Working with objects - JavaScript
this chapter describes how to use objects, properties, functions, and methods, and how to create your own objects.
...methods are defined the way normal functions are defined, except that they have to be assigned as the property of an object.
...the second parameter is an object whose property names are the getter or setter names, and whose property values are objects for defining the getter or setter functions.
Deprecated and obsolete features - JavaScript
functions expression closures are deprecated.
... use regular functions or arrow functions instead.
... the escape and unescape functions are deprecated.
Array.prototype.forEach() - JavaScript
kindly make sure you are aware of the implications while using promises(or async functions) as foreach callback.
... note: if passing the callback function uses an arrow function expression, the thisarg parameter can be omitted, since all arrow functions lexically bind the this value.
...the following is just one way and is presented to explain how array.prototype.foreach() works by using ecmascript 5 object.* meta property functions.
Function() constructor - JavaScript
calling the constructor directly can create functions dynamically, but suffers from security and similar (but far less significant) performance issues to eval.
... however, unlike eval, the function constructor creates functions which execute in the global scope only.
...this is less efficient than declaring a function with a function expression or function statement and calling it within your code because such functions are parsed with the rest of the code.
Function.name - JavaScript
a function object's read-only name property indicates the function's name as specified when it was created, or it may be rather anonymous or ''(an empty string) for functions created anonymously.
... function dosomething() {} dosomething.name; // "dosomething" function constructor name functions created with the syntax new function(...) or just function(...) create function objects and their name is "anonymous".
... (new function).name; // "anonymous" anonymous function expression anonymous function expressions that were created using the keyword function or arrow functions would have ""(an empty string) as their name.
Object.create() - JavaScript
this is especially true when debugging, since common object-property converting/detecting utility functions may generate errors, or simply lose information (especially if using silent error-traps that ignore errors).
...however, when attempting to actually use these objects, their differences quickly become apparent: > "oco is: " + oco // shows "oco is: [object object]" > "ocn is: " + ocn // throws error: cannot convert object to primitive value testing just a few of the many most basic built-in functions shows the magnitude of the problem more clearly: > alert(oco) // shows [object object] > alert(ocn) // throws error: cannot convert object to primitive value > oco.tostring() // shows [object object] > ocn.tostring() // throws error: ocn.tostring is not a function > oco.valueof() // shows {} > ocn.valueof() // throws error: ocn.valueof is not a function > oco.hasownproperty("p") // shows "tru...
...vel properties - po: [object object] - pn: [object object] however, setting the generic prototype as the new object's prototype works even better: ocn = object.create( null ); // create "null" object (same as before) object.setprototypeof(ocn, object.prototype); // set new object's prototype to the "generic" object (not standard-object) (in addition to all the string-related functions shown above, this also adds:) > ocn.valueof() // shows {} > ocn.hasownproperty("x") // shows "false" > ocn.constructor // shows "object() { [native code] }" // ...and all the rest of the properties and methods of object.prototype.
WebAssembly.Instance - JavaScript
instance objects contain all the exported webassembly functions that allow calling into webassembly code from javascript.
... 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.
...asynchronously, for example using the webassembly.instantiatestreaming() function like this: const importobject = { imports: { imported_func: function(arg) { console.log(arg); } } }; webassembly.instantiatestreaming(fetch('simple.wasm'), importobject) .then(obj => obj.instance.exports.exported_func()); this also demonstrates how the exports property is used to access exported functions.
WebAssembly.Table() constructor - JavaScript
at the moment this can only have a value of "anyfunc" (functions).
... 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).
... so after instantiation, the table still has length 2, but the elements now contain callable exported webassembly functions which we can call from js.
WebAssembly.instantiate() - JavaScript
importobject optional an object containing the values to be imported into the newly-created instance, such as functions or webassembly.memory objects.
... instance: a webassembly.instance object that contains all the exported webassembly functions.
... importobject optional an object containing the values to be imported into the newly-created instance, such as functions or webassembly.memory objects.
eval() - JavaScript
this means, for instance, that function declarations create global functions, and that the code being evaluated doesn't have access to local variables within the scope where it's being called.
..."a.b.c" var result = setdescendantprop(obj, proppath, 1); // obj.a.b.c will now be 1 use functions instead of evaluating snippets of code javascript has first-class functions, which means you can pass functions as arguments to other apis, store them in variables and objects' properties, and so on.
...} , false); closures are also helpful as a way to create parameterized functions without concatenating strings.
function* - JavaScript
you can also define generator functions using the generatorfunction constructor, or the function expression syntax.
... description generators are functions that can be exited and later re-entered.
...however, an even simpler solution to these problems can be achieved with async functions.
JavaScript reference - JavaScript
etimeformat 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 return class iterations do...while for for each...in for...in for...of for await...of while other debugger import label with expressions and operators javascript expressions and operators.
...iftrue : iffalse) assignment operators = *= /= %= += -= <<= >>= >>>= &= ^= |= [a, b] = [1, 2] {a, b} = {a:1, b:2} functions this chapter documents how to work with javascript functions to develop your applications.
... arguments arrow functions default parameters rest parameters additional reference pages lexical grammar data types and data structures strict mode deprecated features ...
JavaScript
javascript (js) is a lightweight, interpreted, or just-in-time compiled programming language with first-class functions.
... javascript building blocks continues our coverage of javascript's key fundamental features, turning our attention to commonly-encountered types of code blocks such as conditional statements, loops, functions, and events.
... functions learn how to work with javascript's functions to develop your applications.
XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes xpath stands for xml path language.
... xpath:functions list and description of the core xpath functions and xslt-specific additions to xpath.
... xpath snippets these are javascript utility functions, that can be used in your own code, based on dom level 3 xpath apis.
Compiling a New C/C++ Module to WebAssembly - WebAssembly
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.
... emscripten requires a large variety of javascript "glue" code to handle memory allocation, memory leaks, and a host of other problems calling a custom function defined in c if you have a function defined in your c code that you want to call as needed from javascript, you can do this using the emscripten ccall() function, and the emscripten_keepalive declaration (which adds your functions to the exported functions list (see why do functions in my c/c++ source code vanish when i compile to javascript, and/or i get no functions to process?)).
... new directory: #include <stdio.h> #include <emscripten/emscripten.h> int main(int argc, char ** argv) { printf("hello world\n"); } #ifdef __cplusplus extern "c" { #endif void emscripten_keepalive myfunction(int argc, char ** argv) { printf("myfunction called\n"); } #ifdef __cplusplus } #endif by default, emscripten-generated code always just calls the main() function, and other functions are eliminated as dead code.
Index - WebAssembly
7 exported webassembly functions guide, javascript, webassembly, export, exported functions, exported wasm functions, wasm exported webassembly functions are how webassembly functions are represented in javascript.
... 10 understanding webassembly text format functions, javascript, s-expressions, webassembly, calls, memory, shared address, table, text format, was, wasm this finishes our high-level tour of the major components of the webassembly text format and how they get reflected in the webassembly js api.
... 11 using the webassembly javascript api api, devtools, javascript, webassembly, compile, instantiate, memory, table this article has taken you through the basics of using the webassembly javascript api to include a webassembly module in a javascript context and make use of its functions, and how to use webassembly memory and tables in javascript.
Communicating using "port" - Archive of obsolete content
; var alertcontentscript = "self.port.on('alert', function(message) {" + " window.alert(message);" + "})"; tabs.on("ready", function(tab) { worker = tab.attach({ contentscript: alertcontentscript }); worker.port.emit("alert", "message from the add-on"); }); tabs.open("http://www.mozilla.org"); in total, the port object defines four functions: emit(): emit a message.
...this means you can't send functions, and if the object contains methods they won't be encoded.
private-browsing - Archive of obsolete content
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.
... to do this with the sdk, you can listen to the system event named "last-pb-context-exited": var events = require("sdk/system/events"); function listener(event) { console.log("last private window closed"); } events.on("last-pb-context-exited", listener); globals functions isprivate(object) function to check whether the given object is private.
querystring - Archive of obsolete content
utility functions for working with query strings.
... globals functions stringify(fields, separator, assignment) serializes an object containing name:value pairs into a query string: querystring.stringify({ foo: 'bar', baz: 4 }); // => 'foo=bar&baz=4' by default '&' and'=' are used as separator and assignment characters, but you can override this using additional optional parameters: querystring.stringify({ foo: 'bar', baz: 4 }, ';', ':'); // => 'foo:bar;baz:4' parameters fields : object the data to convert to a query string.
widget - Archive of obsolete content
we could implement the main user interface as a widget hosting an array of buttons to control play/pause/stop functions.
...but because content scripts can't use the sdk's apis, we'll want the content script to send messages to the main add-on code, which can then implement the media player functions using the sdk.
windows - Archive of obsolete content
usage the windows module provides basic functions for working with browser windows.
... globals functions open(options) open a new window.
High-Level APIs - Archive of obsolete content
hotkeys assign hotkey combinations to functions in your add-on.
... private-browsing check whether a given object is private, so an add-on can respect private browsing querystring utility functions for working with query strings.
content/mod - Archive of obsolete content
experimental provides functions to modify a page content.
... globals constructors functions attachto(modification, window) function applies given modification to a given window.
content/worker - Archive of obsolete content
onmessage function functions that will registered as a listener to a 'message' events.
... onerror function functions that will registered as a listener to an 'error' events.
frame/utils - Archive of obsolete content
experimental provides helper functions for working with platform internals like frames and browsers.
... execution of scripts may easily be enabled: let { open } = require('sdk/window/utils'); let { create } = require('sdk/frame/utils'); let window = open('data:text/html,top'); let frame = create(window.document, { uri: 'data:text/html,<script>console.log("running");</script>', allowjavascript: true }); } globals functions create(document, options) creates a xul browser element in a privileged document.
lang/type - Archive of obsolete content
functions for working with type detection.
... globals functions isundefined(value) returns true if value is undefined, false otherwise.
places/favicon - Archive of obsolete content
helper functions for working with favicons.
... globals functions getfavicon(object, callback) takes an object that represents a page's url and returns a promise that resolves with the favicon url for that page.
places/history - Archive of obsolete content
ript' { query: "javascript", from: lastweek }], // we want to order chronologically by visit date { sort: "date" } ).on("end", function (results) { // results is an array of objects containing visit data, // sorted by visit date, with all entries from more than a week ago // that contain 'ruby', *in addition to* entries from this last week // that contain 'javascript' }); globals functions search(queries, options) queries can be performed on history entries by passing in one or more query options.
... placesemitter the placesemitter is not exposed in the module, but returned from the search functions.
platform/xpcom - Archive of obsolete content
functions register(factory) register the factory or service supplied.
...if you do this, you can use the register() and unregister() functions to register and unregister.
stylesheet/utils - Archive of obsolete content
experimental helper functions for working with stylesheets.
... globals functions loadsheet(window, uri, type) synchronously loads a style sheet from uri and adds it to the list of additional style sheets of the document.
tabs/utils - Archive of obsolete content
functions for working with xul tabs and the xul tabbrowser object.
... globals functions activatetab(tab, window) set the specified tab as the active, or selected, tab.
test/utils - Archive of obsolete content
usage before and after helper functions before() and after() are available for running a function before or after each test in a suite.
...'sdk/test/utils'); let { search } = require('sdk/places/bookmarks'); exports.testcountbookmarks = function (assert, done) { search().on('end', function (results) { assert.equal(results, 0, 'should be no bookmarks'); done(); }); }; before(exports, function (name, assert, done) { removeallbookmarksasync(function () { done(); }); }); require('sdk/test').run(exports); globals functions before(exports, beforefn) runs beforefn before each test in the file.
util/array - Archive of obsolete content
helper functions for working with arrays.
... globals functions has(array, element) returns true if the given array contains the element or false otherwise.
util/object - Archive of obsolete content
functions for working with objects.
... globals functions merge(source, arguments) merges all of the properties of all arguments into the first argument.
window/utils - Archive of obsolete content
functions for working with browser windows.
... globals functions getmostrecentbrowserwindow() get the topmost browser window, as an nsidomwindow instance.
Connecting to Remote Content - Archive of obsolete content
ement && "parseerror" != rootelement.tagname) { let shopelements = rootelement.getelementsbytagname("shop"); let totalelement = rootelement.getelementsbytagname("total")[0]; window.alert(shopelements[1].getelementsbytagname("name")[0].firstchild.nodevalue); // => orange window.alert(totalelement.firstchild.nodevalue); // => 2 } }; using dom functions is good for simple xml documents, but dom manipulation code can become too complicated if the documents are more complex.
... filter a complex xml file and generate a simpler xml document with only the data you need, so then you can use regular dom functions to read it.
CSS3 - Archive of obsolete content
css color module level 3 recommendation since june 7th, 2011 adds the opacity property, and the hsl(), hsla(), rgba() and rgb() functions to create <color> values.
... motion path module level 1 working draft css fonts module level 4 working draft css easing functions level 1 working draft css logical properties and values level 1 editor's draft modules in the revising phase modules that are in the revising phase are much less stable than those in the refining phase.
Creating a dynamic status bar extension - Archive of obsolete content
we use the window.addeventlistener() dom function to tell firefox to call the stockwatcher.startup() function when a new browser window is opened: window.addeventlistener("load", function(e) { stockwatcher.startup(); }, false); our new extension has two primary functions: startup() and refreshinformation().
...in fact, even the this value would not match, so we couldn't get at the same variables and functions that way.
Style System Overview - Archive of obsolete content
[design flaw in frame/sc relationship] three functions for creating style contexts on nsistyleset, wrapped by similarly named ones on nsiprescontext: resolvestylecontextfor: for elements.
... resolvepseudostylecontextfor: for pseudo-elements (:first-letter, :before, etc.) resolvestylecontextfornonelement: skips rule matching and uses root rule node (text frame optimization) managing style contexts style context resolving functions will walk the rule processors in stylesetimpl::filerules, find the correct rule node, and find a current child of the parent (“sibling sharing”) or create a new child.
Supporting private browsing mode - Archive of obsolete content
it will simply always report that private browsing is off, and will never call any registered watcher functions.
...} in addition, you can install watcher functions to be called when private browsing turns on and off, as shown in the following example.
Binding Implementations - Archive of obsolete content
the second type of property is one that defines functions that are invoked when the property is either retrieved or set.
... these functions are called getters and setters in xbl.
Elements - Archive of obsolete content
to access anonymous nodes on an xbl bound element, you can use the getanonymouselementbyattribute and getanonymousnodes functions.
...a property consists of a pair of getter/setter functions that can be defined using onget/onset attributes or getter/setter elements underneath the property element.
onchange - Archive of obsolete content
a change event is fired in different ways for different xul input elements as listed below: onchange type: script code textbox when enter key is pressed radio/check box when the state is changed select list when the selected item is changed what is accessible the script context at this point can only access the following things: global values/functions i.e.
... window, document, or any of the functions/objects/variables bound to the window object event object example <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window id="findfile-window" title="find files" orient="horizontal" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script type="text/javascript"> function myfunction(e){ /* do something cool here or just say the below */ alert(e.target.nodename); } </script> <textbox id="find-text" onchange="return myfunction(event);"/> </window> ...
Introduction to XUL - Archive of obsolete content
javascript functions may be added in a fashion similar to html.
... interface xulelement : element { nodelist getelementsbyattribute(in domstring name, in domstring value); }; getelementsbyattribute functions as does its namesake in xuldocument, though this version returns only those elements which match the criteria and are descendants (in css selector terminology) of the given element.
view - Archive of obsolete content
ArchiveMozillaXULPropertyview
functions available in the view allow one to retrieve the data within the cells, and determine which rows are nested within others.
... for a complete list of view functions, see the nsitreeview interface.
RDF Modifications - Archive of obsolete content
the first is when the modification functions on the datasource are called.
... there are four such functions: 'assert', to add a new triple (or arrow) to the rdf graph, 'unassert' to remove a triple, 'change' to adjust the target of a triple, and 'move' to adjust the source of a 'triple'.
textbox (Toolkit autocomplete) - Archive of obsolete content
a change event is fired in different ways for different xul input elements as listed below: onchange type: script code textbox when enter key is pressed radio/check box when the state is changed select list when the selected item is changed what is accessible the script context at this point can only access the following things: global values/functions i.e.
... window, document, or any of the functions/objects/variables bound to the window object event object example <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window id="findfile-window" title="find files" orient="horizontal" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script type="text/javascript"> function myfunction(e){ /* do something cool here or just say the below */ alert(e.target.nodename); } </script> <textbox id="find-text" onchange="return myfunction(event);"/> </window> oninput type: script code this event is sent when a user enters text in a textbox.
Textbox (XPFE autocomplete) - Archive of obsolete content
a change event is fired in different ways for different xul input elements as listed below: onchange type: script code textbox when enter key is pressed radio/check box when the state is changed select list when the selected item is changed what is accessible the script context at this point can only access the following things: global values/functions i.e.
... window, document, or any of the functions/objects/variables bound to the window object event object example <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window id="findfile-window" title="find files" orient="horizontal" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script type="text/javascript"> function myfunction(e){ /* do something cool here or just say the below */ alert(e.target.nodename); } </script> <textbox id="find-text" onchange="return myfunction(event);"/> </window> onerrorcommand type: script code this event handler is called when an error occurs when selecting a result from the popup.
Adding Event Handlers - Archive of obsolete content
we write this using javascript functions much in the same way as html.
...we'll define some functions in the file and we can call them in event handlers.
Additional Install Features - Archive of obsolete content
it provides some functions which can be used to examine and modify files on disk.
... functions also exist to move(), rename() and execute() files.
Creating an Installer - Archive of obsolete content
this script has access to various install functions which can be used to install files and components.
...this script will call install functions which will indicate which files from the archive should be installed.
Custom Tree Views - Archive of obsolete content
in general, although the tree view has thirty or so functions that may be implemented, you only need to implement the ones that the tree will call.
...box; }, iscontainer: function(row){ return false; }, isseparator: function(row){ return false; }, issorted: function(){ return false; }, getlevel: function(row){ return 0; }, getimagesrc: function(row,col){ return null; }, getrowproperties: function(row,props){}, getcellproperties: function(row,col,props){}, getcolumnproperties: function(colid,col,props){} }; the functions in the example not described above do not need to perform any action, but they must be implemented as the tree calls them to gather additional information.
Trees - Archive of obsolete content
ArchiveMozillaXULTutorialTrees
this interface contains thirty properties and functions which you may implement.
... these functions will be called by the tree as necessary to retrieve data and state about the tree.
XUL element attributes - Archive of obsolete content
this results in a performance enhancement, but you will not be able to use the dom functions to retrieve the tree rows.
...you can use this as a parameter to getelementbyid() and other dom functions and to reference the element in style sheets.
The Implementation of the Application Object Model - Archive of obsolete content
several of the implemented functions would even have identical implementations, i.e.
...this layer would serve several useful functions.
colorpicker - Archive of obsolete content
a change event is fired in different ways for different xul input elements as listed below: onchange type: script code textbox when enter key is pressed radio/check box when the state is changed select list when the selected item is changed what is accessible the script context at this point can only access the following things: global values/functions i.e.
... window, document, or any of the functions/objects/variables bound to the window object event object example <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window id="findfile-window" title="find files" orient="horizontal" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script type="text/javascript"> function myfunction(e){ /* do something cool here or just say the below */ alert(e.target.nodename); } </script> <textbox id="find-text" onchange="return myfunction(event);"/> </window> preference type: id connects the element to a corresponding preference.
preference - Archive of obsolete content
a change event is fired in different ways for different xul input elements as listed below: onchange type: script code textbox when enter key is pressed radio/check box when the state is changed select list when the selected item is changed what is accessible the script context at this point can only access the following things: global values/functions i.e.
... window, document, or any of the functions/objects/variables bound to the window object event object example <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window id="findfile-window" title="find files" orient="horizontal" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script type="text/javascript"> function myfunction(e){ /* do something cool here or just say the below */ alert(e.target.nodename); } </script> <textbox id="find-text" onchange="return myfunction(event);"/> </window> readonly type: boolean if set to true, then the user cannot change the value of the element.
window - Archive of obsolete content
you can use this as a parameter to getelementbyid() and other dom functions and to reference the element in style sheets.
...some of mozilla's window handling functions use this attribute to group windows of the same type together.
Multi-process plugin architecture - Archive of obsolete content
when multi-process plugins are enabled, a shim layer in the browser implements the plugin api (the npp_ functions which would normally be implemented directly by the plugin).
...in the plugin process, the shim layer serves as a plugin host, implementing the npn_ functions used by the plugin, and forwards the calls to the plugin dll: multi-process plugins, also called out of process plugins or oopp first shipped in firefox 3.6.4 on windows and linux, and in firefox 4 on mac os x.
NPClass - Archive of obsolete content
« gecko plugin api reference « scripting plugins summary npclass is a structure that holds a set of pointers to functions that make up the behavior of an instance of an npclass (i.e.
...you should instead use the appropriate api functions.
TCP/IP Security - Archive of obsolete content
because of this, a security control at a higher layer cannot provide protection for lower layers, because the lower layers perform functions of which the higher layers are not aware.
...n and use of transport layer security, available from https://csrc.nist.gov/publications/nistpubs/.) the use of tls typically requires each application to support tls; however, unlike application layer controls, which typically involve extensive customization of the application, transport layer controls such as tls are much less intrusive because they do not need to understand the application’s functions or characteristics.
Developing cross-browser and cross-platform pages - Archive of obsolete content
the browser identification approach relies on functions that check the browser type string value and browser version string value and that search for certains characters or sub-strings in the navigator.useragent property string.
... once "detected", the web author then uses different functions (aka code branching) or points the user to different pages (aka site branching) or web content.
Introduction - Archive of obsolete content
however, many of the same functions that you would use in the dom can be used in e4x.
...use of inline functions in content although the brackets are restricted to single statements for evaluation, one might provide an anonymous function to perform some extra processing inline: var a = 'foo'; var b = <bar>{function () {var c = a.touppercase(); var d = 5 * 5; return c + d;}()}</bar>; where the above produces: <bar>foo25</bar>.
Legacy generator function - Archive of obsolete content
the legacy generator function statement declares legacy generator functions with the specified parameters.
... you can also define functions using the function constructor with functionbody and at least one yield expression, and a legacy generator function expression.
Debug - Archive of obsolete content
in windows 8.x store apps, the write and writeln functions of the debug object display strings in the visual studio output window at run time.
... functions debug.mstraceasynccallbackcompleted indicates that the callback stack associated with a previously specified asynchronous operation has completed.
New in JavaScript 1.5 - Archive of obsolete content
functions can now be declared inside an if clause.
... functions can now be declared inside an expression.
ECMAScript 2015 support in Mozilla - Archive of obsolete content
irefox 41) weakmap (firefox 6) weakmap.clear() (firefox 20) optional iterable argument in weakmap constructor (firefox 36) constructor argument: new weakmap(null) (firefox 37) monkey-patched set() in constructor (firefox 37) weakset (firefox 34) constructor argument: new weakset(null) (firefox 37) monkey-patched add() in constructor (firefox 37) new math functions math.imul() (firefox 20) math.clz32() (firefox 31) math.fround() (firefox 26) math.log10(), math.log2(), math.log1p(), math.expm1(), math.cosh(), math.sinh(), math.tanh(), math.acosh(), math.asinh(), math.atanh(), math.hypot(), math.trunc(), math.sign(), math.cbrt() (firefox 25) additions to the number object number.isnan() (firefox 16) number.isfinite() (firefox 16) number.isinteger...
...pliance bug 950547 implemented in firefox 51) let (js 1.7, firefox 2) (es2015 compliance bug 950547 implemented in firefox 51) destructuring assignment (js 1.7, firefox 2) (es2015 compliance bug 1055984) statements for...of (firefox 13) works in terms of .iterator() and .next() (firefox 17) use "@@iterator" property (firefox 27) use symbol.iterator property (firefox 36) functions rest parameters (firefox 15) default parameters (firefox 15) parameters without defaults after default parameters (firefox 26) destructured parameters with default value assignment (firefox 41) arrow functions (firefox 22) generator function (firefox 26) yield (firefox 26) yield* (firefox 27) arguments[@@iterator] (firefox 46) other features binary and octa...
Archived JavaScript Reference - Archive of obsolete content
see also the newer version of date.prototype.tolocaledatestring().ecmascript 2016 to es.next support in mozillaexpression closuresexpression closures are a shorthand function syntax for writing simple functions.for each...inthe for each...in statement iterates a specified variable over all values of object's properties.
...do not use it!handler.enumerate()the handler.enumerate() method used to be a trap for for...in statements, but has been removed from the ecmascript standard in es2016 and is deprecated in browsers.legacy generator functionthe legacy generator function statement declares legacy generator functions with the specified parameters.legacy generator function expressionthe function keyword can be used to define a legacy generator function inside an expression.
ParallelArray - Archive of obsolete content
the higher-order functions available on parallelarray attempted to execute in parallel, though they may fall back to sequential execution if necessary.
... to ensure that your code executes in parallel, it is suggested that the functions should be limited to the parallelizable subset of js that firefox supports.
Back to the Server: Server-Side JavaScript On The Rise - Archive of obsolete content
runat=”server-proxy” – allows for the exposure of server-side javascript functions to the browser.
...listing 8 shows the two functions used to handle the comment submission process.
Mozilla XForms Specials - Archive of obsolete content
(limitation tracked in bug 271724) optional parameters in xpath functions optional parameters in xpath functions are not supported, you will have to specify all parameters when calling a function.
... this affects functions like hmac() or digest().
Archived open Web documentation - Archive of obsolete content
the higher-order functions available on parallelarray attempted to execute in parallel, though they may fall back to sequential execution if necessary.
... to ensure that your code executes in parallel, it is suggested that the functions should be limited to the parallelizable subset of js that firefox supports.
Parsing microformats in JavaScript - Archive of obsolete content
note: this doesn't return the html as a string, but an object with a few functions you can call to retrieve the html and do other tasks.
... the functions you can call on the returned object are: string = html.tostring(); returns a string using innertext().
Anatomy of a video game - Game development
building a main loop in javascript javascript works best with events and callback functions.
...let us assume that your game's functions and variables are built on a namespace that you called mygame.
Building up a basic demo with Babylon.js - Game development
as with any other 3d library it provides built-in functions to help you implement common 3d functionality more quickly.
...add the following code to the bottom of your second <script> element: var engine = new babylon.engine(canvas); the babylon global object contains all the babylon.js functions available in the engine.
3D games on the Web - Game development
as with any other 3d library, it provides built-in functions to help you implement common 3d functionality more quickly.
... building up a basic demo with three.js three.js, like any other library, gives you a huge advantage: instead of writing hundreds of lines of webgl code to build anything interesting you can use built-in helper functions to do it a lot easier and faster.
Implementing controls using the Gamepad API - Game development
both functions are fairly simple: connect: function(evt) { gamepadapi.controller = evt.gamepad; gamepadapi.turbo = true; console.log('gamepad connected.'); }, the connect() function takes the event as a parameter and assigns the gamepad object to the gamepadapi.controller variable.
...the buttonpressed function is used in the update loop of the game like this: if(gamepadapi.turbo) { if(gamepadapi.buttonpressed('a','hold')) { this.turbo_fire(); } if(gamepadapi.buttonpressed('b')) { this.managepause(); } } if gamepadapi.turbo is true and the given buttons are pressed (or held), we execute the proper functions assigned to them.
Plug-in Development Overview - Gecko Plugin API Reference
caution: gecko caches the values returned by these functions and will only call it if the plug-in's timestamp has changed.
...in streams produced by the plug-in, by contrast, the plug-in calls netscape functions to create a stream, push data into it, and delete it.
CRUD - MDN Web Docs Glossary: Definitions of Web-related terms
it is a mnemonic for the four basic functions of persistent storage.
... crud typically refers to operations performed in a database or datastore, but it can also apply to higher level functions of an application such as soft deletes where data is not actually deleted but marked as deleted via a status.
Control flow - MDN Web Docs Glossary: Definitions of Web-related terms
to do this, the script uses a conditional structure or if...else, so that different code executes depending on whether the form is complete or not: if (field==empty) { promptuser(); } else { submitform(); } a typical script in javascript or php (and the like) includes many control structures, including conditionals, loops and functions.
...looking back at the code in the if and else sections, the lines promptuser and submitform could also be calls to other functions in the script.
Cryptographic hash function - MDN Web Docs Glossary: Definitions of Web-related terms
cryptographic hash functions are used for authentication, digital signatures, and message authentication codes.
...compute (because they are generated frequently) not invertible (each digest could come from a very large number of messages, and only brute-force can generate a message that leads to a given digest) tamper-resistant (any change to a message leads to a different digest) collision-resistant (it should be impossible to find two different messages that produce the same digest) cryptographic hash functions such as md5 and sha-1 are considered broken, as attacks have been found that significantly reduce their collision resistance.
Encapsulation - MDN Web Docs Glossary: Definitions of Web-related terms
encapsulation is the packing of data and functions into one component (for example, a class) and then controlling access to that component to make a "blackbox" out of the object.
... because of this, a user of that class only needs to know its interface (that is, the data and functions exposed outside the class), not the hidden implementation.
First-class Function - MDN Web Docs Glossary: Definitions of Web-related terms
a programming language is said to have first-class functions when functions in that language are treated like any other variable.
... for example, in such a language, a function can be passed as an argument to other functions, can be returned by another function and can be assigned as a value to a variable.
Global object - MDN Web Docs Glossary: Definitions of Web-related terms
any global variables or functions can be accessed as properties of the window object.
... explanation: the global variable foo was stored in the window object, like this: foo: "foobar" access global functions function greeting() { console.log("hi!"); } window.greeting(); // it is the same as the normal invoking: greeting(); the example above explains how global functions are stored as properties in the window object.
Parameter - MDN Web Docs Glossary: Definitions of Web-related terms
parameter variables are used to import arguments into functions.
... two kinds of parameters: input parameters the most common kind; they pass values into functions.
Asynchronous JavaScript - Learn web development
making asynchronous programming easier with async and await promises can be somewhat complex to set up and understand, and so modern browsers have implemented async functions and the await operator.
... the former allows standard functions to implicitly behave asynchronously with promises, whereas the latter can be used inside async functions to wait for promises before the function continues.
Drawing graphics - Learn web development
canvas includes functions for drawing straight lines, circles, bézier curves, and more.
... there are a few javascript functions that will allow you to run functions repeatedly, several times a second, the best one for our purposes here being window.requestanimationframe().
Third-party APIs - Learn web development
below the existing addeventlistener() call, add these two new ones, which cause the nextpage() and previouspage() functions to be invoked when the relevant buttons are clicked: nextbtn.addeventlistener('click', nextpage); previousbtn.addeventlistener('click', previouspage); below your previous addition, let's define the two functions — add this code now: function nextpage(e) { pagenumber++; fetchresults(e); }; function previouspage(e) { if(pagenumber > 0) { pagenumber--; } else { return;...
...the restful api has functions available to handle making the http requests and returning the results.
Silly story generator - Learn web development
project brief you have been provided with some raw html/css and a few text strings and javascript functions; you need to write the necessary javascript to turn this into a working program, which does the following: generates a silly story when the "generate random story" button is pressed.
... initial variables and functions: in the raw text file, copy all of the code underneath the heading "1.
What is JavaScript? - Learn web development
the updatename() code block (these types of reusable code blocks are called "functions") asks the user for a new name, and then inserts that name into the paragraph to update the display.
...jquery.js may load before or after script2.js and script3.js and if this is the case, any functions in those scripts depending on jquery will produce an error because jquery will not be defined at the time the script runs.
Object prototypes - Learn web development
prerequisites: understanding javascript functions, familiarity with javascript basics (see first steps and building blocks), and oojs basics (see introduction to objects).
... note: it's important to understand that there is a distinction between an object's prototype (available via object.getprototypeof(obj), or via the deprecated __proto__ property) and the prototype property on constructor functions.
Introducing JavaScript objects - Learn web development
you can even create your own objects to encapsulate related functions and variables into efficient packages and act as handy data containers.
... object-oriented javascript for beginners with the basics out of the way, we'll now focus on object-oriented javascript (oojs) — this article presents a basic view of object-oriented programming (oop) theory, then explores how javascript emulates object classes via constructor functions, and how to create object instances.
JavaScript — Dynamic client-side scripting - Learn web development
javascript building blocks in this module, we continue our coverage of all javascript's key fundamental features, turning our attention to commonly-encountered types of code block such as conditional statements, loops, functions, and events.
...you can even create your own objects to encapsulate related functions and variables into efficient packages.
React interactivity: Events and state - Learn web development
react provides a variety of special functions that allow us to provide new capabilities to components, like state.
... these functions are called hooks, and the usestate hook, as its name implies, is precisely the one we need in order to give our component some state.
React interactivity: Editing, filtering, conditional rendering - Learn web development
add the edittask() function inside your app component, in the same place as the other functions: function edittask(id, newname) { const editedtasklist = tasks.map(task => { // if this task has the same id as the edited task if (id === task.id) { // return {...task, name: newname} } return task; }); settasks(editedtasklist); } pass edittask into our <todo /> components as a prop in the same way we did with deletetask: const tasklist = tasks.map(task => ( ...
... at the top of app.js, beneath our imports but above our app() function, let's add an object called filter_map: const filter_map = { all: () => true, active: task => !task.completed, completed: task => task.completed }; the values of filter_map are functions that we will use to filter the tasks data array: the all filter shows all tasks, so we return true for all tasks.
TypeScript support in Svelte - Learn web development
so it is in fact any javascript object with a couple limitations, for example undefined, functions, and symbols are not valid json values.
...they can be applied to interfaces, classes, and functions.
Introduction to automated testing - Learn web development
help (question mark) — accesses help/support functions.
... make sure everything is saved, and run your file like so: node call_bstack below we've also provided some other ready-made functions you might find useful when working with the browserstack restful api.
Benchmarking
profiling tools currently the gecko profiler has limitations in the ui for inverted call stack top function analysis which is very useful for finding heavy functions that call into a whole bunch of code.
... currently such functions may be easy to miss looking at a profile, so feel free to also use your favorite native profiler.
Chrome registration
to update your add-on to work without this flag: if your add-on depends upon xbl bindings attached to content objects (that is, it needs to be able to call functions or get and set properties created by the xbl binding), you'll need to use the object's wrappedjsobject property to obtain a wrapped object.
... if you need to call functions or access properties defined by the content -- for example, if your add-on wants to add a button to the page that calls a javascript function defined by the page.
Interface Compatibility
this includes not only xpcom interfaces, but javascript functions, xbl bindings, and any other visible behavior.
... binary interfaces traditionally, mozilla has maintained a set of xpcom interfaces and functions with the @status frozen marking.
mach
you essentially have a bunch of python functions saying "i provide command x" and mach hooks up command line argument parsing, terminal interaction, and dispatching.
...these include command line parsing, a structured logger, dispatching, and utility functions to aid in the implementation of mach commands.
Overview of Mozilla embedding APIs
public return codes ns_succeeded ns_error_failure ns_error_not_implemented public functions the following functions are available from the xpcom dll.
...to facilitate this, a set of global functions are available to access the nsmemory methods without requiring an instance of the nsmemory service (see nsmemory.h).
Add-on Manager
many functions in the add-on manager interface operate asynchronously returning results through callbacks passed to the functions.
...all of its functions are asynchronous, meaning that a callback function must be passed to receive the addon instances.
OS.File.Error
} catch (ex) { if (ex instanceof os.file.error && ex.becausenosuchfile) { // the file does not exist } } global object os.file.error methods overview the following functions are utility functions that may be used to construct instances of os.file.error, setting the platform-specific error number.
...instances of os.file.error in case of any i/o error, the functions of os.file raise instances of os.file.error.
Promise.jsm
ise.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 specific to the add-on sdk.
...this method registers callback functions that are called as soon as the promise is either fulfilled or rejected.
Using JavaScript code modules
creating a javascript code module a very simple javascript module looks like this: var exported_symbols = ["foo", "bar"]; function foo() { return "foo"; } var bar = { name : "bar", size : 3 }; var dummy = "dummy"; notice that the module uses normal javascript to create functions, objects, constants, and any other javascript type.
...any modifications to data, objects, or functions will be available in any scope that has imported the module.
JavaScript code modules
bookmarkhtmlutils.jsm provides utility functions for importing and exporting bookmarks from the old-school "bookmarks.html" style bookmark files.
... netutil.jsm provides helpful networking utility functions, including the ability to easily copy data from an input stream to an output stream asynchronously.
gettext
in php, however, the default gettext functions don't support passing such additional argument.
... to fix this, you may choose to write your own helper gettext functions.
Refcount tracing and balancing
exclude functions.
... to aid in this process, you can create an "excludes file", that lists the name of functions that you want to exclude from the tree building process (presumably because you've matched them).
about:memory
explicit allocations this section contains a single tree, called "explicit", that measures all the memory allocated via explicit calls to heap allocation functions (such as malloc and new) and to non-heap allocations functions (such as mmap and virtualalloc).
... this "explicit" value at the root of the tree represents all the memory allocated via explicit calls to allocation functions.
A guide to searching crash reports
specifically, crash-stats offers two basic functions: searching you can search the crash reports database by over 100 criteria: crash signature, date, platform, product, version, etc.
... to achieve full power and flexibility requires a good understanding of both of these functions.
NSPR Contributor Guide
provide header file descriptions that fully document your public typedefs, enums, macros and functions.
...that said: there are some libraries that implement functions intended for use with applications using nspr, such as ...nsprpub/lib/libc/plgetopt.*.
Cached Monitors
this chapter describes the functions you use when you work with cached monitors.
... cached monitors functions cached monitors allow the client to associate monitoring protection and state change synchronization in a lazy fashion.
Condition Variables
condition variable type condition variable functions conditions are closely associated with a single monitor, which typically consists of a mutex, one or more condition variables, and the monitored data.
... condition variable type prcondvar condition variable functions pr_newcondvar pr_destroycondvar pr_waitcondvar pr_notifycondvar pr_notifyallcondvar ...
Dynamic Library Linking
library linking types these data types are defined for dynamic library linking: prlibrary prstaticlinktable library linking functions the library linking functions are: pr_setlibrarypath pr_getlibrarypath pr_getlibraryname pr_freelibraryname pr_loadlibrary pr_unloadlibrary pr_findsymbol pr_findsymbolandlibrary finding symbols defined in the main executable program pr_loadlibrary cannot open a handle that references the main executable program.
... platform notes to use the dynamic library loading functions on some platforms, certain environment variables must be set at run time, and you may need to link your executable programs using special linker options.
Locks
lock type lock functions in nspr, a mutex of type prlock controls locking, and associated condition variables communicate changes in state among threads.
... lock type prlock lock functions pr_newlock creates a new lock object.
Named Shared Memory
shared memory protocol named shared memory functions shared memory protocol using named shared memory functions pr_opensharedmemory creates the shared memory segment, if it does not already exist, or opens a connection with the existing shared memory segment if it already exists.
... named shared memory functions pr_opensharedmemory pr_attachsharedmemory pr_detachsharedmemory pr_closesharedmemory pr_deletesharedmemory ...
PLHashComparator
for convenience, two comparator functions are provided.
... remark the return value of plhashcomparator functions should be of type prbool.
PRExplodedTime
on input to nspr functions, only the essential members of prexplodedtime must be specified.
... the two nonessential members (day of week and day of year) are ignored by nspr functions as input.
PRHostEnt
description this structure is used by many of the network address functions.
... use the network address functions to manipulate the prhostent structure.
PRLock
syntax #include <prlock.h> typedef struct prlock prlock; description nspr represents a lock as an opaque entity to clients of the functions described in "locks".
... functions that operate on locks do not have timeouts and are not interruptible.
PR_AttachThread
description you use pr_attachthread when you want to use nss functions on the native thread that was not created with nspr.
... in nspr release 19980529b and earlier, it is necessary for a native thread not created by nspr to call pr_attachthread before it calls any nspr functions, and call pr_detachthread when it is done calling nspr functions.
Process Management and Interprocess Communication
note that the functions described in this chapter are not available for macos or win16 operating systems.
... process management types and constants the types defined for process management are: prprocess prprocessattr process management functions the process manipulation function fall into these categories: setting the attributes of a new process creating and managing processes setting the attributes of a new process the functions that create and manipulate attribute sets of new processes are: pr_newprocessattr pr_resetprocessattr pr_destroyprocessattr pr_processattrsetstdioredirect pr_processattrsetcurrentdirectory pr_processattrsetinheritablefd creating and managing processes the functions that create and manage processes are: pr_createprocess pr_detachprocess pr_waitprocess pr_killprocess ...
Introduction to Network Security Services
three shared libraries export public functions: the ssl library supports core ssl operations.
...for a complete list of public functions exported by these shared libraries in nss 3.2, see nss functions.
JSS 4.4.0 Release Notes
jss 4.4.0 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/jss/releases/jss_4_4_0_rtm/src/ new in jss 4.40 new functionality new functions new macros notable changes in jss 4.40 picks up work done downstream for fedora and rhel and used by various linux distributions with includes:.
...furthermore, applications that restrict their use of jss apis to the functions listed in jss public functions will remain compatible with future versions of the jss shared libraries.
NSS_3.12.1_release_notes.html
new in nss 3.12.1 new functions in the nss shared library: cert_nametoasciiinvertible (see cert.h) convert an certname into its rfc1485 encoded equivalent.
... furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.12.9 release notes
new in nss 3.12.9 removed functions new ssl options new error codes bugs fixed the following bugs have been fixed in nss 3.12.9.
... furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.14.3 release notes
new functions in pk11pub.h pk11_signwithsymkey - similar to pk11_sign, performs a signing operation in a single operation.
...furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.15.1 release notes
new functions none.
...furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.15.2 release notes
specifically, the following cipher suites are now supported: tls_ecdhe_ecdsa_with_aes_128_gcm_sha256 tls_ecdhe_rsa_with_aes_128_gcm_sha256 tls_dhe_rsa_with_aes_128_gcm_sha256 tls_rsa_with_aes_128_gcm_sha256 new functions pk11_cipherfinal has been introduced, which is a simple alias for pk11_digestfinal.
...furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.15.4 release notes
new functions cert_forcepostmethodforocsp cert_getsubjectnamedigest cert_getsubjectpublickeydigest ssl_peercertificatechain ssl_recommendedcanfalsestart ssl_setcanfalsestartcallback new types cert_rev_m_force_post_method_for_ocsp: when this flag is used, libpkix will never attempt to use the http get method for ocsp requests; it will always use post.
...furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.15 release notes
new functions in ssl.h ssl_peerstapledocspresponse - returns the server's stapled ocsp response, when used with a tls client socket that negotiated the status_request extension.
... in secitem.h secitem_allocarray secitem_duparray secitem_freearray secitem_zfreearray - utility functions to handle the allocation and deallocation of secitemarrays secitem_reallocitemv2 - replaces secitem_reallocitem, which is now obsolete.
NSS 3.18 release notes
new functions in certdb.h sec_checkcrltimes - check the validity of a crl at the given time.
...furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.19.1 release notes
thus, the seckey_publickeystrength and seckey_publickeystrengthinbits functions could report smaller values for values that have leading zero values.
...furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.19.2.4 release notes
security fixes in nss 3.19.2.4 the following security fixes from nss 3.21 have been backported to nss 3.19.2.4: bug 1185033 / cve-2016-1979 - use-after-free during processing of der encoded keys in nss bug 1209546 / cve-2016-1978 - use-after-free in nss during ssl connections in low memory bug 1190248 / cve-2016-1938 - errors in mp_div and mp_exptmod cryptographic functions in nss compatibility nss 3.19.2.4 shared libraries are backward compatible with all older nss 3.x shared libraries.
...furthermore, applications that restrict the use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.19 release notes
new functions in cert.h cert_getimposednameconstraints - check if any imposed constraints exist for the given certificate, and if found, return the constraints as encoded certificate extensions.
...furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.20 release notes
new functions in ssl.h ssl_dhegroupprefset - configure the set of allowed/enabled dhe group parameters that can be used by nss for a server socket.
...furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.21 release notes
new in nss 3.21 new functionality certutil 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 st...
...furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.23 release notes
new functions in ssl.h ssl_setdowngradecheckversion - set maximum version for new serverrandom anti-downgrade mechanism.
...furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.27 release notes
added support for rsa-pss signatures in tls 1.2 and tls 1.3 new functions in ssl.h ssl_namedgroupconfig notable changes in nss 3.27 update 2016-10-02: the maximum tls version supported has been increased to tls 1.3 (draft).
...applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.31 release notes
new functions in cert.h cert_getcertisperm - retrieve the permanent storage status attribute of a certificate in a thread safe way.
...furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.33 release notes
new functions in cert.h cert_findcertbyissuerandsncx - a variation of existing function cert_findcertbyissuerandsn that accepts an additional password context parameter.
...furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.34.1 release notes
new in nss 3.34 new functionality none new functions bugs fixed in nss 3.34.1 this bugzilla query returns all the bugs fixed in nss 3.34.1: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.34.1 compatibility nss 3.34.1 shared libraries are backward compatible with all older nss 3.x shared libraries.
...furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.34 release notes
new functions bugs fixed in nss 3.34 this bugzilla query returns all the bugs fixed in nss 3.34: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.34 compatibility nss 3.34 shared libraries are backward compatible with all older nss 3.x shared libraries.
...furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.36.7 release notes
bugs fixed in nss 3.36.7 bug 1507135 and bug 1507174 - add additional null checks to several cms functions to fix a rare cms crash.
...furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.38 release notes
new functions in secitem.h secitem_makeitem - allocate and make an item with the requested contents new macros in ssl.h ssl_record_size_limit - used to control the tls record size limit extension notable changes in nss 3.38 fixed cve-2018-0495 in bug 1464971.
...furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.39 release notes
new functions in cert.h cert_getcertkeytype - query the key type associated with the given certificate.
...furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.40.1 release notes
this is a patch release to fix cve-2018-12404 new functions none bugs fixed in nss 3.40.1 bug 1485864 - cache side-channel variant of the bleichenbacher attack (cve-2018-12404) compatibility nss 3.40.1 shared libraries are backward compatible with all older nss 3.x shared libraries.
...furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.40 release notes
nss 3.40 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_40_rtm/src/ new in nss 3.40 new functionality the draft-00 version of encrypted sni support is implemented tstclnt now takes -n option to specify encrypted sni key new functions none notable changes in nss 3.40 the mozilla::pkix library has been ported from mozilla psm to nss.
...furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.41.1 release notes
bugs fixed in nss 3.41.1 bug 1507135 and bug 1507174 - add additional null checks to several cms functions to fix a rare cms crash.
...furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.41 release notes
bug 1493215 - enabled the following ciphersuites by default: tls_ecdhe_ecdsa_with_aes_256_gcm_sha384 tls_ecdhe_rsa_with_aes_256_gcm_sha384 tls_dhe_rsa_with_aes_256_gcm_sha384 tls_rsa_with_aes_256_gcm_sha384 new functions none notable changes in nss 3.41 the following ca certificates were added: cn = certigna root ca sha-256 fingerprint: d48d3d23eedb50a459e55197601c27774b9d7b18c94d5a059511a10250b93168 cn = gts root r1 sha-256 fingerprint: 2a575471e31340bc21581cbd2cf13e158463203ece94bcf9d3cc196bf09a5472 cn = gts root r2 sha-256 fingerprint: c45d7bb08e6d67e62e4235110b56...
...furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.42.1 release notes
bugs fixed in nss 3.42.1 bug 1507135 and bug 1507174 - add additional null checks to several cms functions to fix a rare cms crash.
...furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.43 release notes
new in nss 3.43 new functionality new functions in sechash.h hash_gethashoidtagbyhashtype - convert type hash_hashtype to type secoidtag in sslexp.h ssl_sendcertificaterequest - allow server to request post-handshake client authentication.
...furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.44 release notes
new in nss 3.44 new functionality new functions in lib/certdb/cert.h cert_getcertificateder - access the der-encoded form of a certcertificate.
...furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.48 release notes
bugs fixed in nss 3.48 bug 1600775 - require nspr 4.24 for nss 3.48 bug 1593401 - fix race condition in self-encrypt functions bug 1599545 - fix assertion and add test for early key update bug 1597799 - fix a crash in nssckfwobject_getattributesize bug 1591178 - add entrust root certification authority - g4 certificate to nss bug 1590001 - prevent negotiation of versions lower than 1.3 after helloretryrequest bug 1596450 - added a simplified and unified mac implementation for hmac and cmac behind pkcs#11 bug 152220...
...furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
nss tech note5
</big></big><big><big>size_of_key_that_was_wrapped_bytes);</big></big> clean up pk11_freesymkey(tobewrappedsymkey); <big>secitem_freeitem(&wrappedkey, pr_true);</big> if (wrappingpubkey) seckey_destroypublickey(wrappingpubkey); if (unwrappingpvtkey) seckey_destroyprivatekey(unwrappingpvtkey); pk11_freeslot(slot); also look at a sample program that uses the above functions.
... <big>sign & verify data</big> seckeyprivatekey *pvtkey; secitem signature; secitem data; secstatus s = pk11_sign(pvtkey, &signature, &data); seckeypublickey *pubkey; secstatus s = pk11_verify(pubkey, &signature, &data, null); misc useful functions get the best wrapping mechanism supported by a slot ck_mechanism_type mech = pk11_getbestwrapmechanism(pk11slotinfo *slot); <big>get the best slot for a certain mechanism</big> pk11slotinfo* slot = pk11_getbestslot(mechanism, null); <big>get the best key length for a certain mechanism on a given slot</big> int keylen = pk11_getbestkeylength(pk11slotinfo *slot, mechanism); get...
NSS release notes template
new functions in ___.h function - description new types in ___.h type - description.
...furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
PKCS #11 Module Specs
moduledb - this library includes nss specific functions to supply additional module specs for loading.
... moduledbonly - this library has no pkcs #11 functions and is only used for loading additional modules.
FC_InitPIN
fc_initpin() must be called when the pkcs #11 security officer (so) is logged into the token and the session is read/write, that is, the session must be in the "r/w so functions" state (cks_rw_so_functions).
... ckr_user_not_logged_in: the session is not in the "r/w so functions" state.
FC_Initialize
only some of the lock functions were provided by the application.
...the nss cryptographic module always uses os locking and doesn't know how to use the lock functions provided by the application.
NSS_3.12.3_release_notes.html
modt.h: secmod_seed_flag in secoidt.h: sec_oid_seed_cbc in sslproto.h: tls_rsa_with_seed_cbc_sha in sslt.h: ssl_calg_seed new structure for seed support: (see blapit.h) seedcontextstr seedcontext new functions in the nss shared library: cert_rfc1485_escapeandquote (see cert.h) cert_comparecerts (see cert.h) cert_registeralternateocspaiainfocallback (see ocsp.h) pk11_getsymkeyhandle (see pk11pqg.h) util_setforkstate (see secoid.h) nss_getalgorithmpolicy (see secoid.h) nss_setalgorithmpolicy (see secoid.h) for the 2 functions a...
... furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
Necko walkthrough
has onstartrequest, onstoprequest, ondataavailable, the three functions in which channel responses are received asynchronously.
... these functions call nsistreamlistener::onstartrequest, nsistreamlistener::ondataavailable and nsistreamlistener::onstoprequest respectively.
Pork Tools
outparamdel outparamdel converts functions to return via return value instead of an outparam.
... it takes a list of functions as input and rewrites the definition and call sites of those functions.
Rhino JavaScript compiler
note that the top-level functions available to the shell (such as print) are not available to compiled scripts when they are run outside the shell.
...functions and scripts compiled this way cannot be decompiled.
Tracing JIT
the architecture-specific methods found in these files are the only functions within nanojit or tracemonkey that emit raw bytes of machine-code into memory.
... the native code of the trace runs, modifying the state structure and native stack, as well as calling native spidermonkey c functions, and reading from and writing to objects in the spidermonkey heap.
JS::Handle
functions which take gc things or values as arguments and need to root those arguments should generally use handles for those arguments and avoid any explicit rooting.
...first, when several such functions call each other then redundant rooting of multiple copies of the gc thing can be avoided.
JS::Value
a c++ variable of type js::value represents a value in javascript: a string, number, object (including arrays and functions), boolean, symbol, null, or undefined.
... the data in a js::value can be accessed using these member functions: js type js::value type tests constructor accessors mutators null val.isnull() js::nullvalue() n/a val.setnull() undefined val.isundefined() js::undefinedvalue() n/a val.setundefined() boolean val.isboolean(), val.istrue(), val.isfalse() js::booleanvalue(bool), js::truevalue(), js::falsevalue() val.toboolean() val.setboolean(bool) number val.isint32(), val.isdouble(), val.isnumber() js::numbervalue(any number type), js::int32value(int32_t), js::doublevalue(double),...
JSObjectPrincipalsFinder
the two debugger functions js_stackframeprincipals and js_evalframeprincipals also use this callback.
... since it is very common for jsobjectops.checkaccess or jsclass.checkaccess hooks to call these functions, the object principals finder callback is a key security feature.
JSPrincipals
the data content of a principals object is defined by the application, which creates instances of jsprincipals, initializes their refcount fields to 1, and passes them into the engine through the js_...forprincipals functions.
...these functions ensure that the given jsprincipals object is indelibly associated not only with the script being compiled or evaluated, but with all functions ever created by that script or code eval()-ed by it.
JS_CStringsAreUTF8
these functions have been removed in spidermonkey 19.
... api users should switch to functions which take utf-8 explicitly or handle their own string encoding and decoding.
JS_ConstructObject
neither of these functions is quite like the javascript new keyword.
... the new object created by these functions is subject to garbage collection.
JS_DefinePropertyWithTinyId
except for the tinyid parameter, these functions behave exactly as js_defineproperty and js_defineucproperty.
... see those functions for more details.
JS_DeleteProperty
these functions are identical to js_deleteproperty2 and js_deletepropertybyid2 except that they do not have an out parameter.
... these functions return true on success, regardless of whether a property was actually deleted, and false on error or exception.
JS_ForwardGetPropertyTo
on success, these functions set *vp to the current value of the property, or undefined if obj has no such property, and return true.
... on an error or exception, these functions return false, and the value left in *vp is undefined.
JS_GetGlobalObject
furthermore, some jsapi functions, such as js_executescript, allow the caller to specify a global object in which the script executes.
...second, the context's global object is used as a default value of last resort by functions that need a default parent object (see js_setparent for details) and by js_getscopechain.
JS_GetProperty
on success, these functions set *vp to the current value of the property, or undefined if obj has no such property, and return true.
... on an error or exception, these functions return false, and the value left in *vp is undefined.
JS_GetPropertyAttrsGetterAndSetter
description see js_getpropertyattributes for details about these functions.
... the only difference is that on success, these functions also get the getter and setter functions for the property.
JS_GetPropertyDefault
on success, these functions set *vp to the current value of the property, or def if obj has no such property, and return true.
... on an error or exception, these functions return false, and the value left in *vp is undefined.
JS_LookupProperty
description the functions js_lookupproperty, js_lookupucproperty, js_lookuppropertybyid, js_lookuppropertywithflags, and js_lookuppropertywithflagsbyid search a specified object, obj, for a property with the given name.
... these functions all have similar behavior: the search starts with obj and proceeds along the prototype chain.
JS_SetInterruptCallback
the callback may use this context to call jsapi functions, but it should first use js_setinterruptcallback to set the context's interrupt callback to null.
... description these functions allow setting an interrupt callback that will be called from the js thread some time after any thread triggered the callback using js_requestinterruptcallback.
JS_SetOperationCallback
the callback may use this context to call jsapi functions, but it should first use js_setoperationcallback to set the context's operation callback to null.
... description these functions allow setting an operation callback that will be called from the js thread some time after any thread triggered the callback using js_triggeroperationcallback.
JS_StringHasLatin1Chars
clients can use js_stringhaslatin1chars and can then call either the latin1* or twobyte* functions.
... some functions like js_copystringchars and js_getstringcharat accept both latin1 and twobyte strings.
SpiderMonkey 17
many jsapi types, functions, and callback signatures have changed, though most of them still have the same names and do the same things.
... (the js_get_class macro abstracting away this difference has accordingly been removed.) garbage collection functions now take runtime argument most garbage collection functions now take a runtime argument instead of a context.
SpiderMonkey 24
many jsapi types, functions, and callback signatures have changed, though most of them still have the same names and do the same things.
... js_getprototype, takes context as first argument js_encodestringtobuffer takes add context as first argument, js_newruntime adds a js_[use|no]_helper_threads flag delete property in jsclass definitions now use js_deletepropertystub garbage collection functions now take runtime argument most garbage collection functions now take a runtime argument instead of a context.
SpiderMonkey 45
many jsapi types; functions, and callback signatures, have changed though most functions that have retain their previous name, providing relatively unchanged functionality.
...) js_internjsstring renamed to js_atomizeandpinjsstring (bug 1178581) js_internstringn renamed to js_atomizeandpinstringn (bug 1178581) js_internstring renamed to js_atomizeandpinstring (bug 1178581) js_internucstringn renamed to js_atomizeandpinucstringn (bug 1178581) js_internucstring renamed to js_atomizeandpinucstring (bug 1178581) deleted apis js_getcompartmentstats js_seticumemoryfunctions js_isgcmarkingtracer js_ismarkinggray js_idarraylength js_idarrayget js_destroyidarray js_defaultvalue js_getparent js_setparent js::parsepropertydescriptorobject js_deleteproperty2 js_deletepropertybyid2 js_deleteucproperty2 js_deleteelement2 js_newfunctionbyid js_bindcallable js_decompilefunctionbody js_getlatin1internedstringchars js_gettwobyteinternedstringchars js_newdateo...
Redis Tips
redis data types include: strings hashes lists sets ordered sets (called zsets in redis) transactions publishers and subscribers this table lists some common programming tasks and data structures, and suggests some redis functions or data structures for them: dictionary lookup set, get, setnx, etc.
... > var r = require('redis').createclient(); // and i'll define these utility functions just for this example > function now() { return (new date()).gettime() / 1000 } > function print(err, results) { console.log(json.stringify(results, null, 2)) } whenever someone logs into my site, i record them in my 'last-login' zset.
Mork
MozillaTechMork
you pass in a file to parsefile, select the tables, and then pass in callback functions for the meta-row and row enumeration functions.
...more detail about individual functions can be found by reading the documentation included in morkreader.h.
STEEL
consider using the functions found in appconstants.jsm or services.jsm instead steel is the scriptable thunderbird easy extension library.
... currently, steel has an steeliapplication interface that implements all the functions of extiapplication.
XPCOM array guide
MozillaTechXPCOMGuideArrays
nsielement** aresult) { // no need to call ns_addref - this does it for you melements->queryelementat(0, ns_get_iid(nsielement), (void**)aresult); } // new version, make sure to call ns_addref() // melements is now a nscomarray<nsielement> void getfirstobject(nsielement** aresult) { *aresult = melements[0]; ns_addref(*aresult); } passing as a parameter when passing nscomarray<t> among functions, the convention is to pass by reference.
... passing as a parameter when passing nstarray<t> among functions, the convention is to pass by reference.
Creating the Component Code
the two other includes, nsicomponentmanager.h and nsicomponentregistrar.h, provide functions such as registerfactorylocation that are required to implement the module and factory classes in your code.
...a listing of this and other global xpcom functions is in the xpcom api reference.
Components.utils
getjstestingfunctions() getobjectprincipal() gets the nsiprincipal for the given javascript object.
... makeobjectpropsnormal() ensures that all functions come from the specified object's scope, and aren't cross-compartment wrappers.
Profiling XPCShell
then, the next lines shows the amount of time spend in the functions in that file.
... the line consists of: the compile count of the function; the call count of the function; the functions name; the starting line number; the ending line number; the function's size; the amount of time (in milliseconds) the fastest call took; the time of the slowest call; the average time spend; the total time; the time spend in the function itself is given (that is the total time excluding the time spend in functions called from this function).
nsEmbedCString
operators operator= this operator is a shortcut for the inherited nsacstring::assign family of functions.
... remarks the methods defined on nsembedcstring are implemented as inline wrappers around the xpcom string functions, prefixed with ns_cstring.
nsEmbedString
operators operator= this operator is a shortcut for the inherited nsastring::assign family of functions.
... remarks the methods defined on nsembedstring are implemented as inline wrappers around the xpcom string functions, prefixed with ns_string.
XPCOM glue classes
an object that takes a strong reference to a reference-counted resource that must be released, typically on destruction of the object.</t>nscstringclass declarationnscstring externalclass declarationnscstringcontainer (external)class declaration nscstringencodingthe nscstringencoding enumeration describes the set of character encodings understood by the ns_cstringtoutf16 and ns_utf16tocstring functions.nsdependentcstringclass declarationnsdependentcstring externalclass declarationnsdependentcsubstringclass declarationnsdependentcsubstring externalclass declarationnsdependentstringclass declarationnsdependentstring externalclass declarationnsdependentsubstringclass declarationnsdependentsubstring externalclass declarationnsembedcstringthe nsembedcstring concrete class provides a way to construct...
...this is done using the functions addref() and release(), which respectively modify a variable of type nsautorefcnt, which basically is a wrapper around a count of the number of references refering to the class.nsstringclass declarationnsstring externalclass declarationnsstringcontainer (external)class declarationnssupportsweakreferenceinherit from this c++ class to add canonical support for nsisupportsweakreference.nsxpidlcstrin...
mozIStorageAggregateFunction
it allows consumers to add aggregate functions that are available to sql queries and triggers.
... there are a number of already defined aggregate functions provided by sqlite.
mozIStorageConnection
pass -1 for variable-argument functions.
...pass -1 for variable-argument functions.
mozIStorageFunction
it allows consumers to add functions that are available to sql queries and triggers.
... there are a number of already defined functions provided by sqlite.
mozIStorageStatement
sample code var statement = dbconn.createstatement( "select * " + "from table_name " + "where column_name like :userinput escape '/'" ); statement.params.userinput = statement.escapestringforlike(someuserinput, "/"); binding functions these functions are discussed in more detail with sample code in the overview document.
... execution functions these functions are discussed in more detail with sample code in the overview document.
nsIAnnotationService
we may want some other similar functions to get annotations with given flags (once we have flags defined).
...we may want some other similar functions to get annotations with given flags (once we have flags defined).
nsIDOMWindowInternal
it provides many of the common functions used in javascript such as alert() or open().
... note: because most of nsidomwindowinternal's functions and attributes are well documented in window, those articles are linked to rather than re-documented.
nsIDOMWindowUtils
ime_status_enabled 1 users can use all functions of ime.
... ime_status_password 2 users cannot use most ime functions.
nsIFaviconService
unlike the other get functions, we needn't have heard of the page or its favicon: the default one will be returned in this case.
...the rest of the functions here will always store favicons even when history is disabled.
Building an Account Manager Extension
prefpanel-devmo-account=devmo demo panel step4: the new panel and javascript the javascript for an account manager panel needs to implement at least the following functions.
... these functions are invoked by the account manager.
nsIMsgDBHdr
there are utility functions that also return it though.
... headers are backed by the database: a call to these functions directly modifies the state of the database, although it is not saved until the database is committed.
nsIStringBundle
intl/strres/nsistringbundle.idlscriptable this interface provides functions for retrieving both formatted and unformatted strings from a properties file.
...it is recommended that you use the methods of xul:stringbundle to access these functions unless necessary.
nsIStringBundleService
this string bundle has functions available on it.
... on the return value object on you can call functions like getstringfromname and formatstringfromname see nsistringbundle.
nsITelemetry
return value the returned jsval object has the following functions: add(value) - adds an integer value to the appropriate bucket snapshot() - returns a snapshot of the histogram with the same data fields as in histogramsnapshots.
... return value the returned jsval object has the following functions: add(key, [optional] value) - adds an integer value to the appropriate bucket.
Reference Manual
nscomptr<nsifoo> foo( getter_addrefs(createafoo()) ); // |getter_addrefs| is a synonym for |dont_addref| that may look better to // you when applied to functions that return |addref|ed pointers nscomptr<nsifoo> foo( dont_addref(createafoo()) ); // or, maybe you don't like it better...
...many xpcom functions return interface pointers as results through parameters, e.g., // getters can return interface pointers through "out" parameters...
XPCOM ownership guidelines
all "factory" and "getter" functions produce owning pointers.
...this is terrific for factory functions, but can be problematic for mere getters.
Working with windows in chrome code
technically speaking, it implements a number of interfaces, including nsidomjswindow and nsidomwindow, but it also contains the user-defined properties for global variables and functions of the window.
...you could declare a local variable in each window along with corresponding setter functions to keep the "instances" of the variable in sync across windows, but fortunately, there's a better way.
Add to iPhoto
the string can be stored in any of a number of encodings, so you use assorted functions that know how to cope with different encodings to set and get values of cfstrings, as well as to perform typical string operations.
...all cfarray functions accept cfmutablearray objects, so you can use cfmutablearray with any routine that accepts a cfarray as input, but cfmutablearray supports additional functions that let you change the contents of the array.
Plug-in Development Overview - Plugins
caution: gecko caches the values returned by these functions and will only call it if the plug-in's timestamp has changed.
...in streams produced by the plug-in, by contrast, the plug-in calls netscape functions to create a stream, push data into it, and delete it.
Streams - Plugins
« previousnext » this chapter describes using plug-in api functions to receive and send streams.
... note: if you want to be sure that the npn_*stream functions are called in the order you want and behave the way you expect, combine npn_newstream, npn_write, and npn_destroy_stream in the same callback.
UI Tour - Firefox Developer Tools
ignore source causes the debugger to skip the file when "stepping into" functions; this can be helpful for avoiding stepping into libraries used by your code.
... ignore source causes the debugger to skip the file when "stepping into" functions.
Debugger.Environment - Firefox Developer Tools
spidermonkey creates exactly one debugger.environment instance for each environment it presents via a given debugger instance: if the debugger encounters the same environment through two different routes (perhaps two functions have closed over the same environment), spidermonkey presents the same debugger.environment instance to the debugger each time.
...for example, functions whose locals are never aliased may present optimized-out environments.
Debugger.Source - Firefox Developer Tools
if a single piece of source code contains both top-level code and function definitions, perhaps with nested functions, then the debugger.script instances for those all refer to the same debugger.source instance.
...(note that one may assign both strings and functions to dom elements’ event handler idl attributes.
Debugger-API - Firefox Developer Tools
you can set functions to be called when new stack frames are pushed; when new code is loaded; and so on.
... [object wrapper][wrapper] functions help manipulate object references that cross privilege boundaries.
UI Tour - Firefox Developer Tools
flame chart if the call tree tells you, statistically, which functions your site is spending most time executing across the whole recording, the flame chart tells you the call stack at any given point during the recording: to learn much more about the flame chart, see the separate flame chart page.
... the allocations view is like the call tree view, but for allocations: it shows you which functions in your page are allocating the most memory over the course of the profile.
Performance - Firefox Developer Tools
you get four sub-tools to examine aspects of the profile in more detail: the waterfall shows the different operations the browser was performing, such as executing layout, javascript, repaints, and garbage collection the call tree shows the javascript functions in which the browser spent most of its time the flame chart shows the javascript call stack over the course of the recording the allocations view shows the heap allocations made by your code over the course of the recording.
... flame chart see which javascript functions are executing, and when, over the course of the recording.
Console messages - Firefox Developer Tools
async stack frames stack traces show stack frames for async functions separately from those for synchronous functions.
... this site makes use of a sha-1 certificate; it's recommended you use certificates with signature algorithms that use hash functions stronger than sha-1.
Web Console Helpers - Firefox Developer Tools
the commands the javascript command line provided by the web console offers a few built-in helper functions that make certain tasks easier.
... let's take a look at the contents of that node by using the $() and inspect() functions: inspect($("#title")) this automatically generates rich output for the object, showing you the contents of the dom node that matches the css selector "#title", which is of course the element with id "title".
The JavaScript input interpreter - Firefox Developer Tools
working with iframes if a page contains embedded iframes, you can use the cd() function to change the console's scope to a specific iframe, and then you can execute functions defined in the document hosted by that iframe.
... function whoareyou() { return "i'm frame1"; } </script> </head> <body> </body> </html> you can switch context to the iframe like this: cd("#frame1"); now you'll see that the global window's document is the iframe: and you can call the function defined in the iframe: helper commands the javascript command line provided by the web console offers a few built-in helper functions that make certain tasks easier.
Background Tasks API - Web APIs
the goal: to be able to add requests to call functions to a queue, with an idle callback that runs those functions whenever the system is idle for long enough a time to make progress.
... let logfragment = null; let statusrefreshscheduled = false; finally, we set up a couple of variables for other items: logfragment will be used to store a documentfragment that's generated by our logging functions to create content to append to the log when the next animation frame is rendered.
Using the CSS Typed Object Model - Web APIs
we can query the length (or number) of transform functions with the .length property.
... had we added translate(), skew(), and rotate() transform functions, the length would have been 4, each with their own x, y, z values, and each with an .is2d property.
Compositing example - Web APIs
unction() { // lum in srgb var lum = { r: 0.33, g: 0.33, b: 0.33 }; // resize canvas canvas1.width = width; canvas1.height = height; canvas2.width = width; canvas2.height = height; lightmix() colorsphere(); runcomposite(); return; }; and this code, runcomposite(), handles the bulk of the work, relying on a number of utility functions to do the hard parts.
...illstyle = "rgba(0,0,0,0.8)"; ctx.fillrect(0, height/2 - 20, width/2, 20); ctx.fillstyle = "#fff"; ctx.font = "14px arial"; ctx.filltext('new content', 5, height/2 - 5); ctx.restore(); dd.appendchild(canvastodrawon); dd.appendchild(canvastodrawfrom); dd.appendchild(canvastodrawresult); dl.appendchild(dd); } }; utility functions the program relies on a number of utility functions.
DedicatedWorkerGlobalScope - Web APIs
some additional global functions, namespaces objects, and constructors, not typically associated with the worker global scope, but available on it, are listed in the javascript reference.
... see also: functions available to workers.
EXT_shader_texture_lod - Web APIs
the ext_shader_texture_lod extension is part of the webgl api and adds additional texture functions to the opengl es shading language which provide the shader writer with explicit control of lod (level of detail).
... glsl built-in functions the following new functions can be used in glsl shader code, if this extension is enabled: vec4 texture2dlodext(sampler2d sampler, vec2 coord, float lod) vec4 texture2dprojlodext(sampler2d sampler, vec3 coord, float lod) vec4 texture2dprojlodext(sampler2d sampler, vec4 coord, float lod) vec4 texturecubelodext(samplercube sampler, vec3 coord, float lod) vec4 texture2dgradext(sampler2d sampler, vec2 p, vec2 dpdx, vec2 dpdy)...
Element: auxclick event - Web APIs
examples in this example we define functions for two event handlers — onclick and onauxclick.
...you also can see the two functions in action by trying the demo out with a multi-button mouse (see it live on github; also see the source code).
GlobalEventHandlers.onauxclick - Web APIs
example in this example we define functions for two event handlers — onclick and onauxclick.
...you can see the two functions in action by trying the demo out with a multi-button mouse (see it live on github; also see the source code).
In depth: Microtasks and the JavaScript runtime environment - Web APIs
a special note about recursive functions—that is, functions which call themselves, possibly over multiple levels of depth or recursion: each recursive call to the function creates a new execution context.
... here we look at how the runtime functions in slightly more detail.
Using IndexedDB - Web APIs
most other asynchronous functions in indexeddb do the same thing - return an idbrequest object with the result or error.
...}; which of the two functions, onsuccess() or onerror(), gets called?
Keyboard - Web APIs
WebAPIKeyboard
the keyboard interface of the the keyboard api provides functions that retrieve keyboard layout maps and toggle capturing of key presses from the physical keyboard.
... methods keyboard.getlayoutmap() returns a promise that resolves with an instance of keyboardlayoutmap which is a map-like object with functions for retrieving the strings associated with specific physical keys.
Navigator - Web APIs
WebAPINavigator
navigator.keyboard read only returns a keyboard object which provides access to functions that retrieve keyboard layout maps and toggle capturing of key presses from the physical keyboard.
...javascript taint/untaint functions removed in javascript 1.2.
Using Pointer Events - Web APIs
convenience functions this example uses two convenience functions that should be looked at briefly to help make the rest of the code more clear.
...) % 16; var b = math.floor(touch.pointerid / 7) % 16; r = r.tostring(16); // make it a hex digit g = g.tostring(16); // make it a hex digit b = b.tostring(16); // make it a hex digit var color = "#" + r + g + b; log("color for touch with identifier " + touch.pointerid + " = " + color); return color; } the result from this function is a string that can be used when calling <canvas> functions to set drawing colors.
SharedWorkerGlobalScope - Web APIs
some additional global functions, namespaces objects, and constructors, not typically associated with the worker global scope, but available on it, are listed in the javascript reference.
... see the complete list of functions available to workers.
SubtleCrypto.sign() - Web APIs
WebAPISubtleCryptosign
the choice of digest algorithm is passed into the generatekey() or importkey() functions.
...an extra property, defining the salt length, is passed into the sign() and verify() functions when they are invoked.
Multi-touch interaction - Web APIs
hold or swipe me 1</div> <div id="target2"> tap, hold or swipe me 2</div> <div id="target3"> tap, hold or swipe me 3</div> <div id="target4"> tap, hold or swipe me 4</div> <!-- ui for logging/bebugging --> <button id="log" onclick="enablelog(event);">start/stop event logging</button> <button id="clearlog" onclick="clearlog(event);">clear the log</button> <p></p> <output></output> miscellaneous functions these functions support the application but aren't directly involved with the event flow.
...nk - two taps // lightblue - more than two taps switch (ev.targettouches.length) { case 1: // single tap` ev.target.style.background = "yellow"; break; case 2: // two simultaneous touches ev.target.style.background = "pink"; break; default: // more than two simultaneous touches ev.target.style.background = "lightblue"; } } event logging the functions are used to log event activity to the application window, to support debugging and learning about the event flow.
Touch events - Web APIs
convenience functions this example uses two convenience functions that should be looked at briefly to help make the rest of the code more clear.
...var b = math.floor(touch.identifier / 7) % 16; r = r.tostring(16); // make it a hex digit g = g.tostring(16); // make it a hex digit b = b.tostring(16); // make it a hex digit var color = "#" + r + g + b; console.log("color for touch with identifier " + touch.identifier + " = " + color); return color; } the result from this function is a string that can be used when calling <canvas> functions to set drawing colors.
URL API - Web APIs
WebAPIURL API
es of individual parameters with the urlsearchparams object's get() method: let addr = new url("https://mysite.com/login?user=someguy&page=news"); try { loginuser(addr.searchparams.get("user")); gotopage(addr.searchparams.get("page")); } catch(err) { showerrormessage(err); } for example, in the above snippet, the username and target page are taken from the query and passed to appropriate functions that are used by the site's code to log in and route the user to their desired destination within the site.
... other functions within urlsearchparams let you change the value of keys, add and delete keys and their values, and even sort the list of parameters.
WebGLRenderingContext.vertexAttribPointer() - Web APIs
keep in mind that these webgl functions have a slow performance and it is better to store the state inside your javascript application.
... however, these functions are great for debugging a webgl context without touching the application code.
WebGL constants - Web APIs
the webgl api provides several constants that are passed into or returned by functions.
... oes_standard_derivatives constant name value description fragment_shader_derivative_hint_oes 0x8b8b indicates the accuracy of the derivative calculation for the glsl built-in functions: dfdx, dfdy, and fwidth.
Introduction to the Real-time Transport Protocol (RTP) - Web APIs
this article provides an overview of what rtp is and how it functions in the context of webrtc.
... note: this example makes use of modern javascript features including async functions and the await expression.
Geometry and reference spaces in WebXR - Web APIs
the following code snippet shows two simple functions, degreestoradians() and radianstodegrees(), which convert back and forth between the two units for measuring angles.
... however, regardless of which type of reference space is being used, you can use the same functions to convert coordinates from space to parent space.
Window.external - Web APIs
WebAPIWindowexternal
the external property of the window api returns an instance of the external interface, which was intended to contain functions related to adding external search providers to the browser.
... however, this is now deprecated, and the contained methods are now dummy functions that do nothing as per spec.
Cognitive accessibility - Accessibility
people with cognitive disabilities may require more time to read content, or to perform functions such as filling out forms.
... provide consistent labeling identical functions should have similar labels every time they are utilized.
CSS Images - CSS: Cascading Style Sheets
reference properties image-orientation image-rendering image-resolution object-fit object-position functions linear-gradient() radial-gradient() repeating-linear-gradient() repeating-radial-gradient() conic-gradient() repeating-conic-gradient() url() element() image() cross-fade() data types <gradient> <image> guides using css gradients presents a specific type of css images, gradients, and how to create and use these.
... living standard standardizes the -webkit prefixed gradient value functions css values and units module level 3the definition of '<url>' in that specification.
Linear-gradient Generator - CSS: Cascading Style Sheets
activeaxis.deactivate();="" axis="lg_axes[getorderid(axisid)];" axis)="" axisid)="" for="" getorderid="function" getorderid(axisid)="" i="0;" i++)="" i;="" i<len;="" ids[lg_axes[i].id]="true;" idx++;="" idx;="" if="" len="lg_axes.length;" lg_axes.length)="" null)="" return="" return;="" true)="" var="" while="" {="" }="" };=""> 1) delete_axis_btn.removeattribute('data-state'); }; /* axis functions */ var updateaxisrotation = function updateaxisrotation(value) { activeaxis.setaxisangle(value); }; var setaxisunit = function setaxisunit(obj) { activeaxis.setunit(obj.value); }; var setaddaxisbutton = function setaddaxisbutton() { add_axis_btn = getelembyid('add-axis'); add_axis_btn.addeventlistener('click', function() { if (lg_axes.length === 4) return; c...
...ntlistener('click',="" code="prefix" container="" container.setattribute('data-alpha',="" container;="" createstartaxis(-18);="" createstartaxis(18);="" delete_point_btn="getelembyid('delete-point');" delete_point_btn.addeventlistener('click',="" delete_point_btn.setattribute('data-state',="" dropdownmanager.init();="" dropdownmanager.subscribe('axis-unit',="" for(var="" function="" function()="" functions="" general="" gradient="[];" gradient.join(',\n="" gradient.push(lg_axes[i].getcssgradient());="" gradient_container="getelembyid('gradient-container');" gradient_container.style.background="gradient.join('," i="" i++)="" if="" init="function" init()="" init,="" inputslidermanager.init();="" inputslidermanager.subscribe('point-position',="" k="0;" len="lg_axes.length;" len;="" lg_axes[i].shortcut...
animation-timing-function - CSS: Cascading Style Sheets
: steps(20, jump-none); animation-timing-function: steps(5, jump-both); animation-timing-function: steps(6, start); animation-timing-function: steps(8, end); /* multiple animations */ animation-timing-function: ease, step-start, cubic-bezier(0.1, 0.7, 1.0, 0.1); /* global values */ animation-timing-function: inherit; animation-timing-function: initial; animation-timing-function: unset; timing functions may be specified on individual keyframes in a @keyframes rule.
...the step timing functions divides the input time into a specified number of intervals that are equal in length.
clamp() - CSS: Cascading Style Sheets
WebCSSclamp
the expressions can be math functions (see calc() for more information), literal values, or other expressions, such as attr(), that evaluate to a valid argument type (like <length>), or nested min() and max() functions.
... it is permitted to nest max() and min() functions as expression values, in which case the inner ones are treated as simple parentheses.
font-variant-alternates - CSS: Cascading Style Sheets
ates: swash(user-defined-ident); font-variant-alternates: ornaments(user-defined-ident); font-variant-alternates: annotation(user-defined-ident); font-variant-alternates: swash(ident1) annotation(ident2); /* global values */ font-variant-alternates: initial; font-variant-alternates: inherit; font-variant-alternates: unset; the @font-feature-values at-rule can define names for alternative glyph functions (stylistic, styleset, character-variant, swash, ornament or annotation), associating the name with opentype parameters.
... syntax this property may take one of two forms: either the keyword normal or one or more of the other keywords and functions listed below, space-separated, in any order.
font-variant - CSS: Cascading Style Sheets
stylistic(), historical-forms, styleset(), character-variant(), swash(), ornaments(), annotation() specifies the keywords and functions related to the font-variant-alternates longhand property.
... small-caps, all-small-caps, petite-caps, all-petite-caps, unicase, titling-caps specifies the keywords and functions related to the font-variant-caps longhand property.
min() - CSS: Cascading Style Sheets
WebCSSmin
it is permitted to nest max() and other min() functions as expression values.
... mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.4 | w3c understanding wcag 2.0 examples setting a maximum size for a label and input another use case for css functions is to set a maximum size on responsive form controls: enabling the width of labels and inputs to shrink as the width of the form shrinks.
exsl:object-type() - EXSLT
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes exsl:object-type() returns a string that indicates the type of the specified object.
...this function lets authors of named templates and extension functions easily provide flexibility in parameter values.
regexp:test() - EXSLT
WebEXSLTregexptest
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes regexp:test() tests to see whether a string matches a specified regular expression.
... the character flags are: g global match has no effect for this function; it's allowed for consistency with other regexp functions.
Sets (set) - EXSLT
WebEXSLTset
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the exslt sets package offers functions that let you perform set manipulation.
... the namespace for these functions is http://exslt.org/sets.
User input and controls - Developer guides
for example if you want to add controls when any key gets pressed, you need to add an event listener on the window object: window.addeventlistener("keydown", handlekeydown, true); window.addeventlistener("keyup", handlekeyup, true); where handlekeydown and handlekeyup are the functions implementing the controls about the keydown and keyup events.
... if you want to use touch events, you need to add event listeners and specify handler functions, which will be called when the event gets fired: element.addeventlistener("touchstart", handlestart, false);
 element.addeventlistener("touchcancel", handlecancel, false);
 element.addeventlistener("touchend", handleend, false);
 element.addeventlistener("touchmove", handlemove, false); where element is the dom element you want to register the touch events on.
<input type="color"> - HTML: Hypertext Markup Language
WebHTMLElementinputcolor
if you have colors that are in any other format (such as css color names or css color functions such as rgb() or rgba()), you'll have to convert them to hexadecimal before setting the value.
... reacting to color changes we provide two functions that deal with color changes.
An overview of HTTP - HTTP
WebHTTPOverview
proxies may perform numerous functions: caching (the cache can be public or private, like the browser cache) filtering (like an antivirus scan or parental controls) load balancing (to allow multiple servers to serve the different requests) authentication (to control access to different resources) logging (allowing the storage of historical information) basic aspects of http http is simple http is generally designed to be si...
...cache or authentication methods were functions handled early in http history.
CSS Houdini
<script> css.paintworklet.addmodule('csscomponent.js'); </script> this added module contains registerpaint() functions, which register completely configurable worklets.
... css painting api developed to improve the extensibility of css — allows developers to write javascript functions that can draw directly into an element's background, border, or content via the paint() css function.
Introduction - JavaScript
javascript also supports functions without any special declarative requirements.
... functions can be properties of objects, executing as loosely typed methods.
JavaScript technologies overview - JavaScript
a prototype-based inheritance mechanism built-in objects and functions (json, math, array.prototype methods, object introspection methods, etc.) strict mode browser support as of october 2016, the current versions of the major web browsers implement ecmascript 5.1 and ecmascript 2015, but older versions (still in use) implement ecmascript 5 only.
... other notable apis the settimeout and setinterval functions were first specified on the window interface in html standard.
Private class fields - JavaScript
private static methods may be generator, async, and async generator functions.
... class classwithprivatemethod { #privatemethod() { return 'hello world' } getprivatemessage() { return this.#privatemethod() } } const instance = new classwithprivatemethod() console.log(instance.getprivatemessage()) // expected output: "hello worl​d" private instance methods may be generator, async, or async generator functions.
Public class fields - JavaScript
these are often utility functions, such as functions to create or clone objects.
... you may make use of generator, async, and async generator functions.
Classes - JavaScript
defining classes classes are in fact "special functions", and just as you can define function expressions and function declarations, the class syntax has two components: class expressions and class declarations.
...static methods are often used to create utility functions for an application.
SyntaxError: missing formal parameter - JavaScript
declaring functions and calling functions are two separate steps.
...y") { return greeting; }; // syntaxerror: missing formal parameter function log({ obj: "value"}) { console.log(arg) }; // syntaxerror: missing formal parameter you will need to use identifiers in function declarations: function square(number) { return number * number; }; function greet(greeting) { return greeting; }; function log(arg) { console.log(arg) }; you can then call these functions with the arguments you like: square(2); // 4 greet("howdy"); // "howdy" log({obj: "value"}); // object { obj: "value" } ...
TypeError: Reduce of empty array with no initial value - JavaScript
in javascript, there are several reduce functions: array.prototype.reduce(), array.prototype.reduceright() and typedarray.prototype.reduce(), typedarray.prototype.reduceright()).
... these functions optionally take an initialvalue (which will be used as the first argument to the first call of the callback).
SyntaxError: "use strict" not allowed in function with non-simple parameters - JavaScript
message edge: cannot apply strict mode on functions with non-simple parameter list firefox: syntaxerror: "use strict" not allowed in function with default parameter syntaxerror: "use strict" not allowed in function with rest parameter syntaxerror: "use strict" not allowed in function with destructuring parameter chrome: syntaxerror: illegal 'use strict' directive in function with non-simple parameter list error type syntaxerror.
... a "use strict" directive is written at the top of a function that has one of the following parameters: default parameters rest parameters destructuring parameters a "use strict" directive is not allowed at the top of such functions per the ecmascript specification.
SyntaxError: function statement requires a name - JavaScript
you'll need to check how functions are defined and if you need to provide a name for it, or if the function in question needs to be a function expression, an iife, or if the function code is placed correctly in this context at all.
...you will need a few more braces in this case: (function () { })(); labeled functions if you are using function labels, you will still need to provide a function name after the function keyword.
Default parameters - JavaScript
function append(value, array = []) { array.push(value) return array } append(1) // [1] append(2) // [2], not [1, 2] this even applies to functions and variables: function callsomething(thing = something()) { return thing } let numberoftimescalled = 0 function something() { numberoftimescalled += 1 return numberoftimescalled } callsomething() // 1 callsomething() // 2 earlier parameters are available to later default parameters parameters defined earlier (to the left) are available to later default parameters: function greet(n...
... this means that functions and variables declared in the function body cannot be referred to from default value parameter initializers; attempting to do so throws a run-time referenceerror.
Array.prototype.reduce() - JavaScript
const numbers = [-5, 6, 2, 0,]; const doubledpositivenumbers = numbers.reduce((accumulator, currentvalue) => { if (currentvalue > 0) { const doubled = currentvalue * 2; accumulator.push(doubled); } return accumulator; }, []); console.log(doubledpositivenumbers); // [12, 4] running promises in sequence /** * runs promises from array of functions that can return promises * in chained manner * * @param {array} arr - promise arr * @return {object} promise object */ function runpromiseinsequence(arr, input) { return arr.reduce( (promisechain, currentfunction) => promisechain.then(currentfunction), promise.resolve(input) ) } // promise function 1 function p1(a) { return new promise((resolve, reject) => { resolve(a * 5)...
... new promise((resolve, reject) => { resolve(a * 4) }) } const promisearr = [p1, p2, f3, p4] runpromiseinsequence(promisearr, 10) .then(console.log) // 1200 function composition enabling piping // building-blocks to use for composition const double = x => x + x const triple = x => 3 * x const quadruple = x => 4 * x // function composition enabling pipe functionality const pipe = (...functions) => input => functions.reduce( (acc, fn) => fn(acc), input ) // composed functions for multiplication of specific values const multiply6 = pipe(double, triple) const multiply9 = pipe(triple, triple) const multiply16 = pipe(quadruple, quadruple) const multiply24 = pipe(double, triple, quadruple) // usage multiply6(6) // 36 multiply9(9) // 81 multiply16(16) // 256 multiply24(10) // 24...
Array.prototype.reduceRight() - JavaScript
e = callback(value, t[k], k, t); } } return value; }; } examples sum up all values within an array var sum = [0, 1, 2, 3].reduceright(function(a, b) { return a + b; }); // sum is 6 flatten an array of arrays var flattened = [[0, 1], [2, 3], [4, 5]].reduceright(function(a, b) { return a.concat(b); }, []); // flattened is [4, 5, 2, 3, 0, 1] run a list of asynchronous functions with callbacks in series each passing their results to the next const waterfall = (...functions) => (callback, ...args) => functions.reduceright( (composition, fn) => (...results) => fn(composition, ...results), callback )(...args); const randint = max => math.floor(math.random() * max) const add5 = (callback, x) => { settimeout(callback, randint(1000), x + 5); }; const mult3 = (...
... input); } ​​​​​​difference between reduce and reduceright var a = ['1', '2', '3', '4', '5']; var left = a.reduce(function(prev, cur) { return prev + cur; }); var right = a.reduceright(function(prev, cur) { return prev + cur; }); console.log(left); // "12345" console.log(right); // "54321" defining composible function the concept of compose function is simple it combines n functions.
AsyncFunction - JavaScript
this is less efficient than declaring an async function with an async function expression and calling it within your code, because such functions are parsed with the rest of the code.
... note: async functions created with the asyncfunction constructor do not create closures to their creation contexts; they are always created in the global scope.
Function.arguments - JavaScript
this property is restricted to non-strict functions.
...the recommended way to access the arguments object available within functions is simply to refer to the variable arguments.
Function.prototype.call() - JavaScript
two other functions, food and toy, invoke product, passing this, name, and price.
... product initializes the properties name and price, both specialized functions define the category.
JSON.stringify() - JavaScript
undefined, functions, and symbols are not valid json values.
... var a = json.stringify({ foo: "bar", baz: "quux" }) //'{"foo":"bar","baz":"quux"}' var b = json.stringify({ baz: "quux", foo: "bar" }) //'{"baz":"quux","foo":"bar"}' console.log(a !== b) // true // some memoization functions use json.stringify to serialize arguments, // which may cause a cache miss when encountering the same object like above example of using json.stringify() with localstorage in a case where you want to store an object created by your user and allowing it to be restored even after the browser has been closed, the following example is a model for the applicability of json.stringify(): // creating...
Math.clz32() - JavaScript
// 11111111111111110111111111110111 (32776 inversed, 0 leading zeros) math.clz32(b); // 0 (this is equal to how many leading one's there are in a) using this logic, a clon function can be created as follows: var clz = math.clz32; function clon(integer){ return clz(~integer); } further, this technique could be extended to create jumpless "count trailing zeros" and "count trailing ones" functions as seen below.
...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.
Object.prototype.__proto__ - JavaScript
for functions, this value is function.prototype.
... for objects created using new fun, where fun is one of the built-in constructor functions provided by javascript (array, boolean, date, number, object, string, and so on — including new constructors added as javascript evolves), this value is always fun.prototype.
Promise.prototype.then() - JavaScript
it takes up to two arguments: callback functions for the success and failure cases of the promise.
... if one or both arguments are omitted or are provided non-functions, then then will be missing the handler(s), but will not generate any errors.
Proxy.revocable() - JavaScript
handler an object whose properties are functions define the behavior of proxy p when an operation is performed on it.
...ar proxy = revocable.proxy; console.log(proxy.foo); // "[[foo]]" revocable.revoke(); console.log(proxy.foo); // typeerror is thrown proxy.foo = 1 // typeerror again delete proxy.foo; // still typeerror typeof proxy // "object", typeof doesn't trigger any trap specifications specification ecmascript (ecma-262)the definition of 'proxy revocation functions' in that specification.
Proxy - JavaScript
ust two properties, and an even simpler handler with no properties: const target = { message1: "hello", message2: "everyone" }; const handler1 = {}; const proxy1 = new proxy(target, handler1); because the handler is empty, this proxy behaves just like the original target: console.log(proxy1.message1); // hello console.log(proxy1.message2); // everyone to customise the proxy, we define functions on the handler object: const target = { message1: "hello", message2: "everyone" }; const handler2 = { get: function(target, prop, receiver) { return "world"; } }; const proxy2 = new proxy(target, handler2); here we've provided an implementation of the get() handler, which intercepts attempts to access properties in the target.
... handler functions are sometimes called traps, presumably because they trap calls to the target object.
WebAssembly.Table - JavaScript
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).
... so after instantiation, the table still has length 2, but the elements now contain callable exported webassembly functions which we can call from js.
WebAssembly.instantiateStreaming() - JavaScript
importobject optional an object containing the values to be imported into the newly-created instance, such as functions or webassembly.memory objects.
... instance: a webassembly.instance object that contains all the exported webassembly functions.
Standard built-in objects - JavaScript
infinity nan undefined globalthis function properties these global functionsfunctions which are called globally, rather than on an object—directly return their results to the caller.
...this includes general objects, booleans, functions, and symbols.
Optional chaining (?.) - JavaScript
operator functions similarly to the .
...at this position as well: someinterface?.custommethod?.() dealing with optional callbacks or event handlers if you use callbacks or fetch methods from an object with a destructuring assignment, you may have non-existent values that you cannot call as functions unless you have tested their existence.
delete operator - JavaScript
as such, delete cannot delete any functions in the global scope (whether this is part from a function definition or a function expression).
... functions which are part of an object (apart from the global scope) can be deleted with delete.
function* expression - JavaScript
the main difference between a function* expression and a function* statement is the function name, which can be omitted in function* expressions to create anonymous generator functions.
... see also the chapter about functions for more information.
super - JavaScript
the super keyword is used to access and call functions on an object's parent.
...the super keyword can also be used to call functions on a parent object.
typeof - JavaScript
typeof new boolean(true) === 'object'; typeof new number(1) === 'object'; typeof new string('abc') === 'object'; // functions typeof function() {} === 'function'; typeof class c {} === 'function'; typeof math.sin === 'function'; typeof null // this stands since the beginning of javascript typeof null === 'object'; in the first implementation of javascript, javascript values were represented as a type tag and a value.
... using new operator // all constructor functions, with the exception of the function constructor, will always be typeof 'object' let str = new string('string'); let num = new number(100); typeof str; // it will return 'object' typeof num; // it will return 'object' let func = new function(); typeof func; // it will return 'function' need for parentheses in syntax // parentheses can be used for determining the data type of expressions.
void operator - JavaScript
non-leaking arrow functions arrow functions introduce a short-hand braceless syntax that returns an expression.
...to be safe, when the return value of a function is not intended to be used, it can be passed to the void operator to ensure that (for example) changing apis do not cause arrow functions' behaviors to change.
block - JavaScript
in strict mode, starting with es2015, functions inside blocks are scoped to that block.
... prior to es2015, block-level functions were forbidden in strict mode.
Making PWAs work offline with Service workers - Progressive web apps (PWAs)
registering the service worker we'll start by looking at the code that registers a new service worker, in the app.js file: note : we're using the es6 arrow functions syntax in the service worker implementation if('serviceworker' in navigator) { navigator.serviceworker.register('./pwa-examples/js13kpwa/sw.js'); }; if the service worker api is supported in the browser, it is registered against the site using the serviceworkercontainer.register() method.
... the fetchevent.respondwith method takes over control — this is the part that functions as a proxy server between the app and the network.
SVG Styling Attributes - SVG: Scalable Vector Graphics
WebSVGAttributeStyling
it functions identically to the class attribute in html.
...it functions identically to the style attribute in html.
Tutorials
javascript building blocks in this module, we continue our coverage of all javascript's key fundamental features, turning our attention to commonly-encountered types of code block such as conditional statements, loops, functions, and events.
...you can even create your own objects to encapsulate related functions and variables into efficient packages.
substring - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the substring function returns a part of a given string.
... notes as in other xpath functions, the position is not zero-based.
translate - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the translate function evaluates a string and a set of characters to translate and returns the translated string.
...a future version of xpath may provide additional functions for case conversion.
Index - XPath
WebXPathIndex
17 functions transforming_xml_with_xslt, xpath, xpath_reference, xslt, xslt_reference no summary!
...the snippets are functions you can use in the real world in your own code.
XPath snippets - XPath
this article provides some xpath code snippets—simple examples of how to a few simple utility functions based on standard interfaces from the dom level 3 xpath specification that expose xpath functionality to javascript code.
... the snippets are functions you can use in the real world in your own code.
The Netscape XSLT/XPath Reference - XSLT: Extensible Stylesheet Language Transformations
the following is an alphabetized and annotated list of the elements, axes, and functions from the w3c's 1.0 recommendation for xslt, as well as from the appropriate sections of the xpath recommendation.
...rted) xsl:template (supported) xsl:text (partially supported) xsl:transform (supported) xsl:value-of (partially supported) xsl:variable (supported) xsl:when (supported) xsl:with-param (supported) axes ancestor ancestor-or-self attribute child descendant descendant-or-self following following-sibling namespace (not supported) parent preceding preceding-sibling self functions boolean() (supported) ceiling() (supported) concat() (supported) contains() (supported) count() (supported) current() (supported) document() (supported) element-available() (supported) false() (supported) floor() (supported) format-number() (supported) function-available() (supported) generate-id() (supported) id() (partially supported) key() (supported) lang() (su...
Transforming XML with XSLT - XSLT: Extensible Stylesheet Language Transformations
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes an overview the separation of content and presentation is a key design feature of xml.
...y supported) xsl:template (supported) xsl:text (partially supported) xsl:transform (supported) xsl:value-of (partially supported) xsl:variable (supported) xsl:when (supported) xsl:with-param (supported) axes ancestor ancestor-or-self attribute child descendant descendant-or-self following following-sibling namespace (not supported) parent preceding preceding-sibling self functions boolean() (supported) ceiling() (supported) concat() (supported) contains() (supported) count() (supported) current() (supported) document() (supported) element-available() (supported) false() (supported) floor() (supported) format-number() (supported) function-available() (supported) generate-id() (supported) id() (partially supported) key() (supported) lang() (supported) last...
Caching compiled WebAssembly modules - WebAssembly
function storeindatabase(db, module) { var store = db.transaction([storename], 'readwrite').objectstore(storename); var request = store.put(module, url); request.onerror = err => { console.log(`failed to store in wasm cache: ${err}`) }; request.onsuccess = err => { console.log(`successfully stored ${url} in wasm cache`) }; } using our helper functions with all the promise-based helper functions defined, we can now express the core logic of an indexeddb cache lookup.
...sults => { storeindatabase(db, results.module); return results.instance; }); }) }, note: it is for this kind of usage that webassembly.instantiate() returns both a module and an instance: the module represents the compiled code and can be stored/retrieved in idb or shared between workers via postmessage(); the instance is stateful and contains the callable javascript functions, therefore it cannot be stored/shared.
Compiling an Existing C Module to WebAssembly - WebAssembly
for that, you need to expose two additional functions — one that allocates memory for the image inside wasm and one that frees it up again: #include <stdlib.h> // required for malloc definition emscripten_keepalive uint8_t* create_buffer(int width, int height) { return malloc(width * height * 4 * sizeof(uint8_t)); } emscripten_keepalive void destroy_buffer(uint8_t* p) { free(p); } the create_buffer() function allocates a buffer for the rgb...
...because functions in c can't have arrays as return types (unless you allocate memory dynamically), this example resorts to a static global array.
WebAssembly
exported webassembly functions exported webassembly functions are the javascript reflections of webassembly functions which allow calling webassembly code from javascript.
... instance objects contain all the exported webassembly functions that allow calling into webassembly code from javascript.
port - Archive of obsolete content
this means you can't send functions, and if the object contains methods they won't be encoded.
Communicating using "postMessage" - Archive of obsolete content
to receive a message from the add-on script, use self's on function: self.on("message", function(addonmessage) { // handle the message }); like all event-registration functions, this takes two parameters: the name of the event, and the handler function.
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 strings, but are more often stored as separate files under the add-on's "data" directory.
Content Processes - Archive of obsolete content
each event emitter has two associated emit functions.
Contributor's Guide - Archive of obsolete content
data members are properties that allow each instance to have their own state, whereas member functions are properties that allow instances to have behavior.
Porting the Library Detector - Archive of obsolete content
the content script, which we'll call library-detector.js, will keep most of the logic of the test functions intact.
Two Types of Scripts - Archive of obsolete content
this enables you to call functions like: window.alert("hello there"); in an add-on's main scripts you can't do that, because the add-on code does not execute in the context of a page, and the dom is therefore not available.
Working with Events - Archive of obsolete content
one of the handler functions removes the listener again.
Guides - Archive of obsolete content
classes and inheritance learn how classes and inheritance can be implemented in javascript, using constructors and prototypes, and about the helper functions provided by the sdk to simplify this.
base64 - Archive of obsolete content
var base64 = require("sdk/base64"); var encodeddata = base64.encode("hello, world"); var decodeddata = base64.decode(encodeddata); globals functions encode(data, charset) creates a base-64 encoded ascii string from a string of binary data.
clipboard - Archive of obsolete content
var clipboard = require("sdk/clipboard"); clipboard.set("data:image/png;base64,ivborw0kggoaaaansuheugaaacaaaaagcaya" + "aabzenr0aaaasuleqvryhe3o0qkaiawd0eyqe3q993aq3cbsukpygfsnty" + "n5ugbqpk0baadgp0brdwxwlweaaaaagpsa3rzdaaaaahgpcgrpganzq2fg" + "bwrr9aaaaabjru5erkjggg%3d%3d", "text"); globals functions set(data, datatype) replace the contents of the user's clipboard with the provided data.
hotkeys - Archive of obsolete content
assign hotkey combinations to functions in your add-on.
indexed-db - Archive of obsolete content
the add-on implements helper functions open(), additem() and getitems() to open the database, add a new item to the database, and get all items in the database.
l10n - Archive of obsolete content
globals functions get(identifier, count, placeholder1...n) this function takes a string parameter which it uses as an identifier to look up and return a localized string in the locale currently set for firefox.
notifications - Archive of obsolete content
globals functions notify(options) displays a transient notification to the user.
page-mod - Archive of obsolete content
this means you can't send functions, and if the object contains methods they won't be usable.
request - Archive of obsolete content
arguments response : listener functions are passed the response to the request as a response object.
simple-prefs - Archive of obsolete content
globals functions on(prefname, listener) registers an event listener that will be called when a preference is changed.
system - Archive of obsolete content
var system = require("sdk/system"); system.exit(); globals functions exit(code) quits the host application with the specified code.
tabs - Archive of obsolete content
globals functions open(options) opens a new tab.
timers - Archive of obsolete content
globals constructors functions settimeout(callback, ms) schedules callback to be called in ms milliseconds.
url - Archive of obsolete content
functions tofilename(url) attempts to convert the given url to a native file path.
console/traceback - Archive of obsolete content
globals functions fromexception(exception) attempts to extract the traceback from exception.
content/loader - Archive of obsolete content
usage the module exports a constructor for the loader object, which inherits on(), once(), and removelistener() functions that enable its users to listen to events.
content/symbiont - Archive of obsolete content
it inherits functions to load and configure content scripts from the loader, and functions to exchange messages between content scripts and the main add-on code from the worker.
event/core - Archive of obsolete content
all listeners of the specific type can be easily removed (only two argument must be passed): off(target, 'message'); also, removing all registered listeners is possible (only one argument must be passed): off(target); globals functions on(target, type, listener) registers an event listener that is called every time events of the specified type is emitted on the given event target.
event/target - Archive of obsolete content
users of the object can listen to the events using the standard on() and once() functions.
io/file - Archive of obsolete content
globals functions basename(path) the path parameter must be an absolute path, relative paths will cause an error.
loader/sandbox - Archive of obsolete content
load(scope, 'resource://path/to/my/script.js'); load(scope, 'file:///path/to/script.js'); load(scope, 'data:,var a = 5;'); globals functions sandbox(source) make a new sandbox that inherits principals from source.
net/url - Archive of obsolete content
globals functions readuri(uri, options) reads a uri and returns a promise.
net/xhr - Archive of obsolete content
functions forceallowthirdpartycookie(xhr) force relevant cookies to be sent with this xmlhttprequest even if normally they would not be.
preferences/service - Archive of obsolete content
globals functions set(name, value) sets the application preference name to value.
remote/child - Archive of obsolete content
each frame then has a content property that's the top-level dom window for the frame, and addeventlistener/removeeventlistener functions that enable you to listen to dom events dispatched by the frame.
remote/parent - Archive of obsolete content
his` is bound to the frame the event came from let frame = this; frame.port.emit("pageshow"); }, true); // main.js const { frames, remoterequire } = require("sdk/remote/parent"); remoterequire("./remote.js", module); // the first argument is the frame the message came from frames.port.on("pageshow", (frame) => { console.log(frame.frameelement.currenturi.host + ": pageshow"); }); globals functions remoterequire(id, module = null) loads a module in any existing and future child processes.
stylesheet/style - Archive of obsolete content
those functions are part of content/mod module.
system/events - Archive of obsolete content
var events = require("sdk/system/events"); var { ci } = require("chrome"); function listener(event) { var channel = event.subject.queryinterface(ci.nsihttpchannel); channel.setrequestheader("user-agent", "mybrowser/1.0", false); } events.on("http-on-modify-request", listener); globals functions emit(type, event) send an event to observer service parameters type : string the event type.
system/unload - Archive of obsolete content
globals functions ensure(object, name) calling ensure() on an object does two things: it replaces a destructor method with a wrapper method that will never call the destructor more than once.
system/xul-app - Archive of obsolete content
globals functions is(name) checks whether the host application is the given application.
ui/button/action - Archive of obsolete content
otherwise, it functions as a getter and returns the button's state for the specified object.
ui/button/toggle - Archive of obsolete content
otherwise, it functions as a getter and returns the button's state for the specified object.
ui/id - Archive of obsolete content
globals functions identify(object) makes and/or gets a unique id for the input.
util/collection - Archive of obsolete content
functions addcollectionproperty(object, propname, [backingarray]) adds a collection property to the given object.
util/list - Archive of obsolete content
: object|string|number functions addlistitem(list, item) function adds a item to a list.
util/uuid - Archive of obsolete content
generate uuid to generate a new uuid, call uuid() with no arguments: let uuid = require('sdk/util/uuid').uuid(); parsing uuid to convert a string representation of a uuid to an nsid, pass the string representation to uuid(): let { uuid } = require('sdk/util/uuid'); let firefoxuuid = uuid('{ec8030f7-c20a-464f-9b0e-13a3a9e97384}'); globals functions uuid(stringid) generate a new uuid, or convert a string representation of a uuid to an nsid.
Release notes - Archive of obsolete content
throttle() and debounce() functions added to lang/functional.
Displaying annotations - Archive of obsolete content
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.
Creating Reusable Modules - Archive of obsolete content
} return path; } hash function firefox has built-in support for hash functions, exposed via the nsicryptohash xpcom interface the documentation page for that interface includes an example of calculating an md5 hash of a file's contents, given its path.
Modifying Web Pages Based on URL - Archive of obsolete content
communicating with the content script your add-on script and content scripts can't directly access each other's variables or call each other's functions, but they can send each other messages.
Modifying the Page Hosted by a Tab - Archive of obsolete content
d: "load-several", label: "load several scripts", icon: "./icon-16.png", onclick: function () { tabs.activetab.attach({ contentscriptfile: [self.data.url('first.js'), self.data.url('second.js')] }); } }); communicating with the content scripts your add-on script and content scripts can't directly access each other's variables or call each other's functions, but they can send each other messages.
Dialogs and Prompts - Archive of obsolete content
?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?> <dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="..." title="..." buttons="accept,cancel" ondialogaccept="return onaccept();" ondialogcancel="return oncancel();"> <script src="chrome://..."/> <!-- content --> </dialog> you need to implement onaccept and oncancel functions in your script.
Finding window handles - Archive of obsolete content
.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 = ctypes.voidptr_t; let sel = ctypes.voidptr_t; // constants let nil = ctypes.voidptr_t(0); //common functions let sel_registername = objc.declare('sel_registername', ctypes.default_abi, sel, ctypes.char.ptr); let objc_msgsend = objc.declare('objc_msgsend', ctypes.default_abi, id, id, sel, '...'); /* https://developer.apple.com/library/mac/documentation/cocoa/reference/applicationkit/classes/nsapplication_class/index.html#//apple_ref/occ/instp/nsapplication/orderfront: * [nswindowptr orderfront:nil] ...
HTML to DOM - Archive of obsolete content
the returned <body> object is of type element here is a sample that counts the number of paragraphs in a string: var dompars = htmlparser('<p>foo</p><p>bar</p>'); alert(dompars.getelementsbytagname('p').length); if htmlparser() returns the element name html (instead of body), you have all document object with its complete functions list, therefore you can retrieve info within div tag like this: var dompars = htmlparser("<div id='userinfo'>john was a mediocre programmer, but people liked him <strong>anyway</strong>.</div>"); alert(dompars.getelementbyid('userinfo').innerhtml); to parse a complete html page, load it into an iframe whose type is content (not chrome).
Preferences - Archive of obsolete content
you can get both trees using the nsiprefservice.getbranch() and nsiprefservice.getdefaultbranch() functions.
Progress Listeners - Archive of obsolete content
}, // for definitions of the remaining functions see related documentation onprogresschange: function(awebprogress, arequest, curself, maxself, curtot, maxtot) {}, onstatuschange: function(awebprogress, arequest, astatus, amessage) {}, onsecuritychange: function(awebprogress, arequest, astate) {} } attach the progress listener to a <browser> or a <tabbrowser> element using addprogresslistener, for example for firefox put the foll...
QuerySelector - Archive of obsolete content
// if you'd like to convert it to a array for convenience, use this instead: // return array.prototype.slice.call(el.queryselectorall(selector)); } alert($('#myid').id); (note that while using the firefox web console, the above functions are available automatically.) both xul and even xml can be easily made supportable (an alternative approach to the following would be to add chromewindow.prototype or window.prototype, accessing this.document.queryselector, or following the jquery style of chaining by returning 'this' within each prototype method of $()): htmldocument.prototype.$ = function (selector) { // only for html retur...
xml:base support in old browsers - Archive of obsolete content
these two functions aim to allow some support for xml:base.
Code snippets - Archive of obsolete content
this lets you access data in typed arrays using c-like string functions.
Displaying web content in an extension without security issues - Archive of obsolete content
vent);"/> and the event handler would look like that: function handlebrowserclick(event) { // only react to left mouse clicks if (event.button != 0) return; // default action on link clicks is to go to this link, cancel it event.preventdefault(); if (event.target instanceof htmlanchorelement && event.target.href) openlinkinbrowser(event.target.href); } safe html manipulation functions when it comes to displaying the data, it is tempting to generate some html code and to insert it into the document via innerhtml.
Downloading JSON and JavaScript in extensions - Archive of obsolete content
json is about state and does not allow functions to be decoded.
Enhanced Extension Installation - Archive of obsolete content
uninstallation, disabling, enabling these functions work on the same principle as installation - the user requests an action through the ui while the application is running and metadata is written (tobeuninstalled, tobedisabled, tobeenabled) and a .autoreg file created in the profile so that on the subsequent startup the extension system's startup routine can remove files (in the uninstall case) and write a new extensions.ini file listing the dire...
Extension Etiquette - Archive of obsolete content
theming if you have xul buttons in your extension that do functions similar to ones that already exist in a browser — for example, a feed reader that reloads and stops — use icons from the browser's theme.
Interaction between privileged and non-privileged pages - Archive of obsolete content
* @see <https://developer.mozilla.org/docs/code_snippets/ * interaction_between_privileged_and_non-privileged_pages#security_notes> */ function geteventdata(event) { if (event.target.ownerdocument != targetdoc) throw "event from unexpected source"; return new xml(event.target.getattribute("eventdatafrompage")); } security notes never invoke the web page's javascript functions from your extension - doing this increases the chance of creating a security hole, where a malicious web page can trick the browser to run its code with extended privileges (just like your extension) with, for example, the ability to delete local files.
Listening to events in Firefox extensions - Archive of obsolete content
if you call javascript functions as part of the pageshow event, you can ensure these functions are called when the page is loaded in browsers other than firefox 1.5 by calling the pageshow event as part of the load event, as shown in the sample later in this article.
Migrating raw components to add-ons - Archive of obsolete content
it allows javascript code to load functions from dlls on windows, and should allow you to eliminate your dependence on binary components entirely.
Appendix: What you should know about open-source software licenses - Archive of obsolete content
modifying software would be changing its functionality or adding new functions.
Chapter 6: Firefox extensions and XUL applications - Archive of obsolete content
with functions that include a lot of variables, this will be hard to read, so you can point out specific variables that you want to watch (figure 4).
Adding menus and submenus - Archive of obsolete content
dom functions like createelement and appendchild can be used to accomplish this.
Adding sidebars - Archive of obsolete content
even handling the construction of a tree using javascript and dom functions can become very convoluted, which is why trees are better used along with templates.
Appendix F: Monitoring DOM changes - Archive of obsolete content
monkey patching in many instances, especially when dealing with chrome code, the best way to modify actions which result in dom mutations is by wrapping the functions that trigger those changes.
Getting Started with Firefox Extensions - Archive of obsolete content
the mozilla add-ons repository (amo) holds an extensive number of extensions with a wide variety of functions: content filtering (adblock plus, noscript), web application interaction (delicious bookmarks, ebay companion) and web development (dom inspector, firebug).
Handling Preferences - Archive of obsolete content
each source is a js file that contains some special functions not available in regular code.
Intercepting Page Loads - Archive of obsolete content
it is full of useful functions, so you should always keep it in mind when you want to handle tabs and web content windows.
Local Storage - Archive of obsolete content
don't log inside functions that are called too often, such as mouseover event handlers, or certain http activity listeners.
Observer Notifications - Archive of obsolete content
you could do that by calling all those functions directly, but xpcom offers you a better and cleaner way to achieve that using observers and the observer service.
Setting Up a Development Environment - Archive of obsolete content
building idl files some extensions require developing xpcom components to add certain advanced functions.
XPCOM Objects - Archive of obsolete content
most of the objects and functions in the lower layers are hidden from the chrome; those that need to be publicized are exposed through xpcom components and interfaces.
Performance best practices in extensions - Archive of obsolete content
defer everything that you can most extensions have a load event listener in the main overlay that runs their startup functions.
Session store API - Archive of obsolete content
deleting a value associated with a tab to delete a value from a tab, you can use code similar to the following: var ss = components.classes["@mozilla.org/browser/sessionstore;1"] .getservice(components.interfaces.nsisessionstore); var currenttab = gbrowser.selectedtab; ss.deletetabvalue(currenttab, "key-name-here"); remarks the window value save and restore functions work exactly like the tab-based functions by similar names.
Promises - Archive of obsolete content
the following examples make use of the task api, which harnesses generator functions to remove some of the syntactic clutter of raw promises, such that asynchronous promise code more closely resembles synchronous, procedural code.
Using Dependent Libraries In Extension Components - Archive of obsolete content
} 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); } extensions/stub/bdsstubloader.cpp (for mac os x) the code as written above won't work for mac os x.
Creating reusable content with CSS and XBL - Archive of obsolete content
in this demonstration, the square and the button make a self-contained widget that functions within an html document.
JXON - Archive of obsolete content
the parker convention the functions listed above for the conversion of an xml document to json (often called "jxon algorithms") are more or less freely based on the parker convention (especially regarding the transformation of tags names into object properties names, the recognition of the typeof of all the collected text content of each tag and the absorption of solitary text and/or cdatasection nodes into primitive values).
Source Navigator - Archive of obsolete content
with it, you can edit your source code, display relationships between classes and functions and members, and display call trees.
Using content preferences - Archive of obsolete content
the content preferences service, implemented by nsicontentprefservice, offers functions for setting and retrieving preferences for specific sites or in the global preference space; global preferences are used whenever a site-specific preference isn't available.
Compiling The npruntime Sample Plugin in Visual Studio - Archive of obsolete content
in fact, all win32 api functions dealing with character strings can be added an 'a' to the end to avoid unicode cast errors.
Enabling the behavior - updating the status periodically - Archive of obsolete content
function loadtinderboxstatus() { gxmlhttprequest = new xmlhttprequest(); gxmlhttprequest.onload = updatetinderboxstatus; gxmlhttprequest.open("get", "http://tinderbox.mozilla.org/seamonkey/panel.html"); gxmlhttprequest.send(null); window.settimeout(loadtinderboxstatus, 60000); } window.settimeout(loadtinderboxstatus, 1000); window.settimeout schedules functions to run at some future time.
Creating a Microsummary - Archive of obsolete content
it also contains basic functions for manipulating those nodes and their content.
Using Dehydra - Archive of obsolete content
as gcc compiles file, dehydra calls functions in the user analysis script with information about the code being compiled.
Dehydra - Archive of obsolete content
dehydra function reference callback and utility functions for dehydra scripts.
Drag and Drop Example - Archive of obsolete content
the boardobserver will need three functions, getsupportedflavours, ondragover and ondrop.
Document Loading - From Load Start to Finding a Handler - Archive of obsolete content
trycontentlistener makes use of the ispreferred and canhandlecontent functions on nsiuricontentlistener and calls docontent() on the listener if it claims to handle the data, as well as hooking up a stream converter if the listener asks for one.
Firefox Sync - Archive of obsolete content
firefox home an ios application that functions as a sync client.
Creating a Help Content Pack - Archive of obsolete content
viewing your content pack in the help viewer to launch the help viewer with your content pack, you need to have chrome://help/content/contexthelp.js loaded into the xul file that provides the ui to open the help viewer: <script type="application/javascript" src="chrome://help/content/contexthelp.js"/> this will allow you to access all of the viewer functions.
Simple Storage - Archive of obsolete content
to manipulate its persistent data, a jetpack therefore need only use the various standard javascript functions and operators.
Menu - Archive of obsolete content
ArchiveMozillaJetpackUIMenu
due to a platform bug in firefox, on os x only, for menus in the menu bar only, command functions defined on menuitems with submenus are not called when descendant menuitems are clicked.
UI - Archive of obsolete content
ui mechanism for displaying jetpack content in a slide-out animated vertical column toolbar including entries and access elements into the toolbar panel a movable, expandable, and custom styled content element to display jetpack content tabs adding events and interacting with browser tabs and their contained documents statusbar low-level functions and basic calls notifications a system for alerting users via provided ui mechanisms selection interacting with user-selected content window mitigates and eases interactions between different browser windows ...
Simple Storage - Archive of obsolete content
to manipulate its persistent data, a jetpack therefore need only use the various standard javascript functions and operators.
statusBar - Archive of obsolete content
the class statusbar contains functions to add and control the statusbar of the browser.
Mozilla Application Framework in Detail - Archive of obsolete content
pport for threads, thread synchronization, normal file and network i/o, interval timing and calendar time, basic memory management (malloc and free) and shared library linking; psm, a set of libraries that perform cryptographic operations including setting up an ssl connection, object signing and signature verification, certificate management (including issuance and revocation), other common pki functions, and s/mime support; an sql support that provides the ability to set up data sources, query a database, and retrieve results as javascript objects or rdf data sources; and an api for directory services via the lightweight directory access protocol (ldap).
Mozilla Crypto FAQ - Archive of obsolete content
psm 1.3 will also provide support for mozilla users to obtain personal digital certificates and perform other pki-related functions.
Scripting - Archive of obsolete content
it can contain the following functions: startup when the app starts, before the user interface is displayed.
Remote debugging - Archive of obsolete content
there give more information about the stack than a breakpad crash report: not only the names of the functions on the stack, but also the values they were passed.
Space Manager Detailed Design - Archive of obsolete content
the new band rect into the linked list bandrect* splitvertically(nscoord abottom); // split the band rect into two horizontally, with this band rect becoming // the left part, and a new band rect being allocated and returned for the // right part // // does not insert the new band rect into the linked list bandrect* splithorizontally(nscoord aright); // accessor functions prbool isoccupiedby(const nsiframe*) const; void addframe(const nsiframe*); void removeframe(const nsiframe*); prbool hassameframelist(const bandrect* abandrect) const; print32 length() const; }; // circular linked list of band rects struct bandlist : bandrect { bandlist(); // accessors prbool isempty() const {return pr_clist_is_empty((prcliststr...
File object - Archive of obsolete content
filesystem access is implemented with nspr i/o functions, and as such shares many semantics.
Abc Assembler Tests - Archive of obsolete content
when run, the assembler tests include the abcasm/abs_helper.as file which defines the following functions: start(summary:string):void - start a new test section described by summary end():void - test section finished compare_stricteq(name:string, expected:*, actual:*):void - compare the results of a testcase where name is the testcase name compare_typeerror(name:string, expected:*, actual:*):void - special function for comparing typeerrors (runtimeerrors) - will only compare the first 22 chars of expected and ...
The life of an HTML HTTP request - Archive of obsolete content
these content nodes are created by calling functions like ns_newhtmlxxxxelement().
The new nsString class implementation (1999) - Archive of obsolete content
to wit: they want to ensure that the underlying buffers cannot be corrupted or altered erroneously they want to ensure that the appropriate set of conversion functions get applied they want some control over the usage pattern of strings, such that the 2-byte (ucs2) form is used whenever possible, and some restrictions are applied to the use of 1-byte (ascii) nscstrings.
Example Sticky Notes - Archive of obsolete content
unlike <field> these are really two functions (getter and setter).
Using XPInstall to Install Plugins - Archive of obsolete content
to actually create and write keys to the windows system registry, you'll use the functions of the winreg object.
Examples - Archive of obsolete content
the following samples demonstrate some of the principal installation functions in the xpinstall api: file.macalias file.windowsshortcut [install.]adddirectory [install.]addfile installtrigger.installchrome installtrigger.startsoftwareupdate windows install example ...
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.
flags - Archive of obsolete content
this results in a performance enhancement, but you will not be able to use the dom functions to retrieve the tree rows.
id - Archive of obsolete content
ArchiveMozillaXULAttributeid
you can use this as a parameter to getelementbyid() and other dom functions and to reference the element in style sheets.
windowtype - Archive of obsolete content
some of mozilla's window handling functions use this attribute to group windows of the same type together.
Building accessible custom components in XUL - Archive of obsolete content
<code> function install_handlers() { var spreadsheet = window.document.getelementbyid('accjaxspreadsheet'); spreadsheet.addeventlistener('keypress', spreadsheet_keypress, true); spreadsheet.addeventlistener('focus', spreadsheet_focus, true); spreadsheet.addeventlistener('click', spreadsheet_click, true); } </code> with this new event handler and associated helper functions, we can navigate between cells and headers using the arrow keys.
Accessing Files - Archive of obsolete content
var file = io.getfile("profile", "sample.txt"); the nsiscriptableio object is a global object always available within an application or extension which provides a number of useful functions for dealing with files.
Working With Directories - Archive of obsolete content
both files and directories are represented using the same kind of object so most of the functions available for nsifile will work for both.
IO - Archive of obsolete content
ArchiveMozillaXULFileGuideIO
it provides a number of useful functions for dealing with files.
Moving, Copying and Deleting Files - Archive of obsolete content
moving a file to move a file, nsifile.moveto() may be used which functions similarly to nsifile.copyto().
MenuItems - Archive of obsolete content
unlike the access key, which only functions while the menu is open, a shortcut key works at any time.
Menus - Archive of obsolete content
this item will be highlighted, and will do certain functions depending on the kind of item it is, and the way in which it has been activated, whether via the keyboard or mouse.
OpenClose - Archive of obsolete content
void openpopupatscreen(in long x, in long y, in boolean iscontextmenu); the iscontextmenu argument indicates that a context menu is being opened, and functions the same as the corresponding argument for the openpopup method.
contentView - Archive of obsolete content
for trees that are not built with a content builder, the functions of nsitreecontentview will not be available, since there are no dom nodes to retrieve.
popupBoxObject - Archive of obsolete content
you wouldn't normally need to use this property as all of its functions are available via the popup itself.
treeBoxObject - Archive of obsolete content
this object implements the nsitreeboxobject interface and contains functions for retrieving the cells at certain coordinates, redrawing cells and scrolling the tree.
Providing Command-Line Options - Archive of obsolete content
a.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.
Simple Query Syntax - Archive of obsolete content
note that the namespace aware functions (with the suffix ns) need to be used to set or remove attributes with namespaces.
Template and Tree Listeners - Archive of obsolete content
some useful functions of the observer are the drag and drop related callbacks to handle when an item is dragged onto the tree.
Complete - Archive of obsolete content
if you want to see these techniques in action, then you can download and install the complete allcustom extension: allcustom.xpi (the link is external only because this wiki does not support xpi files.) the extension does not contain any useful functions.
Tree Widget Changes - Archive of obsolete content
currently, only checkbox columns support editing, although the content-based tree handles the nsitreeview.setcellvalue() and nsitreeview.setcelltext() functions to change the tree content with a script for other types of cells.
Adding Properties to XBL-defined Elements - Archive of obsolete content
methods are functions which may be executed.
Anonymous Content - Archive of obsolete content
note that to dom functions, the content will appear as it was in the xul file, so the menupopup will be a child of the menu.
Box Objects - Archive of obsolete content
the others have functions which are more easily accessible by methods mapped directly onto the element, since those types are generally only used with one particular element.
Creating Dialogs - Archive of obsolete content
the two functions dook() and docancel() both return true, which indicates that the dialog should be closed.
Features of a Window - Archive of obsolete content
you can use this reference to call functions of the other window.
List Controls - Archive of obsolete content
they work similar to the html select element, which performs both functions, but the xul elements have additional features.
Manifest Files - Archive of obsolete content
in javascript, it is possible for a web page to override built-in functions with their own code.
More Button Features - Archive of obsolete content
the style attribute functions similar to its html counterpart.
More Tree Features - Archive of obsolete content
the tree view has a number of functions which specify the hierarchy of the items in a tree.
More Wizards - Archive of obsolete content
wizard functions the wizard works much like a tabbed panel, except that the tabs are not displayed and the user navigates between pages by using the buttons along the bottom.
Open and Save Dialogs - Archive of obsolete content
when the dialog is closed, you can use the interface functions to get the file that was selected.
Property Files - Archive of obsolete content
the element has a number of functions which can be used to get strings from the property file and get other locale information.
Stack Positioning - Archive of obsolete content
you can use the dom functions to move the order of the elements around.
Templates - Archive of obsolete content
if you were to use dom functions to traverse the tree, you will find these elements there and can query their properties.
Toolbars - Archive of obsolete content
« previousnext » a toolbar is usually placed along the top of a window and contains a number of buttons that perform common functions.
Updating Commands - Archive of obsolete content
the functions used can be found in the 'chrome://communicator/content/utilityoverlay.js' script.
XPCOM Examples - Archive of obsolete content
this means that you can call any of the functions provided by it, one of which is the focus() function.
XUL Structure - Archive of obsolete content
xul functions in much the same way.
Using Remote XUL - Archive of obsolete content
xul loaded and rendered in this way is called remote xul and can be used for basic functions like web site navigation as well as to build sophisticated web-based applications.
Using nsIXULAppInfo - Archive of obsolete content
for example, one of unfrozen functions you're relying on was changed.
Using the Editor from XUL - Archive of obsolete content
these functions call beforeedit() and afteredit() on the current typing rules.
XUL Questions and Answers - Archive of obsolete content
do something "final" here // (my two cents) } else { // this fires when a load finishes } } } return 0; } // this fires when the location bar changes i.e load event is confirmed // or when the user switches tabs listobj.onlocationchange = function(aprogress, arequest, auri) { // do whatever you want to do return 0; } // for definitions of the remaining functions see xulplanet.com listobj.onprogresschange = function() { return 0 }; listobj.onstatuschange = function() { return 0 }; listobj.onsecuritychange = function() { return 0 }; listobj.onlinkiconavailable = function() { return 0 }; /* i use the progress listener to trap the end of a local html "template" file loading, and run xslt transormations.
Accessibility/XUL Accessibility Reference - Archive of obsolete content
these functions must be replicated elsewhere (like in the main menu, e.g.
menupopup - Archive of obsolete content
you wouldn't normally need to use this property as all of its functions are available via the popup itself.
panel - Archive of obsolete content
ArchiveMozillaXULpanel
you wouldn't normally need to use this property as all of its functions are available via the popup itself.
scrollbox - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a box that has additional functions that can be used to scroll the content.
tooltip - Archive of obsolete content
you wouldn't normally need to use this property as all of its functions are available via the popup itself.
wizard - Archive of obsolete content
some of mozilla's window handling functions use this attribute to group windows of the same type together.
CommandLine - Archive of obsolete content
a similar and better way to implement this solution is by defining argument specific handlers with registering and unregistering functions in your command line handler service.
Debugging a XULRunner Application - Archive of obsolete content
unction toopenwindowbytype is not defined if you get an error that "function toopenwindowbytype is not defined" you may add the following function to your scripts (doesn't seem to be in the venkman overlay): function toopenwindowbytype(intype, uri) { var winopts = "chrome,extrachrome,menubar,resizable,scrollbars,status,toolbar"; window.open(uri, "_blank", winopts); } i can't see my pages, functions ...
Using LDAP XPCOM with XULRunner - Archive of obsolete content
} 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.
2006-11-17 - Archive of obsolete content
quick builds for localisers (full or partial) discussion on moz-l10n-builder, which automates many of the functions required in localization process.
2006-10-06 - Archive of obsolete content
thunderbird is continuously repeating 7 functions including c_opensession which accesses the card that he is developing.
JS-Engine FAQ - Archive of obsolete content
non-js-engine questions can i call functions in mozilla extensions from web page?
2006-11-24 - Archive of obsolete content
discussions about functions that display the events/tasks of the calendars in month view.
NPN_PostURLNotify - Archive of obsolete content
description npn_posturlnotify functions identically to npn_posturl, with these exceptions: npn_posturlnotify supports specifying headers when posting a memory buffer.
NPP_NewStream - Archive of obsolete content
if the stream comes from a local file, the npp_write and npp_writeready functions are not called.
NPVariant - Archive of obsolete content
follows: javascript type npvarianttype undefined npvarianttype_void null npvarianttype_null boolean npvarianttype_bool number npvarianttype_int32 or npvarianttype_double string npvarianttype_string all other types npvarianttype_object functions npn_releasevariantvalue() npn_getstringidentifier() npn_getstringidentifiers() npn_getintidentifier() npn_identifierisstring() npn_utf8fromidentifier() npn_intfromidentifier() macros plugin developers are not expected to directly manipulate or access the members of the npvariant instance, instead, the function npn_releasevariantvalue(), and the following macros are provided: ...
NPAPI plugin reference - Archive of obsolete content
npclass npclass is a structure that holds a set of pointers to functions that make up the behavior of an instance of an npclass (i.e.
Plugins - Archive of obsolete content
scripting plugins: macromedia flash this article explains how javascript can be used to access methods from within the flash plugin, as well as how a feature called fscommands can be used to access javascript functions from within the flash animation.
.htaccess ( hypertext access ) - Archive of obsolete content
php_value auto_prepend_file "/real/path/to/file/functions.php" # adds function.php at the top of requested document php_value auto_append_file "/real/path/to/file/footer.php" # adds footer.html at bottom of requested document customized error responses : user can be directed to different pages depending on the error they caused or by the webserver.
Security Controls - Archive of obsolete content
second, the system should offer only the required functionality to each authorized user, so that no one can use functions that are not necessary.
Encryption and Decryption - Archive of obsolete content
in most cases, two related functions are employed, one for encryption and the other for decryption.
Introduction to Public-Key Cryptography - Archive of obsolete content
to provide maximum operational flexibility, interactions with end entities can be separated from the other functions of a ca and handled by a separate service called a registration authority (ra).
Introduction to SSL - Archive of obsolete content
among its other functions, the ssl handshake protocol determines how the server and client negotiate which cipher suites they will use to authenticate each other, to transmit certificates, and to establish session keys.
SSL and TLS - Archive of obsolete content
among other functions, the ssl handshake determines how the server and client negotiate which cipher suite they will use to authenticate each other, to transmit certificates, and to establish session keys.
Common Firefox theme issues and solutions - Archive of obsolete content
using the default theme in the latest firefox, please try tools > web developer > inspect to see how this new feature functions and how it should be styled.
Processing XML with E4X - Archive of obsolete content
consequently, filters can also run against the value of a single node contained within the current element: var people = <people> <person> <name>bob</name> <age>32</age> </person> <person> <name>joe</name> <age>46</age> </person> </people>; alert(people.person.(name == "joe").age); // alerts 46 filter expressions can even use javascript functions: function over40(i) { return i > 40; } alert(people.person.(over40(parseint(age))).name); // alerts joe handling namespaces e4x is fully namespace aware.
Array comprehensions - Archive of obsolete content
for future-facing usages, consider using array.prototype.map, array.prototype.filter, arrow functions, and spread syntax.
ECMAScript 2016 to ES.Next support in Mozilla - Archive of obsolete content
ecmascript 2016 array.prototype.includes() (firefox 43) typedarray.prototype.includes() (firefox 43) exponentiation operator (firefox 52) ecmascript 2017 object.values() (firefox 47) object.entries() (firefox 47) string.prototype.padstart() (firefox 48) string.prototype.padend() (firefox 48) object.getownpropertydescriptors() (firefox 50) async functions async function (firefox 52) async function expression (firefox 52) asyncfunction (firefox 52) await (firefox 52) trailing commas in function parameter lists (firefox 52) ecmascript 2018 spread in object literals and rest parameters (firefox 55) for await...of (firefox 57) global_objects/sharedarraybuffer (firefox 57, with flags) global_objects/promise/finally (firefox...
Microsoft JavaScript extensions - Archive of obsolete content
objects activexobject debug enumerator vbarray functions getobject scriptengine scriptenginebuildversion scriptenginemajorversion scriptengineminorversion statements @cc-on @if @set other date.getvardate() error.description error.number error.stacktracelimit ...
New in JavaScript 1.2 - Archive of obsolete content
charcode() string.prototype.match() string.prototype.replace() string.prototype.search() string.prototype.slice() string.prototype.substr() new operators delete equality operators (== and !=) new statements labeled statements switch do...while import export other new features regular expressions signed scripts changed functionality in javascript 1.2 you can now nest functions within functions.
New in JavaScript 1.4 - Archive of obsolete content
new features in javascript 1.4 exception handling (throw and try...catch) in operator instanceof operator changed functionality in javascript 1.4 eval() changes (cannot be called indirectly and no longer a method of object) arguments not a property of functions deprecated function.arity in favor of function.length changes to liveconnect ...
New in JavaScript 1.8.5 - Archive of obsolete content
new features in javascript 1.8.5 new functions function description object.create() creates a new object with the specified prototype object and properties.
Old Proxy API - Archive of obsolete content
in these functions, this refers to the handler object.
Implementation Status - Archive of obsolete content
419190; 7.10.2 current() supported 7.10.3 id() unsupported 7.10.4 context() unsupported 7.11.1 choose() unsupported 7.11.2 event() supported 7.12 extension functions unsupported not a compliance requirement for an xforms processor 8.
Using XForms and PHP - Archive of obsolete content
it is a very common error to read code with include(), or require(), functions, or another file access function, and have spaces or empty lines that are output before header() is called.
Common causes of memory leaks in extensions - Extensions
another solution would be to use the setinterval()/settimeout() instances content windows provide, but there is a big drawback with this idea: if the user disables javascript globally or locally (such as by using an add-on like noscript), then using the content window functions won't work.
bootstrap.js - Extensions
the bootstrap.js script should contain several specific functions, which are called by the browser to manage the extension.
Index - Game development
as with any other 3d library it provides built-in functions to help you implement common 3d functionality more quickly.
Building up a basic demo with the PlayCanvas engine - Game development
add the following code to the bottom of your second <script> element: var app = new pc.application(canvas); app.start(); the pc global object contains all the playcanvas functions available in the engine.
Building up a basic demo with Three.js - Game development
three.js, as with any other 3d library, provides built-in helper functions to help you implement common 3d functionality more quickly.
WebVR — Virtual Reality for the Web - Game development
see the vreffect and vrcontrols functions available on the three.js github to help you implement and handle webvr with three.js.
Audio for Web games - Game development
let's create another async function to set up the sample — we can combine the two async functions in a nice promise pattern to perform further actions when each file is loaded and buffered: async function loadfile(filepath) { const track = await getfile(filepath); return track; } let's also create a playtrack() function, which we can call once a file has been fetched.
Tiles and tilemaps overview - Game development
here are examples showing how to translate from world coordinates to screen coordinates and back again: // these functions assume that the camera points to the top left corner function worldtoscreen(x, y) { return {x: x - camera.x, y: y - camera.y}; } function screentoworld(x,y) { return {x: x + camera.x, y: y + camera.y}; } rendering a trivial method for rendering would just be to iterate over all the tiles (like in static tilemaps) and draw them, substracting the camera coordinates (like in the worldtoscre...
asm.js - Game development
it is a very small, strict subset of javascript that only allows things like `while`, `if`, numbers, top-level named functions, and other simple constructs.
Collision detection - Game development
it's our decision how to implement this, of course, but it can be tough to calculate whether the ball is touching the rectangle or not because there are no helper functions in canvas for this.
Move the ball - Game development
replace the existing draw() function with the following two functions: function drawball() { ctx.beginpath(); ctx.arc(x, y, 10, 0, math.pi*2); ctx.fillstyle = "#0095dd"; ctx.fill(); ctx.closepath(); } function draw() { ctx.clearrect(0, 0, canvas.width, canvas.height); drawball(); x += dx; y += dy; } compare your code you can check the finished code for this article for yourself in the live demo below, and play with it to unde...
Initialize the framework - Game development
the id of the <canvas> to use for rendering if one already exists on the page (we've specified null because we want phaser to create its own.) the names to use for phaser's three key functions that load and start the game, and update the game loop on every frame; we will use the same names to keep it clean.
Physics - Game development
this kind of functionality is just the tip of the iceberg — there are various functions and variables that can help you manipulate the physics objects.
2D breakout game using Phaser - Game development
you will learn the basics of using the phaser framework to implement fundamental game mechanics like rendering and moving images, collision detection, control mechanisms, framework-specific helper functions, animations and tweens, and winning and losing states.
Ajax - MDN Web Docs Glossary: Definitions of Web-related terms
with interactive websites and modern web standards, ajax is gradually being replaced by functions within javascript frameworks and the official fetch api standard.
Base64 - MDN Web Docs Glossary: Definitions of Web-related terms
in javascript there are two functions respectively for decoding and encoding base64 strings: btoa(): creates a base-64 encoded ascii string from a "string" of binary data ("btoa" should be read as "binary to ascii").
Bézier curve - MDN Web Docs Glossary: Definitions of Web-related terms
hereʼs an animated illustration demonstrating the creation of the curve: learn more genreal knowledge bézier curve on wikipedia learn about it cubic bézier timing functions in css keysplines svg attribute cubic bézier generator ...
Callback function - MDN Web Docs Glossary: Definitions of Web-related terms
a good example is the callback functions executed inside a .then() block chained onto the end of a promise after that promise fulfills or rejects.
Class - MDN Web Docs Glossary: Definitions of Web-related terms
prototype-based programming languages (like javascript) using functions as classes in javascript class-based programming on wikipedia object-oriented programming on wikipedia ...
Closure - MDN Web Docs Glossary: Definitions of Web-related terms
in javascript, functions create a closure context.
HMAC - MDN Web Docs Glossary: Definitions of Web-related terms
it can use any kind of cryptographic functions, and its strengh depends on the underlying function (sha1 or md5 for instance), and the chosen secret key.
JSON - MDN Web Docs Glossary: Definitions of Web-related terms
json does not natively represent more complex data types like functions, regular expressions, dates, and so on.
Java - MDN Web Docs Glossary: Definitions of Web-related terms
it comes with a large library of readily usable functions, the java software development kit (sdk).
Main thread - MDN Web Docs Glossary: Definitions of Web-related terms
this means that long-running javascript functions can block the thread, leading to an unresponsive page and a bad user experience.
Method - MDN Web Docs Glossary: Definitions of Web-related terms
note: in javascript functions themselves are objects, so, in that context, a method is actually an object reference to a function.
SLD - MDN Web Docs Glossary: Definitions of Web-related terms
additional subdomains can be created in order to provide additional information about various functions of a server or to delimit areas under the same domain.
Scope - MDN Web Docs Glossary: Definitions of Web-related terms
a function serves as a closure in javascript, and thus creates a scope, so that (for example) a variable defined exclusively within the function cannot be accessed from outside the function or within other functions.
Second-level Domain - MDN Web Docs Glossary: Definitions of Web-related terms
additional subdomains can be created in order to provide additional information about various functions of a server or to delimit areas under the same domain.
Signature - MDN Web Docs Glossary: Definitions of Web-related terms
it may refer to: signature (functions) a function signature (or type signature, or method signature) defines input and output of functions or methods.
UDP (User Datagram Protocol) - MDN Web Docs Glossary: Definitions of Web-related terms
udp provides checksums for data integrity, and port numbers for addressing different functions at the source and destination of the datagram.
Wrapper - MDN Web Docs Glossary: Definitions of Web-related terms
in programming languages such as javascript, a wrapper is a function that is intended to call one or more other functions, sometimes purely for convenience, and sometimes adapting them to do a slightly different task in the process.
JPEG - MDN Web Docs Glossary: Definitions of Web-related terms
a discrete cosine transform expresses a finite sequence of data points in terms of a sum of cosine functions oscillating at different frequencies.
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.
MDN Web Docs Glossary: Definitions of Web-related terms
rollport sctp sdp search engine second-level domain secure sockets layer (ssl) selector (css) self-executing anonymous function semantics seo serialization server server timing session hijacking sgml shadow tree shim signature signature (functions) signature (security) simd simple header simple response header sisd site site map sld sloppy mode slug smoke test smpte (society of motion picture and television engineers) smtp snap positions soap spa (single-page application) specification ...
How CSS is structured - Learn web development
functions while most values are relatively simple keywords or numeric values, there are some values which take the form of a function.
Web fonts - Learn web development
each of the url() functions points to a font file that we want to import into our css — we need to make sure the paths to the files are correct, so add fonts/ to the start of each path (adjust as necessary).
What are browser developer tools? - Learn web development
this article explains how to use the basic functions of your browser's devtools.
Common questions - Learn web development
this article explains how to use the basic functions of your browser's devtools.
Sending form data - Learn web development
the specific characters you should be cautious with vary depending on the context in which the data is used and the server platform you employ, but all server-side languages have functions for this.
HTML basics - Learn web development
as the title suggests, this article will give you a basic understanding of html and its functions.
Tips for authoring fast-loading HTML pages - Learn web development
javascript files for functions required during the loading of the page, but not any interaction related javascript that can only run after page loads.
Making decisions in your code — conditionals - Learn web development
ternary operator example the ternary operator is not just for setting variable values; you can also run functions, or lines of code — anything you like.
Client-side storage - Learn web development
we have created another version of the video store example we saw in the previous section — this functions identically, except that it also saves the html, css, and javascript in the cache api via a service worker, allowing the example to run offline!
Basic math in JavaScript — numbers and operators - Learn web development
this is especially true when we are learning to program javascript (or any other language for that matter) — so much of what we do relies on processing numerical data, calculating new values, and so on, that you won't be surprised to learn that javascript has a full-featured set of math functions available.
Storing the information you need — Variables - Learn web development
variables can also contain complex data and even entire functions to do amazing things.
What went wrong? Troubleshooting JavaScript - Learn web development
as you'll learn in more detail in our later functions article, code inside functions runs in a separate scope than code outside functions.
Adding features to our bouncing balls demo - Learn web development
at the point where you loop through every ball and call the draw(), update(), and collisiondetect() functions for each one, make it so that these functions are only called if the current ball exists.
Working with JSON - Learn web development
populating the header now that we've retrieved the json data and converted it into a javascript object, let's make use of it by writing the two functions we referenced above.
Multimedia: video - Learn web development
if not, there are online tools, such as ffmpeg (discussed in section below), that encode, decode, convert, and perform other optimization functions.
Introduction to the server side - Learn web development
web frameworks are collections of functions, objects, rules and other code constructs designed to solve common problems, speed up development, and simplify the different types of tasks faced in a particular domain.
Ember interactivity: Events, classes and state - Learn web development
note: a decorator is basically a wrapper function, which wraps and calls other functions or properties, providing additional functionality along the way.
Ember resources and troubleshooting - Learn web development
more concretely, using mut allows for template-only settings functions to be declared: <checkbox @value={{this.somedata}} @ontoggle={{fn (mut this.somedata) (not this.somedata)}} /> whereas, without mut, a component class would be needed: import component from '@glimmer/component'; import { tracked } from '@glimmer/tracking'; import { action } from '@ember/object'; export default class example extends component { @tracked somedata = false; @action set...
Introduction to client-side frameworks - Learn web development
thanks to vue, we didn't have to write our own functions for building the ui; the framework will handle that for us in an optimized, efficient way.
Getting started with React - Learn web development
component functions are named with pascalcase.
Dynamic behavior in Svelte: working with variables and props - Learn web development
this is not some special svelte syntax — here we are just using regular javascript arrow functions.
Using Vue computed properties - Learn web development
for installation, and to use some of the more advanced features of vue (like single file components or render functions), you'll need a terminal with node + npm installed.
Vue conditional rendering: editing existing todos - Learn web development
for installation, and to use some of the more advanced features of vue (like single file components or render functions), you'll need a terminal with node + npm installed.
Adding a new todo form: Vue events, methods, and models - Learn web development
for installation, and to use some of the more advanced features of vue (like single file components or render functions), you'll need a terminal with node + npm installed.
Focus management with Vue refs - Learn web development
for installation, and to use some of the more advanced features of vue (like single file components or render functions), you'll need a terminal with node + npm installed.
Rendering a list of Vue components - Learn web development
for installation, and to use some of the more advanced features of vue (like single file components or render functions), you'll need a terminal with node + npm installed.
Vue resources - Learn web development
for installation, and to use some of the more advanced features of vue (like single file components or render functions), you'll need a terminal with node + npm installed.
Styling Vue components with CSS - Learn web development
for installation, and to use some of the more advanced features of vue (like single file components or render functions), you'll need a terminal with node + npm installed.
Implementing feature detection - Learn web development
we first use the media attribute to only apply the brick css to the page if the page width is 480px or less: <link href="dist/brick.css" type="text/css" rel="stylesheet" media="all and (max-width: 480px)"> we then use matchmedia() in the javascript several times, to only run brick navigation functions if we are on the small screen layout (in wider screen layouts, everything can be seen at once, so we don't need to navigate between different views).
Client-side tooling overview - Learn web development
for example: sass/scss: this css extension allows you to use variables, nested rules, mixins, functions, and many other features, some of which are available in native css (such as variables), and some of which aren't.
Package management basics - Learn web development
whilst the tooling is on our machine, we can ask the software to inspect our use of the code and only include the functions that we're actually using in production — a process known as "tree shaking".
Accessibility Features in Firefox
for example, you can disable functions that websites use to move or resize windows, or to remove your status bar, to disable right-click contextual menus, change the status bar text, etc.
Information for External Developers Dealing with Accessibility
mac keys: keyboard shortcuts quick reference for mac os x complete reference on keyboard for mac os x: this document list all functions of specified keys, known keyboard shortcuts, explains how to create keyboard shortcuts, explains appropriate use for the arrow keys, how to move the insertion point with keys, how to extent text selection with keys, functions of function keys, what are reserved keyboard shortcuts, how to create your own keyboard shortcuts, keyboard focus and navigation, type-ahead and key-repeat, etc.
Mozilla’s UAAG evaluation report
(p2) c provides stated functions 11.6 user profiles.
Adding a new CSS property
note that use of setcoord (if the resulting value needs to be a tagged union) or setdiscrete is preferred when it's possible to use those functions.
Creating a Firefox sidebar
as of firefox 23, the addpanel and addpersistentpanel functions have been removed from the deprecated, netscape-derived window.sidebar object.
Creating reftest-based unit tests
the helper functions snapshotwindow and comparesnapshots are available in testing/mochitest/tests/simpletest/windowsnapshot.js.
The Firefox codebase: CSS Guidelines
formatting spacing & indentation 2 spaces indentation is preferred add a space after each comma, except within color functions: linear-gradient(to bottom, black 1px, rgba(255,255,255,0.2) 1px) always add a space before !important.
Callgraph
this can be used for performing static analysis based on the relationship between functions and methods.
Creating Custom Events That Can Pass Data
use nsdomevent.h's ns_forward_to_nsdomevent macro so that you don't have to forward manually (unless you plan on overriding one of nsdomevent's original functions).
Contributing to the Mozilla code base
run hg blame on the file and look for the people who have touched the functions you're working on.
Limitations of frame scripts
one of the functions of the sandbox is to restrict access to the local file system by processes that host remote content.
Communicating with frame scripts
a single value: // frame script addeventlistener("click", function (event) { var results = sendsyncmessage("my-addon@me.org:my-e10s-extension-message", { details : "they clicked", tag : event.target.tagname }); content.console.log(results[0]); // "value from chrome" }, false); like arguments, return values from sendsyncmessage() must be json-serializable, so chrome can't return functions.
Message manager overview
communicate with frame scripts using addmessagelistener() and broadcastasyncmessage() or sendasyncmessage() functions.
Performance best practices for Firefox front-end engineers
a number of tests have been written that exercise various functions of the browser (opening tabs, opening windows) and ensure that we don’t add new uninterruptible reflows accidentally while those actions occur.
Security best practices for Firefox front-end engineers
developers are able to avoid tripping the rule by using escaping functions in combination with template strings, for example: bar.innerhtml = escapehtml`<a href='${url}'>about</a>`; in system-privileged chrome code, any kind of remaining scripts will still be removed by our sanitizer.
HTMLIFrameElement.findNext()
examples the following functions are taken from our browser api demo, and cycle through the available search results.
Roll your own browser: An embedding how-to
there are two functions that are needed: nsresult ns_initembedding(const char *apath); nsresult ns_termembedding(); pretty self-explanatory.
Gecko SDK
contents of the sdk the sdk contains the following: 1.9.2 idl files for frozen interfaces (under idl/) header files for frozen interfaces, xpcom functions, and nspr functions (under include/) import libraries or shared libraries (under lib/) static utility libraries (under lib/) various tools (under bin/) for more information about safely linking xpcom components using the xpcom "glue" library, see xpcom glue.
Script security
however, the privileged target is able to copy objects and functions into the less privileged scope using the exportfunction() and cloneinto() functions, and the less privileged scope is then able to use them.
HTTP Cache
//github.com/realityripple/uxp/blob/master/netwerk/base/public/nsiloadcontextinfo.idl it is a helper interface wrapping 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.
JavaScript-DOM Prototypes in Mozilla
here are a few of the properties of obj's prototype: obj.__proto__ parentnode (getter function) src (getter and setter functions) getelementsbytagname (function) text_node (number property, constant) ...
JavaScript Tips
xul tips when inserting code with an xul overlay, wrap functions and variables inside an object with a unique name to avoid conflicting with existing or future function and variable names.
Assert.jsm
report() all of the aforementioned functions must throw an assertionerror when a corresponding condition is not met, with a message that may be undefined if not provided.
JavaScript OS
os.shared utilities for defining functions that interact with the operating system.
Examples
settimeout(function () { deferred.resolve('rawr my success value'); }, atimeout); } catch (ex) { // generally, functions returning promises propagate exceptions through // the returned promise, though they may also choose to fail early.
PromiseUtils.jsm
the promiseutils.jsm javascript code module offers some useful functions related to dom promise.
PromiseWorker.jsm
the above example can be rewritten like this: myworker.post('func', [new basepromiseworker.meta(buffer, {transfers: [buffer]})]); this is convenient if the function's arguments are generated by some other functions or passed from somewhere else.
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).
WebRequest.jsm
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 use addlistener to add a listener to a particular event.
XPCOMUtils.jsm
methods definelazygetter() getter functions in javascript give you a way to define a property of an object, but not calculate the property's value until it is accessed.
Mozilla Framework Based on Templates (MFBT)
the mozilla framework based on templates ("mfbt") is the central repository for macros, functions, and data structures used throughout mozilla code, including in the javascript engine.
DMD
many allocation stack traces start with multiple frames that mention allocation wrapper functions, e.g.
Leak-hunting strategies and tips
if you really need to debug leaks that involve js objects closely, you can get detailed printouts of the paths js uses to mark objects when it is determining the set of live objects by using the functions added in bug 378261 and bug 378255.
TraceMalloc
the output is a large html file that hyperlinks ancestor and descendent libraries, classes, and functions that call into one another, attributing malloc blame up and down each graph.
Preferences
using preferences from application code firefox 6 introduced static functions for accessing preferences efficiently from within application code.
Patches and pushes
for references on how each tag functions, visit the opensearch wiki page and the mozsearch wiki page.
MailNews
it provides a number of functions and capabilities, including: communications protocols - smtp, pop3, imap, nntp message management, including search and filtering message composition address book the mailnews code lives in the mailnews/ directory of comm-central.
Midas editor module security preferences
to enable these functions, you must modify your browser preferences.
NSPR Poll Method
the poll method is one of the functions in the priomethods table.
NSPR's Position On Abrupt Thread Termination
they are alternatives to large state machines with mostly non-blocking library functions.
Process Forking in NSPR
no nspr functions should be called in the child process before the exec call is made.
IPC Semaphores
note: see also named shared memory ipc semaphore functions ipc semaphore functions pr_opensemaphore pr_waitsemaphore pr_postsemaphore pr_closesemaphore pr_deletesemaphore ...
PLHashEntry
these fields are for use by the hash table library functions and the user should not tamper with them.
PLHashTable
the number of buckets in a hash table may be changed by the library functions during the lifetime of the table to optimize speed and space.
PRDir
directory structure used with directory i/o functions.
PRFileDesc
otherwise, you use functions such as pr_open and pr_newtcpsocket to obtain a file descriptor, which you should treat as an opaque structure.
PRLibrary
a reference to such a structure can be returned by some of the functions in the runtime and serve to identify a particular instance of a library.
PRNetAddr
type used with socket manipulation functions to specify a network address.
PRSeekWhence
specifies how to interpret the offset parameter in setting the file pointer associated with the fd parameter for the pr_seek and pr_seek64 functions.
PRStatus
type for status code returned by some functions.
PRThread
this pointer is a required parameter for most of the functions that operate on threads.
PR_CreateIOLayerStub
methods a pointer to the priomethods structure specifying the functions for the new layer.
PR_DetachThread
in nspr release 19980529b and earlier, it is necessary for a native thread not created by nspr to call pr_attachthread before it calls any nspr functions, and call pr_detachthread when it is done calling nspr functions.
PR_EXTERN
used to define the prototypes for functions or variables that are to be exported from a shared library.
PR_FindSymbol
use this function to look up functions or data symbols in a shared library.
PR_FreeLibraryName
description this function deletes the storage allocated by the runtime in the functions described previously.
PR ImportTCPSocket
for example, on posix systems, nspr will put the native file descriptor (an int) in non-blocking mode by calling fcntl to set the o_nonblock file status flag on the native file descriptor, and then nspr will call socket functions such as recv, send, and poll on the native file descriptor.
PR_Interrupt
file i/o is considered instantaneous, so file i/o functions cannot be interrupted.
PR_SetConcurrency
however, it may also prove advantageous on uniprocessor systems to reduce the impact of having a locally scheduled thread calling incidental blocking functions.
Thread Pools
thread pool types thread pool functions thread pool types prjobiodesc prjobfn prthreadpool prjob thread pool functions pr_createthreadpool pr_queuejob pr_queuejob_read pr_queuejob_write pr_queuejob_accept pr_queuejob_connect pr_queuejob_timer pr_canceljob pr_joinjob pr_shutdownthreadpool pr_jointhreadpool ...
Running NSPR tests
known issues other issues with the nspr test suite are: some of the test programs test the accuracy of the timeout of nspr functions.
NSPR
netscape portable runtime (nspr) provides a platform-neutral api for system level and libc-like functions.
NSS CERTVerify Log
certverifylog all the nss verify functions except, the *verifynow() functions, take a parameter called 'certverifylog'.
Using JSS
MozillaProjectsNSSJSSUsing JSS
jss dependencies core library name description binary release location nspr4 nspr os abstraction layer http://ftp.mozilla.org/pub/mozilla.org/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.
NSS_3.11.10_release_notes.html
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.14.2 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.14.4 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.14.5 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.15.3.1 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.15.3 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.15.5 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.16.1 release notes
new functions in pk11pub.h pk11_exportderprivatekeyinfo and pk11_exportprivkeyinfo - exports a private key in a der-encoded asn.1 privatekeyinfo type or a seckeyprivatekeyinfo structure.
NSS 3.16.2.1 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.16.2.2 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.16.2.3 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.16.3 release notes
new functions in cert.h ​cert_getgeneralnametypefromstring - an utlity function to lookup a value of type certgeneralnametype given a human readable string.
NSS 3.16.5 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.16.6 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.16 release notes
new functions in cms.h nss_cmssignerinfo_verify - verify the signature of a single signerinfo.
NSS 3.17.1 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.17.2 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.17.3 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.17.4 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.18.1 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.19.2.1 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.19.2.2 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.19.2.3 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.19.2 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.19.3 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.19.4 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.20.1 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.20.2 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.21.1 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.21.2 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.21.3 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.21.4 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.22.1 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.22.2 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.22.3 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.25.1 release notes
applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.26.2 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.26 release notes
applications that restrict their use of nss apis, to the functions listed in nss public functions, will remain compatible with future versions of the nss shared libraries.
NSS 3.27.1 release notes
applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.27.2 Release Notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.28.1 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.28.2 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.28.3 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.28.4 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.28.5 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.29.1 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.29.2 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.29.3 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.29.5 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.29 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.30.1 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.30.2 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.31.1 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.32 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.36.1 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.36.2 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.36.4 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.36.5 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.36.6 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.36.8 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.36 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.37.1 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.37.3 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.37 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.44.1 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.44.2 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.44.3 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.44.4 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.46.1 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.46 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.47.1 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.47 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.48.1 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.49.1 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.49.2 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.49 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.50 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.51.1 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.51 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.52.1 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.53.1 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.53 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.54 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.55 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS 3.56 release notes
furthermore, applications that restrict their use of nss apis to the functions listed in nss public functions will remain compatible with future versions of the nss shared libraries.
NSS Sample Code Sample1
sample code #include <iostream.h> #include "pk11pub.h" #include "keyhi.h" #include "nss.h" // key management for keys share among multiple hosts // // this example shows how to use nss functions to create and // distribute keys that need to be shared among multiple servers // or hosts.
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.
NSS Sample Code sample2
* this code uses the simplest of the init functions, which does not * require a nss database to exist */ rv = nss_nodb_init("."); if (rv != secsuccess) { fprintf(stderr, "nss initialization failed (err %d)\n", pr_geterror()); goto out; } /* choose mechanism: ckm_des_cbc_pad, ckm_des3_ecb, ckm_des3_cbc.....
NSS Sample Code sample3
* this code uses the simplest of the init functions, which does not * require a nss database to exist */ nss_nodb_init("."); /* get a slot to use for the crypto operations */ slot = pk11_getinternalkeyslot(); if (!slot) { cout << "getinternalkeyslot failed" << endl; status = 1; goto done; } /* * part 1 - simple hashing */ cout << "part 1 -- simple hashing" << endl; /* initialize data */ memset(data, ...
NSS sources building testing
for any functions that are listed in the .def files, nss promises that the binary function interface (abi) will remain stable.
NSS Tech Notes
tn8: background information on libssl's cache functions and sids.
Overview of NSS
nss makes use of netscape portable runtime (nspr), a platform-neutral open-source api for system functions designed to facilitate cross-platform development.
FC_CancelFunction
description parallel functions are not implemented.
FC_Logout
description logs the current user out of a user_functions session.
NSS_Initialize
if any of those simpler nss initialization functions suffices for your needs, call that instead.
sslkey.html
upgraded documentation may be found in the current nss reference key functions chapter 6 key functions this chapter describes two functions used to manipulate private keys and key databases such as the key3.db database provided with communicator.
NSS Tools pk12util-tasks
use nss functions in pcertdb for handling older database ...
NSS tools : signtool
in addition, a single test signing certificate functions as both an object-signing certificate and a ca.
Network Security Services
nss ssl public functions summarizes the ssl apis exported by the nss shared libraries.
Personal Security Manager (PSM)
these operations include setting up an ssl connection, object signing and signature verification, certificate management (including issuance and revocation), and other common pki functions.
Rhino documentation
serialization how to serialize javascript objects and functions in rhino.
Rhino optimization
another benefit of the interpreted mode is that the interpreter performs tail-call elimination of recursive functions.
Rhino overview
in version 1.3 and greater these functions are ecma conformant.
The JavaScript Runtime
string java.lang.charsequence (java.lang.string or org.mozilla.javascript.consstring) object org.mozilla.javascript.scriptable in addition, ecma refers to objects that implement [[call]] as functions.
SpiderMonkey compartments
javascript objects (including javascript functions, which are objects also) are only allowed to touch objects in the same compartment.
Creating JavaScript jstest reftests
comparison functions and shared test functionality the jstest runner loads the code in js/src/tests/shell.js for every test.
Creating JavaScript tests
jstests automatically load js/src/tests/shell.js before they run, which creates a ton of functions.
64-bit Compatibility
there are three helper functions in lirwriter: ins_i2p() - on 32-bit platforms, does nothing.
Exact Stack Rooting
} a secondary benefit: since all js functions take js::handlets, code that does not root cstack gcpointers correctly will be much less likely to compile.
Invariants
(here "the global object" refers to the object at the end of the scope chain of the function object we're executing.) requests many functions require a request.
Property cache
the shape of an object does not cover: anything about the object's prototype other than its identity; anything about the object's parent; obj->freeslot, which can be different for same-shaped objects if they have a jsclass.reserveslots hook (bug 535416); anything about the values of the object's own properties, beyond what the method guarantee and the branded object guarantee say about functions.
JS::CallArgs
the eventual plan is to change jsnative to take const callargs& directly, for automatic assertion of correct use and to make calling functions more efficient.
JS::CompileOptions
(note that one may assign both strings and functions to dom elements' event handler idl attributes.
JS::GetFirstArgumentAsTypeHint
syntax bool js::getfirstargumentastypehint(jscontext* cx, callargs args, jstype *result); name type description cx jscontext * the context in which to define functions.
JSBool
jsbool is the return type of many jsapi functions and callbacks.
JSCheckAccessOp
jscheckaccessop implementations generally work by using jsdbgapi functions such as js_frameiterator and js_stackframeprincipals to obtain the principals of the code attempting the checked operation, then examining those principals and comparing them with the system's security policy.
JSClass
a jsclass has a name, flags, and several callback functions for advanced customization of object behavior.
JSExceptionState
syntax struct jsexceptionstate; description a jsexceptionstate object is returned by the js_saveexceptionstate function, and is passed to functions js_restoreexceptionstate and js_dropexceptionstate.
JSExtendedClass
pass &myextendedclass.base to functions like js_initclass or js_newobject that require a jsclass *.
JSID_IS_GCTHING
testing and conversion functions between a js id and a gc thing.
JSID_IS_INT
testing and conversion functions between a js id and an integer.
JSID_IS_STRING
testing and conversion functions between a js id and a js string.
JSID_IS_SYMBOL
this article covers features introduced in spidermonkey 38 testing and conversion functions between a js id and a js symbol.
JSObjectOps.setProto
the jsobjectops.setproto and setparent callbacks implement the js_setprototype and js_setparent functions.
JSPropertySpec
to define an array of jspropertyspec, use js_psg, js_psgs, js_self_hosted_get, js_self_hosted_getset, and js_ps_end see also mxr id search for jspropertyspec jsfunctionspec jsnativewrapper js_defineproperties js_psg js_psgs js_self_hosted_get js_self_hosted_getset js_ps_end bug 766448 - changed type of getter and setter to wrapper bug 938728 - added selfhostedgetter and selfhostedsetter bug 958262 - changed type of getter and setter to union, and removed selfhostedgetter and selfhostedsetter.
JSRuntime
earlier versions allowed using js_clearcontextthread and other functions to move a jscontext from one thread to another.
JSScript
for now, i'll just say that this class represents a section of compiled javascript code, and the functions to create, run, and analyize it.
JSType
jstype_function functions.
JSVersion
the functions js_getversion, js_setversion, js_stringtoversion, and js_versiontostring use these values.
JS_AddArgumentFormatter
js_removeargumentformatter removes any conversion functions associated with format.
JS_AddExternalStringFinalizer
since the jsstringfinalizeop callback is called during garbage collection, it must avoid most jsapi functions.
JS_AddFinalizeCallback
it was replaced with js_addfinalizecallback, to allow adding multiple callback functions.
JS_CallFunction
see also mxr id search for js_callfunction mxr id search for js_callfunctionname mxr id search for js_callfunctionvalue js_compilefunction js_definefunction js_definefunctions js_getfunctionobject js_newfunction js_valuetofunction bug 965830 ...
JS_ClearNewbornRoots
see js_enterlocalrootscope for a better way to manage newborns in cases where native hooks (functions, getters, setters, etc.) create many gc-things, potentially without connecting them to predefined local roots such as *rval or argv[i] in an active jsnative function.
JS_ClearPendingException
many jsapi functions can simply report an error and return false without building and throwing an exception object.
JS_CompileFunction
see also mxr id search for js_compilefunction mxr id search for js_compileucfunction jsfun_bound_method jsfun_global_parent js_callfunction js_callfunctionname js_callfunctionvalue js_decompilefunction js_decompilefunctionbody js_definefunction js_definefunctions js_getfunctionobject js_newfunction js_setbranchcallback js_valuetofunction bug 1089026 ...
JS_CompileFunctionForPrincipals
see also mxr id search for js_compilefunctionforprincipals mxr id search for js_compileucfunctionforprincipals jsfun_bound_method jsfun_global_parent js_callfunction js_callfunctionname js_callfunctionvalue js_compilefunction js_decompilefunction js_decompilefunctionbody js_definefunction js_definefunctions js_getfunctionobject js_newfunction js_valuetofunction bug 938907 ...
JS_CompileUTF8FileHandle
if principals is non-null, it points to a jsprincipals object that is associated with the new script and any functions it creates.
JS_ConvertArguments
it saves you from having to write separate tests and elaborate if...else statements in your function code to retrieve and translate multiple js values for use with your own functions.
JS_DecompileFunction
see also mxr id search for js_decompilefunction js_decompilescript js_callfunction js_callfunctionname js_callfunctionvalue js_compilefunction js_decompilefunctionbody js_definefunction js_definefunctions js_getfunctionobject js_newfunction js_setbranchcallback js_valuetofunction ...
JS_DecompileFunctionBody
see also mxr id search for js_decompilefunctionbody js_decompilescript js_callfunction js_callfunctionname js_callfunctionvalue js_compilefunction js_decompilefunction js_definefunction js_definefunctions js_getfunctionobject js_newfunction js_setbranchcallback js_valuetofunction ...
JS_DefineElement
see also mxr id search for js_defineelement js_defineconstdoubles js_definefunction js_definefunctions js_defineobject js_defineproperties js_defineproperty js_definepropertywithtinyid js_deleteelement js_getarraylength js_getelement js_isarrayobject js_lookupelement js_newarrayobject js_setelement bug 959787 - changed parameter types ...
JS_DefineFunction
see also mxr id search for js_definefunction mxr id search for js_defineucfunction mxr id search for js_definefunctionbyid js_callfunctionname js_callfunctionvalue js_compilefunction js_definefunctions js_defineobject js_defineproperties js_defineproperty js_getfunctionobject js_newfunction bug 607695 - added js_definefunctionbyid ...
JS_DefineOwnProperty
a getter or setter defined with this functions will be observable from js code.
JS_DefineProperties
see also mxr id search for js_defineproperties js_defineconstdoubles js_defineelement js_definefunction js_definefunctions js_defineobject js_defineproperty js_initclass bug 855582 ...
JS_DeleteProperty2
these functions return true on success, regardless of whether a property was actually deleted.
JS_DestroyContext
description these functions destroy a context, cx.
JS_EncodeString
note that for non-ascii strings, if js_cstringsareutf8 is false, these functions can return a corrupted copy of the contents of the string.
JS_EnterLocalRootScope
description scoped local root management allows native functions, getter/setters, etc.
JS_ErrorFromException
other contexts in the same runtime can have their own error reporting functions.
JS_GetErrorPrototype
other contexts in the same runtime can have their own error reporting functions.
JS_GetFunctionCallback
returns the callback currently configured to be called when javascript functions are invoked or exited, as established by a prior call to js_setfunctioncallback.
JS_GetLocaleCallbacks
callback functions struct jslocalecallbacks { jslocaletouppercase localetouppercase; jslocaletolowercase localetolowercase; jslocalecompare localecompare; // not used #if expose_intl_api jslocaletounicode localetounicode; }; typedef bool (* jslocaletouppercase)(jscontext *cx, js::handlestring src, js::mutablehandlevalue rval); typedef bool (* jslocaletolowercase)(jscontext *c...
JS_GetReservedSlot
they cannot be returned from functions, set as properties on objects, embedded in javascript arrays, and so on.) new objects' reserved slots are initialized to undefined.
JS_GetScopeChain
these objects represent the lexical scope of the currently executing statement or expression, not the call stack, so they include: the variable objects of any enclosing functions or let statements or expressions, and any objects selected by enclosing with statements, in order from the most-nested scope outward; lastly the global object against which the function was created.
JS_GetStringBytes
note that for non-ascii strings, if js_cstringsareutf8 is false, these functions can return a corrupted copy of the contents of the string.
JS_InitStandardClasses
these global objects, functions, constructors, and constants are created as properties of obj.
JS_InstanceOf
js_instanceof can also be used in native functions to check the class of an argument when a particular class is required.
JS_IsConstructing
ordinary non-constructor jsnatives have no need to call this; it always returns js_false for such functions.
JS_IsExceptionPending
otherwise, it returns false this can be used from jsnative functions which call js code to determine if the called js code threw an exception or not.
JS_LockGCThing
see also bug 734250 - removed *rt functions bug 706885 ...
JS_NewContext
javascript objects, functions, strings, and numbers may be shared among the contexts in a jsruntime, but they cannot be shared across jsruntimes.
JS_NewFunction
see also mxr id search for js_newfunction mxr id search for js_newfunctionbyid js_callfunction js_callfunctionname js_callfunctionvalue js_compilefunction js_compileucfunction js_definefunction js_definefunctions js_getfunctionname js_getfunctionobject bug 607695 - added js_newfunctionbyid bug 1140573 - removed parent parameter bug 1054756 - removed js_newfunctionbyid ...
JS_NewObject
choosing a default prototype like many jsapi functions, js_newobject selects an appropriate prototype for the newly created object if you don't supply one yourself.
JS_NewRegExpObject
see also mxr id search for js_newregexpobject mxr id search for js_newucregexpobject mxr id search for js_newregexpobjectnostatics mxr id search for js_newucregexpobjectnostatics regexp bug 571355 - added nostatics functions ...
JS_NewStringCopyN
the two functions differ only in the type of the character array s; both functions create ordinary javascript strings, and all javascript strings are made up of 16-bit characters.
JS_ParseJSON
description use these functions to parse a sequence of characters as json.
JS_ReportErrorNumber
description these functions create a jserrorreport, populate it with an error message obtained from the given jserrorcallback, and either report it to the current error reporter callback or create an error object and set it as the pending exception.
JS_ReportPendingException
note that certain jsapi functions automatically do this for uncaught exceptions; see "automatic handling of uncaught exceptions" in the jsapi user guide.
JS_SaveExceptionState
either of those two functions frees any memory used by the jsexceptionstate.
JS_SaveFrameChain
description these two functions are used to set aside cx's call stack while that stack is inactive.
JS_SetBranchCallback
callback syntax jsbool (*jsbranchcallback)(jscontext *cx, jsscript *script); name type description cx jscontext * pointer to a jscontext which the callback may use to call into jsapi functions.
JS_SetContextCallback
added in spidermonkey 31 callback syntax typedef bool (* jscontextcallback)(jscontext *cx, unsigned contextop, void *data); name type description cx jscontext * pointer to a jscontext which the callback may use to call into jsapi functions.
JS_SetFunctionCallback
fcb jsfunctioncallback the callback to execute when javascript functions are invoked and exited.
JS_SetGCZeal
there are several different levels which have different functions: zeal level description 0 normal amount of collection.
JS_SuspendRequest
in spidermonkey 1.8 and later, these functions will be present, but will do nothing, in non-js_threadsafe builds.
JS_ValueToECMAInt32
all three functions first convert v to a floating-point number as if by calling js_valuetonumber; nan values are then converted to zero.
Property attributes
some objects like function/object have self-hosted functions that can only be defined after the initialization is already finished.
jschar
functions that use jschar will use char16_t directly.
jsid
a few jsapi functions use jsids instead of js::values for property names: js_nextproperty, js_enumerate, and all functions with names ending in byid.
Parser API
functions interface function <: node { id: identifier | null; params: [ pattern ]; defaults: [ expression ]; rest: identifier | null; body: blockstatement | expression; generator: boolean; expression: boolean; } a function declaration or expression.
SpiderMonkey 1.8.8
many jsapi types, functions, and callback signatures have changed, though most of them still have the same names and do the same things.
Split object
split objects are only useful for implementing objects that will be on the scope chain of functions.
TPS Bookmark Lists
at this separator should be moved to position: the title of the existing bookmark item, in the current folder, where this separator should be moved to (i.e., this separator would be inserted into the bookmark list at the position of the named bookmark, causing that bookmark to be positioned below this separator) example: { separator: true } bookmark lists and phase actions following are the functions you can use in phase actions related to bookmarks: bookmarks.add - the bookmark items in the list are added to the end of their parent folder in the specified order.
TPS Formdata Lists
for example: var formdata1 = [ { fieldname: "testing", value: "success", date: -1 }, { fieldname: "testing", value: "failure", date: -2 }, { fieldname: "username", value: "joe" } ]; formdata lists and phase actions you can use the following functions in phase actions for formdata lists: formdata.add formdata.delete formdata.verify formdata.verifynot for an example, see the tps formdata unittest: http://hg.mozilla.org/services/tps/f...st_formdata.js notes note 1, tps supports the delete action for formdata, but sync currently does not correctly sync deleted form data, see bug 564296.
TPS History Lists
ct with begin and end properties, which should have integer values that express time since the present in hours (see date above) for example: var history_to_delete = [ { uri: "http://www.cnn.com/" }, { begin: -24, end: -1 }, { host: "www.google.com" } ]; history lists and phase actions history lists cannot be modified, they can only be added, deleted, and verified, using the following functions: history.add history.delete history.verify history.verifynot ...
TPS Password Lists
password lists and phase actions following are the functions that can be used in phase actions related to passwords: passwords.add passwords.delete passwords.modify passwords.verify passwords.verifynot ...
TPS Tab Lists
p://hg.mozilla.org/automation/crossweave/raw-file/2d9aca9585b6/pages/page1.html", title: "crossweave test page 1", profile: "profile1" }, { uri: "data:text/html,<html><head><title>hello</title></head><body>hello</body></html>", title: "hello", profile: "profile1" } ]; tab lists and phase actions tabs cannot be modified or deleted, only added or verified with the following functions: tabs.add - opens the specified tabs in the browser window.
Thread Sanitizer
compile-time blacklisting functions with racy memory access can be flagged, such that the compiler will not instrument them.
Exploitable crashes
if it's over 300 functions long, it's likely to be a too-much-recursion crash.
Gecko object attributes
dropeffect indicates what functions can be performed when the dragged object is released on the drop target.
Feed content access API
nsifeedtextconstruct represents text values in a feed; includes functions that let you fetch the text as plain text or html.
Places Developer Guide
however, firefox developers can take advantage of several helper apis that are browser-specific: fuel - a collection of wrapper apis for easing access to a number of firefox utilities and services nsiplacestransactionsservice - a firefox service for modifying bookmarks in a transactional manner, providing facilities for undo/redo places utilities for javascript - accessors and helper functions for firefox and extensions creating bookmarks, folders and other items creating a bookmark // create an nsiuri for the url to be bookmarked.
Retrieving part of the bookmarks tree
configure the query to get a hierarchical bookmarks result, pass the folder id to setfolders in your query object: query.setfolders([toolbarfolder], 1); run the query the executequery and executequeries functions will return an nsinavhistoryresult object containing the results of your query: var result = historyservice.executequery(query, options); get the results when you are querying for exactly one folder grouped by folder with no fancy query parameters such as keywords or date ranges (as in this example), the root of the result will be an nsinavhistorycontainerresultnode corresponding to your folder.
FUEL
fuel has a fueliapplication interface that implements all the functions of extiapplication.
SMILE
smile has a smileiapplication interface that implements all the functions of extiapplication.
XML Extras
for xmlhttprequest object you can mostly rely on the microsoft xmlhttprequest documentation, with some caveats: all functions and property names begin with a lower case letter and the object creation is different.
How to build an XPCOM component in JavaScript
the imported library contains functions for generating the module, factory, and the nsgetmodule and queryinterface functions for you.
Component Internals
string classes and xpcom the glue library provides stub functions for the public functions that xpcom provides (see xpcom/build/nsxpcom.h).
Finishing the Component
* * @status frozen */ these frozen interfaces and functions are part of the gecko sdk.
Setting up the Gecko SDK
: $(cc) $(ccparms) /c cspecialthingmodule.cpp link: link.exe /dll /out:"cspecialthing.dll" /implib:"cspecialthing.lib" /machine:i386 xpcom.lib xpcomglue_s.lib nspr4.lib "cspecialthing.obj" "cspecialthingmodule.obj" clean: del *.lib *.dll *.obj *.exp please note, this makefile is only for compiling the sample, you will probably have more .lib files if you are linking against winapi functions like kernel32.lib, user32.lib, etc.
Using XPCOM Utilities to Make Things Easier
ns_impl_nsgetmodule_with_ctor_dtor(name, components, ctor, dtor) this combines the last two macros so that you can define functions to be called at the construction and destruction of the module object.
How To Pass an XPCOM Object to a New Window
a more useful example is available in the source code: toolkit/components/help/content/contexthelp.js#61 if you want to be able to call functions within an xpcom object from a xul window's code, you can do so if you pass the xpcom object as one of the arguments to the window creation method.
Components.Constructor
(this benefit is also partly a result of having to travel through the layer between the javascript engine and xpcom fewer times.) the behavior of functions returned by components.constructor() varies depending upon the arguments given to components.constructor() when called.
Components.utils.evalInSandbox
you can import functions or objects into the sandbox simply by assigning them to the sandbox object.
Components.utils.evalInWindow
this does impose some restrictions on the sorts of things that can be returned: in particular, the result can't contain any functions, because functions can't be structured-cloned.
Components object
utils.makeobjectpropsnormal ensures that all functions come from the specified object's scope, and aren't cross-compartment wrappers.
PyXPCOM
pyxpcom also contains several classes that provide access to functions for initializing and shutting down xpcom and gecko from python, as well as some xpcom helper functions.
XPConnect wrappers
if you need to make objects or functions defined in chrome code accessible to content, use components.utils.cloneinto or components.utils.exportfunction.
XPCShell Reference
the following are some useful functions that can be invoked from the command line: clear(object) clear() removes all properties from an object.
xpcshell
see the xpcshell reference for information on command line arguments and extension functions.
NS_InitXPCOM2
many of the xpcom glue functions and classes are also available prior to xpcom initialization, including for example nsembedcstring and nscomptr.
NS_InitXPCOM3
many of the xpcom glue functions and classes are also available prior to xpcom initialization, including for example nsembedcstring and nscomptr.
Append
« xpcom api reference summary the append family of functions appends a value to the end of a string's internal buffer.
Assign
« xpcom api reference summary the assign family of functions sets the value of a string's internal buffer.
Insert
« xpcom api reference summary the insert family of functions inserts a value into a string's internal buffer.
Replace
« xpcom api reference summary the replace family of functions sets the value of a string's internal buffer.
operator=
« xpcom api reference summary this operator is a shortcut for the assign family of functions.
operator+=
« xpcom api reference summary this operator+= is a shortcut for the append family of functions.
Append
« xpcom api reference summary the append family of functions appends a value to the end of a string's internal buffer.
Assign
« xpcom api reference summary the assign family of functions sets the value of a string's internal buffer.
Insert
« xpcom api reference summary the insert family of functions inserts a value into a string's internal buffer.
Replace
« xpcom api reference summary the replace family of functions sets the value of a string's internal buffer.
operator=
« xpcom api reference summary this operator= is a shortcut for the append family of functions.
operator+=
« xpcom api reference summary this operator+= is a shortcut for the append family of functions.
nsCOMPtr
the class itself and the supporting functions that are used with it are not frozen, but they are available as part of the xpcom glue library for easy reuse.
nsCStringEncoding
« xpcom api reference summary the nscstringencoding enumeration describes the set of character encodings understood by the ns_cstringtoutf16 and ns_utf16tocstring functions.
operator=
« xpcom api reference summary this operator is a shortcut for the inherited nsacstring::assign family of functions.
operator=
« xpcom api reference summary this operator is a shortcut for the inherited nsastring::assign family of functions.
nsMemory
however, if you use these functions in your xpcom component, and if you link to the xpcom glue library, then your component will only have a runtime dependency on the frozen xpcom api.
RefPtr
this is done using the functions addref() and release(), which respectively modify a variable of type nsautorefcnt, which basically is a wrapper around a count of the number of references refering to the class.
IAccessibleComponent
coordinates used by the functions of this interface are specified in different coordinate systems.
inIDOMUtils
layout/inspector/inidomutils.idlscriptable dom utility functions.
mozIJSSubScriptLoader
any top-level functions or variables created by the loaded script via var are created as properties of the targetobj target object (but things declared via let and const are not).
mozIThirdPartyUtil
netwerk/base/public/mozithirdpartyutil.idlscriptable utility functions for determining whether a given uri, channel, or window hierarchy is third party with respect to a known uri.
nsIBidiKeyboard
in the gecko 1.9 branch, we are going to implement all the interface, with xkb functions for xlib and gtk2 backends.
nsIBrowserHistory
it adds functions used by the basic browser like, marking pages as typed in the url bar, and removing pages as from the history interface.
nsIContentSecurityPolicy
tion, in nsiuri arequestorigin, in nsisupports acontext, in acstring amimetypeguess, in nsisupports aextra); short shouldprocess(in unsigned long acontenttype, in nsiuri acontentlocation, in nsiuri arequestorigin, in nsisupports acontext, in acstring amimetype, in nsisupports aextra); attributes attribute type description allowseval boolean whether this policy allows eval and eval-like functions such as settimeout("code string", time).
nsICryptoHash
since hash functions are computed over bytes, you will first need to convert the string to a series of bytes using nsiscriptableunicodeconverter and a unicode encoding that you specify.
nsICycleCollectorListener
if begin() returns an error none of the other functions will be called.
nsIDOMChromeWindow
(); void getattentionwithcyclecount(in long acyclecount); void maximize(); void minimize(); void notifydefaultbuttonloaded(in nsidomelement defaultbutton); void restore(); void setcursor(in domstring cursor); attributes attribute type description browserdomwindow nsibrowserdomwindow the related nsibrowserdomwindow instance which provides access to yet another layer of utility functions by chrome script.
nsIDOMClientRect
it is returned by functions like element.getboundingclientrect.
nsIEventListenerInfo
this approach is necessary because event listeners added with addeventlistener won't necessarily be nsieventlisteners; the dom code will fix up ordinary javascript functions to act as listeners.
nsIFile
xpcom provides the string conversion functions ns_cstringtoutf16 and ns_utf16tocstring, which can be used to convert a string between utf-16 and the native character encoding.
nsIIOService
netwerk/base/public/nsiioservice.idlscriptable this interface provides a set of url parsing utility functions.
nsILocalFile
therefore, never use these functions unless you are absolutely sure that the path passed to them is always ascii-only.
Using nsILoginManager
getting nsiloginmanager to get a component implementing nsiloginmanager, use the following: var passwordmanager = components.classes["@mozilla.org/login-manager;1"].getservice( components.interfaces.nsiloginmanager ); most login manager functions take an nsilogininfo object as a parameter.
nsIMessageListener
this function receives a message from one of the three message-sending functions in the message manager framework: broadcastasyncmessage sendasyncmessage sendsyncmessage.
nsIMessenger
the nsimessenger interface provides functions for managing the history, undo and redo operations, and for loading, saving, or deleting messages and attachments in mailnews.
nsIMsgDatabase
void synccounts(); getthreadcontainingmsghdr() nsimsgthread getthreadcontainingmsghdr(in nsimsgdbhdr msghdr) ; markhdrread() helpers for user command functions like delete, mark read, etc.
nsIMsgSendLater
the nsimsgsendlater interface provides functions for managing the unsent folder of a messaging account.
nsINavHistoryObserver
notes the removepagesbyhost() and removepagesbytimeframe() functions call beginupdatebatch() and endupdatebatch() rather than onclearhistory() or ondeleteuri().
nsINavHistoryService
toolkit/components/places/nsinavhistoryservice.idlscriptable this interface provides complex query functions, more fine-grained getters and setters.
nsIPromptService
its methods should be used in privileged code instead of dom window.alert, window.confirm, and other similar functions.
nsIWebProgressListener
erequestor) .getinterface(ci.nsidomwindowutils) .outerwindowid; sendasyncmessage("myaddonmessage", { name: "onlocationchange", outerwindowid: outerwindowid, uri: auri.spec, charset: auri.charset, flag: aflag, }); }, // for definitions of the remaining functions see related documentation onprogresschange: function(awebprogress, arequest, curself, maxself, curtot, maxtot) {}, onstatuschange: function(awebprogress, arequest, astatus, amessage) {}, onsecuritychange: function(awebprogress, arequest, astate) {} } let filter = cc["@mozilla.org/appshell/component/browser-status-filter;1"] .createinstance(ci.nsiwebprogress); filter.a...
nsIXMLHttpRequestEventTarget
handling the events when the handler functions for these events are called, they receive as a parameter a progressevent, which implements the nsidomprogressevent interface.
nsIZipReader
all functions now pass the filenames (both in and out) as autf8string.
XPCOM Interface Reference by grouping
this is the root element and may contain some functions defined in other groups.
Storage
the full list of binding functions can be found with the mozistoragestatement documentation.
Troubleshooting XPCOM components registration
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.
Using the clipboard
the following boilerplate utility functions will be used in all later code examples.
Xptcall Porting Guide
a similar include file (xptcall/public/xptcstubsdef.inc) is expanded using platform specific macros to define the stub functions.
pyxpidl
unlike xpidl, which combined all the functions into a single utility, pyxpidl is comprised of two utilities: header.py, which generates c++ headers from idl, and typelib.py, which generates xpt files.
XPIDL
however, the presence of the binaryname property allows the user to select another name to use in native code (to avoid conflicts with other functions).
Testing Mozilla code
in addition, the runtime part replaces the malloc and free functions to check dynamically allocated memory.
nsIMsgCloudFileProvider
constants the following constants are used for the status codes passed to the onstoprequest functions of the nsirequestobserver's used by the asynchronous methods of nsimsgcloudfileprovider.
Index
this object provides many of the functions required for working with folder views.
Mail composition back end
currently, this method does several functions depending on the arguments passed in, but this could easily lead to confusion.
Mail event system
the notification functions should probably go to an nsifolderbroadcaster interface or something, since they need to know what folder is being modified.
Building a Thunderbird extension 6: Adding JavaScript
further documentation more functions for the dom objects are listed on: dom/window (api reference for the window object) dom/document (api reference for the document object) gecko dom reference (overview of all dom objects in gecko) you may also find the javascript cheat sheet very useful.
Folders and message lists
this object provides many of the functions required for working with folder views.
Thunderbird extensions
functions for dealing with messages (delete, archive, change tags, etc.) are included.
libmime content type handlers
api's content type handler plugins are dynamically loaded and need to access internal pointers, functions that are part of the c based object system.
Using Mozilla code in other projects
nspr the netscape portable runtime provides a platform-neutral api for system level and libc-type functions.
Using the Mozilla symbol server
the server functions like microsoft's symbol server so the documentation there can be useful.
Examples
lightweight bridge for calling cocoa frameworks from javascript, js-macosx transparently handles definition of cocoa api, both c and objective-c, and provides automatic declarations for framework functions, structures, constants and enumerations, as well as allows creating and subclassing cocoa classes.
Declaring and Using Callbacks
c functions occasionally take function pointers as arguments, which are generally used as callbacks.
Declaring types
primitive types primitive types are those types that represent a single value in memory, as opposed to arrays, structures, or functions.
CType
functiontype these represent callable c functions.
Int64
because javascript doesn't currently include standard support for 64-bit integer values, js-ctypes offers the int64 and uint64 objects to let you work with c functions and data that need (or may need) values represented using a 64-bit data type.
Library
this can be used both for exported data symbols and for functions.
UInt64
as javascript doesn't currently include standard support for 64-bit integer values, js-ctypes offers the int64 and uint64 objects to let you work with c functions and data that need (or may need) to use data represented using a 64-bit data type.
js-ctypes
using js-ctypes ctypes.open custom native file standard os libraries finding window handles working with data working with arraybuffers declaring types declaring and calling functions declaring and using callbacks type conversion memory management chromeworker js-ctypes reference a reference guide to the js-ctypes api.
Constants - Plugins
npvers_has_popups_enabled_state 16 the npn_pushpopupsenabledstate() and npn_poppopupsenabledstate() functions are supported.
Initialization and Destruction - Plugins
no plug-in api calls can take place in either direction until the initialization completes successfully, with the exception of the functions np_initialize and np_shutdown, which are not in the function tables.
Scripting plugins - Plugins
calling npn_getvalue() with either of those new enumerations will return an npobject representing the browser object, and from there, the functions in this api can be used to get and set properties, and to call methods on those browser objects.
Version, UI, and Status Information - Plugins
« previousnext » this chapter describes the functions that allow a plug-in to display a message on the status line, get agent information, and check on the current version of the plug-in api and the browser.
Set an XHR breakpoint - Firefox Developer Tools
when your code breaks on an xhr request, the righthand pane will have two additional sections: call stack the list of functions that were executed in order ot get to the currently executing code.
Index - Firefox Developer Tools
152 web console helpers debugging, javascript, web development, web console the javascript command line provided by the web console offers a few built-in helper functions that make certain tasks easier.
Use the Inspector API - Firefox Developer Tools
attributes and functions: .selection - information about the inspector's selection: .isnode() - returns true if selection is node.
Sorting algorithms comparison - Firefox Developer Tools
this program compares the performance of three different sorting algorithms: bubble sort selection sort quicksort it consists of the following functions: sortall() top-level function.
Firefox Developer Tools
dom property viewer inspect the page's dom properties, functions, etc.
Attr - Web APIs
WebAPIAttr
in most dom methods, you will directly retrieve the attribute as a string (e.g., element.getattribute()), but certain functions (e.g., element.getattributenode()) or means of iterating return attr types.
AudioListener.dopplerFactor - Web APIs
in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position via the positionpanner() function.
AudioListener.forwardX - Web APIs
in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position via the positionpanner() function.
AudioListener.forwardY - Web APIs
in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position via the positionpanner() function.
AudioListener.forwardZ - Web APIs
in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position via the positionpanner() function.
AudioListener.positionX - Web APIs
in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position via the positionpanner() function.
AudioListener.positionY - Web APIs
in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position via the positionpanner() function.
AudioListener.positionZ - Web APIs
in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position via the positionpanner() function.
AudioListener.setOrientation() - Web APIs
in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position via the positionpanner() function.
AudioListener.setPosition() - Web APIs
in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position via the positionpanner() function.
AudioListener.speedOfSound - Web APIs
in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position via the positionpanner() function.
AudioListener.upX - Web APIs
WebAPIAudioListenerupX
in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position via the positionpanner() function.
AudioListener.upY - Web APIs
WebAPIAudioListenerupY
in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position via the positionpanner() function.
AudioListener.upZ - Web APIs
WebAPIAudioListenerupZ
in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position via the positionpanner() function.
AudioListener - Web APIs
in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position via the positionpanner() function.
AudioTrack - Web APIs
usage notes to get an audiotrack for a given media element, use the element's audiotracks property, which returns an audiotracklist object from which you can get the individual tracks contained in the media: var el = document.queryselector("video"); var tracks = el.audiotracks; you can then access the media's individual tracks using either array syntax or functions such as foreach().
BaseAudioContext.createPanner() - Web APIs
in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position via the positionpanner() function.
BaseAudioContext.createWaveShaper() - Web APIs
note: sigmoid functions are commonly used for distortion curves because of their natural properties.
CSS - Web APIs
WebAPICSS
css factory functions can be used to return a new cssunitvalue with a value of the parameter number of the units of the name of the factory function method used.
CSSStyleDeclaration.setProperty() - Web APIs
we then use three functions to generate random values for the properties in question, and update the rule with these values.
Using the CSS Painting API - Web APIs
now we can really start to see the benefits of this api, if we can control a myriad of drawing parameters from our css through both custom properties and extra paint() function arguments, then we can really start to build reusable and highly controllable styling functions.
CSS Painting API - Web APIs
the css painting api — part of the css houdini umbrella of apis — allows developers to write javascript functions that can draw directly into an element's background, border, or content.
Cache.put() - Web APIs
WebAPICacheput
in such cases you are better off using cache.add()/cache.addall(), as they are shorthand functions for one or more of these operations.
CanvasRenderingContext2D.filter - Web APIs
syntax ctx.filter = "<filter-function1> [<filter-function2>] [<filter-functionn>]"; ctx.filter = "none"; values the filter property accepts a value of "none" or one or more of the following filter functions in a domstring.
Basic usage of canvas - Web APIs
the <canvas> element has a method called getcontext(), used to obtain the rendering context and its drawing functions.
Transformations - Web APIs
a save and restore canvas state example this example tries to illustrate how the stack of drawing states functions by drawing a set of consecutive rectangles.
console.log() - Web APIs
WebAPIConsolelog
there's more information in the chrome console api reference about this and other functions.
Console API - Web APIs
the console api spec was created to define consistent behavior, and all modern browsers eventually settled on implementing this behavior — although some implementations still have their own additional proprietary functions.
Document.cookie - Web APIs
WebAPIDocumentcookie
note: as you can see from the code above, document.cookie is an accessor property with native setter and getter functions, and consequently is not a data property with a value: what you write is not the same as what you read, everything is always mediated by the javascript interpreter.
DocumentOrShadowRoot.getSelection() - Web APIs
this can make the object appear to be a string when used with other functions when it is really an object with properties and methods.
Introduction to the DOM - Web APIs
the following very simple web page provides a <script> element in the header in which you can place functions that test the interface, a few html elements with attributes that you can retrieve, set, or otherwise manipulate, and the web user interface necessary to call those functions from the browser.
EXT_texture_compression_bptc - Web APIs
constants the compressed texture formats are exposed by 4 constants and can be used in two functions: compressedteximage2d() and compressedtexsubimage2d().
EXT_texture_compression_rgtc - Web APIs
constants the compressed texture formats are exposed by 4 constants and can be used in two functions: compressedteximage2d() and compressedtexsubimage2d().
Using files from web applications - Web APIs
we don't actually need to do anything with the dragenter and dragover events in our case, so these functions are both simple.
Using the Frame Timing API - Web APIs
chrome performance tool the chrome (and canary) browsers also have a performance tool with similar functions as firefox.
Using the Gamepad API - Web APIs
the index property also functions as the index into the array returned by navigator.getgamepads().
GeolocationCoordinates.longitude - Web APIs
together with a domtimestamp indicating a time of measurement, the geolocationcoordinates object is part of the geolocationposition interface, which is the object type returned by geolocation api functions that obtain and return a geographical position.
HTMLImageElement.name - Web APIs
since it functions identically to id, you can and should use it instead.
HTMLSelectElement - Web APIs
htmlselectelement.name a domstring reflecting the name html attribute, containing the name of this control used by servers and dom search functions.
HTML Drag and Drop API - Web APIs
these are convenience functions to help with dragging multiple items or non-string data (such as files).
IDBDatabase.onabort - Web APIs
}; example this example shows an idbopendbrequest.onupgradeneeded block that creates a new object store; it also includes onerror and onabort functions to handle non-success cases.
IDBDatabase.onerror - Web APIs
} example this example shows an idbopendbrequest.onupgradeneeded block that creates a new object store; it also includes onerror and onabort functions to handle non-success cases.
IDBDatabase.onversionchange - Web APIs
} example this example shows an idbopendbrequest.onupgradeneeded block that creates a new object store; it also includes onerror and onabort functions to handle non-success cases, and an onversionchange function to notify when a database structure change has occurred.
IDBLocaleAwareKeyRange - Web APIs
the idblocaleawarekeyrange interface of the indexeddb api is a firefox-specific version of idbkeyrange — it functions in exactly the same fashion, and has the same properties and methods, but it is intended for use with idbindex objects when the original index had a locale value specified upon its creation (see createindex()'s optionalparameters) — that is, it has locale aware sorting enabled.
IDBObjectStore.add() - Web APIs
note also the functions attached to transaction event handlers to report on the outcome of the transaction opening in the event of success or failure.
IDBRequest - Web APIs
example in the following code snippet, we open a database asynchronously and make a request; onerror and onsuccess functions are included to handle the success and error cases.
IDBTransaction.abort() - Web APIs
note also the functions attached to transaction event handlers to report on the outcome of the transaction opening in the event of success or failure.
IDBTransaction.db - Web APIs
WebAPIIDBTransactiondb
note also the functions attached to transaction event handlers to report on the outcome of the transaction opening in the event of success or failure.
IDBTransaction.error - Web APIs
note also the functions attached to transaction event handlers to report on the outcome of the transaction opening in the event of success or failure.
IDBTransaction.mode - Web APIs
note also the functions attached to transaction event handlers to report on the outcome of the transaction opening in the event of success or failure.
IDBTransaction.objectStore() - Web APIs
note also the functions attached to transaction event handlers to report on the outcome of the transaction opening in the event of success or failure.
IDBTransaction.onabort - Web APIs
note also the functions attached to transaction event handlers to report on the outcome of the transaction opening in the event of success or failure.
IDBTransaction.oncomplete - Web APIs
note also the functions attached to transaction event handlers to report on the outcome of the transaction opening in the event of success or failure.
IDBTransaction.onerror - Web APIs
note also the functions attached to transaction event handlers to report on the outcome of the transaction opening in the event of success or failure.
IDBTransaction - Web APIs
note also the functions attached to transaction event handlers to report on the outcome of the transaction opening in the event of success or failure.
Keyboard.getLayoutMap() - Web APIs
the getlayoutmap() method of the keyboard interface returns a promise that resolves with an instance of keyboardlayoutmap which is a map-like object with functions for retrieving the strings associated with specific physical keys.
KeyboardLayoutMap - Web APIs
the keyboardlayoutmap interface of the the keyboard api is a map-like object with functions for retrieving the string associated with specific physical keys.
LockManager.request() - Web APIs
notice that both functions use a lock called my_resource.
MIDIInputMap - Web APIs
though it works generally like a map, because it is read-only it does not contain clear(), delete(), or set() functions.
MIDIOutputMap - Web APIs
although it works like a map, because it is read-only, it does not contain clear(), delete(), or set() functions.
Recording a media element - Web APIs
utility functions next, we create some utility functions that will get used later.
MouseEvent.button - Web APIs
WebAPIMouseEventbutton
others may have many buttons mapped to different functions and button values.
Navigator.keyboard - Web APIs
the keyboard read-only property of the navigator interface returns a keyboard object which provides access to functions that retrieve keyboard layout maps and toggle capturing of key presses from the physical keyboard.
NavigatorID - Web APIs
javascript taint/untaint functions were removed in javascript 1.2.
Notifications API - Web APIs
serviceworkerglobalscope includes the serviceworkerglobalscope.onnotificationclick handler, for firing custom functions when a notification is clicked.
PageTransitionEvent - Web APIs
the pagetransitionevent event object is available inside handler functions for the pageshow and pagehide events, fired when a document is being loaded or unloaded.
PannerNode.coneInnerAngle - Web APIs
the x and z components are always at a 90° to each other, so we can use the sine and cosine functions, which are offset by the same amount in radians.
PannerNode.coneOuterAngle - Web APIs
the x and z components are always at a 90° to each other, so we can use the sine and cosine functions, which are offset by the same amount in radians.
PannerNode.coneOuterGain - Web APIs
the x and z components are always at a 90° to each other, so we can use the sine and cosine functions, which are offset by the same amount in radians.
PannerNode.distanceModel - Web APIs
in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position via the positionpanner() function.
PannerNode.maxDistance - Web APIs
in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position via the positionpanner() function.
PannerNode.orientationX - Web APIs
the x and z components are always at a 90° to each other, so we can use the sine and cosine functions, which are offset by the same amount in radians.
PannerNode.orientationY - Web APIs
the x and z components are always at a 90° to each other, so we can use the sine and cosine functions, which are offset by the same amount in radians.
PannerNode.orientationZ - Web APIs
the x and z components are always at a 90° to each other, so we can use the sine and cosine functions, which are offset by the same amount in radians.
PannerNode.panningModel - Web APIs
in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position via the positionpanner() function.
PannerNode.setOrientation() - Web APIs
in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position via the positionpanner() function.
PannerNode.setPosition() - Web APIs
in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position via the positionpanner() function.
PannerNode.setVelocity() - Web APIs
in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position via the positionpanner() function.
PannerNode - Web APIs
in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position via the positionpanner() function.
PaymentRequest.show() - Web APIs
then/catch syntax you can also use the older promise-based approach to work with payments, using the then() and catch() functions on the promise returned by show(): function processspayment() { const payrequest = new paymentrequest(methoddata, details, options); payrequest.onshippingaddresschange = ev => ev.updatewith(checkaddress(payrequest)); payrequest.onshippingoptionchange = ev => ev.updatewith(checkshipping(payrequest)); payrequest.show() .then(response => validateresponse(response)) .catch(err => h...
Payment processing concepts - Web APIs
functions of a payment handler a user agent may provide built-in support for certain types of payments.
Using the Payment Request API - Web APIs
so for example, you could create a new paymentrequest instance like so: var request = new paymentrequest(buildsupportedpaymentmethoddata(), buildshoppingcartdetails()); the functions invoked inside the constructor simply return the required object parameters: function buildsupportedpaymentmethoddata() { // example supported payment methods: return [{ supportedmethods: 'basic-card', data: { supportednetworks: ['visa', 'mastercard'], supportedtypes: ['debit', 'credit'] } }]; } function buildshoppingcartdetails() { // hardcoded for demo purposes...
PointerEvent.pressure - Web APIs
example in this snippet, when a pointerdown event is fired, different functions are called depending on the value of the event's pressure property.
PointerEvent.tangentialPressure - Web APIs
example in this snippet, when a pointerdown event is fired, different functions are called depending on the value of the event's tangentialpressure property.
PointerEvent.twist - Web APIs
example when a pointerdown event is fired, different functions are called depending on the value of the event's twist property.
RTCRemoteOutboundRtpStreamStats.localId - Web APIs
example in this example, we have a pair of functions: the first, networkteststart(), captures an initial report, and the second, networkteststop(), captures a second report, then uses the two reports to output some information about the network conditions...
RTCRtpCapabilities - Web APIs
the rtcrtpcapabilities dictionary is a data type used to describe the capabilities of an rtcrtpsender or rtcrtpreceiver in response to a call to the rtcrtpsender.getcapabilities() or rtcrtpreceiver.getcapabilities() static functions, both of which return an array of rtcrtpcapabilities objects.
RTCRtpCodecCapability - Web APIs
an array of objects of this type is returned in the codecs property of the rtcrtpcapabilities object returned in response to a call to either of the static functions rtcrtpsender.getcapabilities() or rtcrtpreceiver.getcapabilities().
ReadableStreamDefaultController - Web APIs
note that a readablestreamdefaultcontroller object is provided as the parameter of the start() and pull() functions.
Request - Web APIs
WebAPIRequest
note: the body functions can be run only once; subsequent calls will resolve with empty strings/arraybuffers.
SourceBufferList - Web APIs
[]) or functions such as foreach() for example.
SubtleCrypto.digest() - Web APIs
supported algorithms digest algorithms, also known as cryptographic hash functions, transform an arbitrarily large block of data into a fixed-size output, usually much shorter than the input.
SubtleCrypto.encrypt() - Web APIs
ptmessage(key) { let encoded = getmessageencoding(); // counter will be needed for decryption counter = window.crypto.getrandomvalues(new uint8array(16)); return window.crypto.subtle.encrypt( { name: "aes-ctr", counter, length: 64 }, key, encoded ); } let iv = new uint8array(16); let key = new uint8array(16); let data = new uint8array(12345); //crypto functions are wrapped in promises so we have to use await and make sure the function that //contains this code is an async function //encrypt function wants a cryptokey object const key_encoded = await crypto.subtle.importkey( "raw", key.buffer, 'aes-ctr' , false, ["encrypt", "decrypt"]); const encrypted_content = await window.crypto.subtle.encrypt( { name: "aes-ctr", counter: iv, ...
TextTrackList - Web APIs
the individual tracks can be accessed using array syntax or functions such as foreach() for example.
VideoTrack - Web APIs
usage notes to get a videotrack for a given media element, use the element's videotracks property, which returns a videotracklist object from which you can get the individual tracks contained in the media: var el = document.queryselector("video"); var tracks = el.videotracks; you can then access the media's individual tracks using either array syntax or functions such as foreach().
VideoTrackList - Web APIs
the individual tracks can be accessed using array syntax or functions such as foreach() for example.
WEBGL_compressed_texture_astc - Web APIs
constants the compressed texture formats are exposed by 28 constants and can be used in two functions: compressedteximage2d() and compressedtexsubimage2d().
WEBGL_compressed_texture_atc - Web APIs
constants the compressed texture formats are exposed by 3 constants and can be used in two functions: compressedteximage2d() and compressedtexsubimage2d().
WEBGL_compressed_texture_etc - Web APIs
constants the compressed texture formats are exposed by 10 constants and can be used in two functions: compressedteximage2d() and compressedtexsubimage2d().
WEBGL_compressed_texture_pvrtc - Web APIs
constants the compressed texture formats are exposed by four constants and can be used in two functions: compressedteximage2d() (where the height and width parameters must be powers of 2) and compressedtexsubimage2d() (where the the height and width parameters must equal the current values of the existing texture and the xoffset and yoffset parameters must be 0).
WEBGL_compressed_texture_s3tc - Web APIs
constants the compressed texture formats are exposed by four constants and can be used in two functions: compressedteximage2d() and compressedtexsubimage2d().
WEBGL_compressed_texture_s3tc_srgb - Web APIs
constants the compressed texture formats are exposed by four constants and can be used in two functions: compressedteximage2d() and compressedtexsubimage2d().
WEBGL_lose_context - Web APIs
the webgl_lose_context extension is part of the webgl api and exposes functions to simulate losing and restoring a webglrenderingcontext.
WaveShaperNode.curve - Web APIs
note: sigmoid functions are commonly used for distortion curves because of their natural properties.
WaveShaperNode.oversample - Web APIs
note: sigmoid functions are commonly used for distortion curves because of their natural properties.
WaveShaperNode - Web APIs
note: sigmoid functions are commonly used for distortion curves because of their natural properties.
WebGLRenderingContext.getParameter() - Web APIs
ext.fragment_shader_derivative_hint_oes glenum oes_standard_derivatives accuracy of the derivative calculation for the glsl built-in functions: dfdx, dfdy, and fwidth.
WebGLRenderingContext.getUniformLocation() - Web APIs
having done this, the next time the shading functions are called, their own variables named uscalingfactor, uglobalcolor, and urotationvector will all have the values provided by the javascript code.
WebGLRenderingContext.hint() - Web APIs
when using the oes_standard_derivatives extension: ext.fragment_shader_derivative_hint_oes: accuracy of the derivative calculation for the glsl built-in functions: dfdx, dfdy, and fwidth.
WebGLRenderingContext.uniform[1234][fi][v]() - Web APIs
many of the functions described here have expanded webgl 2 interfaces, which can be found under webgl2renderingcontext.uniform[1234][uif][v]().
A basic 2D WebGL animation example - Web APIs
compiling and linking the shader program constructing and linking the program the buildshaderprogram() function accepts as input an array of objects describing a set of shader functions to be compiled and linked into the shader program and returns the shader program after it's been built and linked.
Adding 2D content to a WebGL context - Web APIs
there are two shader functions run when drawing webgl content: the vertex shader and the fragment shader.
Lighting in WebGL - Web APIs
it just runs two functions you supply — a vertex shader and a fragment shader — and expects you to write creative functions to get the results you want.
Using WebGL extensions - Web APIs
extension objects if an extension defines specific symbols or functions that are not available in the core specification of webgl, they will be available on the extension object returned by the call to gl.getextension().
WebGL best practices - Web APIs
rgb8 in particular is often surprisingly slow, as masking out the alpha channel and/or patching blend functions has fairly high overhead.
Establishing a connection: The WebRTC perfect negotiation pattern - Web APIs
the perfect negotiation logic now we get into the true perfect negotiation logic, which functions entirely independently from the rest of the application.
A simple RTCDataChannel sample - Web APIs
similarly, this example uses arrow functions to simplify syntax.
The WebSocket API (WebSockets) - Web APIs
jsonrpc-bidirectional: asynchronous rpc which, on a single connection, may have functions exported on the server and, and the same time, on the client (client may call server, server may also call client).
Lighting a WebXR setting - Web APIs
by altering the accuracy of these functions, the browser makes the data less consistent, and, importantly, makes the data generated by two computers differ, even in the same setting.
Basic concepts behind Web Audio API - Web APIs
this modular design provides the flexibility to create complex audio functions with dynamic effects.
Migrating from webkitAudioContext - Web APIs
codeaudiodata(xhr.response, function onsuccess(decodedbuffer) { // decoding was successful, do something useful with the audio buffer }, function onfailure() { alert("decoding the audio buffer failed"); }); }; note that the decodeaudiodata() method is asynchronous, which means that it will return immediately, and then when the decoding finishes, one of the success or failure callback functions will get called depending on whether the audio decoding was successful.
Using the Web Audio API - Web APIs
because of this modular design, you can create complex audio functions with dynamic effects.
Web Audio API - Web APIs
this modular design provides the flexibility to create complex audio functions with dynamic effects.
Web Crypto API - Web APIs
even assuming you use the basic cryptographic functions correctly, secure key management and overall security system design are extremely hard to get right, and are generally the domain of specialist security experts.
Web Locks API - Web APIs
advanced use for more complicated cases, such as holding the lock for an arbitrary amount of time, the callback can return a promise explicitly resolved by the script: // capture promise control functions: let resolve, reject; const p = new promise((res, rej) => { resolve = res; reject = rej; }); // request the lock: navigator.locks.request('my_resource', lock => { // lock is acquired.
Web Workers API - Web APIs
see functions and classes available to workers for more details.
Window.controllers - Web APIs
chrome code can add controllers (to be used in conjunction with the godocommand and goupdatecommand functions in globaloverlay.js).
Window.getSelection() - Web APIs
this can make the object appear to be a string when used with other functions when it is really an object with properties and methods.
Window.open() - Web APIs
WebAPIWindowopen
firefox (50.0.1) functions as described: from the same domain+port reopen with same name will access the previously created window.
Window: popstate event - Web APIs
note: when writing functions that process popstate event it is important to take into account that properties like window.location will already reflect the state change (if it affected the current url), but document might still not.
Window.requestAnimationFrame() - Web APIs
the callback function is passed one single argument, a domhighrestimestamp similar to the one returned by performance.now(), indicating the point in time when requestanimationframe() starts to execute callback functions.
window.requestIdleCallback() - Web APIs
functions are generally called in first-in-first-out order; however, callbacks which have a timeout specified may be called out-of-order if necessary in order to run them before the timeout elapses.
Window.scrollY - Web APIs
WebAPIWindowscrollY
} window.scrollbypages(1); notes use this property to check that the document hasn't already been scrolled when using relative scroll functions such as scrollby(), scrollbylines(), or scrollbypages().
Window.window - Web APIs
WebAPIWindowwindow
thus, "this.window" inside of its functions would refer to that window object.
Window - Web APIs
WebAPIWindow
the window interface is home to a variety of functions, namespaces, objects, and constructors which are not necessarily directly associated with the concept of a user interface window.
WindowEventHandlers.onunload - Web APIs
note: browsers equipped with pop-up blockers will ignore all window.open() method calls in onunload event handler functions.
Worker - Web APIs
WebAPIWorker
not all interfaces and functions are available to scripts inside a worker.
WorkerGlobalScope.self - Web APIs
we also maintain a list of functions and classes available to web workers.
Using XMLHttpRequest - Web APIs
*/, "yourpage.html"); oreq.onload = getheadertime; oreq.send(); do something when last modified date changes let's create two functions: function getheadertime () { var nlastvisit = parsefloat(window.localstorage.getitem('lm_' + this.filepath)); var nlastmodif = date.parse(this.getresponseheader("last-modified")); if (isnan(nlastvisit) || nlastmodif > nlastvisit) { window.localstorage.setitem('lm_' + this.filepath, date.now()); isfinite(nlastvisit) && this.callback(nlastmodif, nlastvisit); } } function ifhascha...
XPathException - Web APIs
constants constant value description invalid_expression_err 51 if the expression has a syntax error or otherwise is not a legal expression according to the rules of the specific xpathevaluator or contains specialized extension functions or variables not supported by this implementation.
XRInputSourceArray.forEach() - Web APIs
note that if you use arrow function notation (=>) to provide the callback, you can omit thisarg, since all arrow functions lexically bind this.
XRSession - Web APIs
WebAPIXRSession
event description end sent to the xrsession object after the webxr session has ended and all hardware-related functions have completed.
XRWebGLLayer.framebuffer - Web APIs
calling functions such as framebuffertexture2d(), framebufferrenderbuffer(), deleteframebuffer(), or getframebufferattachmentparameter() on an opaque framebuffer results in the webgl error invalid_operation (0x0502).
Using the aria-describedby attribute - Accessibility
</div> </div> example 2: a close button in the example below, a link that functions as a 'close' button on a dialog is described elsewhere in the document.
Using the aria-invalid attribute - Accessibility
ore sophisticated): function checkvalidity(aid, asearchterm, amsg){ var elem = document.getelementbyid(aid); var invalid = (elem.value.indexof(asearchterm) < 0); if (invalid) { elem.setattribute("aria-invalid", "true"); updatealert(amsg); } else { elem.setattribute("aria-invalid", "false"); updatealert(); } } the snippet below shows the alert functions, which add (or remove) the error message: function updatealert(msg) { var oldalert = document.getelementbyid("alert"); if (oldalert) { document.body.removechild(oldalert); } if (msg) { var newalert = document.createelement("div"); newalert.setattribute("role", "alert"); newalert.setattribute("id", "alert"); var content = document.createtext...
ARIA: feed role - Accessibility
by identifying the elements inside of an article that provide the title and the primary content, assistive technologies can provide functions that enable users to jump from article to article and efficiently discern which articles they want to read.
Keyboard-navigable JavaScript widgets - Accessibility
prevent used key events from performing browser functions if your widget handles a key event, prevent the browser from also handling it (for example, scrolling in response to the arrow keys) by using your event handler's return code.
:has() - CSS: Cascading Style Sheets
WebCSS:has
instead, it could only be used with functions like document.queryselector(); this was due to performance concerns.
@supports - CSS: Cascading Style Sheets
WebCSS@supports
the following example returns true if the browser's transform-origin property considers 5% 5% valid: @supports (transform-origin: 5% 5%) {} function syntax the second basic supports condition is a supports function, the syntax for these is supported by all browsers, but the functions themselves are still being standardized.
Introduction to formatting contexts - CSS: Cascading Style Sheets
the name of the flow-root keyword refers to the fact that you're creating something that serves, in essence, like a new root element (like <html> does), given how the new context is created and its flow layout functions.
CSS Grid Layout - CSS: Cascading Style Sheets
id-row: 3; } .five { grid-column: 2; grid-row: 4; } .six { grid-column: 3; grid-row: 4; } reference css properties grid-template-columns grid-template-rows grid-template-areas grid-template grid-auto-columns grid-auto-rows grid-auto-flow grid grid-row-start grid-column-start grid-row-end grid-column-end grid-row grid-column grid-area row-gap column-gap gap css functions repeat() minmax() fit-content() css data types <flex> glossary entries grid grid lines grid tracks grid cell grid area gutters grid axis grid row grid column guides basic concepts of grid layout relationship of grid layout to other layout methods layout using line-based placement grid template areas layout using named grid lines auto-placement in css grid l...
CSS data types - CSS: Cascading Style Sheets
WebCSSCSS Types
css data types define typical values (including keywords and units) accepted by css properties and functions.
Privacy and the :visited selector - CSS: Cascading Style Sheets
little white lies to preserve users' privacy, firefox and other browsers will lie to web applications under certain circumstances: the window.getcomputedstyle method, and similar functions such as element.queryselector, will always return values indicating that a user has never visited any of the links on a page.
Value definition syntax - CSS: Cascading Style Sheets
the comma is often used to separate values in enumerations, or parameters in mathematical-like functions; the slash often separates parts of the value that are semantically different, but have a common syntax.
Visual formatting model - CSS: Cascading Style Sheets
this includes continuous media such as a computer screen and paged media such as a book or document printed by browser print functions.
<angle> - CSS: Cascading Style Sheets
WebCSSangle
it is used, for example, in <gradient>s and in some transform functions.
animation-direction - CSS: Cascading Style Sheets
animation steps are performed backwards, and timing functions are also reversed.
aspect-ratio - CSS: Cascading Style Sheets
the aspect-ratio css property sets a preferred aspect ratio for the box, which will be used in the calculation of auto sizes and some other layout functions.
calc() - CSS: Cascading Style Sheets
WebCSScalc
it is permitted to nest calc() functions, in which case the inner ones are treated as simple parentheses.
<filter-function> - CSS: Cascading Style Sheets
syntax the <filter-function> data type is specified using one of the filter functions listed below.
<gradient> - CSS: Cascading Style Sheets
WebCSSgradient
they are generated with the repeating-linear-gradient() and repeating-radial-gradient() functions.
grid-template-columns - CSS: Cascading Style Sheets
the grid-template-columns css property defines the line names and track sizing functions of the grid columns.
grid-template-rows - CSS: Cascading Style Sheets
the grid-template-rows css property defines the line names and track sizing functions of the grid rows.
rotate - CSS: Cascading Style Sheets
WebCSSrotate
this maps better to typical user interface usage, and saves having to remember the exact order of transform functions to specify in the transform property.
scale - CSS: Cascading Style Sheets
WebCSSscale
this maps better to typical user interface usage, and saves having to remember the exact order of transform functions to specify in the transform value.
matrix() - CSS: Cascading Style Sheets
cartesian coordinates on ℝ2 homogeneous coordinates on ℝℙ2 cartesian coordinates on ℝ3 homogeneous coordinates on ℝℙ3 ac bd actxbdty001 actxbdty001 ac0txbd0ty00100001 [a b c d tx ty] the values represent the following functions: matrix( scalex(), skewy(), skewx(), scaley(), translatex(), translatey() ) examples html <div>normal</div> <div class="changed">changed</div> css div { width: 80px; height: 80px; background-color: skyblue; } .changed { transform: matrix(1, 2, -1, 1, 80, 80); background-color: pink; } result specifications specification status comment css transfor...
translateZ() - CSS: Cascading Style Sheets
editor's draft adds 3d transform functions to the css transforms standard.
translate - CSS: Cascading Style Sheets
WebCSStranslate
this maps better to typical user interface usage, and saves having to remember the exact order of transform functions to specify in the transform value.
url() - CSS: Cascading Style Sheets
WebCSSurl()
the url() function can be passed as a parameter of another css functions, like the attr() function.
visibility - CSS: Cascading Style Sheets
the value is interpolated as a discrete step, where values of the timing function between 0 and 1 map to visible and other values of the timing function (which occur only at the start/end of the transition or as a result of cubic-bezier() functions with y values outside of [0, 1]) map to the closer endpoint.
exsl:node-set() - EXSLT
WebEXSLTexslnode-set
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes exsl:node-set() returns a node-set from a result tree fragment, which is what you get when you look at the xsl:variable instead of its select attribute to fetch a variable's value.
Common (exsl) - EXSLT
WebEXSLTexsl
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the exslt common package provides basic functions that expand upon the capabilities of xslt.
math:highest() - EXSLT
WebEXSLTmathhighest
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes math:highest() returns the node in the specified node-set with the highest value (where the highest value calculated using math:max()).
math:lowest() - EXSLT
WebEXSLTmathlowest
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes math:lowest() returns the node in the specified node-set with the lowest value (where the lowest value calculated using math:min()).
math:max() - EXSLT
WebEXSLTmathmax
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes math:max() returns the maximum value of a node-set.
math:min() - EXSLT
WebEXSLTmathmin
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes math:min() returns the minimum value of a node-set.
Math (math) - EXSLT
WebEXSLTmath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the exslt math package provides functions for working with numeric values and comparing nodes.
regexp:match() - EXSLT
WebEXSLTregexpmatch
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes regexp:match() performs regular expression matching on a string, returning the submatches found as a result.
regexp:replace() - EXSLT
WebEXSLTregexpreplace
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes regexp:replace() replaces the portions of a string that match a given regular expression with the contents of another string.
Regular expressions (regexp) - EXSLT
WebEXSLTregexp
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the exslt regular expressions package provides functions that allow testing, matching, and replacing text using javascript style regular expressions.
set:difference() - EXSLT
WebEXSLTsetdifference
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes set:difference() returns the difference between two node-sets.
set:distinct() - EXSLT
WebEXSLTsetdistinct
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes set:distinct() returns a subset of the nodes in the specified node-set, returning only nodes with unique string values.
set:has-same-node() - EXSLT
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes set:has-same-node() determines whether two node-sets have any nodes in common.
set:intersection() - EXSLT
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes set:intersection() returns the intersection of two node-sets.
set:leading() - EXSLT
WebEXSLTsetleading
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes set:leading() returns the nodes in one node-set that come before the first node in the other node-set.
set:trailing() - EXSLT
WebEXSLTsettrailing
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes set:trailing() returns the nodes in one node-set that come after the first node in the other node-set.
str:concat() - EXSLT
WebEXSLTstrconcat
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes str:concat() returns a string containing all the string values in a node-set concatenated together.
str:split() - EXSLT
WebEXSLTstrsplit
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes str:split() splits a string using a pattern string to determine where the splits should occur, returning a node-set containing the resulting strings.
str:tokenize() - EXSLT
WebEXSLTstrtokenize
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes str:tokenize() splits a string using a set of characters as delimiters that determine where the splits should occur, returning a node-set containing the resulting strings.
Strings (str) - EXSLT
WebEXSLTstr
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the exslt strings package provides functions that allow the manipulation of strings.
Index - Event reference
WebEventsIndex
each event is represented by an object which is based on the event interface, and may have additional custom fields and/or functions used to get additional information about what happened.
Event reference
each event is represented by an object which is based on the event interface, and may have additional custom fields and/or functions used to get additional information about what happened.
Cross-browser audio basics - Developer guides
">audiofile.mp3</a></p> </audio> <!-- custom play and pause buttons --> <button id="play">play</button> <button id="pause">pause</button> next, we attach some functionality to the player using javascript: window.onload = function(){ var myaudio = document.getelementbyid('my-audio'); var play = document.getelementbyid('play'); var pause = document.getelementbyid('pause'); // associate functions with the 'onclick' events play.onclick = playaudio; pause.onclick = pauseaudio; function playaudio() { myaudio.play(); } function pauseaudio() { myaudio.pause(); } } media loading events above we have shown how you can create a very simple audio player, but what if we want to show progress, buffering and only activate the buttons when the media is ready to play?
Overview of events and handlers - Developer guides
there is also some subtlety in learning how to write the handler functions since such code works asynchronously and potentially will run repeatedly but in slightly different situations.
Event developer guide - Developer guides
WebGuideEvents
the custom events page describes how the event code design pattern can be used in custom code to define new event types emitted by user objects, register listener functions to handle those events, and trigger the events in user code.
<input type="date"> - HTML: Hypertext Markup Language
WebHTMLElementinputdate
n> <span> <label for="year">year:</label> <select id="year" name="year"> </select> </span> </div> </form> the months are hardcoded (as they are always the same), while the day and year values are dynamically generated depending on the currently selected month and year, and the current year (see the code comments below for detailed explanations of how these functions work.) span { padding-left: 5px; } input:invalid + span::after { content: '✖'; } input:valid + span::after { content: '✓'; } javascript the other part of the code that may be of interest is the feature detection code — to detect whether the browser supports <input type="date">.
<input type="datetime-local"> - HTML: Hypertext Markup Language
for="minute">minute:</label> <select id="minute" name="minute"> </select> </span> </div> </div> </form> the months are hard-coded (as they are always the same), while the day and year values are dynamically generated depending on the currently selected month and year, and the current year respectively (see the code comments below for detailed explanations of how these functions work.) we also decided to dynamically generate the hours and minutes, as there are so many of them!
<input type="hidden"> - HTML: Hypertext Markup Language
WebHTMLElementinputhidden
normally, the name attribute functions on hidden inputs just like on any other input.
<input type="month"> - HTML: Hypertext Markup Language
WebHTMLElementinputmonth
the list of available year values is dynamically generated depending on the current year (see the code comments below for detailed explanations of how these functions work).
<link>: The External Resource Link element - HTML: Hypertext Markup Language
WebHTMLElementlink
non-standard attributes methods the value of this attribute provides information about the functions that might be performed on an object.
<nextid>: The NeXT ID element (Obsolete) - HTML: Hypertext Markup Language
WebHTMLElementnextid
<form>, <input>, <textarea>, <select>, and <option> html version 2 strict level 1 this is like regular level 1 but it also excludes these depreciated elements, along with such constructs as nesting a header (<h*> element) within a link (<a> element) html version 2 level 2 this is the default and includes and permits all html level 2 functions and elements and attributes html version 2 strict level 2 this excludes these depreciated elements and also forbids such constructs as nesting a header (<h*> element) within a link (<a> element), or having a forms <input> element which is not within a block level element such as <p> html version 3.2 <nextid> has vanished altogether, never to be heard from again.
class - HTML: Hypertext Markup Language
classes allow css and javascript to select and access specific elements via the class selectors or functions like the dom method document.getelementsbyclassname.
Global attributes - HTML: Hypertext Markup Language
classes allows css and javascript to select and access specific elements via the class selectors or functions like the method document.getelementsbyclassname().
HTML documentation index - HTML: Hypertext Markup Language
WebHTMLIndex
classes allow css and javascript to select and access specific elements via the class selectors or functions like the dom method document.getelementsbyclassname.
CSP: trusted-types - HTTP
the http content-security-policy (csp) trusted-types directive instructs user agents to restrict usage of known dom xss sinks to a predefined set of functions that only accept non-spoofable, typed values in place of strings.
Feature-Policy: geolocation - HTTP
when this policy is enabled, calls to getcurrentposition() and watchposition() will cause those functions' callbacks to be invoked with a positionerror code of permission_denied.
Feature-Policy - HTTP
when this policy is disabled, calls to getcurrentposition() and watchposition() will cause those functions' callbacks to be invoked with a positionerror code of permission_denied.
Index - HTTP
WebHTTPHeadersIndex
when this policy is enabled, calls to getcurrentposition() and watchposition() will cause those functions' callbacks to be invoked with a positionerror code of permission_denied.
POST - HTTP
WebHTTPMethodsPOST
as described in the http 1.1 specification, post is designed to allow a uniform method to cover the following functions: annotation of existing resources posting a message to a bulletin board, newsgroup, mailing list, or similar group of articles; adding a new user through a signup modal; providing a block of data, such as the result of submitting a form, to a data-handling process; extending a database through an append operation.
HTTP range requests - HTTP
partial requests are useful for large media or downloading files with pause and resume functions, for example.
About JavaScript - JavaScript
javascript® (often shortened to js) is a lightweight, interpreted, object-oriented language with first-class functions, and is best known as the scripting language for web pages, but it's used in many non-browser environments as well.
Concurrency model and the event loop - JavaScript
the processing of functions continues until the stack is once again empty.
Indexed collections - JavaScript
the foreach() method provides another way of iterating over an array: let colors = ['red', 'green', 'blue'] colors.foreach(function(color) { console.log(color) }) // red // green // blue alternatively, you can shorten the code for the foreach parameter with es2015 arrow functions: let colors = ['red', 'green', 'blue'] colors.foreach(color => console.log(color)) // red // green // blue the function passed to foreach is executed once for every item in the array, with the array item passed as the argument to the function.
JavaScript Guide - JavaScript
ript javascript and java ecmascript tools hello world grammar and types basic syntax & comments declarations variable scope variable hoisting data structures and types literals control flow and error handling if...else switch try/catch/throw error objects loops and iteration for while do...while break/continue for..in for..of functions defining functions calling functions function scope closures arguments & parameters arrow functions expressions and operators assignment & comparisons arithmetic operators bitwise & logical operators conditional (ternary) operator numbers and dates number literals number object math object date object text formatting string literals string object...
About the JavaScript reference - JavaScript
functions chapter about javascript functions.
static - JavaScript
these are often utility functions, such as functions to create or clone objects.
Warning: expression closures are deprecated - JavaScript
var x = function() { return 1; } var obj = { count: function() { return 1; } }; standard syntax using arrow functions alternatively, you can use arrow functions: var x = () => 1; standard syntax using shorthand method syntax expression closures can also be found with getter and setter, like this: var obj = { get x() 1, set x(v) this.v = v }; with es2015 method definitions, this can be converted to: var obj = { get x() { return 1 }, set x(v) { this.v = v } }; ...
TypeError: "x" is not a constructor - JavaScript
generator functions cannot be used as constructors either.
TypeError: "x" is not a function - JavaScript
there are many built-in functions in need of a (callback) function.
ReferenceError: "x" is not defined - JavaScript
however, a function can access all variables and functions defined inside the scope in which it is defined.
TypeError: 'x' is not iterable - JavaScript
p = new map; map.set('france', 'paris'); map.set('england', 'london'); // iterate over the property names: for (let country of map.keys()) { let capital = map[country]; console.log(country, capital); } for (let capital of map.values()) console.log(capital); for (const [country, capital] of map.entries()) console.log(country, capital); iterating over a generator generators are functions you call to produce an iterable object.
JavaScript error reference - JavaScript
operatorsyntaxerror: missing variable namesyntaxerror: missing } after function bodysyntaxerror: missing } after property listsyntaxerror: redeclaration of formal parameter "x"syntaxerror: return not in functionsyntaxerror: test for equality (==) mistyped as assignment (=)?syntaxerror: unterminated string literaltypeerror: "x" has no propertiestypeerror: "x" is (not) "y"typeerror: "x" is not a constructortypeerror: "x" is not a functiontypeerror: "x" is not a non-null objecttypeerror: "x" is read-onlytypeerror: 'x' is not iterabletypeerror: more arguments neededtypeerror: reduce of empty array with no ini...
Method definitions - JavaScript
this means that legacy generator functions won't work either, and will throw a syntaxerror.
arguments.callee - JavaScript
this is useful when the name of the function is unknown, such as within a function expression with no name (also called "anonymous functions").
getter - JavaScript
note the following when working with the get syntax: it can have an identifier which is either a number or a string; it must have exactly zero parameters (see incompatible es5 change: literal getter and setter functions must now have exactly zero or one arguments for more information); it must not appear in an object literal with another get or with a data entry for the same property ({ get x() { }, get x() { } } and { x: ..., get x() { } } are forbidden).
setter - JavaScript
note the following when working with the set syntax: it can have an identifier which is either a number or a string; it must have exactly one parameter (see incompatible es5 change: literal getter and setter functions must now have exactly zero or one arguments for more information); it must not appear in an object literal with another set or with a data entry for the same property.
Array.prototype.every() - JavaScript
function isbigenough(element, index, array) { return element >= 10; } [12, 5, 8, 130, 44].every(isbigenough); // false [12, 54, 18, 130, 44].every(isbigenough); // true using arrow functions arrow functions provide a shorter syntax for the same test.
Array.from() - JavaScript
ar", "baz" ] array from a map const map = new map([[1, 2], [2, 4], [4, 8]]); array.from(map); // [[1, 2], [2, 4], [4, 8]] const mapper = new map([['1', 'a'], ['2', 'b']]); array.from(mapper.values()); // ['a', 'b']; array.from(mapper.keys()); // ['1', '2']; array from an array-like object (arguments) function f() { return array.from(arguments); } f(1, 2, 3); // [ 1, 2, 3 ] using arrow functions and array.from() // using an arrow function as the map function to // manipulate the elements array.from([1, 2, 3], x => x + x); // [2, 4, 6] // generate a sequence of numbers // since the array is initialized with `undefined` on each position, // the value of `v` below will be `undefined` array.from({length: 5}, (v, i) => i); // [0, 1, 2, 3, 4] sequence generator (range) // sequence genera...
Array.prototype.map() - JavaScript
certain functions are also commonly used with one argument, even though they take additional optional arguments.
Array.prototype.some() - JavaScript
function isbiggerthan10(element, index, array) { return element > 10; } [2, 5, 8, 1, 4].some(isbiggerthan10); // false [12, 5, 8, 1, 4].some(isbiggerthan10); // true testing array elements using arrow functions arrow functions provide a shorter syntax for the same test.
Date() constructor - JavaScript
keep in mind that most unix timestamp functions are only accurate to the nearest second.
Date - JavaScript
particularly useful are the functions that output the date and time in coordinated universal time (utc), the global standard time defined by the world time standard.
Error.prototype.stack - JavaScript
the non-standard stack property of error objects offer a trace of which functions were called, in what order, from which line and file, and with what arguments.
Function.prototype.apply() - JavaScript
const array = ['a', 'b']; const elements = [0, 1, 2]; array.push.apply(array, elements); console.info(array); // ["a", "b", 0, 1, 2] using apply and built-in functions clever usage of apply allows you to use built-in functions for some tasks that would probably have otherwise been written by looping over the array values.
Function.prototype.toSource() - JavaScript
examples native functions for the built-in function object, tosource() returns the following string indicating that the source code is not available: function function() { [native code] } custom functions for custom functions, tosource() returns the javascript source that defines the object as a string.
GeneratorFunction - JavaScript
this is less efficient than declaring a generator function with a function* expression and calling it within your code, because such functions are parsed with the rest of the code.
Intl.DateTimeFormat.prototype.formatToParts() - JavaScript
for example by using array.prototype.map(), arrow functions, a switch statement, template literals, and array.prototype.reduce().
Intl.NumberFormat.prototype.formatToParts() - JavaScript
for example by using array.prototype.map(), arrow functions, a switch statement, template literals, and array.prototype.reduce().
Map - JavaScript
key types a map's keys can be any value (including functions, objects, or any primitive).
Math.max() - JavaScript
see using apply and built-in functions for more details.
Math.random() - JavaScript
examples note that as numbers in javascript are ieee 754 floating point numbers with round-to-nearest-even behavior, the ranges claimed for the functions below (excluding the one for math.random() itself) aren't exact.
Math.random() - JavaScript
examples note that as numbers in javascript are ieee 754 floating point numbers with round-to-nearest-even behavior, the ranges claimed for the functions below (excluding the one for math.random() itself) aren't exact.
Math.round() - JavaScript
note that this differs from many languages' round() functions, which often round this case to the next integer away from zero, instead giving a different result in the case of negative numbers with a fractional part of exactly 0.5.
Object.defineProperties() - JavaScript
properties is almost completely equivalent (note the comment in iscallable) to the following reimplementation in javascript: function defineproperties(obj, properties) { function converttodescriptor(desc) { function hasproperty(obj, prop) { return object.prototype.hasownproperty.call(obj, prop); } function iscallable(v) { // nb: modify as necessary if other values than functions are callable.
Object.defineProperty() - JavaScript
an accessor descriptor is a property described by a getter-setter pair of functions.
Object.freeze() - JavaScript
note that strings, numbers, and booleans are always immutable and that functions and arrays are objects.
Object - JavaScript
return current.apply(this, arguments); } } since javascript doesn't exactly have sub-class objects, prototype is a useful workaround to make a “base class” object of certain functions that act as objects.
Promise.prototype.catch() - JavaScript
){ console.log('after a catch the chain is restored'); }, function () { console.log('not fired due to the catch'); }); gotchas when throwing errors // throwing an error will call the catch method most of the time var p1 = new promise(function(resolve, reject) { throw new error('uh-oh!'); }); p1.catch(function(e) { console.error(e); // "uh-oh!" }); // errors thrown inside asynchronous functions will act like uncaught errors var p2 = new promise(function(resolve, reject) { settimeout(function() { throw new error('uncaught exception!'); }, 1000); }); p2.catch(function(e) { console.error(e); // this is never called }); // errors thrown after resolve is called will be silenced var p3 = new promise(function(resolve, reject) { resolve(); throw new error('silenced exception!');...
Comparing Reflect and Object methods - JavaScript
some of the static functions that exist on reflect also correspond to methods available on object, which predates es2015.
Reflect - JavaScript
the reflect object provides the following static functions which have the same names as the proxy handler methods.
String.raw() - JavaScript
the first syntax mentioned above is only rarely used, because the javascript engine will call this with proper arguments for you, (just like with other tag functions).
String.prototype.trimEnd() - JavaScript
aliasing for consistency with functions like string.prototype.padend the standard method name is trimend.
String.prototype.trimStart() - JavaScript
aliasing for consistency with functions like string.prototype.padstart the standard method name is trimstart.
TypedArray.prototype.every() - JavaScript
function isbigenough(element, index, array) { return element >= 10; } new uint8array([12, 5, 8, 130, 44]).every(isbigenough); // false new uint8array([12, 54, 18, 130, 44]).every(isbigenough); // true testing typed array elements using arrow functions arrow functions provide a shorter syntax for the same test.
TypedArray.prototype.filter() - JavaScript
function isbigenough(element, index, array) { return element >= 10; } new uint8array([12, 5, 8, 130, 44]).filter(isbigenough); // uint8array [ 12, 130, 44 ] filtering typed array elements using arrow functions arrow functions provide a shorter syntax for the same test.
TypedArray.prototype.some() - JavaScript
function isbiggerthan10(element, index, array) { return element > 10; } new uint8array([2, 5, 8, 1, 4]).some(isbiggerthan10); // false new uint8array([12, 5, 8, 1, 4]).some(isbiggerthan10); // true testing typed array elements using arrow functions arrow functions provide a shorter syntax for the same test.
TypedArray - JavaScript
there are at present no such engines, so %typedarray% is only useful to polyfill functions or properties onto all typedarray constructors.
WeakSet - JavaScript
use case: detecting circular references functions that call themselves recursively need a way of guarding against circular data structures by tracking which objects have already been processed.
WebAssembly.Instance() constructor - JavaScript
importobject optional an object containing the values to be imported into the newly-created instance, such as functions or webassembly.memory objects.
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.
WebAssembly.Module.customSections() - JavaScript
(read high level structure for information on section structures, and how normal sections ("known sections") and custom sections are distinguished.) this provides developers with a way to include custom data inside wasm modules for other purposes, for example the name custom section, which allows developers to provide names for all the functions and locals in the module (like "symbols" in a native build).
WebAssembly.Module.exports() - JavaScript
return value an array containing objects representing the exported functions of the given module.
WebAssembly.Module.imports() - JavaScript
return value an array containing objects representing the imported functions of the given module.
WebAssembly.Table.prototype.set() - JavaScript
sembly.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.length); console.log(tbl.get(0)()); console.log(tbl.get(1)()); }); note how you've got to include a second function i...
WebAssembly - JavaScript
you can compare it to math, which is also a namespace object for mathematical constants and functions, or to intl which is the namespace object for internationalization constructors and other language-sensitive functions.
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.
Object initializer - JavaScript
// shorthand method names (es2015) let o = { property(parameters) {}, } in ecmascript 2015, there is a way to concisely define properties whose values are generator functions: let o = { *generator() { ...........
Pipeline operator (|>) - JavaScript
examples chaining function calls the pipeline operator can improve readability when chaining several functions.
Spread syntax (...) - JavaScript
only for iterables objects themselves are not iterable, but they become iterable when used in an array, or with iterating functions such as map(), reduce(), and assign().
await - JavaScript
var response = await promisedfunction().catch((err) => { console.error(err); }); // response will be undefined if the promise is rejected specifications specification ecmascript (ecma-262)the definition of 'async functions' in that specification.
instanceof - JavaScript
this may not make sense at first, but for scripts dealing with multiple frames or windows, and passing objects from one context to another via functions, this will be a valid and strong issue.
yield - JavaScript
it cannot be called from nested functions or from callbacks.
Expressions and operators - JavaScript
note: => is not an operator, but the notation for arrow functions.
break - JavaScript
block_1: { console.log('1'); break block_2; // syntaxerror: label not found } block_2: { console.log('2'); } break within functions syntaxerrors are also generated in the following code examples which use break statements within functions that are nested within a loop, or labeled block that the break statements are intended to break out of.
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.
for...of - JavaScript
functions generating an iterable object: function* fibonacci() { // a generator function let [prev, curr] = [0, 1]; while (true) { [prev, curr] = [curr, prev + curr]; yield curr; } } for (const n of fibonacci()) { console.log(n); // truncate the sequence at 1000 if (n >= 1000) { break; } } do not reuse generators generators should not be re-used, even if the for...of loop is ...
label - JavaScript
l: function f() {} in strict mode code, however, this will throw a syntaxerror: 'use strict'; l: function f() {} // syntaxerror: functions cannot be labelled generator functions can neither be labeled in strict code, nor in non-strict code: l: function* f() {} // syntaxerror: generator functions cannot be labelled specifications specification ecmascript (ecma-262)the definition of 'labelled statement' in that specification.
let - JavaScript
console.log(x); // 2 } console.log(x); // 2 } function lettest() { let x = 1; { let x = 2; // different variable console.log(x); // 2 } console.log(x); // 1 } at the top level of programs and functions, let, unlike var, does not create a property on the global object.
throw - JavaScript
if no catch block exists among caller functions, the program will terminate.
var - JavaScript
the scope of a variable declared with var is its current execution context and closures thereof, which is either the enclosing function and functions declared within it, or, for variables declared outside any function, global.
Template literals (Template strings) - JavaScript
// let str2 = strings[2]; let agestr; if (ageexp > 99){ agestr = 'centenarian'; } else { agestr = 'youngster'; } // we can even return a string built using a template literal return `${str0}${personexp}${str1}${agestr}`; } let output = mytag`that ${ person } is a ${ age }`; console.log(output); // that mike is a youngster tag functions don't even need to return a string!
Trailing commas - JavaScript
var arr = [1, 2, 3,,,]; arr.length; // 5 objects starting with ecmascript 5, trailing commas in object literals are legal as well: var object = { foo: "bar", baz: "qwerty", age: 42, }; trailing commas in functions ecmascript 2017 allows trailing commas in function parameter lists.
JavaScript shells - JavaScript
execute js - (no longer maintained) - firefox-extension which provides an enhanced javascript-console, where you can comfortably enter and execute arbitrary javascript-code and modify functions.
Animation performance and frame rate - Web Performance
rather, the page is being repainted, repeatedly, based on javascript canvas api functions.
Optimizing startup performance - Web Performance
by establishing a queue of functions to be called in sequence, you can more easily manage running bits of code without blocking the main thread.
Graphic design for responsive sites - Progressive web apps (PWAs)
javascript javascript has functions that enable developers to create animations, and any other type of interactivity you want.
Structural overview of progressive web apps - Progressive web apps (PWAs)
we'll look at how the app functions more closely in later articles in this guide.
color-interpolation-filters - SVG: Scalable Vector Graphics
it has no affect on filter functions, which operate in the srgb color space.
filter - SVG: Scalable Vector Graphics
WebSVGAttributefilter
working draft extended the values by several special filter functions.
gradientTransform - SVG: Scalable Vector Graphics
r="darkblue" /> </radialgradient> <rect x="0" y="0" width="200" height="200" fill="url(#gradient1)" /> <rect x="0" y="0" width="200" height="200" fill="url(#gradient2)" style="transform: translatex(220px);" /> </svg> usage notes default value identity transform value <transform-list> animatable yes <transform-list> a list of transformation functions specifying some additional transformation from the gradient coordinate system onto the target coordinate system.
patternTransform - SVG: Scalable Vector Graphics
value <transform-list> default value identity transform animatable yes transform functions to know more about the definition of transform functions, see the transform attribute definition.
style - SVG: Scalable Vector Graphics
WebSVGAttributestyle
it functions identically to the style attribute in html.
transform - SVG: Scalable Vector Graphics
value <transform-list> default value none animatable yes transform functions the following transform functions can be used by the transform attribute <transform-list> warning: as per the spec, you should be able to also use css transform functions.
SVG documentation index - SVG: Scalable Vector Graphics
WebSVGIndex
it functions identically to the style attribute in html.
Scripting - SVG: Scalable Vector Graphics
WebSVGScripting
inter-document scripting: calling javascript functions when calling a javascript function that resides in the html file from an svg file that is embedded in an html document, you should use parent.functionname() to reference the function.
Web Components
life cycle callbacks special callback functions defined inside the custom element's class definition, which affect its behavior: connectedcallback: invoked when the custom element is first connected to the document's dom.
Axes - XPath
WebXPathAxes
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes there are thirteen different axes in the xpath specification.
Comparison of CSS Selectors and XPath - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes this article seeks to document the difference between css selectors and xpath for web developers to be able to better choose the right tool for the right job.
boolean - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the boolean function evaluates an expression and returns true or false.
ceiling - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the ceiling function evaluates a decimal number and returns the smallest integer greater than or equal to the decimal number.
choose - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the choose function returns one of the specified objects based on a boolean parameter.
concat - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the concat function concatenates two or more strings and returns the resulting string.
contains - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the contains function determines whether the first argument string contains the second argument string and returns boolean true or false.
count - XPath
WebXPathFunctionscount
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the count function counts the number of nodes in a node-set and returns an integer.
current - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the current function can be used to get the context node in an xslt instruction.
document - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the document finds a node-set in an external document, or multiple external documents, and returns the resulting node-set.
element-available - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the element-available function determines if an element is available and returns true or false.
false - XPath
WebXPathFunctionsfalse
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the false function returns boolean false.
floor - XPath
WebXPathFunctionsfloor
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the floor function evaluates a decimal number and returns the largest integer less than or equal to the decimal number.
format-number - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the format-number function evaluates a number and returns a string representing the number in a given format.
function-available - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the function-available function determines if a given function is available and returns boolean true or false.
generate-id - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the generate-id function generates a unique id for the first node in a given node-set and returns a string containing that id.
id - XPath
WebXPathFunctionsid
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the id function finds nodes matching the given ids and returns a node-set containing the identified nodes.
key - XPath
WebXPathFunctionskey
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the key function returns a node-set of nodes that have the given value for the given key.
lang - XPath
WebXPathFunctionslang
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the lang function determines whether the context node matches the given language and returns boolean true or false.
last - XPath
WebXPathFunctionslast
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the last function returns a number equal to the context size from the expression evaluation context.
local-name - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the local-name function returns a string representing the local name of the first node in a given node-set.
name - XPath
WebXPathFunctionsname
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the name function returns a string representing the qname of the first node in a given node-set.
namespace-uri - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the namespace-uri function returns a string representing the namespace uri of the first node in a given node-set.
normalize-space - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the normalize-space function strips leading and trailing white-space from a string, replaces sequences of whitespace characters by a single space, and returns the resulting string.
not - XPath
WebXPathFunctionsnot
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the not function evaluates a boolean expression and returns the opposite value.
number - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the number function converts an object to a number and returns the number.
position - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the position function returns a number equal to the context position from the expression evaluation context.
round - XPath
WebXPathFunctionsround
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the round function returns a number that is the nearest integer to the given number.
starts-with - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the starts-with checks whether the first string starts with the second string and returns true or false.
string-length - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the string-length function returns a number equal to the number of characters in a given string.
string - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the string function converts the given argument to a string.
substring-after - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the substring-after function returns a string that is the rest of a given string after a given substring.
substring-before - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the substring-before function returns a string that is the part of a given string before a given substring.
sum - XPath
WebXPathFunctionssum
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the sum function returns a number that is the sum of the numeric values of each node in a given node-set.
system-property - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the system-property function returns an object representing the given system-property.
true - XPath
WebXPathFunctionstrue
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the true function returns a boolean value of true.
unparsed-entity-url - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the unparsed-entity-url() function returns the uri of the unparsed entity with the given name.
Introduction to using XPath in JavaScript - XPath
using xpath functions to reference elements with a default namespace another approach to match default elements in a non-null namespace (and one which works well for dynamic xpath expressions where the namespaces might not be known), involves referring to a particular element using a form such as [namespace-uri()='http://www.w3.org/1999/xhtml' and name()='p' and @id='_myid'].
<xsl:apply-imports> - XSLT: Extensible Stylesheet Language Transformations
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:apply-imports> element is fairly arcane, used mostly in complex stylesheets.
<xsl:apply-templates> - XSLT: Extensible Stylesheet Language Transformations
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:apply-templates> element selects a set of nodes in the input tree and instructs the processor to apply the proper templates to them.
<xsl:attribute-set> - XSLT: Extensible Stylesheet Language Transformations
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:attribute-set> element creates a named set of attributes, which can then be applied as whole to the output document, in a manner similar to named styles in css.
<xsl:attribute> - XSLT: Extensible Stylesheet Language Transformations
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:attribute> element creates an attribute in the output document, using any values that can be accessed from the stylesheet.
<xsl:call-template> - XSLT: Extensible Stylesheet Language Transformations
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:call-template> element invokes a named template.
<xsl:choose> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementchoose
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:choose> element defines a choice among a number of alternatives.
<xsl:comment> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementcomment
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:comment> element writes a comment to the output document.
<xsl:copy-of> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementcopy-of
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:copy-of> element makes a deep copy (including descendant nodes) of whatever the select attribute specifies to the output document.
<xsl:copy> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementcopy
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:copy> element transfers a shallow copy (the node and any associated namespace node) of the current node to the output document.
<xsl:decimal-format> - XSLT: Extensible Stylesheet Language Transformations
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:decimal-format> element defines the characters and symbols that are to be used in converting numbers into strings using theformat-number( ) function.
<xsl:element> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementelement
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:element> element creates an element in the output document.
<xsl:fallback> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementfallback
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:fallback> element specifies what template to use if a given extension (or, eventually, newer version) element is not supported.
<xsl:for-each> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementfor-each
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:for-each> element selects a set of nodes and processes each of them in the same way.
<xsl:if> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementif
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:if> element contains a test attribute and a template.
<xsl:import> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementimport
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:import> element is a top-level element that serves to import the contents of one stylesheet into another stylesheet.
<xsl:include> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementinclude
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:include> element merges the contents of one stylesheet with another.
<xsl:key> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementkey
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:key> element declares a named key which can be used elsewhere in the stylesheet with the key( ) function.
<xsl:message> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementmessage
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:message> element outputs a message (to the javascript console in ns) and optionally terminates execution of the stylesheet.
<xsl:namespace-alias> - XSLT: Extensible Stylesheet Language Transformations
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:namespace-alias> element is a rarely used device that maps a namespace in the stylesheet to a different namespace in the output tree.
<xsl:number> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementnumber
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:number> element counts things sequentially.
<xsl:otherwise> - XSLT: Extensible Stylesheet Language Transformations
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:otherwise> element is used to define the action that should be taken when none of the <xsl:when> conditions apply.
<xsl:output> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementoutput
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:output> element controls the characteristics of the output document.
<xsl:param> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementparam
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:param> element establishes a parameter by name and, optionally, a default value for that parameter.
<xsl:preserve-space> - XSLT: Extensible Stylesheet Language Transformations
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:preserve-space> element defines the elements in the source document for which whitespace should be preserved.
<xsl:processing-instruction> - XSLT: Extensible Stylesheet Language Transformations
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:processing-instruction> element writes a processing instruction to the output document.
<xsl:sort> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementsort
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:sort> element defines a sort key for nodes selected by <xsl:apply-templates> or <xsl:for-each> and determines the order in which they are processed.
<xsl:strip-space> - XSLT: Extensible Stylesheet Language Transformations
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:strip-space> element defines the elements in the source document for which whitespace should be removed.
<xsl:stylesheet> - XSLT: Extensible Stylesheet Language Transformations
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:stylesheet> element (or the equivalent <xsl:transform> element) is the outermost element of a stylesheet.
<xsl:template> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementtemplate
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:template> element defines an output producing template.
<xsl:text> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementtext
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:text> element writes literal text to the output tree.
<xsl:transform> - XSLT: Extensible Stylesheet Language Transformations
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:transform> element is exactly equivalent to the <xsl:stylesheet> element.
<xsl:value-of> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementvalue-of
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:value-of> element evaluates an xpath expression, converts it to a string, and writes that string to the result tree.
<xsl:variable> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementvariable
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:variable> element declares a global or local variable in a stylesheet and gives it a value.
<xsl:when> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementwhen
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:when> element always appears within an <xsl:choose> element, acting like a case statement.
<xsl:with-param> - XSLT: Extensible Stylesheet Language Transformations
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:with-param> element sets the value of a parameter to be passed into a template.
XSLT elements reference - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElement
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes there are two types of elements discussed here: top-level elements and instructions.
Index - XSLT: Extensible Stylesheet Language Transformations
WebXSLTIndex
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes found 54 pages: # page tags and summary 1 xslt: extensible stylesheet language transformations landing, web, xslt extensible stylesheet language transformations (xslt) is an xml-based language used, in conjunction with specialized processing software, for the transformation of xml documents.
PI Parameters - XSLT: Extensible Stylesheet Language Transformations
possible future developments should we allow any xslt functions in the expression?
XSLT: Extensible Stylesheet Language Transformations
WebXSLT
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes extensible stylesheet language transformations (xslt) is an xml-based language used, in conjunction with specialized processing software, for the transformation of xml documents.