Search completed in 1.10 seconds.
MediaQueryList.removeListener() - Web APIs
in the new implementation the standard event mechanism is used, and the callback is a standard function. return value void. ...
...in the new implementation the standard event mechanism is used, and the callback is a standard function. return value void. ...
...in the new implementation the standard event mechanism is used, and the callback is a standard function. return value void. ...
...And 7 more matches
<datalist>: The HTML Data List element - HTML: Hypertext Markup Language
the html <data
list> element contains a set of <option> elements that represent the permissible or recommended options available to choose from within other controls. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories flow content, phrasing content. permitted content either phrasing content or zero or more <option> elements. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that accepts phrasing content. ...
...ithub.com/mdn/interactive-examples and send us a pull request. content categories flow content, phrasing content. permitted content either phrasing content or zero or more <option> elements. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that accepts phrasing content. ...
... flow content, phrasing content. permitted content either phrasing content or zero or more <option> elements. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that accepts phrasing content. ...
...And 4 more matches
SpeechGrammarList.SpeechGrammarList() - Web APIs
the speechgrammar
list() constructor creates a new speechgrammar
list object instance. syntax var mygrammar
list = new speechgrammar
list(); parameters none. examples in our simple speech color changer example, we create a new speechrecognition object instance using the speechrecognition() constructor, create a new speechgrammar
list, add our grammar string to it using the speechgrammar
list.addfromstring method, and set it to be the grammar that will be recognised by the speechrecognition instance using the speechrecognition.grammars property. var grammar = '#jsgf v1.0; grammar colors; public <color> = aqua | azure | beige | bisque | black | blue | brown | chocolate | coral | crimson | cyan | fuchsia | ghostwhite | gold | goldenrod | gray | green | indigo | ivory | khaki | lavender | lime...
... draft ...
... draft ...
...And 3 more matches
MediaQueryList.addListener() - Web APIs
the add
listener() method of the mediaquery
list interface adds a
listener to the mediaquery
listener that will run a custom callback function in response to the media query status changing. this is basically an alias for eventtarget.addevent
listener(), for backwards compatibility purposes. older browsers should use add
listener instead of addevent
listener since mediaquery
list only inherits from eventtarget in newer browsers. syntax mediaquery
list.add
listener(func) parameters func a function or function reference representing the callback function you want to run when the media query status changes. in the original implementation, the callback was a non-standard mediaquery
listlistener object. in the new implementation the standard event mechanism is used, the callback is a standard functi...
... return value void. ...
... working draft initial definition ...
... working draft initial definition ...
MediaQueryListListener - Web APIs
this feature is outdated. the mediaquery
list.add
listener() callback is now a plain function and called with the standard mediaquery
listevent object. a mediaquery
list object maintains a
list of media queries on a document, and handles sending notifications to
listeners when the media queries on the document change. this makes it possible to observe a document to detect when its media queries change, instead of polling the values periodically, if you need to detect changes to the values of media queries on a document. a mediaquery
listlistener is a callback function that gets invoked with a single argument, the mediaquery
list for which the evaluated result changed. syntax function( mediaquery
list ) { ... } parameters mediaquery
list the mediaquery
list instance. specifications ...
...document. a mediaquery
listlistener is a callback function that gets invoked with a single argument, the mediaquery
list for which the evaluated result changed. syntax function( mediaquery
list ) { ... } parameters mediaquery
list the mediaquery
list instance. specifications specification status comment css object model (cssom) view modulethe definition of 'mediaquery
listlistener' in that specification. working draft initial definition ...
MediaQueryListEvent.MediaQueryListEvent() - Web APIs
the mediaquery
listevent constructor creates a new mediaquery
listevent instance. syntax var mymqlevent = new mediaquery
listevent(init); parameters init an init object that defines features of the new object instance. the available properties are: media: a domstring representing a serialized media query. matches: a boolean representing the media query status — true if it matches, false if not. examples var media = '(max-width: 600px)'; var matches = true; var mymediaquery
listevent = new mediaquery
listevent({media, matches}); specifications specification status comment css object model (cssom) view modulethe definition of 'mediaquery
listevent()' in that specification. working draft initial definition ...
TrackDefaultList.TrackDefaultList() - Web APIs
the trackdefault
list() constructor of the trackdefault
list interface constructs and returns a new trackdefault
list object. syntax var trackdefault
list = new trackdefault
list(trackdefaults); parameters trackdefaults a sequence (array) of trackdefault objects. example tbd. ...
EventTarget.addEventListener() - Web APIs
the eventtarget method addevent
listener() sets up a function that will be called whenever the specified event is delivered to the target. common targets are element, document, and window, but the target may be any object that supports events (such as xmlhttprequest). addevent
listener() works by adding a function or an object that implements event
listener to the
list of event
listeners for the specified event type on the eventtarget on which it's called. syntax target.addevent
listener(type,
listener [, options]); target.addevent
listener(type,
listener [, usecapture]); target.addevent
listener(type,
listener [, usecapture, wantsuntrusted ]); // gecko/mozilla only parameters type a case-sensitive string representing the event type to
listen for. ...
...he
list of event
listeners for the specified event type on the eventtarget on which it's called. syntax target.addevent
listener(type,
listener [, options]); target.addevent
listener(type,
listener [, usecapture]); target.addevent
listener(type,
listener [, usecapture, wantsuntrusted ]); // gecko/mozilla only parameters type a case-sensitive string representing the event type to
listen for.
listener the object that receives a notification (an object that implements the event interface) when an event of the specified type occurs. this must be an object implementing the event
listener interface, or a javascript function. see the event
listener callback for details on the callback itself. options optional an options object specifies characteristics about the event
listener. the available ...
... the specified type occurs. this must be an object implementing the event
listener interface, or a javascript function. see the event
listener callback for details on the callback itself. options optional an options object specifies characteristics about the event
listener. the available options are: capture a boolean indicating that events of this type will be dispatched to the registered
listener before being dispatched to any eventtarget beneath it in the dom tree. once a boolean indicating that the
listener should be invoked at most once after being added. if true, the
listener would be automatically removed when invoked. ...
...And 78 more matches
Element.classList - Web APIs
the element.class
list is a read-only property that returns a live domtoken
list collection of the class attributes of the element. this can then be used to manipulate the class
list. using class
list is a convenient alternative to accessing an element's
list of classes as a space-delimited string via element.classname. syntax const elementclasses = elementnodereference.class
list; returns a domtoken
list representing the contents of the element's class attribute. if the class attribute is not set or empty, it returns an empty domtoken
list, i.e. a domtoken
list with the length property equal to 0. the domtoken
list itself is read-only, although you can modify it using the add() and remove() methods. examples const div = document.createelement('div'); div.classname = 'foo'; // our starting ...
...ass attribute is not set or empty, it returns an empty domtoken
list, i.e. a domtoken
list with the length property equal to 0. the domtoken
list itself is read-only, although you can modify it using the add() and remove() methods. ...
...s an empty domtoken
list, i.e. a domtoken
list with the length property equal to 0. the domtoken
list itself is read-only, although you can modify it using the add() and remove() methods. ...
...And 40 more matches
ARIA: listbox role - Accessibility
it is highly recommended to use the html select element, or a group of radio buttons if only one item can be selected, or a group of checkboxes if multiple items can be selected, because there is a lot of keyboard interactivity to manage focus for all the descendants, and native html elements provide this functionality for you for free. ...
... it is highly recommended to use the html select element, or a group of radio buttons if only one item can be selected, or a group of checkboxes if multiple items can be selected, because there is a lot of keyboard interactivity to manage focus for all the descendants, and native html elements provide this functionality for you for free. ...
... it is highly recommended to use the html select element, or a group of radio buttons if only one item can be selected, or a group of checkboxes if multiple items can be selected, because there is a lot of keyboard interactivity to manage focus for all the descendants, and native html elements provide this functionality for you for free. ...
...And 37 more matches
Styling lists - Learn web development
previous overview: styling text next
lists behave like any other text for the most part, but there are some css properties specific to
lists that you need to know about, and some best practices to consider. this article explains all. prerequisites: basic computer literacy, html basics (study introduction to html), css basics (study introduction to css), css text and font fundamentals. objective: to become familiar with the best practices and properties related to styling
lists. a simple
list example to begin with, let's look at a simple
list example. throughout this article, we'll look at unordered, ordered, and description
lists — all have styling features that are similar, and some that are particular to their type of
list. the unstyled example is...
... and properties related to styling
lists. a simple
list example to begin with, let's look at a simple
list example. throughout this article, we'll look at unordered, ordered, and description
lists — all have styling features that are similar, and some that are particular to their type of
list. ...
...ple
list example to begin with, let's look at a simple
list example. throughout this article, we'll look at unordered, ordered, and description
lists — all have styling features that are similar, and some that are particular to their type of
list. ...
...And 36 more matches
listbox - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] this element is used to create a
list of items where one or more of the items may be selected. a
listbox may contain multiple columns. there are numerous methods which allow the items in the
listbox to be retrieved and modified. you may specify the number of rows to display in the
list using the rows attribute. additional rows can be viewed using a scroll bar. a
listbox is expected to contain
listitem elements. all the rows in the
listbox are the same height, which is the height of the tallest item in the
list. if you wish to create a
list with variable height rows, or with non-text content, you should instead use the rich
listbox element. see
list controls for more information. attributes ...
... item in the
list. if you wish to create a
list with variable height rows, or with non-text content, you should instead use the rich
listbox element. see
list controls for more information. ...
...hods additemtoselection, appenditem, clearselection, ensureelementisvisible, ensureindexisvisible, getindexoffirstvisiblerow, getindexofitem, getitematindex, getnumberofvisiblerows, getrowcount, getselecteditem, insertitemat, invertselection, movebyoffset, removeitemat, removeitemfromselection, scrolltoindex, selectall, selectitem, selectitemrange, timedselect, toggleitemselection examples <
listbox id="the
list"> <
listitem label="ruby"/> <
listitem label="emerald"/> <
listitem label="sapphire" selected="true"/> <
listitem label="diamond"/> </
listbox> <
listbox id="the
list" rows="10" width="400"> <
listhead> <
listheader label="1ct gem" width="240"/> <
listheader label="price" width="150"/> </
listhead> <
listcols> <
listcol/> <
listcol flex="1"/> </
listcols> </lis...
...And 28 more matches
List Controls - Archive of obsolete content
« previousnext » xul has a number of types of elements for creating
list boxes.
list boxes a
list box is used to display a number of items in a
list. the user may select an item from the
list. xul provides two types of elements to create
lists, a
listbox element to create multi-row
list boxes, and a menu
list element to create drop-down
list boxes. they work similar to the html select element, which performs both functions, but the xul elements have additional features. the simplest
list box uses the
listbox element for the box itself, and the
listitem element for each item. for example, this
list box will have four rows, one for each item. ...
...-row
list boxes, and a menu
list element to create drop-down
list boxes. they work similar to the html select element, which performs both functions, but the xul elements have additional features. the simplest
list box uses the
listbox element for the box itself, and the
listitem element for each item. for example, this
list box will have four rows, one for each item. example 1 : source view <
listbox> <
listitem label="butter pecan" /> <
listitem label="chocolate chip" /> <
listitem label="raspberry ripple" /> <
listitem label="squash swirl" /> </
listbox> like with the html option element, you can assign a value for each item using the value attribute. you can then use the value in a script. ...
..., this
list box will have four rows, one for each item. example 1 : source view <
listbox> <
listitem label="butter pecan" /> <
listitem label="chocolate chip" /> <
listitem label="raspberry ripple" /> <
listitem label="squash swirl" /> </
listbox> like with the html option element, you can assign a value for each item using the value attribute. you can then use the value in a script. the
list box will default to a suitable size, but you can control the size with the rows attribute. set it to the number of rows to display in the
list box. a scroll bar will appear that the user can use to display the additional rows. ...
...And 26 more matches
menulist - Archive of obsolete content
more information is available in the xul tutorial. ...
... more information is available in the xul tutorial. ...
... more information is available in the xul tutorial. ...
...And 21 more matches
richlistbox - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] this element is used to create a
list of
listitems (rich
listitems), similar to a
listbox, but is designed to be used when the items do not contain simple text content. note: in versions of firefox prior to firefox 3, rich
list boxes support only single selection. firefox 3 introduced multiple selection to rich
list boxes. attributes disabled, disablekeynavigation, preference, seltype, suppressonselect, tabindex, value properties accessibletype, currentindex, currentitem, disabled, disablekeynavigation, itemcount, scrollboxobject, selectedcount, selectedindex, selecteditem, selecteditems, seltype, suppressonselect, tabindex, value methods additemtoselection, appenditem, clearselec...
... attributes disabled type:...
... attributes disabled type: boolean indica...
...And 19 more matches
AudioListener - Web APIs
the audio
listener interface represents the position and orientation of the unique person
listening to the audio scene, and is used in audio spatialization. all pannernodes spatialize in relation to the audio
listener stored in the baseaudiocontext.
listener attribute. it is important to note that there is only one
listener per context and that it isn't an audionode. properties the position, forward, and up value are set and retrieved using different syntaxes. retrieval is done by accessing, for example, audio
listener.positionx, while setting the same property is done with audio
listener.positionx.value. this is why these values are not marked read only, which is how they appear in the specification's idl. ...
... context and that it isn't an audionode. properties the position, forward, and up value are set and retrieved using different syntaxes. retrieval is done by accessing, for example, audio
listener.positionx, while setting the same property is done with audio
listener.positionx.value. this is why these values are not marked read only, which is how they appear in the specification's idl. audio
listener.positionx represents the horizontal position of the
listener in a right-hand cartesian coordinate sytem. the default is 0. ...
.... retrieval is done by accessing, for example, audio
listener.positionx, while setting the same property is done with audio
listener.positionx.value. this is why these values are not marked read only, which is how they appear in the specification's idl. audio
listener.positionx represents the horizontal position of the
listener in a right-hand cartesian coordinate sytem. the default is 0. audio
listener.positiony represents the vertical position of the
listener in a right-hand cartesian coordinate sytem. the default is 0. audio
listener.positionz represents the longitudinal (back and forth) position of the
listener in a right-hand cartesian coordinate sytem. the default is 0. ...
...And 19 more matches
listcol - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a column in a
listbox. you can make some columns flexible and other columns non-flexible. ...
... « xul reference home [ examples | attributes | properties | methods | related ] a column in a
listbox. you can make some columns flexible and other columns non-flexible. ...
... « xul reference home [ examples | attributes | properties | methods | related ] a column in a
listbox. you can make some columns flexible and other columns non-flexible. ...
...And 18 more matches
EventTarget.removeEventListener() - Web APIs
the eventtarget.removeevent
listener() method removes from the eventtarget an event
listener previously registered with eventtarget.addevent
listener(). the event
listener to be removed is identified using a combination of the event type, the event
listener function itself, and various optional options that may affect the matching process; see matching event
listeners for removal syntax target.removeevent
listener(type,
listener[, options]); target.removeevent
listener(type,
listener[, usecapture]); parameters type a string which specifies the type of event for which to remove an event
listener.
listener the event
listener function of the event handler to remove from the event target. options optional an options object that specifies characteristics about the event
listener. the ava...
... string which specifies the type of event for which to remove an event
listener.
listener the event
listener function of the event handler to remove from the event target. options optional an options object that specifies characteristics about the event
listener. the available options are: capture: a boolean which indicates that events of this type will be dispatched to the registered
listener before being dispatched to any eventtarget beneath it in the dom tree. mozsystemgroup: available only in code running in xbl or in firefox' chrome, it is a boolean defining if the
listener is added to the system group. usecapture optional specifies whether the event
listener to be removed is registered as a capturing
listener or not. if this parameter is absent, a default value of fa...
...atched to any eventtarget beneath it in the dom tree. mozsystemgroup: available only in code running in xbl or in firefox' chrome, it is a boolean defining if the
listener is added to the system group. usecapture optional specifies whether the event
listener to be removed is registered as a capturing
listener or not. if this parameter is absent, a default value of false is assumed. if a
listener is registered twice, one with capture and one without, remove each one separately. removal of a capturing
listener does not affect a non-capturing version of the same
listener, and vice versa. ...
...And 18 more matches
SVGTransformList - Web APIs
svg transform
list interface the svgtransform
list defines a
list of svgtransform objects. an svgtransform
list object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown. ...
... svg transform
list interface the svgtransform
list defines a
list of svgtransform objects. an svgtransform
list object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown. ...
... svgtransform createsvgtransformfrommatrix(in svgmatrix) svgtransform consolidate() properties readonly unsigned long numberofitems readonly unsigned long length normative document svg 1.1 (2nd edition) properties name type description numberofitems unsigned long the number of items in the
list. ...
...And 18 more matches
Progress Listeners - Archive of obsolete content
progress
listeners progress
listeners allow extensions to be notified of events associated with documents loading in the browser and with tab switching events. progress
listeners implement the nsiwebprogress
listener interface. note that if you just want to execute your code each time a page loads, you can use an an easier method, onpageload(). note that onpageload does not fire for back button clicks. in the examples below the progress
listener is attached to the tabbrowser, which means you don't get any notifications for inactive tabs. firefox 3.5 includes a way to set up a
listener for all tabs, selected and not:
listening to events on all tabs. ...
...easier method, onpageload(). note that onpageload does not fire for back button clicks. in the examples below the progress
listener is attached to the tabbrowser, which means you don't get any notifications for inactive tabs. firefox 3.5 includes a way to set up a
listener for all tabs, selected and not:
listening to events on all tabs. ...
...does not fire for back button clicks. in the examples below the progress
listener is attached to the tabbrowser, which means you don't get any notifications for inactive tabs. firefox 3.5 includes a way to set up a
listener for all tabs, selected and not:
listening to events on all tabs. ...
...And 17 more matches
Manipulating Lists - Archive of obsolete content
« previousnext » the xul
listbox provides a number of specialized methods.
list manipulation the
listbox element provides numerous methods to retrieve and manipulate its items. 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. the appenditem() function is used to append a new item to the end a
list. similar to the dom appendchild() function except that it takes a string label, and you do not have to worry about where to add it in the
list structure. ...
...ible. these functions are bit simpler and will do the right thing. the appenditem() function is used to append a new item to the end a
list. similar to the dom appendchild() function except that it takes a string label, and you do not have to worry about where to add it in the
list structure. here is an example: example 1 : source view <script> function additem(){ document.getelementbyid('the
list').appenditem("thursday", "thu"); } </script> <
listbox id="the
list"/> <button label="add" oncommand="additem();"/> the appenditem() takes two arguments, the label, in this case 'thursday', and a value 'thu'. the two arguments correspond to the label attribute and the value attribute on the
listitem element. the value is used only as an extra optional value associated with an item which you mig...
...a value 'thu'. the two arguments correspond to the label attribute and the value attribute on the
listitem element. the value is used only as an extra optional value associated with an item which you might wish to use in a script. similarly, there is also an insertitemat() and a removeitemat() function which inserts a new item and removes an existing item respectively. the syntax is as follows:
list.insertitemat(3, "thursday", "thu");
list.removeitemat(3); the insertitemat() function takes an additional argument, the position to insert the new item. the new item is inserted at this index, so, in the example, the new item will be added at position 3 while the item previously at that position will now be at position 4. remember that the first item is 0. the removeitemat() function will remov...
...And 17 more matches
Starting our Svelte Todo list app - Learn web development
we want our users to be able to browse, add and delete tasks, and also to mark them as complete. ...
... we want our users to be able to browse, add and delete tasks, and also to mark them as complete. ...
...the current app state, run cd mdn-svelte-tutorial/02-starting-our-todo-app or directly download the folder's content: npx degit opensas/mdn-svelte-tutorial/02-starting-our-todo-app remember to run npm install && npm run dev to start your app in development mode. repl to code along with us using the repl, start at https://svelte.dev/repl/b7b831ea3a354d3789cefbc31e2ca495?version=3.23.2 todo
list app features this is how our todo
list app wil look like once it's ready: using this ui our user will be able to: browse their tasks. mark tasks as completed/pending without deleting them. remove tasks. add new tasks. filter tasks by status: all tasks, active tasks, or completed tasks. edit tasks. mark all tasks as active/completed. remove all completed tasks. building our first c...
...And 16 more matches
list-style - CSS: Cascading Style Sheets
the
list-style css shorthand property allows you set all the
list style properties at once. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. note: this property is applied to
list items, i.e., elements with display:
list-item; . by default this includes <li> elements. because this property is inherited, it can be set on a parent element (normally <ol> or <ul>) to make the same
list styling apply to all the items inside. ...
...end us a pull request. note: this property is applied to
list items, i.e., elements with display:
list-item; . by default this includes <li> elements. because this property is inherited, it can be set on a parent element (normally <ol> or <ul>) to make the same
list styling apply to all the items inside. ...
...est. note: this property is applied to
list items, i.e., elements with display:
list-item; . by default this includes <li> elements. because this property is inherited, it can be set on a parent element (normally <ol> or <ul>) to make the same
list styling apply to all the items inside. ...
...And 16 more matches
listcols - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a container for the columns of a
listbox, each of which are created with the
listcol element. there should be only one
listcols element in a
list box. if there is no
listcols element, the
list box has a single column. ...
... « xul reference home [ examples | attributes | properties | methods | related ] a container for the columns of a
listbox, each of which are created with the
listcol element. there should be only one
listcols element in a
list box. if there is no
listcols element, the
list box has a single column. ...
... « xul reference home [ examples | attributes | properties | methods | related ] a container for the columns of a
listbox, each of which are created with the
listcol element. there should be only one
listcols element in a
list box. if there is no
listcols element, the
list box has a single column. ...
...And 15 more matches
nsIDBChangeListener
the nsidbchange
listener interface is used by components wanting to receive notification when the current database changes somehow. ...
... the nsidbchange
listener interface is used by components wanting to receive notification when the current database changes somehow. ...
... the nsidbchange
listener interface is used by components wanting to receive notification when the current database changes somehow. ...
...And 15 more matches
listitem - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a single row in a
listbox. the text of the
listitem is specified either using
listcell elements, or by placing a label attribute directly on the
listitem element. by default it contains a single
listcell element of type and class appropriate to that of the
listitem. more information is available in the xul tutorial. ...
... single
listcell element of type and class appropriate to that of the
listitem. more information is available in the xul tutorial. attributes accesskey, checked, command, crop, current, disabled, image, label, preference, selected, tabindex, type, value properties accesskey, accessible, checked, control, crop, current, disabled, image, label, selected, tabindex, value style classes
listitem-iconic examples <
listbox id="the
list"> <
listitem label="ruby"/> <
listitem label="emerald"/> <
listitem label="sapphire" selected="true"/> <
listitem label="diamond"/> </
listbox> attributes accesskey type: character this should be set to a character that is used as a shortcut key. this should be one of the characters that appears in the label attribute for the element. ...
...layed text is larger than this maximum width, you may be able to use the max-width css property (or the maxwidth attribute) to override this size. for example, for a menuitem in a menu you can add the following css rule when you want to use the value none: menupopup > menuitem, menupopup > menu { max-width: none; } current type: boolean this attribute will be set to true if the
listitem is the current item. this is typically used by a theme to customize the focus ring. to change the currently selected item in a
listbox, use the
listbox property selecteditem. disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the element is disabled. disabled elements are usually drawn with grayed-out text. if the element is disabled, it...
...And 14 more matches
list-style-position - CSS: Cascading Style Sheets
the
list-style-position css property sets the position of the ::marker relative to a
list item. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. it is often more convenient to use the shorthand
list-style. note: this property is applied to
list items, i.e., elements with display:
list-item;. by default this includes <li> elements. because this property is inherited, it can be set on the parent element (normally <ol> or <ul>) to let it apply to all
list items. ...
...use the shorthand
list-style. note: this property is applied to
list items, i.e., elements with display:
list-item;. by default this includes <li> elements. because this property is inherited, it can be set on the parent element (normally <ol> or <ul>) to let it apply to all
list items. note that there is variance among browsers regarding behavior when a block element is placed first within a
list element declared as
list-style-position: inside. chrome and safari both place this element on the same line as the marker box, whereas firefox, internet explorer, and opera place it on the next line. for more information on this, see bug 36854. ...
...st items. note that there is variance among browsers regarding behavior when a block element is placed first within a
list element declared as
list-style-position: inside. chrome and safari both place this element on the same line as the marker box, whereas firefox, internet explorer, and opera place it on the next line. for more information on this, see bug 36854. syntax /* keyword values */
list-style-position: inside;
list-style-position: outside; /* global values */
list-style-position: inherit;
list-style-position: initial;
list-style-position: unset; the
list-style-position property is specified as one of the keyword values
listed below. values inside the ::marker is the first element among the
list item's contents. outside the ::marker is outside the principal block box. ...
...And 13 more matches
list-style-type - CSS: Cascading Style Sheets
the
list-style-type css property sets the marker (such as a disc, character, or custom counter style) of a
list item element. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the color of the marker will be the same as the computed color of the element it applies to. only a few elements (<li> and <summary>) have a default value of display:
list-item. however, the
list-style-type property may be applied to any element whose display value is set to
list-item. moreover, because this property is inherited, it can be set on a parent element (commonly <ol> or <ul>) to make it apply to all
list items. syntax /* partial l...
... the element it applies to. only a few elements (<li> and <summary>) have a default value of display:
list-item. however, the
list-style-type property may be applied to any element whose display value is set to
list-item. moreover, because this property is inherited, it can be set on a parent element (commonly <ol> or <ul>) to make it apply to all
list items. ...
... to. only a few elements (<li> and <summary>) have a default value of display:
list-item. however, the
list-style-type property may be applied to any element whose display value is set to
list-item. moreover, because this property is inherited, it can be set on a parent element (commonly <ol> or <ul>) to make it apply to all
list items. ...
...And 13 more matches
listcell - Archive of obsolete content
an ellipsis will be used in place of the cropped text. if the box direction is reversed, the cropping is reversed. ...
...an ellipsis will be used in place of the cropped text. if the box direction is reversed, the cropping is reversed. ...
...an ellipsis will be used in place of the cropped text. if the box direction is reversed, the cropping is reversed. ...
...And 12 more matches
nsIMessageListenerManager
dom/base/nsimessagemanager.idlscriptable this interface enables clients to
listen for messages sent using the nsimessagebroadcaster, nsimessagesender, or nsisyncmessagesender interfaces. 1.0 66 introduced gecko 17 inherits from: nsisupports last changed in gecko 41 (firefox 41 / thunderbird 41 / seamonkey 2.38) implemented by: @mozilla.org/globalmessagemanager;1. ...
...syncmessagesender interfaces. 1.0 66 introduced gecko 17 inherits from: nsisupports last changed in gecko 41 (firefox 41 / thunderbird 41 / seamonkey 2.38) implemented by: @mozilla.org/globalmessagemanager;1. ...
...uced gecko 17 inherits from: nsisupports last changed in gecko 41 (firefox 41 / thunderbird 41 / seamonkey 2.38) implemented by: @mozilla.org/globalmessagemanager;1. ...
...And 12 more matches
DataTransferItemList.remove() - Web APIs
return value undefined. exceptions invalidstateerror the drag data store is not in read/write mode, so the item can't be removed. example this example shows the use of the remove() method. ...
... return value undefined. exceptions invalidstateerror the drag data store is not in read/write mode, so the item can't be removed. example this example shows the use of the remove() method. ...
... return value undefined. exceptions invalidstateerror the drag data store is not in read/write mode, so the item can't be removed. example this example shows the use of the remove() method. ...
...And 12 more matches
Template and Tree Listeners - Archive of obsolete content
you would implement this object with these two methods if you wish to be notified when the template is rebuilt using the builder's rebuild call. ...
...you would implement this object with these two methods if you wish to be notified when the template is rebuilt using the builder's rebuild call. ...
...you would implement this object with these two methods if you wish to be notified when the template is rebuilt using the builder's rebuild call. ...
...And 11 more matches
TPS Bookmark Lists
each key is the full path for the array of contents specified in the key's value. for example: var bookmarks_after_second_modify = { "menu": [ { uri: "http://www.getfirefox.com/", title: "get firefox" } ], "menu/foldera": [ { uri: "http://mozilla.com", title: "mozilla" }, ] }; this describes two bookmarks, one in the "menu" folder, and the other in the "folder1" subfolder of "menu". ...
...bookmark. optional. keyword: the keyword for the bookmark. optional. after: the title of the bookmark item expected to be found after this bookmark; used only in verify and modify actions. before: the title of the bookmark item expected to be found before this bookmark; used only in verify and modify actions. changes: an object containing new properties to be set for this bookmark when this asset
list is used in a modify action. the properties for this object include the uri, title, loadinsidebar, description, tags, keyword properties above, plus two additional properties: location: the full path of the folder that the bookmark should be moved to position: the title of the existing bookmark item, in the current folder, where this bookmark should be moved to (i.e., this bookmark would be inser...
...ction. the properties for this object include the uri, title, loadinsidebar, description, tags, keyword properties above, plus two additional properties: location: the full path of the folder that the bookmark should be moved to position: the title of the existing bookmark item, in the current folder, where this bookmark should be moved to (i.e., this bookmark would be inserted into the bookmark
list at the position of the named bookmark, causing that bookmark to be positioned below the current one) example: { uri: "http://www.google.com", title: "google", loadinsidebar: false, tags: [ "google", "computers", "misc" ] } livemark objects valid properties are: livemark: the livemark name. required. siteuri: the livemark's uri. optional. feeduri: the livemark's feed uri. required. afte...
...And 11 more matches
SVGLengthList - Web APIs
svg length
list interface the svglength
list defines a
list of svglength objects. an svglength
list object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown. ...
... svg length
list interface the svglength
list defines a
list of svglength objects. an svglength
list object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown. ...
... svglength removeitem(in unsigned long index) svglength appenditem(in svglength newitem) properties readonly unsigned long numberofitems readonly unsigned long length normative document svg 1.1 (2nd edition) properties name type description numberofitems unsigned long the number of items in the
list. ...
...And 11 more matches
nsIEventListenerService
content/events/public/nsievent
listenerservice.idlscriptable a service that can be used to get a
list of
listeners observing events; this is primarily useful for debuggers. 1.0 66 introduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4) implemented by: @mozilla.org/event
listenerservice;1. to create an instance, use: var event
listenerservice = components.classes["@mozilla.org/event
listenerservice;1"] .getservice(components.interfaces.nsievent
listenerservice); universalxpconnect privileges are required to use this service. method overview void geteventtargetchainfor(in nsidomeventtarget aeventtarget, [optional] out unsigned long acount, [retval, arr...
.../event
listenerservice;1"] .getservice(components.interfaces.nsievent
listenerservice); universalxpconnect privileges are required to use this service. ...
...privileges are required to use this service. ...
...And 10 more matches
nsIJumpListBuilder
widget/public/nsijump
listbuilder.idlscriptable please add a summary to this article. 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) jump
lists are built and then applied. modifying an applied jump
list is not permitted. callers should begin the creation of a new jump
list using init
listbuild(), add sub
lists using add
listtobuild(), then commit the jump
list using commit
listbuild().
lists are built in real-time during the sequence of build calls, make sure to check for errors on each individual step. the default number of allowed items in a jump
list is ten. users can change the number through system preferences. ...
...n of a new jump
list using init
listbuild(), add sub
lists using add
listtobuild(), then commit the jump
list using commit
listbuild().
lists are built in real-time during the sequence of build calls, make sure to check for errors on each individual step. the default number of allowed items in a jump
list is ten. users can change the number through system preferences. user may also pin items to jump
lists, which take up additional slots. applications do not have control over the number of items allowed in jump
lists; excess items added are dropped by the system. item insertion priority is defined as first to last added. users may remove items from jump
lists after they are committed. the system tracks removed items between commits. a
list of these items is returned by a call to init
listbuild(). n...
...ch take up additional slots. applications do not have control over the number of items allowed in jump
lists; excess items added are dropped by the system. item insertion priority is defined as first to last added. users may remove items from jump
lists after they are committed. the system tracks removed items between commits. a
list of these items is returned by a call to init
listbuild(). nsijump
listbuilder does not filter entries added that have been removed since the last commit. to prevent repeatedly adding entires users have removed, applications are encouraged to track removed items internally. each
list is made up of an array of nsiwinjump
listitems representing items such as shortcuts, links, and separators. see nsijump
listitem for information on adding additional jump
list types. metho...
...And 10 more matches
NodeList.prototype.forEach() - Web APIs
thisarg optional value to use as this when executing callback. return value undefined. ...
... thisarg optional value to use as this when executing callback. return value undefined. ...
... thisarg optional value to use as this when executing callback. return value undefined. ...
...And 10 more matches
SVGPointList - Web APIs
svg point
list interface the svgpoint
list defines a
list of svgpoint objects. an svgpoint
list object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown. interface overview also implement none methods void clear() svgpoint initialize(in svgpoint newitem) svgpoint getitem(in unsigned long index) svgpoint insertitembefore(in svgpoint newitem, in unsigned long index) svgpoint replaceitem(in svgpoint newitem, in unsigned long index) svgpoint removeitem(in unsigned long index) svgpoint appenditem(in svgpoint newitem) ...
...ies readonly unsigned long numberofitems normative document svg 1.1 (2nd edition) properties name type description numberofitems unsigned long the number of items in the
list. methods name & arguments return description clear() void clears all existing current items from the
list, with the result being an empty
list. exceptions: a domexception with code no_modification_allowed_err is ra...
... methods name & arguments return description clear() void clears all existing current items from the
list, with the result being an empty
list. exceptions: a domexception with code no_modification_allowed_err is raised when the
list corresponds to a read only attribute or when the object itself is read only. ...
...And 10 more matches
Listening to events in Firefox extensions - Archive of obsolete content
ication and extension authors can use to receive notifications from <xul:browser> and <xul:tabbrowser> elements to hear about changes relating to loads of the content contained within them. simple dom events registering for a dom event is done using with code such as the following: function callback(evt) { // do your processing here. check evt.target for the target of the event. ...
... domtitlechanged dispatched when the title of the page changes. ...
...page contains frames, then when the cached page is loaded: pageshow events from each frame fire before the pageshow event in the main document fires. when the user navigates away from the cached page, the pagehide event from each frame fires before the pagehide event in the main document. for navigation that occurs inside a single frame, events fire only in the affected frame. ...
...And 9 more matches
Network request list - Firefox Developer Tools
each request is displayed in its own row: by default, the network monitor is cleared each time you navigate to a new page or reload the current page. you can override this behavior by checking "enable persistent logs" in the settings. network request columns you can toggle columns on and off by right-clicking on the table header and choosing the specific column from the context menu. a reset columns command is available on the context menu to reset the columns to their initial configuration. ...
...anges to a resize icon when you move it over the border of a column. you can drag to manually set the size of column. starting in firefox 76 you can double-click a column divider to resize the column to the left of it to fit its contents. the reset columns command on the context menu also resets the width of the columns to the default values. clicking the column header label sorts the request
list by that column. you can reset the sort to the default by selecting "reset sorting" from the context menu. here is a
list of all available columns: status: the http status code returned. the numeric code is displayed on a colored background, to help unusual ones stand out. if there was no response, this column is empty. or you might see a red circle with a diagonal slash for responses that ...
...a message about why the resource was not transferred. a number value is less than size if the resource was compressed. if the resource was fetched from a service worker cache, then this cell displays "service worker". cached resources may be fetched from the cache and the network simultaneously, which may improve load time for slow caches. starting with firefox 68, the transferred column
lists either "cached (raced)" or "[size] (raced)" depending on the faster source. this feature is called race cache with network (rcwn). if the resource was blocked, the message indicates why it was blocked. for example, "csp", "malware", "cors missing allow origin", "blocked by [name of extension]". size: the size of the transferred resource. image thumbnails if the request is for an imag...
...And 9 more matches
AudioListener.setOrientation() - Web APIs
the setorientation() method of the audio
listener interface defines the orientation of the
listener. it consists of two direction vectors: the front vector, defined by the three unitless parameters x, y and z, describes the direction of the face of the
listener, that is the direction the nose of the person is pointing towards. the front vector's default value is (0, 0, -1). the up vector, defined by three unitless parameters xup, yup and zup, describes the direction of the top of the
listener's head. the up vector's default value is (0, 1, 0). the two vectors must be separated by an angle of 90° — in linear analysis terms, they must be perpendicular to each other. ...
...he front vector's default value is (0, 0, -1). the up vector, defined by three unitless parameters xup, yup and zup, describes the direction of the top of the
listener's head. the up vector's default value is (0, 1, 0). the two vectors must be separated by an angle of 90° — in linear analysis terms, they must be perpendicular to each other. syntax var audioctx = new audiocontext(); var my
listener = audioctx.
listener; my
listener.setorientation(0,0,-1,0,1,0); returns void. ...
...ector's default value is (0, 1, 0). the two vectors must be separated by an angle of 90° — in linear analysis terms, they must be perpendicular to each other. syntax var audioctx = new audiocontext(); var my
listener = audioctx.
listener; my
listener.setorientation(0,0,-1,0,1,0); returns void. example in the following example, you can see an example of how the createpanner() method, audio
listener and pannernode would be used to control audio spatialisation. ...
...And 9 more matches
SVGPathSegList - Web APIs
svg path segment
list interface this interface defines a
list of svgpathseg objects. interface overview also implement none methods void clear() svgpathseg initialize(in svgpathseg newitem) svgpathseg getitem(in unsigned long index) svgpathseg insertitembefore(in svgpathseg newitem, in unsigned long index) svgpathseg replaceitem(in svgpathseg newitem, in unsigned long index) svgpathseg removeitem(in unsigned long index) svgpathseg appenditem(in svgpathseg newitem) properties readonly unsigned long numb...
... readonly unsigned long numberofitems normative document svg 1.1 (2nd edition) properties name type description numberofitemsread only unsigned long the number of items in the
list. methods clear() void clears all existing current items from the
list, with the result being an empty
list. exceptions: a domexception with code no_modification_allowed_err is raised when the
list cannot be modified. ...
...rent items from the
list, with the result being an empty
list. exceptions: a domexception with code no_modification_allowed_err is raised when the
list cannot be modified. initialize(in svgpathseg newitem) svgpathseg clears all existing current items from the
list and re-initializes the
list to hold the single item specified by newitem. if the inserted item is already in a
list, it is removed from its previous
list before it is inserted into this
list. the inserted item is the item itself and not a copy. the return value is the item inserted into the
list. exceptions: a domexception with code no_modification_allowed_err i...
...And 9 more matches
Intl.ListFormat - JavaScript
the intl.
listformat object is a constructor for objects that enable language-sensitive
list formatting. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. constructor intl.
listformat() creates a new
listformat object. static methods intl.
listformat.supportedlocalesof() returns an array containing those of the provided locales that are supported without having to fall back to the runtime's default locale. instance methods intl.
listformat.prototype.format() returns a language-specific formatted string representing the elements of the
list. ...
... intl.
listformat() creates a new
listformat object. static methods intl.
listformat.supportedlocalesof() returns an array containing those of the provided locales that are supported without having to fall back to the runtime's default locale. instance methods intl.
listformat.prototype.format() returns a language-specific formatted string representing the elements of the
list. intl.
listformat.prototype.formattoparts() returns an array of objects representing the different components that can be used to format a
list of values in a locale-aware fashion. examples using format the following example shows how to create a
list formatter using the english language. ...
...type.format() returns a language-specific formatted string representing the elements of the
list. intl.
listformat.prototype.formattoparts() returns an array of objects representing the different components that can be used to format a
list of values in a locale-aware fashion. examples using format the following example shows how to create a
list formatter using the english language. ...
...And 9 more matches
nsIDownloadProgressListener
as the states of downloads change, the methods described here are called by the download manager so your code can take whatever steps it needs to. ...
... as the states of downloads change, the methods described here are called by the download manager so your code can take whatever steps it needs to. ...
... as the states of downloads change, the methods described here are called by the download manager so your code can take whatever steps it needs to. this interface works very similarly to the nsiwebprogress interface. ...
...And 8 more matches
NodeList - Web APIs
node
list objects are collections of nodes, usually returned by properties such as node.childnodes and methods such as document.queryselectorall(). although node
list is not an array, it is possible to iterate over it with foreach(). it can also be converted to a real array using array.from(). however, some older browsers have not implemented node
list.foreach() nor array.from(). this can be circumvented by using array.prototype.foreach() — see this document's example. live vs. static node
lists although they are both considered node
lists, there are 2 varieties of node
list: live and static. live node
lists in some cases, the node
list is live, which means that changes in the dom automatically update the collection. for example, node.childnodes is live: const parent = document.getelement...
... some cases, the node
list is live, which means that changes in the dom automatically update the collection. for example, node.childnodes is live: const parent = document.getelementbyid('parent'); let child_nodes = parent.childnodes; console.log(child_nodes.length); // let's assume "2" parent.appendchild(document.createelement('div')); console.log(child_nodes.length); // outputs "3" static node
lists in other cases, the node
list is static, where any changes in the dom does not affect the content of the collection. the ubiquitous document.queryselectorall() method returns a static node
list. it's good to keep this distinction in mind when you choose how to iterate over the items in the node
list, and whether you should cache the
list's length. ...
... outputs "3" static node
lists in other cases, the node
list is static, where any changes in the dom does not affect the content of the collection. the ubiquitous document.queryselectorall() method returns a static node
list. it's good to keep this distinction in mind when you choose how to iterate over the items in the node
list, and whether you should cache the
list's length. properties node
list.length the number of nodes in the node
list. methods node
list.item() returns an item in the
list by its index, or null if the index is out-of-bounds. an alternative to accessing node
list[i] (which instead returns undefined when i is out-of-bounds). this is mostly useful for non-javascript dom implementations. ...
...And 8 more matches
SVGNumberList - Web APIs
svg number
list interface the svgnumber
list defines a
list of svgnumber objects. an svgnumber
list object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown. note: starting in gecko 5.0,the svgnumber
list dom interface is now indexable and can be accessed like arrays. interface overview also implement none methods void clear() svgnumber initialize(in svgnumber newitem) svgnumber getitem(in unsigned long index) svgnumber insertitembefore(in svgnumber newitem, in unsigned long index) svgnumber replaceitem(in svgnumber newitem, in unsigned long index) svgnumber removeitem(in unsigned long index) svgnumber appenditem(in svgnumber newitem) pro...
...number removeitem(in unsigned long index) svgnumber appenditem(in svgnumber newitem) properties readonly unsigned long numberofitems readonly unsigned long length normative document svg 1.1 (2nd edition) properties name type description numberofitems unsigned long the number of items in the
list. ...
...vgnumber newitem) properties readonly unsigned long numberofitems readonly unsigned long length normative document svg 1.1 (2nd edition) properties name type description numberofitems unsigned long the number of items in the
list. length unsigned long the number of items in the
list. methods name & arguments return description clear() void clears all existing current items from the
list, with the result being an empty
list. exceptions: a domexception with code no_modification_allowed_err is raised when the
list corresponds to a read only attribute or when the object itself is read only. initiali...
...And 8 more matches
SVGStringList - Web APIs
svg string
list interface the svgstring
list defines a
list of domstring objects. an svgstring
list object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown. interface overview also implement none methods void clear() domstring initialize(in domstring newitem) domstring getitem(in unsigned long index) domstring insertitembefore(in domstring newitem, in unsigned long index) domstring replaceitem(in domstring newitem, in unsigned long index) domstring removeitem(in unsigned long index) domstring appenditem(in domstring newitem) properties readonly unsigned long numberofitems readonly unsigned long length ...
...mstring removeitem(in unsigned long index) domstring appenditem(in domstring newitem) properties readonly unsigned long numberofitems readonly unsigned long length normative document svg 1.1 (2nd edition) properties name type description numberofitems unsigned long the number of items in the
list. length unsigned long a mirror of the value in numberofitems, for consistency with other interfaces. methods name & arguments return description clear() void clears all existing current items from the
list, with the result being an empty
list. exceptions: a domexception with code no_modification_allowed_err is raised ...
... length unsigned long a mirror of the value in numberofitems, for consistency with other interfaces. methods name & arguments return description clear() void clears all existing current items from the
list, with the result being an empty
list. exceptions: a domexception with code no_modification_allowed_err is raised when the
list corresponds to a read only attribute or when the object itself is read only. initialize(in domstring newitem) domstring clears all existing current items from the
list and re-initializes the
list to hold the single item specified by the parameter. if the inserted item is already in a
list, it is removed from its previous
list before it is inserted into this
list. the ...
...And 8 more matches
Consistent list indentation - CSS: Cascading Style Sheets
one of the most common style changes made to
lists is a change in the indentation distance—that is, how far the
list items are pushed over to the right. this often leads to frustration, because what works in one browser often doesn't have the same effect in another. for example, if you declare that
lists have no left margin, they move over in internet explorer, but sit stubbornly in place in gecko-based browsers.this article will help you understand the problems that can occur and how to avoid them. in order to understand why this is the case, and more importantly how to avoid the problem altogether, it's necessary to examine the details of
list construction. making a
list first, we consider a single, pure
list item. ...
...e over in internet explorer, but sit stubbornly in place in gecko-based browsers.this article will help you understand the problems that can occur and how to avoid them. in order to understand why this is the case, and more importantly how to avoid the problem altogether, it's necessary to examine the details of
list construction. making a
list first, we consider a single, pure
list item. this
list item has no marker (otherwise known as a "bullet") and is not yet part of a
list itself. it hangs alone in the void, simple and unadorned, as shown in figure 1. that dotted red border represents outer edges of the content-area of the
list item. remember that, at this point, the
list item has no padding or borders. if we add two more
list items, we get a result like that shown in figure 2. n...
...self. it hangs alone in the void, simple and unadorned, as shown in figure 1. that dotted red border represents outer edges of the content-area of the
list item. remember that, at this point, the
list item has no padding or borders. if we add two more
list items, we get a result like that shown in figure 2. now we wrap these in a parent element; in this case, we'll wrap them in an unordered
list (i.e., <ul>). according to the css box model, the
list items' boxes must be displayed within the parent element's content area. since that parent has no padding or margins yet, we get the situation shown in figure 3. ...
...And 8 more matches
Beginning our React todo list - Learn web development
you need to check your code against our version, you can find a finished version of the sample react app code in our todo-react repository. for a running live version, see https://mdn.github.io/todo-react-build/. prerequisites: familiarity with the core html, css, and javascript languages, knowledge of the terminal/command line. objective: to introduce our todo
list case study, and get the basic app structure and styling in place. our app's user stories in software development, a user story is an actionable goal from the perspective of the user. defining user stories before we begin our work will help us focus our work. our app should fulfill the following stories: as a user, i can read a
list of tasks. add a task using the mouse or keyboard. m...
...-hidden">show </span> <span>active</span> <span classname="visually-hidden"> tasks</span> </button> <button type="button" classname="btn toggle-btn" aria-pressed="false"> <span classname="visually-hidden">show </span> <span>completed</span> <span classname="visually-hidden"> tasks</span> </button> </div> <h2 id="
list-heading"> 3 tasks remaining </h2> <ul role="
list" classname="todo-
list stack-large stack-exception" aria-labelledby="
list-heading" > <li classname="todo stack-small"> <div classname="c-cb"> <input id="todo-0" type="checkbox" defaultchecked={true} /> <label classname="todo-label" htmlfor="todo-0"> ...
... — we'll style it in a moment. first, consider the jsx we have, and how it corresponds to our user stories: we have a <form> element, with an <input type="text"> for writing out a new task, and a button to submit the form. we have an array of buttons that will be used to filter our tasks. we have a heading that tells us how many tasks remain. we have our 3 tasks, arranged in an un-ordered
list. each task is a
list item (<li>), and has buttons to edit and delete it and a checkbox to check it off as done. the form will allow us to make tasks; the buttons will let us filter them; the heading and
list are our way to read them. the ui for editing a task is conspicuously absent for now. that's okay – we'll write that later. accessibility features you may notice some unusual attributes ...
...And 7 more matches
nsIBlocklistService
xpcom/system/nsiblock
listservice.idlscriptable please add a summary to this article. ...
... xpcom/system/nsiblock
listservice.idlscriptable please add a summary to this article. ...
...idlscriptable please add a summary to this article. ...
...And 7 more matches
AudioListener.setPosition() - Web APIs
the setposition() method of the audio
listener interface defines the position of the
listener. the three parameters x, y and z are unitless and describe the
listener's position in 3d space according to the right-hand cartesian coordinate system. pannernode objects use this position relative to individual audio sources for spatialisation. the default value of the position vector is (0, 0, 0). syntax var audioctx = new audiocontext(); var my
listener = audioctx.
listener; my
listener.setposition(1,1,1); returns void. example in the following example, you can see an example of how the createpanner() method, audio
listener and pannernode would be used to control audio spatialisation. ...
... the position vector is (0, 0, 0). syntax var audioctx = new audiocontext(); var my
listener = audioctx.
listener; my
listener.setposition(1,1,1); returns void. example in the following example, you can see an example of how the createpanner() method, audio
listener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio
listener and panner (source) occupy initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change rea
listically as your character moves closer to or further away from a music player such as a stereo. in the example you can see this being controlled by the functi...
...via the positionpanner() function. ...
...And 7 more matches
DataTransferItemList.DataTransferItem() - Web APIs
the returned value is never null. example this example shows how to use drag and drop. ...
...the returned value is never null. example this example shows how to use drag and drop. ...
...the returned value is never null. example this example shows how to use drag and drop. ...
...And 7 more matches
SpeechGrammarList.addFromURI() - Web APIs
the weight means the importance of this grammar, or the likelihood that it will be recognised by the speech recognition service. ...
...the weight means the importance of this grammar, or the likelihood that it will be recognised by the speech recognition service. ...
...the weight means the importance of this grammar, or the likelihood that it will be recognised by the speech recognition service. ...
...And 7 more matches
ARIA: List role - Accessibility
the aria
list role can be used to identify a
list of items. it is normally used in conjunction with the
listitem role, which is used to identify a
list item contained inside the
list. <section role="
list"> <div role="
listitem">
list item 1</div> <div role="
listitem">
list item 2</div> <div role="
listitem">
list item 3</div> </section> description any content that consists of an outer container with a
list of elements inside it can be identified to assistive technologies using the
list and
listitem containers respectively. a
list must have one or more
listitem children, or, alternatively, have one or more groups as children, with each group having one or more
listitems as children. ...
...see best practices for a full example. ...
...see best practices for a full example. ...
...And 7 more matches
nsIMsgFilterList
defined in comm-central/ mailnews/ base/ search/ public/ nsimsgfilter
list.idl attributes folder attribute nsimsgfolder nsimsgfilter
list::folder version readonly attribute short nsimsgfilter
list::version arbitraryheaders readonly attribute acstring nsimsgfilter
list::arbitraryheaders shoulddownloadallheaders readonly attribute boolean nsimsgfilter
list::shoulddownloadallheaders filtercount readonly attribute unsigned long nsimsgfilter
list::filtercount loggingenabled attribute boolean nsimsgfilter
list::loggingenabled defaultfile attribute nsilocalfile nsimsgfilter
list::defaultfile logstream attribute nsioutputstream nsimsgfilter
list::logstream logurl readonly attribute acstring nsimsgfilter
list::logurl methods getfilterat() nsimsgfilter nsimsgfilter
list::getfilterat (in unsigned...
...loggingenabled attribute boolean nsimsgfilter
list::loggingenabled defaultfile attribute nsilocalfile nsimsgfilter
list::defaultfile logstream attribute nsioutputstream nsimsgfilter
list::logstream logurl readonly attribute acstring nsimsgfilter
list::logurl methods getfilterat() nsimsgfilter nsimsgfilter
list::getfilterat (in unsigned long filterindex ) getfilternamed() nsimsgfilter nsimsgfilter
list::getfilternamed (in astring filtername) setfilterat() nsimsgfilter nsimsgfilter
list::setfilterat ( in unsigned long filterindex, in nsimsgfilter filter ) removefilter() void nsimsgfilter
list::removefilter (in nsimsgfilter filter) removefilterat() void nsimsgfilter
list::removefilterat (in unsigned long filterindex) movefilterat() void nsimsgfilter
list::movefil...
...index, in nsimsgfilter filter ) removefilter() void nsimsgfilter
list::removefilter (in nsimsgfilter filter) removefilterat() void nsimsgfilter
list::removefilterat (in unsigned long filterindex) movefilterat() void nsimsgfilter
list::movefilterat ( in unsigned long filterindex, in nsmsgfiltermotionvalue motion ) insertfilterat() void nsimsgfilter
list::insertfilterat ( in unsigned long filterindex, in nsimsgfilter filter ) movefilter() void nsimsgfilter
list::movefilter ( in nsimsgfilter filter, in nsmsgfiltermotionvalue motion ) createfilter() nsimsgfilter nsimsgfilter
list::createfilter ( in astring name ) savetofile() void nsimsgfilter
list::savetofile ( in nsioutputstream stream ) parsecondit...
...And 6 more matches
nsIWebProgressListener
inherits from: nsisupports last changed in gecko 15 (firefox 15 / thunderbird 15 / seamonkey 2.12) nsiwebprogress describes the parent-child relationship of nsiwebprogress instances. ...
...d with other state type flags. unlike state_is_window, this flag is only set when activity within the nsiwebprogress instance being observed starts or stops. if activity only occurs in a child nsiwebprogress instance, then this flag will be set to indicate the start and stop of that activity. for example, in the case of navigation within a single frame of a html frameset, a nsiwebprogress
listener instance attached to the nsiwebprogress of the frameset window will receive onstatechange() calls with the state_is_network flag set to indicate the start and stop of said navigation. in other words, an observer of an outer window can determine when activity, that may be constrained to a child window or set of child windows, starts and stops. state_is_window 0x00080000 thi...
...th awebprogress. progress totals are reset to zero when all requests in awebprogress complete (corresponding to onstatechange() being called with astateflags including the state_stop and state_is_window flags). note: if any progress value is unknown, or if its value would exceed the maximum value of type long, then its value is replaced with -1. note: if the object also implements nsiwebprogress
listener2 and the caller knows about that interface, this function will not be called. instead, nsiwebprogress
listener2.onprogresschange64() will be called. void onprogresschange( in nsiwebprogress awebprogress, in nsirequest arequest, in long acurselfprogress, in long amaxselfprogress, in long acurtotalprogress, in long amaxtotalprogress ); parameters awebprogress the nsiwebprogres...
...And 6 more matches
AudioListener.dopplerFactor - Web APIs
the deprecated dopplerfactor property of the audio
listener interface is a double value representing the amount of pitch shift to use when rendering a doppler effect. the dopplerfactor property's default value is 1, which is a sensible default for most situations. syntax var audioctx = new audiocontext(); var my
listener = audioctx.
listener; my
listener.dopplerfactor = 1; value a double indicating the doppler effect's pitch shift value. the value is 1 by default. example in the following example, you can see an example of how the createpanner() method, audio
listener and pannernode would be used to control audio spatialisation. ...
... var my
listener = audioctx.
listener; my
listener.dopplerfactor = 1; value a double indicating the doppler effect's pitch shift value. the value is 1 by default. example in the following example, you can see an example of how the createpanner() method, audio
listener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio
listener and panner (source) occupy initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change rea
listically as your character moves closer to or further away from a music player such as a stereo. in the example you can see this being controlled by the functi...
...via the positionpanner() function. ...
...And 6 more matches
AudioListener.forwardX - Web APIs
the forwardx read-only property of the audio
listener interface is an audioparam representing the x value of the direction vector defining the forward direction the
listener is pointing in. note: the parameter is a-rate when used with a pannernode whose panningmodel is set to equalpower, or k-rate otherwise. syntax var audioctx = new audiocontext(); var my
listener = audioctx.
listener; my
listener.forwardx.value = 0; value an audioparam. its default value is 0, and it can range between positive and negative infinity. example in the following example, you can see an example of how the createpanner() method, audio
listener and pannernode would be used to control audio spatialisation. ...
...tener = audioctx.
listener; my
listener.forwardx.value = 0; value an audioparam. its default value is 0, and it can range between positive and negative infinity. example in the following example, you can see an example of how the createpanner() method, audio
listener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio
listener and panner (source) occupy initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change rea
listically as your character moves closer to or further away from a music player such as a stereo. in the example you can see this being controlled by the functi...
...via the positionpanner() function. ...
...And 6 more matches
AudioListener.forwardY - Web APIs
the forwardy read-only property of the audio
listener interface is an audioparam representing the y value of the direction vector defining the forward direction the
listener is pointing in. note: the parameter is a-rate when used with a pannernode whose panningmodel is set to equalpower, or k-rate otherwise. syntax var audioctx = new audiocontext(); var my
listener = audioctx.
listener; my
listener.forwardy.value = 0; value an audioparam. its default value is 0, and it can range between positive and negative infinity. example in the following example, you can see an example of how the createpanner() method, audio
listener and pannernode would be used to control audio spatialisation. ...
...tener = audioctx.
listener; my
listener.forwardy.value = 0; value an audioparam. its default value is 0, and it can range between positive and negative infinity. example in the following example, you can see an example of how the createpanner() method, audio
listener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio
listener and panner (source) occupy initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change rea
listically as your character moves closer to or further away from a music player such as a stereo. in the example you can see this being controlled by the functi...
...via the positionpanner() function. ...
...And 6 more matches
AudioListener.forwardZ - Web APIs
the forwardz read-only property of the audio
listener interface is an audioparam representing the z value of the direction vector defining the forward direction the
listener is pointing in. note: the parameter is a-rate when used with a pannernode whose panningmodel is set to equalpower, or k-rate otherwise. syntax var audioctx = new audiocontext(); var my
listener = audioctx.
listener; my
listener.forwardz.value = 0; value an audioparam. its default value is -1, and it can range between positive and negative infinity. example in the following example, you can see an example of how the createpanner() method, audio
listener and pannernode would be used to control audio spatialisation. ...
...ener = audioctx.
listener; my
listener.forwardz.value = 0; value an audioparam. its default value is -1, and it can range between positive and negative infinity. example in the following example, you can see an example of how the createpanner() method, audio
listener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio
listener and panner (source) occupy initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change rea
listically as your character moves closer to or further away from a music player such as a stereo. in the example you can see this being controlled by the functi...
...via the positionpanner() function. ...
...And 6 more matches
AudioListener.positionX - Web APIs
the positionx read-only property of the audio
listener interface is an audioparam representing the x position of the
listener in 3d cartesian space. note: the parameter is a-rate when used with a pannernode whose pannernode is set to equalpower, or k-rate otherwise. syntax var audioctx = new audiocontext(); var my
listener = audioctx.
listener; my
listener.positionx.value = 1; value an audioparam. its default value is 0, and it can range between positive and negative infinity. example in the following example, you can see an example of how the createpanner() method, audio
listener and pannernode would be used to control audio spatialisation. ...
...ener = audioctx.
listener; my
listener.positionx.value = 1; value an audioparam. its default value is 0, and it can range between positive and negative infinity. example in the following example, you can see an example of how the createpanner() method, audio
listener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio
listener and panner (source) occupy initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change rea
listically as your character moves closer to or further away from a music player such as a stereo. in the example you can see this being controlled by the functi...
...via the positionpanner() function. ...
...And 6 more matches
AudioListener.positionY - Web APIs
the positiony read-only property of the audio
listener interface is an audioparam representing the y position of the
listener in 3d cartesian space. note: the parameter is a-rate when used with a pannernode whose pannernode is set to equalpower, or k-rate otherwise. syntax var audioctx = new audiocontext(); var my
listener = audioctx.
listener; my
listener.positiony.value = 1; value an audioparam. its default value is 0, and it can range between positive and negative infinity. example in the following example, you can see an example of how the createpanner() method, audio
listener and pannernode would be used to control audio spatialisation. ...
...ener = audioctx.
listener; my
listener.positiony.value = 1; value an audioparam. its default value is 0, and it can range between positive and negative infinity. example in the following example, you can see an example of how the createpanner() method, audio
listener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio
listener and panner (source) occupy initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change rea
listically as your character moves closer to or further away from a music player such as a stereo. in the example you can see this being controlled by the functi...
...via the positionpanner() function. ...
...And 6 more matches
AudioListener.positionZ - Web APIs
the positionz read-only property of the audio
listener interface is an audioparam representing the z position of the
listener in 3d cartesian space. note: the parameter is a-rate when used with a pannernode whose pannernode is set to equalpower, or k-rate otherwise. syntax var audioctx = new audiocontext(); var my
listener = audioctx.
listener; my
listener.positionz.value = 1; value an audioparam. its default value is 0, and it can range between positive and negative infinity. example in the following example, you can see an example of how the createpanner() method, audio
listener and pannernode would be used to control audio spatialisation. ...
...ener = audioctx.
listener; my
listener.positionz.value = 1; value an audioparam. its default value is 0, and it can range between positive and negative infinity. example in the following example, you can see an example of how the createpanner() method, audio
listener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio
listener and panner (source) occupy initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change rea
listically as your character moves closer to or further away from a music player such as a stereo. in the example you can see this being controlled by the functi...
...via the positionpanner() function. ...
...And 6 more matches
AudioListener.speedOfSound - Web APIs
the speedofsound property of the audio
listener interface is a double value representing the speed of sound, in meters per second. the speedofsound property's default value is 343.3 m/s and is used to calculate the doppler shift appropriate for the speed the panner is travelling at (as defined by pannernode.setvelocity.) note: bear in mind that no propagation delay is automatically applied to a sound far from the
listener. syntax var audioctx = new audiocontext(); var my
listener = audioctx.
listener; my
listener.speedofsound = 343.3; value a double. example in the following example, you can see an example of how the createpanner() method, audio
listener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio li...
...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. ...
...via the positionpanner() function. ...
...And 6 more matches
AudioListener.upX - Web APIs
the upx read-only property of the audio
listener interface is an audioparam representing the x value of the direction vector defining the up direction the
listener is pointing in. note: the parameter is a-rate when used with a pannernode whose pannernode is set to equalpower, or k-rate otherwise. syntax var audioctx = new audiocontext(); var my
listener = audioctx.
listener; my
listener.upx.value = 0; value an audioparam. its default value is 0, and it can range between positive and negative infinity. example in the following example, you can see an example of how the createpanner() method, audio
listener and pannernode would be used to control audio spatialisation. ...
...my
listener = audioctx.
listener; my
listener.upx.value = 0; value an audioparam. its default value is 0, and it can range between positive and negative infinity. example in the following example, you can see an example of how the createpanner() method, audio
listener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio
listener and panner (source) occupy initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change rea
listically as your character moves closer to or further away from a music player such as a stereo. in the example you can see this being controlled by the functi...
...via the positionpanner() function. ...
...And 6 more matches
AudioListener.upY - Web APIs
the upy read-only property of the audio
listener interface is an audioparam representing the y value of the direction vector defining the up direction the
listener is pointing in. note: the parameter is a-rate when used with a pannernode whose pannernode is set to equalpower, or k-rate otherwise. syntax var audioctx = new audiocontext(); var my
listener = audioctx.
listener; my
listener.upy.value = 0; value an audioparam. its default value is 1, and it can range between positive and negative infinity. example in the following example, you can see an example of how the createpanner() method, audio
listener and pannernode would be used to control audio spatialisation. ...
...my
listener = audioctx.
listener; my
listener.upy.value = 0; value an audioparam. its default value is 1, and it can range between positive and negative infinity. example in the following example, you can see an example of how the createpanner() method, audio
listener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio
listener and panner (source) occupy initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change rea
listically as your character moves closer to or further away from a music player such as a stereo. in the example you can see this being controlled by the functi...
...via the positionpanner() function. ...
...And 6 more matches
AudioListener.upZ - Web APIs
the upz read-only property of the audio
listener interface is an audioparam representing the z value of the direction vector defining the up direction the
listener is pointing in. note: the parameter is a-rate when used with a pannernode whose pannernode is set to equalpower, or k-rate otherwise. syntax var audioctx = new audiocontext(); var my
listener = audioctx.
listener; my
listener.upz.value = 0; value an audioparam. its default value is 0, and it can range between positive and negative infinity. example in the following example, you can see an example of how the createpanner() method, audio
listener and pannernode would be used to control audio spatialisation. ...
...my
listener = audioctx.
listener; my
listener.upz.value = 0; value an audioparam. its default value is 0, and it can range between positive and negative infinity. example in the following example, you can see an example of how the createpanner() method, audio
listener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio
listener and panner (source) occupy initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change rea
listically as your character moves closer to or further away from a music player such as a stereo. in the example you can see this being controlled by the functi...
...via the positionpanner() function. ...
...And 6 more matches
<ol>: The Ordered List element - HTML: Hypertext Markup Language
the html <ol> element represents an ordered
list of items — typically rendered as a numbered
list. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories flow content, and if the <ol> element's children include at least one <li> element, palpable content. permitted content zero or more <li>, <script> and <template> elements. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that accepts flow content. ...
...st. content categories flow content, and if the <ol> element's children include at least one <li> element, palpable content. permitted content zero or more <li>, <script> and <template> elements. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that accepts flow content. implicit aria role
list permitted aria roles directory, group,
listbox, menu, menubar, none, presentation, radiogroup, tab
list, toolbar, tree dom interface htmlo
listelement attributes this element also accepts the global attributes. reversed this boolean attribute specifies that the
list’s items are in reverse order. items will be numbered from high to low. start an integer to sta...
...always an arabic numeral (1, 2, 3, etc.), even when the numbering type is letters or roman numerals. for example, to start numbering elements from the letter "d" or the roman numeral "iv," use start="4". ...
...And 6 more matches
<ul>: The Unordered List element - HTML: Hypertext Markup Language
the html <ul> element represents an unordered
list of items, typically rendered as a bulleted
list. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories flow content, and if the <ul> element's children include at least one <li> element, palpable content. permitted content zero or more <li>, <script> and <template> elements. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that accepts flow content. ...
...st. content categories flow content, and if the <ul> element's children include at least one <li> element, palpable content. permitted content zero or more <li>, <script> and <template> elements. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that accepts flow content. implicit aria role
list permitted aria roles directory, group,
listbox, menu, menubar, none, presentation, radiogroup, tab
list, toolbar, tree dom interface htmlu
listelement attributes this element includes the global attributes. compact this boolean attribute hints that the
list should be rendered in a compact style. the interpretation of this attribute depends on the user agent, an...
...
list should be rendered in a compact style. the interpretation of this attribute depends on the user agent, and it doesn't work in all browsers. warning: do not use this attribute, as it has been deprecated: use css instead. to give a similar effect as the compact attribute, the css property line-height can be used with a value of 80%. type this attribute sets the bullet style for the
list. the values defined under html3.2 and the transitional version of html 4.0/4.01 are: circle disc square a fourth bullet type has been defined in the webtv interface, but not all browsers support it: triangle. if not present and if no css
list-style-type property applies to the element, the user agent selects a bullet type depending on the nesting level of the
list. warning: do not...
...And 6 more matches
Fixing Incorrectly Sized List Item Markers - Archive of obsolete content
summary: an obscure bug in gecko causes
list-item markers to be differently sizeed than the text of the
list item, but there is a fix authors can use. learn how to correctly size
list item markers in gecko 0.9.4, the basis of netscape 6.2.x and compuserve 7. shortly before mozilla 0.9.4 was finished, a bug was introduced that affects the sizing of
list item markers (such as the numbers in an ordered
list). while this bug was corrected shortly after 0.9.4 was finished, the bug still affects all netscape 6.2.x versions, as well as compuserve 7.0. the problem in affected browsers,
list item markers will very often appear to be too big compared to the text in the
list item itself. ...
...see bug 110360, which explains the problem and shows when the fix was applied. ...
...see bug 110360, which explains the problem and shows when the fix was applied. ...
...And 5 more matches
Rendering a list of Vue components - Learn web development
manage the app's data and an html-based template syntax that maps to the underlying dom structure. 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. objective: to learn how to loop through an array of data and render it in multiple components. rendering
lists with v-for to be an effective to-do
list, we need to be able to render multiple to-do items. to do that, vue has a special directive, v-for. this is a built-in vue directive that lets us include a loop inside of our template, repeating the rendering of a template feature for each item in an array. we'll use this to iterate through an array of to-do items and display them in our app in separate ...
...long the lines of those seen below. this way you have some data available for rendering using v-for. export default { name: 'app', components: { todoitem }, data() { return { todoitems: [ { label: 'learn vue', done: false }, { label: 'create a vue project with the cli', done: true }, { label: 'have fun', done: true }, { label: 'create a to-do
list', done: false } ] }; } }; now that we have a
list of items, we can use the v-for directive to display them. directives are applied to elements like other attributes. in case of v-for, you use a special syntax similar to a for...in loop in javascript — v-for="item in items" — where items is the array you want to iterate over, and item is a reference to the current element in the ...
...eat, and renders that element and its children. in this case, we want to display an <li> element for every to-do item inside our todoitems array. then we want to pass the data from each to-do item to a todoitem component. key attribute before we do that, there's one other piece of syntax to know about that is used with v-for, the key attribute. to help vue optimize rendering the elements in the
list, it tries to patch
list elements so it's not recreating them every time the
list changes. however, vue needs help. to make sure it is re-using
list elements appropriately, it needs a unique "key" on the same element that you attach v-for to. to make sure that vue can accurately compare the key attributes, they need to be string or numeric values. while it would be great to use the name field, th...
...And 5 more matches
Accessible Toolkit Checklist
sibility (msaa) api support for custom controls. however, be aware that the wrapping layer will introduce accessibility bugs, and thus you will need to test extensively and fill in the holes. you will also need to provide a way for custom and owner drawn controls to easily accessibility api support, as wxwidgets does. there will be custom and owner drawn controls -- there always are. for example,
lists of checkboxes are implemented in windows with images of checked and unchecked checkboxes. owner drawn toolkits , like xul and flash's flex ui framework use few or no native widgets. these toolkits need to have accessibility implemented from the ground up, and get nothing for free in terms of keyboard, api or os-theme support. in this case, adding a complete or even a partial ac...
...require more than one full time person as well as cooperation from windows assistive technology vendors when parts of your msaa solution isn't working. often these kinds of toolkits don't use a separate window for each control; in that case remember to generate a unique 32 bit child id for each control so that the msaa event system can call back for the right iaccessible for each event. the check
list this check
list is currently only for microsoft windows, but should be expanded to include information about linux and os x. it is maintained by the mozilla accessibility community. contributions are welcome. general dialogs/windows/general escape key cancels dialogs and refocuses the previously focused on the parent window. alt+f4 closes windows, similar to escape but even wor...
... in autocomplete text fields, make sure that the left or right arrow closes the popup and starts moving through the text letter by letter msaa support, including accessible value that holds text, protected for password fields and read...
...And 5 more matches
Linked Lists
this chapter describes the nspr api for managing linked
lists. the api is a set of macros for initializing a circular (doubly linked)
list, inserting and removing elements from the
list. the macros are not thread safe. the caller must provide for mutually-exclusive access to the
list, and for the nodes being added and removed from the
list. linked
list types linked
list macros linked
list types the prc
list type represents a circular linked
list. ...
...e api is a set of macros for initializing a circular (doubly linked)
list, inserting and removing elements from the
list. the macros are not thread safe. the caller must provide for mutually-exclusive access to the
list, and for the nodes being added and removed from the
list. linked
list types linked
list macros linked
list types the prc
list type represents a circular linked
list. ...
...doubly linked)
list, inserting and removing elements from the
list. the macros are not thread safe. the caller must provide for mutually-exclusive access to the
list, and for the nodes being added and removed from the
list. linked
list types linked
list macros linked
list types the prc
list type represents a circular linked
list. ...
...And 5 more matches
nsIDOMOfflineResourceList
the nsidomofflineresource
list interface provides access to the application cache that allows web content's resources to be cached locally for use while offline. it includes methods for adding resources to and removing resources from the cache, as well as for enumerating the dynamically managed resource
list. dom/interfaces/offline/nsidomofflineresource
list.idlscriptable please add a summary to this article. last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) inherits from: nsisupports method overview void mozadd(in domstring uri); boolean mozhasitem(in domstring uri); domstring mozitem(in unsigned long index); void mozremove(in domstring uri); void swapcache(); void update(); attributes ...
... fennec 1.0) inherits from: nsisupports method overview void mozadd(in domstring uri); boolean mozhasitem(in domstring uri); domstring mozitem(in unsigned long index); void mozremove(in domstring uri); void swapcache(); void update(); attributes attribute type description mozitems nsidomofflineresource
list the
list of dynamically-managed entries in the offline resource
list. read only. mozlength unsigned long the number of entries in the dynamically managed offline resource
list. read only. onchecking nsidomevent
listener an event
listener to be called when fetching the application cache manifest and checking for updates. onerror nsidomevent
listener ...
...ist of dynamically-managed entries in the offline resource
list. read only. mozlength unsigned long the number of entries in the dynamically managed offline resource
list. read only. onchecking nsidomevent
listener an event
listener to be called when fetching the application cache manifest and checking for updates. onerror nsidomevent
listener an event
listener to be called when an error occurs during the caching process. onnoupdate nsidomevent
listener an event
listener to be called when there is no update to download. ondownloading nsidomevent
listener an event
listener to be called when resources are being downloaded into the cache. ...
...And 5 more matches
DataTransferItemList.add() - Web APIs
type a string of the drag item's type. some example types are text/html and text/plain. file a file object. no type needs to be given in this case. return value a datatransferitem containing the specified data. ...
... type a string of the drag item's type. some example types are text/html and text/plain. file a file object. no type needs to be given in this case. return value a datatransferitem containing the specified data. ...
... type a string of the drag item's type. some example types are text/html and text/plain. file a file object. no type needs to be given in this case. return value a datatransferitem containing the specified data. ...
...And 5 more matches
DataTransferItemList.clear() - Web APIs
return value undefined example this example shows the use of the clear() method. ...
... return value undefined example this example shows the use of the clear() method. ...
... return value undefined example this example shows the use of the clear() method. ...
...And 5 more matches
HTMLOListElement - Web APIs
the htmlo
listelement interface provides special properties (beyond those defined on the regular htmlelement interface it also has available to it by inheritance) for manipulating ordered
list elements. <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="midd...
...co,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlelement</text></a><polyline points="491,25 501,20 501,30 491,25" stroke="#d4dde4" fill="none"/><line x1="501" y1="25" x2="509" y2="25" stroke="#d4dde4"/><line x1="509" y1="25" x2="509" y2="90" stroke="#d4dde4"/><line x1="509" y1="90" x2="492" y2="90" stroke="#d4dde4"/><a xlink:href="/docs/web/api/htmlo
listelement" target="_top"><rect x="331" y="65" width="160" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="411" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlo
listelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits p...
...h="160" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="411" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlo
listelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmlo
listelement.reversed is a boolean value reflecting the reversed and defining if the numbering is descending, that is its value is true, or ascending (false). ...
...And 5 more matches
SpeechGrammarList - Web APIs
the speechgrammar
list interface of the web speech api represents a
list of speechgrammar objects containing words or patterns of words that we want the recognition service to recognize. grammar is defined using jspeech grammar format (jsgf.) other formats may also be supported in the future. constructor speechgrammar
list.speechgrammar
list() creates a new speechgrammar
list object. properties speechgrammar
list.length read only returns the number of speechgrammar objects contained in the speechgrammar
list. methods speechgrammar
list.item() standard getter — allows individual speechgrammar objects to be retrieved from the speechgrammar
list using array syntax. ...
...structor speechgrammar
list.speechgrammar
list() creates a new speechgrammar
list object. properties speechgrammar
list.length read only returns the number of speechgrammar objects contained in the speechgrammar
list. methods speechgrammar
list.item() standard getter — allows individual speechgrammar objects to be retrieved from the speechgrammar
list using array syntax. speechgrammar
list.addfromuri() takes a grammar present at a specific uri and adds it to the speechgrammar
list as a new speechgrammar object. speechgrammar
list.addfromstring() takes a grammar present in a specific domstring within the code base (e.g. stored in a variable) and adds it to the speechgrammar
list as a new speechgrammar object. examples in our simple speech color changer example, we create a new sp...
...w speechgrammar object. speechgrammar
list.addfromstring() takes a grammar present in a specific domstring within the code base (e.g. stored in a variable) and adds it to the speechgrammar
list as a new speechgrammar object. examples in our simple speech color changer example, we create a new speechrecognition object instance using the speechrecognition() constructor, create a new speechgrammar
list, add our grammar string to it using the speechgrammar
list.addfromstring method, and set it to be the grammar that will be recognised by the speechrecognition instance using the speechrecognition.grammars property. var grammar = '#jsgf v1.0; grammar colors; public <color> = aqua | azure | beige | bisque | black | blue | brown | chocolate | coral | crimson | cyan | fuchsia | ghostwhite | gold | go...
...And 5 more matches
TouchList - Web APIs
example see the example on the main touch events article. specifications specification status comment touch events – level 2 draft non-stable version. ...
... example see the example on the main touch events article. specifications specification status comment touch events – level 2 draft non-stable version. ...
... example see the example on the main touch events article. specifications specification status comment touch events – level 2 draft non-stable version. ...
...And 5 more matches
util/list - Archive of obsolete content
experimental building blocks for composing
lists. globals constructors
list(element1, element2, ...) constructor can takes any number of elements and creates an instance of
list populated with the specified elements. parameters element1 : object|string|number element2 : object|string|number ... : object|string|number functions add
listitem(
list, item) function adds a item to a
list. remove
listitem(
list, item) function removes an item from a
list list an ordered collection (also known as a sequence) disallowing duplicate elements.
list is composed out of iterable, therefore it provides custom enumeration behavior that is similar to array (enumerates only on the elements of the
list). ...
...bject|string|number functions add
listitem(
list, item) function adds a item to a
list. remove
listitem(
list, item) function removes an item from a
list list an ordered collection (also known as a sequence) disallowing duplicate elements.
list is composed out of iterable, therefore it provides custom enumeration behavior that is similar to array (enumerates only on the elements of the
list).
list is a base trait and is meant to be part of a composition, since all of its api is private except for the length property. ...
...om a
list list an ordered collection (also known as a sequence) disallowing duplicate elements.
list is composed out of iterable, therefore it provides custom enumeration behavior that is similar to array (enumerates only on the elements of the
list).
list is a base trait and is meant to be part of a composition, since all of its api is private except for the length property. ...
...And 4 more matches
FC_GetFunctionList
name fc_getfunction
list - get a pointer to the
list of function pointers in the fips mode of operation. syntax ck_rv fc_getfunction
list(ck_function_
list_ptr *ppfunction
list); parameters fc_getfunction
list has one parameter: ppfunction
list [output] the address of a variable that will receive a pointer to the
list of function pointers. description fc_getfunction
list stores in *ppfunction
list a pointer to the nss cryptographic module's
list of function pointers in the fips mode of operation. a user may call fc_getfunction
list without logging into the token (to assume the nss user role). return value fc_getfunction
list always returns ckr_ok. ...
...nter to the
list of function pointers. description fc_getfunction
list stores in *ppfunction
list a pointer to the nss cryptographic module's
list of function pointers in the fips mode of operation. a user may call fc_getfunction
list without logging into the token (to assume the nss user role). return value fc_getfunction
list always returns ckr_ok. ...
...f function pointers. description fc_getfunction
list stores in *ppfunction
list a pointer to the nss cryptographic module's
list of function pointers in the fips mode of operation. a user may call fc_getfunction
list without logging into the token (to assume the nss user role). return value fc_getfunction
list always returns ckr_ok. ...
...And 4 more matches
nsIEventListenerInfo
content/events/public/nsievent
listenerservice.idlscriptable an instance of this interface describes how an event
listener was added to an event target; these are returned by nsievent
listenerservice.get
listenerinfofor, which provides a
list of all the
listeners to a given event target. 1.0 66 introduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) method overview nsisupports getdebugobject(); astring tosource(); attributes attribute type description allowsuntrusted boolean indicates whether or not the event
listener allows untrusted events. read only. ...
... changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) method overview nsisupports getdebugobject(); astring tosource(); attributes attribute type description allowsuntrusted boolean indicates whether or not the event
listener allows untrusted events. read only. capturing boolean indicates whether or not the event
listener is in capture mode. read only. insystemeventgroup boolean indicates whether or not the event
listener is in the system event group. read only. type astring the type of the event for which the
listener was added. read only. methods getdebugobject() returns the debugger object if the debug service is active. nsisupports getdebugobject(); parameters none. ret...
...emeventgroup boolean indicates whether or not the event
listener is in the system event group. read only. type astring the type of the event for which the
listener was added. read only. methods getdebugobject() returns the debugger object if the debug service is active. nsisupports getdebugobject(); parameters none. return value if jsdidebuggerservice is active and the
listener is implemented in js, this returns the
listener as a jsdivalue. otherwise null. this is the method you should use if you want to get access to the actual
listener, but the debugger service must be already active, which significantly slows down script execution. accordingly, this should probably only be used by real debuggers. ...
...And 4 more matches
nsITransactionList
editor/txmgr/idl/nsitransaction
list.idlscriptable please add a summary to this article. inherits from: nsisupports last changed in gecko 1.7 method overview nsitransaction
list getchild
listforitem(in long aindex); nsitransaction getitem(in long aindex); long getnumchildrenforitem(in long aindex); boolean itemisbatch(in long aindex); attributes attribute type description numitems long the number of transactions contained in this
list. read only. methods getchild
listforitem() returns the
list of children associated with the item at aindex. implementations may return null if there are no children, or an empty
list. the
list returned is addref'd so it is up to the caller to release the transaction when it is done. ...
...tes attribute type description numitems long the number of transactions contained in this
list. read only. methods getchild
listforitem() returns the
list of children associated with the item at aindex. implementations may return null if there are no children, or an empty
list. the
list returned is addref'd so it is up to the caller to release the transaction when it is done. nsitransaction
list getchild
listforitem( in long aindex ); parameters aindex the index of the item in the
list. return value the nsitransaction
list of children associated with the item at aindex. getitem() returns the transaction at the given index in the
list. note that a null can be returned here if the item is a batch. the transaction returned is addref'd so it is up to the caller to release the transaction ...
... return value the number of child (auto-aggreated) transactions the item at aindex has. ...
...And 4 more matches
AudioTrackList.onchange - Web APIs
the audiotrack
list property onchange is an event handler which is called when the change event occurs, indicating that one or more of the audiotracks in the audiotrack
list have been enabled or disabled. the event is passed into the event handler in the form of an event object; the event doesn't provide any additional information. to determine the new state of media's tracks, you'll have to look at their audiotrack.enabled flags. note: you can also add a handler for the change event using addevent
listener(). syntax audiotrack
list.onchange = eventhandler; value set onchange to a function that should be called whenever tracks are enabled or disabled on the media element. ...
...to look at their audiotrack.enabled flags. note: you can also add a handler for the change event using addevent
listener(). syntax audiotrack
list.onchange = eventhandler; value set onchange to a function that should be called whenever tracks are enabled or disabled on the media element. example this snippet establishes a handler for the change event that looks at each of the tracks in the
list, calling a function to update the state of a user interface control that indicates the current state of the track. ...
...tax audiotrack
list.onchange = eventhandler; value set onchange to a function that should be called whenever tracks are enabled or disabled on the media element. example this snippet establishes a handler for the change event that looks at each of the tracks in the
list, calling a function to update the state of a user interface control that indicates the current state of the track. ...
...And 4 more matches
DOMTokenList - Web APIs
the domtoken
list interface represents a set of space-separated tokens. such a set is returned by element.class
list, htmllinkelement.rel
list, htmlanchorelement.rel
list, htmlareaelement.rel
list, htmliframeelement.sandbox, or htmloutputelement.htmlfor. it is indexed beginning with 0 as with javascript array objects. domtoken
list is always case-sensitive. properties domtoken
list.length read only is an integer representing the number of objects stored in the object. domtoken
list.value a stringifier property that returns the value of the
list as a domstring. methods domtoken
list.item(index) returns the item in the
list by its index, or undefined if index is greater than or equal to the
list's length. ...
... is always case-sensitive. properties domtoken
list.length read only is an integer representing the number of objects stored in the object. domtoken
list.value a stringifier property that returns the value of the
list as a domstring. methods domtoken
list.item(index) returns the item in the
list by its index, or undefined if index is greater than or equal to the
list's length. domtoken
list.contains(token) returns true if the
list contains the given token, otherwise false. domtoken
list.add(token1[, token2[, ...tokenn]]) adds the specified token(s) to the
list. domtoken
list.remove(token1[, token2[, ...tokenn]]) removes the specified token(s) from the
list. domtoken
list.replace(oldtoken, newtoken) replaces token with newtoken. ...
... equal to the
list's length. domtoken
list.contains(token) returns true if the
list contains the given token, otherwise false. domtoken
list.add(token1[, token2[, ...tokenn]]) adds the specified token(s) to the
list. domtoken
list.remove(token1[, token2[, ...tokenn]]) removes the specified token(s) from the
list. domtoken
list.replace(oldtoken, newtoken) replaces token with newtoken. domtoken
list.supports(token) returns true if a given token is in the associated attribute's supported tokens. domtoken
list.toggle(token [, force]) removes token from the
list if it exists, or adds token to the
list if it doesn't. returns a boolean indicating whether token is in the
list after the operation. ...
...And 4 more matches
DataTransferItemList.length - Web APIs
the read-only length property of the datatransferitem
list interface returns the number of items currently in the drag item
list. syntax length = datatransferitem
list.length; value the number of drag data items in the
list, or 0 if the
list is empty or disabled. the drag item
list is considered to be disabled if the item
list's datatransfer object is not associated with a drag data store. example this example shows the use of the length property. ...
... disabled. the drag item
list is considered to be disabled if the item
list's datatransfer object is not associated with a drag data store. example this example shows the use of the length property. javascript function dragstart_handler(ev) { console.log("dragstart"); // add this element's id to the drag payload so the drop handler will // know which element to add to its tree var data
list = ev.datatransfer.items; data
list.add(ev.target.id, "text/plain"); // add some other items to the drag payload data
list.add("<p>... ...
... length property. javascript function dragstart_handler(ev) { console.log("dragstart"); // add this element's id to the drag payload so the drop handler will // know which element to add to its tree var data
list = ev.datatransfer.items; data
list.add(ev.target.id, "text/plain"); // add some other items to the drag payload data
list.add("<p>... ...
...And 4 more matches
HTMLMediaElement.controlsList - Web APIs
if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 4 more matches
MediaQueryList - Web APIs
a mediaquery
list object stores information on a media query applied to a document, with support for both immediate and event-driven matching against the state of the document. you can create a mediaquery
list by calling matchmedia() on the window object. the resulting object handles sending notifications to
listeners when the media query state changes (i.e. when the media query test starts or stops evaluating to true). this is very useful for adaptive design, since this makes it possible to observe a document to detect when its media queries change, instead of polling the values periodically, and allows you to programmatically make changes to a document based on media query status. properties the mediaquery
list interface inherits properties from its parent interface, eventtarget. matches...
...to observe a document to detect when its media queries change, instead of polling the values periodically, and allows you to programmatically make changes to a document based on media query status. properties the mediaquery
list interface inherits properties from its parent interface, eventtarget. matchesread only a boolean that returns true if the document currently matches the media query
list, or false if not. mediaread only a domstring representing a serialized media query. methods the mediaquery
list interface inherits methods from its parent interface, eventtarget. add
listener() adds to the mediaquery
list a callback which is invoked whenever the media query status—whether or not the document matches the media queries in the
list—changes. this method exists primarily fo...
...ized media query. methods the mediaquery
list interface inherits methods from its parent interface, eventtarget. add
listener() adds to the mediaquery
list a callback which is invoked whenever the media query status—whether or not the document matches the media queries in the
list—changes. this method exists primarily for backward compatibility; if possible, you should instead use addevent
listener() to watch for the change event. remove
listener() removes the specified
listener callback from the callbacks to be invoked when the mediaquery
list changes media query status, which happens any time the document switches between matching and not matching the media queries
listed in the mediaquery
list. this method has been kept for backward compatibility; if possible, you should generally use...
...And 4 more matches
SpeechGrammarList.addFromString() - Web APIs
the weight means the importance of this grammar, or the likelihood that it will be recognised by the speech recognition service. the value can be between 0.0 and 1.0; if not specified, the default used is 1.0. ...
...the weight means the importance of this grammar, or the likelihood that it will be recognised by the speech recognition service. the value can be between 0.0 and 1.0; if not specified, the default used is 1.0. ...
...the weight means the importance of this grammar, or the likelihood that it will be recognised by the speech recognition service. the value can be between 0.0 and 1.0; if not specified, the default used is 1.0. ...
...And 4 more matches
Intl.ListFormat() constructor - JavaScript
a string with a bcp 47 language tag, or an array of such strings. for the general form and interpretation of the locales argument, see the intl page. options optional. an object with some or all of the following properties: localematcher the locale matching algorithm to use. possible values are "lookup" and "best fit"; the default is "best fit". ...
...cales argument, see the intl page. options optional. an object with some or all of the following properties: localematcher the locale matching algorithm to use. possible values are "lookup" and "best fit"; the default is "best fit". for information about this option, see the intl page. type the format of output message. possible values are "conjunction" that stands for "and"-based
lists (default, e.g., a, b, and c), or "disjunction" that stands for "or"-based
lists (e.g., a, b, or c). "unit" stands for
lists of values with units (e.g., 5 pounds, 12 ounces). style the length of the formated message. possible values are: "long" (default, e.g., a, b, and c); "short" (e.g., a, b, c), or "narrow" (e.g., a b c). when style is short or narrow, unit is the only allowed value for t...
..., b, or c). "unit" stands for
lists of values with units (e.g., 5 pounds, 12 ounces). style the length of the formated message. possible values are: "long" (default, e.g., a, b, and c); "short" (e.g., a, b, c), or "narrow" (e.g., a b c). when style is short or narrow, unit is the only allowed value for the type option. examples using format the following example shows how to create a
list formatter using the english language. ...
...And 4 more matches
List Open Tabs - Archive of obsolete content
you can download the icon here: . run the add-on, load a couple of tabs and click the button. ...
...you can download the icon here: . run the add-on, load a couple of tabs and click the button. ...
...you can download the icon here: . run the add-on, load a couple of tabs and click the button. ...
...And 3 more matches
List of commands - Archive of obsolete content
the following
lists commands which might be usable by <command> or command dispatchers/controllers. ...
... the following
lists commands which might be usable by <command> or command dispatchers/controllers. ...
... cmd_charprevious cmd_charnext cmd_selectcharprevious cmd_selectcharnext cmd_beginline cmd_endline cmd_selectbeginline cmd_selectendline cmd_wordprevious cmd_wordnext cmd_selectwordprevious cmd_selectwordnext cmd_scrollpageup cmd_scrollpagedown cmd_scrolllineup cmd_scrolllinedown cmd_movepageup cmd_movepagedown cmd_selectpageup cmd_selectpagedown other commands the following
list other commands (prefixed by cmd_ or browser:) which have not been categorized here yet (though they are in the alphabetical
list below): http://lxr.mozilla.org/seamonkey/sou...baroverlay.xul http://lxr.mozilla.org/seamonkey/sou...t/navigator.js http://lxr.mozilla.org/seamonkey/sou...toroverlay.xul http://lxr.mozilla.org/seamonkey/sou...onaltoolbar.js http://lxr.mozilla.org/seamonkey/sou...
...And 3 more matches
richlistitem - Archive of obsolete content
attributes disabled, searchlabel, selected, tabindex, value properties accessible, control, disabled, label, selected, tabindex, value examples (example needed) attributes disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the element is disabled. disabled elements are usually drawn with grayed-out text. if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire. ...
...in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not require validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable). for user editable menu
list elements, the contents, as visible to the user, are read and set using the menu
list.value syntax. for those elements, setattribute("value", myvalue) and getattribute("value") do not access or affect the contents displayed to the user. properties accessible type: nsiaccessible returns the accessibility object for the element. control type: element i...
...property's value is true if this element is selected, or false if it is not. this property is read only. this property is available for menuitem and menuseparator elements in firefox 3. tabindex type: integer gets and sets the value of the tabindex attribute. value type: string gets and sets the value of the value attribute. ...
...And 3 more matches
DownloadList
a download
list object represents a collection of download objects that can be viewed and managed by the user interface, and persisted across sessions. a reference to a download
list object can be obtained using the downloads.get
list() function. method overview promise<array<download>> getall(); promise add(download adownload); promise remove(download adownload); promise addview(object aview); promise removeview(object aview); void removefinished([optional] function afilterfn); methods getall() retrieves a snapshot of the downloads that are currently in the
list. the returned array does not change when downloads are added or removed, though the download objects it contains are still up...
...erfn); methods getall() retrieves a snapshot of the downloads that are currently in the
list. the returned array does not change when downloads are added or removed, though the download objects it contains are still updated in real time. promise<array<download>> getall(); parameters none. promise resolves to an array of download objects. add() adds a new download to the end of the items
list. note: when a download is added to the
list, its onchange event is registered by the
list, thus it cannot be used to monitor the download. to receive change notifications for downloads that are added to the
list, use the addview() method to register for ondownloadchanged notifications. promise add( download adownload ); parameters adownload the download object to add. promis...
...if the download was already removed, this method has no effect. promise remove( download adownload ); parameters adownload the download object to remove. promise resolves to undefined when the download has been removed. ...
...And 3 more matches
AudioTrackList.length - Web APIs
example this snippet gets the number of audio tracks in the first <video> element found in the dom by queryselector(). ...
... example this snippet gets the number of audio tracks in the first <video> element found in the dom by queryselector(). ...
... example this snippet gets the number of audio tracks in the first <video> element found in the dom by queryselector(). ...
...And 3 more matches
FileList - Web APIs
an object of this type is returned by the files property of the html <input> element; this lets you access the
list of files selected with the <input type="file"> element. it's also used for a
list of files dropped into web content when using the drag and drop api; see the datatransfer object for details on this usage. note: prior to gecko 1.9.2, the input element only supported a single file being selected at a time, meaning that the file
list would contain only one file. starting with gecko 1.9.2, if the input element's multiple attribute is true, the file
list may contain multiple files. using the file
list all <input> element nodes have a files attribute of type file
list on them which allows access to the items in this
list. for example, if the html includes the following file input: ...
... the input element's multiple attribute is true, the file
list may contain multiple files. using the file
list all <input> element nodes have a files attribute of type file
list on them which allows access to the items in this
list. for example, if the html includes the following file input: <input id="fileitem" type="file"> the following line of code fetches the first file in the node's file
list as a file object: var file = document.getelementbyid('fileitem').files[0]; method overview file item(index); properties attribute type description length integer a read-only value indicating the number of files in the
list. methods item() returns a file object representing the file at the specified index in the file
list. file item( ...
...erview file item(index); properties attribute type description length integer a read-only value indicating the number of files in the
list. methods item() returns a file object representing the file at the specified index in the file
list. file item( index ); parameters index the zero-based index of the file to retrieve from the
list. return value the file representing the requested file. ...
...And 3 more matches
MediaList.mediaText - Web APIs
also note that is you try to set mediatext to null, it will be treated as an empty string, i.e. ...
... also note that is you try to set mediatext to null, it will be treated as an empty string, i.e. ...
... also note that is you try to set mediatext to null, it will be treated as an empty string, i.e. ...
...And 3 more matches
PerformanceObserverEntryList.getEntries() - Web APIs
the getentries() method of the performanceobserverentry
list interface returns a
list of explicitly observed performance entry objects for a given filter. the
list's members are determined by the set of entry types specified in the call to the observe() method. the
list is available in the observer's callback function (as the first parameter in the callback). this method is exposed to window and worker interfaces. syntax general syntax: entries =
list.getentries(); entries =
list.getentries(performanceentryfilteroptions); specific usage: entries =
list.getentries({name: "entry_name", entrytype: "mark"}); parameters performanceentryfilteroptionsoptional is a performanceentryfilteroptions dictionary, having the following fields: "name", the name of a performance entry. "en...
...ist.getentries(); entries =
list.getentries(performanceentryfilteroptions); specific usage: entries =
list.getentries({name: "entry_name", entrytype: "mark"}); parameters performanceentryfilteroptionsoptional is a performanceentryfilteroptions dictionary, having the following fields: "name", the name of a performance entry. "entrytype", the entry type. the valid entry types are
listed in the performanceentry.entrytype method. "initiatortype", the type of the initiating resource (for example an html element). the values are defined by the performanceresourcetiming.initiatortype interface. this parameter is currently not supported on chrome or opera. return value a
list of explicitly observed performanceentry objects that meets the criteria of the filter. the items wil...
...if no argument is given, all entries are returned. ...
...And 3 more matches
SourceBufferList - Web APIs
the individual source buffers can be accessed using array operator (i.e. []) or functions such as foreach() for example. ...
...the individual source buffers can be accessed using array operator (i.e. []) or functions such as foreach() for example. ...
..."#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/sourcebuffer
list" target="_top"><rect x="151" y="1" width="160" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="231" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">sourcebuffer
list</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties sourcebuffer
list...
...And 3 more matches
SpeechGrammarList.item() - Web APIs
the item getter of the speechgrammar
list interface is a standard getter — it allows individual speechgrammar objects to be retrieved from the speechgrammar
list using array syntax. syntax var myfirstgrammar = speechgrammar
listinstance[0]; returns a speechgrammar object. examples var grammar = '#jsgf v1.0; grammar colors; public <color> = aqua | azure | beige | bisque | black | blue | brown | chocolate | coral | crimson | cyan | fuchsia | ghostwhite | gold | goldenrod | gray | green | indigo | ivory | khaki | lavender | lime | linen | magenta | maroon | moccasin | navy | olive | orange | orchid | peru | pink | plum | purple | red | salmon | sienna | silver | snow | tan | teal | thistle | tomato | turquoise | violet | white | yellow ;' var recognition = new speechrecognition(); var spe...
... specifications specification status comment web speech apithe definition of 'item()' in that specification. draft ...
... specifications specification status comment web speech apithe definition of 'item()' in that specification. draft ...
...And 3 more matches
SpeechGrammarList.length - Web APIs
the length read-only property of the speechgrammar
list interface returns the number of speechgrammar objects contained in the speechgrammar
list. syntax var my
listlength = speechgrammar
listinstance.length; value a number indicating the number of speechgrammar objects contained in the speechgrammar
list. examples var grammar = '#jsgf v1.0; grammar colors; public <color> = aqua | azure | beige | bisque | black | blue | brown | chocolate | coral | crimson | cyan | fuchsia | ghostwhite | gold | goldenrod | gray | green | indigo | ivory | khaki | lavender | lime | linen | magenta | maroon | moccasin | navy | olive | orange | orchid | peru | pink | plum | purple | red | salmon | sienna | silver | snow | tan | teal | thistle | tomato | turquoise | violet | white | yellow ;' var recognition = n...
... specifications specification status comment web speech apithe definition of 'length' in that specification. draft ...
... specifications specification status comment web speech apithe definition of 'length' in that specification. draft ...
...And 3 more matches
VideoTrackList.onchange - Web APIs
the videotrack
list property onchange is an event handler which is called when the change event occurs, indicating that a videotrack in the videotrack
list has been made active. the event is passed into the event handler in the form of an event object; the event doesn't provide any additional information. to determine the new state of media's tracks, you'll have to look at their videotrack.selected flags. note: you can also add a handler for the change event using addevent
listener(). syntax videotrack
list.onchange = eventhandler; value set onchange to a function that should be called whenever a track is made active. ...
...media's tracks, you'll have to look at their videotrack.selected flags. note: you can also add a handler for the change event using addevent
listener(). syntax videotrack
list.onchange = eventhandler; value set onchange to a function that should be called whenever a track is made active. example this snippet establishes a handler for the change event that looks at each of the tracks in the
list, calling a function to update the state of a user interface control that indicates the current state of the track. ...
...ing addevent
listener(). syntax videotrack
list.onchange = eventhandler; value set onchange to a function that should be called whenever a track is made active. example this snippet establishes a handler for the change event that looks at each of the tracks in the
list, calling a function to update the state of a user interface control that indicates the current state of the track. ...
...And 3 more matches
ARIA: Listitem role - Accessibility
the aria
listitem role can be used to identify an item inside a
list of items. it is normally used in conjunction with the
list role, which is used to identify a
list container. <section role="
list"> <div role="
listitem">
list item 1</div> <div role="
listitem">
list item 2</div> <div role="
listitem">
list item 3</div> </section> description any content that consists of an outer container with a
list of elements inside it can be identified to assistive technologies using the
list and
listitem containers respectively. there are no hard and fast rules about which elements you should use to markup the
list and
list items, but you should make sure that the
list items make sense in the context of a
list, e.g. a shopping
list, recipe steps, driving directions. warning: if at all possible i...
...he
list and
listitem containers respectively. there are no hard and fast rules about which elements you should use to markup the
list and
list items, but you should make sure that the
list items make sense in the context of a
list, e.g. a shopping
list, recipe steps, driving directions. warning: if at all possible in your work, you should use the appropriate semantic html elements to mark up a
list and its
listitems — <ul>/<ol> and <li>. see best practices for a full example. associated wai-aria roles, states, and properties
list a
list of items. elements with role
list must have one or more elements with the role
listitem as children, a one or more elements with the role of group that have one or more elements with the
listitem role as children. group a collection of relate...
... <ul>/<ol> and <li>. see best practices for a full example. associated wai-aria roles, states, and properties
list a
list of items. elements with role
list must have one or more elements with the role
listitem as children, a one or more elements with the role of group that have one or more elements with the
listitem role as children. group a collection of related objects, limited to
list items when nested in a
list, not important enough to have their own place in a pages table of contents. keyboard interactions none. required javascript features none. ...
...And 3 more matches
CORS-safelisted response header - MDN Web Docs Glossary: Definitions of Web-related terms
a cors-safe
listed response header is an http header which has been safe
listed so that it will not be filtered when responses are processed by cors, since they're considered safe (as the headers
listed in access-control-expose-headers). ...
... a cors-safe
listed response header is an http header which has been safe
listed so that it will not be filtered when responses are processed by cors, since they're considered safe (as the headers
listed in access-control-expose-headers). ...
...sted response header is an http header which has been safe
listed so that it will not be filtered when responses are processed by cors, since they're considered safe (as the headers
listed in access-control-expose-headers). ...
...And 2 more matches
PR_INIT_STATIC_CLIST
statically initializes a circular
list. syntax #include <prc
list.h> pr_init_static_c
list (prc
list *
listp); parameter
listp a pointer to the anchor of the linked
list. description pr_init_static_c
list statically initializes the specified
list to be an empty
list. ...
... statically initializes a circular
list. syntax #include <prc
list.h> pr_init_static_c
list (prc
list *
listp); parameter
listp a pointer to the anchor of the linked
list. description pr_init_static_c
list statically initializes the specified
list to be an empty
list. ...
... statically initializes a circular
list. syntax #include <prc
list.h> pr_init_static_c
list (prc
list *
listp); parameter
listp a pointer to the anchor of the linked
list. description pr_init_static_c
list statically initializes the specified
list to be an empty
list. ...
...And 2 more matches
nsIXULBuilderListener
inherits from: nsisupports last changed in gecko 1.7 method overview void didrebuild(in nsixultemplatebuilder abuilder); void willrebuild(in nsixultemplatebuilder abuilder); methods didrebuild() called after a template builder has rebuilt its content. void didrebuild( in nsixultemplatebuilder abuilder ); parameters abuilder the template builder that has rebuilt the content. willrebuild() called before a template builder rebuilds its content. ...
...ilt its content. void didrebuild( in nsixultemplatebuilder abuilder ); parameters abuilder the template builder that has rebuilt the content. willrebuild() called before a template builder rebuilds its content. void willrebuild( in nsixultemplatebuilder abuilder ); parameters abuilder the template builder that rebuilds the content. ...
... void didrebuild( in nsixultemplatebuilder abuilder ); parameters abuilder the template builder that has rebuilt the content. willrebuild() called before a template builder rebuilds its content. void willrebuild( in nsixultemplatebuilder abuilder ); parameters abuilder the template builder that rebuilds the content. ...
...And 2 more matches
Examine Event Listeners - Firefox Developer Tools
firefox can display: standard dom events jquery events react eve...
...firefox can display: standard dom events jquery events react eve...
...firefox can display: standard dom events jquery events react eve...
...And 2 more matches
AudioTrackList.getTrackById() - Web APIs
if no match is found, this method returns null. the tracks are searched in their natural order; that is, in the order defined by the media resource itself, or, if the resource doesn't define an order, the relative order in which the tracks are declared by the media resource. ...
...if no match is found, this method returns null. the tracks are searched in their natural order; that is, in the order defined by the media resource itself, or, if the resource doesn't define an order, the relative order in which the tracks are declared by the media resource. ...
...if no match is found, this method returns null. the tracks are searched in their natural order; that is, in the order defined by the media resource itself, or, if the resource doesn't define an order, the relative order in which the tracks are declared by the media resource. ...
...And 2 more matches
AudioTrackList - Web APIs
event handlers onaddtrack an event handler to be called when the addtrack event is fired, indicating that a new audio track has been added to the media element. onchange an event handler to be called when the change event occurs. ...
... event handlers onaddtrack an event handler to be called when the addtrack event is fired, indicating that a new audio track has been added to the media element. onchange an event handler to be called when the change event occurs. ...
...rs when one or more tracks have been enabled or disabled by their enabled flag being changed. onremovetrack an event handler to call when the removetrack event is sent, indicating that an audio track has been removed from the media element. methods this interface also inherits methods from its parent interface, eventtarget. gettrackbyid() returns the audiotrack found within the audiotrack
list whose id matches the specified string. if no match is found, null is returned. events addtrack fired when a new audio track has been added to the media element. also available via the onaddtrack property. change fired when a track has been enabled or disabled. also available via the onchange property. removetrack fired when a new audio track has been removed from the media element. a...
...And 2 more matches
DOMTokenList.toggle() - Web APIs
the toggle() method of the domtoken
list interface removes a given token from the
list and returns false. if token doesn't exist it's added and the function returns true. syntax token
list.toggle(token [, force]); parameters token a domstring representing the token you want to toggle. force optional a boolean that, if included, turns the toggle into a one way-only operation. if set to false, then token will only be removed, but not added. if set to true, then token will only be added, but not removed. return value a boolean indicating whether token is in the
list after the call. examples in the following example we retrieve the
list of classes set on a <span> element as a domtoken
list using element.class
list. ...
...ne way-only operation. if set to false, then token will only be removed, but not added. if set to true, then token will only be added, but not removed. return value a boolean indicating whether token is in the
list after the call. examples in the following example we retrieve the
list of classes set on a <span> element as a domtoken
list using element.class
list. we then replace a token in the
list, and write the
list into the <span>'s node.textcontent. ...
... then token will only be added, but not removed. return value a boolean indicating whether token is in the
list after the call. examples in the following example we retrieve the
list of classes set on a <span> element as a domtoken
list using element.class
list. we then replace a token in the
list, and write the
list into the <span>'s node.textcontent. ...
...And 2 more matches
HTMLDListElement - Web APIs
the htmld
listelement interface provides special properties (beyond those of the regular htmlelement interface it also has available to it by inheritance) for manipulating definition
list (<dl>) elements. <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">event...
...co,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlelement</text></a><polyline points="491,25 501,20 501,30 491,25" stroke="#d4dde4" fill="none"/><line x1="501" y1="25" x2="509" y2="25" stroke="#d4dde4"/><line x1="509" y1="25" x2="509" y2="90" stroke="#d4dde4"/><line x1="509" y1="90" x2="492" y2="90" stroke="#d4dde4"/><a xlink:href="/docs/web/api/htmld
listelement" target="_top"><rect x="331" y="65" width="160" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="411" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmld
listelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits p...
...h="160" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="411" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmld
listelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmld
listelement.compact is a boolean indicating that spacing between
list items should be reduced. ...
...And 2 more matches
HTMLUListElement - Web APIs
the htmlu
listelement interface provides special properties (beyond those defined on the regular htmlelement interface it also has available to it by inheritance) for manipulating unordered
list elements. <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="mi...
...co,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlelement</text></a><polyline points="491,25 501,20 501,30 491,25" stroke="#d4dde4" fill="none"/><line x1="501" y1="25" x2="509" y2="25" stroke="#d4dde4"/><line x1="509" y1="25" x2="509" y2="90" stroke="#d4dde4"/><line x1="509" y1="90" x2="492" y2="90" stroke="#d4dde4"/><a xlink:href="/docs/web/api/htmlu
listelement" target="_top"><rect x="331" y="65" width="160" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="411" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlu
listelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits p...
...h="160" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="411" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlu
listelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmlu
listelement.type is a domstring value reflecting the type and defining the kind of marker to be used to display. the values are browser dependent and have never been standardized. htmlu
listelement.compact is a boolean indicating that spacing between
list items should be reduced. this property reflects the compact attribute only, it doesn't consider the line-height css property used for that beh...
...And 2 more matches
MediaQueryList.matches - Web APIs
the matches read-only property of the mediaquery
list interface is a boolean that returns true if the document currently matches the media query
list, or false if not. you can be notified when the value of matches changes by watching for the change event to be fired at the mediaquery
list. syntax var matches = <varm>mediaquery
list.matches; value a boolean which is true if the document currently matches the media query
list; otherwise, it's false. ...
...the value of matches changes by watching for the change event to be fired at the mediaquery
list. syntax var matches = <varm>mediaquery
list.matches; value a boolean which is true if the document currently matches the media query
list; otherwise, it's false. ...
...or the change event to be fired at the mediaquery
list. syntax var matches = <varm>mediaquery
list.matches; value a boolean which is true if the document currently matches the media query
list; otherwise, it's false. ...
...And 2 more matches
MutationObserverInit.childList - Web APIs
if subtree is false, only the node indicated by the observer's target node is monitored for changes. ...
...if subtree is false, only the node indicated by the observer's target node is monitored for changes. ...
...if subtree is false, only the node indicated by the observer's target node is monitored for changes. ...
...And 2 more matches
PerformanceObserverEntryList.getEntriesByName() - Web APIs
the getentriesbyname() method of the performanceobserverentry
list interface returns a
list of explicitly observed performance entry objects for a given name and entry type. the
list's members are determined by the set of entry types specified in the call to the observe() method. the
list is available in the observer's callback function (as the first parameter in the callback). this method is exposed to window and worker interfaces. syntax entries =
list.getentriesbyname(name, type); parameters name a domstring representing the name of the entry to retrieve. type optional a domstring representing the type of entry to retrieve such as "mark". the valid entry types are
listed in performanceentry.entrytype. ...
...the first parameter in the callback). this method is exposed to window and worker interfaces. syntax entries =
list.getentriesbyname(name, type); parameters name a domstring representing the name of the entry to retrieve. type optional a domstring representing the type of entry to retrieve such as "mark". the valid entry types are
listed in performanceentry.entrytype. return value a
list of explicitly observed performance entry objects that have the specified name and type. if the type argument is not specified, only the name will be used to determine the entries to return. the items will be in chronological order based on the entries' starttime. if no objects meet the specified criteria, an empty
list is returned. example function print_perf_entry(pe) { console.log("name: " ...
...o objects meet the specified criteria, an empty
list is returned. ...
...And 2 more matches
PerformanceObserverEntryList.getEntriesByType() - Web APIs
the getentriesbytype() method of the performanceobserverentry
list returns a
list of explicitly observed performance entry objects for a given performance entry type. the
list's members are determined by the set of entry types specified in the call to the observe() method. the
list is available in the observer's callback function (as the first parameter in the callback). this method is exposed to window and worker interfaces. syntax entries =
list.getentriesbytype(type); parameters type the type of entry to retrieve such as "frame". the valid entry types are
listed in performanceentry.entrytype. return value a
list of explicitly observed performanceentry objects that have the specified type. the items will be in chronological order based on the entries' starttime. if no objects hav...
...esbytype(type); parameters type the type of entry to retrieve such as "frame". the valid entry types are
listed in performanceentry.entrytype. return value a
list of explicitly observed performanceentry objects that have the specified type. the items will be in chronological order based on the entries' starttime. if no objects have the specified type, or no argument is provided, an empty
list is returned. ...
...fied type, or no argument is provided, an empty
list is returned. ...
...And 2 more matches
RadioNodeList - Web APIs
the radionode
list interface represents a collection of radio elements in a <form> or a <fieldset> element. ...
...tion of radio elements in a <form> or a <fieldset> element. ...
... position: absolute; top: 0; left: 0;" viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/node
list" target="_top"><rect x="1" y="1" width="80" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="41" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">node
list</text></a><polyline points="81,25 91,20 91,30 81,25" stroke="#d4dde4" fill="none"/><line x1="91" y1="25" x2="121" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/radionode
list" target="_top"><rect x="121" y="1" width="130" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="186" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4...
...And 2 more matches
SpeechRecognitionResultList.item() - Web APIs
// it has a getter so it can be accessed like an array // the first [0] returns the speechrecognitionresult at position 0. ...
... // it has a getter so it can be accessed like an array // the first [0] returns the speechrecognitionresult at position 0. ...
... // it has a getter so it can be accessed like an array // the first [0] returns the speechrecognitionresult at position 0. ...
...And 2 more matches
SpeechRecognitionResultList.length - Web APIs
// it has a getter so it can be accessed like an array // the first [0] returns the speechrecognitionresult at position 0. ...
... // it has a getter so it can be accessed like an array // the first [0] returns the speechrecognitionresult at position 0. ...
... // it has a getter so it can be accessed like an array // the first [0] returns the speechrecognitionresult at position 0. ...
...And 2 more matches
TextTrackList.length - Web APIs
example this snippet gets the number of text tracks in the first media element found in the dom by queryselector(). ...
... example this snippet gets the number of text tracks in the first media element found in the dom by queryselector(). ...
... example this snippet gets the number of text tracks in the first media element found in the dom by queryselector(). ...
...And 2 more matches
TextTrackList - Web APIs
event handlers onaddtrack an event handler to be called when the addtrack event is fired, indicating that a new text track has been added to the media element. onchange an event handler to be called when the change event occurs. ...
... event handlers onaddtrack an event handler to be called when the addtrack event is fired, indicating that a new text track has been added to the media element. onchange an event handler to be called when the change event occurs. ...
...dded to the media element. onchange an event handler to be called when the change event occurs. onremovetrack an event handler to call when the removetrack event is sent, indicating that a text track has been removed from the media element. methods this interface also inherits methods from its parent interface, eventtarget. gettrackbyid() returns the texttrack found within the texttrack
list whose id matches the specified string. if no match is found, null is returned. events addtrack fired when a new text track has been added to the media element. also available via the onaddtrack property. change fired when a text track has been made active or inactive. also available via the onchange property. removetrack fired when a new text track has been removed from the media elem...
...And 2 more matches
VideoTrackList.length - Web APIs
example this snippet gets the number of video tracks in the first <video> element found in the dom by queryselector(). ...
... example this snippet gets the number of video tracks in the first <video> element found in the dom by queryselector(). ...
... example this snippet gets the number of video tracks in the first <video> element found in the dom by queryselector(). ...
...And 2 more matches
VideoTrackList - Web APIs
selectedindex read only the index of the currently selected track, if any, or −1 otherwise. event handlers onaddtrack an event handler to be called when the addtrack event is fired, indicating that a new video track has been added to the media element. ...
... selectedindex read only the index of the currently selected track, if any, or −1 otherwise. event handlers onaddtrack an event handler to be called when the addtrack event is fired, indicating that a new video track has been added to the media element. ...
...the selected property for a track has changed, due to the track being made active or inactive. onremovetrack an event handler to call when the removetrack event is sent, indicating that a video track has been removed from the media element. methods this interface also inherits methods from its parent interface, eventtarget. gettrackbyid() returns the videotrack found within the videotrack
list whose id matches the specified string. if no match is found, null is returned. events addtrack fired when a new video track has been added to the media element. also available via the onaddtrack property. change fired when a video track has been made active or inactive. also available via the onchange property. removetrack fired when a new video track has been removed from the media e...
...And 2 more matches
list-style-image - CSS: Cascading Style Sheets
the
list-style-image css property sets an image to be used as the
list item marker. it is often more convenient to use the shorthand
list-style. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. note: this property is applied to
list items, i.e. elements with display:
list-item; by default this includes <li> elements. because this property is inherited, it can be set on the parent element (normally <ol> or <ul>) to let it apply to all
list items. ...
...ractive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. note: this property is applied to
list items, i.e. elements with display:
list-item; by default this includes <li> elements. because this property is inherited, it can be set on the parent element (normally <ol> or <ul>) to let it apply to all
list items. syntax /* keyword values */
list-style-image: none; /* <url> values */
list-style-image: url('starsolid.gif'); /* global values */
list-style-image: inherit;
list-style-image: initial;
list-style-image: unset; values <url> location of image to use as the marker. none specifies that no image is used as the marker. if this value is set, the marker defined in
list-style-type will be used instead. formal definition init...
... <url> values */
list-style-image: url('starsolid.gif'); /* global values */
list-style-image: inherit;
list-style-image: initial;
list-style-image: unset; values <url> location of image to use as the marker. none specifies that no image is used as the marker. if this value is set, the marker defined in
list-style-type will be used instead. ...
...And 2 more matches
<dl>: The Description List element - HTML: Hypertext Markup Language
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories flow content, and if the <dl> element's children include one name-value group, palpable content. ...
...onally intermixed with <script> and <template> elements. or: one or more <div> elements, optionally intermixed with <script> and <template> elements. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that accepts flow content. implicit aria role no corresponding role permitted aria roles group,
list, none, presentation dom interface htmld
listelement attributes this element only includes the global attributes. examples single term and description <dl> <dt>firefox</dt> <dd> a free, open source, cross-platform, graphical web browser developed by the mozilla corporation and hundreds of volunteers. </dd> <!-- other terms and descriptions --> </dl> ...
...he red panda also known as the lesser panda, wah, bear cat or firefox, is a mostly herbivorous mammal, slightly larger than a domestic cat (60 cm long). </dd> <!-- other terms and descriptions --> </dl> multiple terms and descriptions it is also possible to define multiple terms with multiple corresponding descriptions, by combining the examples above. metadata description
lists are useful for displaying metadata as a
list of key-value pairs. <dl> <dt>name</dt> <dd>godzilla</dd> <dt>born</dt> <dd>1952</dd> <dt>birthplace</dt> <dd>japan</dd> <dt>color</dt> <dd>green</dd> </dl> tip: it can be handy to define a key-value separator in the css, such as: dt::after { content: ": "; } wrapping name-value groups in <div> elements whatwg html allows wrappi...
...And 2 more matches
List of Mozilla-Based Applications - Archive of obsolete content
name description additional information 389 directory server ldap server uses nss a380 seatback entertainment system media software this blog post mentions a reference to mozilla being used but i couldn't find more information about it. ...
... name description additional information 389 directory server ldap server uses nss a380 seatback entertainment system media software this blog post mentions a reference to mozilla being used but i couldn't find more information about it. ...
...deo, audio, and even devices such as zen, zune, pocketpcs, ipods, and psps mekhala browser part of the khmeros linux distro midbrowser mobile web browser mockery mockup creation tool built on xulrunner mongodb database project uses spidermonkey moyura email client part of the khmeros linux distro mozcards, jo
listopwatch, jolitimer simple apps for maemo uses xulrunner moznet .net control embeddable gecko for .net applications wraps xulrunner for use in .net applications my internet browser localized browser uses gecko myna application server javascript application server for java uses mozilla rhino nextcms (fr) cms nightingale ...
... topstyle html, xhtml and css editor seems to have optional gecko embedding but doesn't use it by default toxtox media browser for tv 5000 downloads trixul gui toolkit uses mozilla spidermonkey trustedbird email client thunderbird bundled with a set of extensions (formerly known as milimail) tuneup music collection organizer
listed on xulrunner hall of fame but haven't seen information elsewhere tuxguitar tabulature editor uses xulrunner twitfactory standalone twitter/identi.ca client uis university information system intranet application, 1000 users, thin client based on ff3 unison desktop enterprise email i think it's using mailnews code but don't have any inf...
listheader - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a header for a single column in a
listbox. attributes disabled properties acesssibletype examples <
listbox> <
listhead> <
listheader label="name"/> <
listheader label="occupation"/> </
listhead> <
listitem> <
listcell label="george"/> <
listcell label="house painter"/> </
listitem> <
listitem> <
listcell label="mary ellen"/> <
listcell label="candle maker"/> </
listitem> <
listitem> <
listcell label="roger"/> <
listcell label="swashbuckler"/> </
listitem> </
listbox> attributes disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the element is disabled. disabled elements are usually drawn with ...
...ave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. label type: string the label that will appear on the element. if this is left out, no text appears. for an editable menuitem element the value of this attribute is copied to the menu
list.value property upon user selection of the menuitem. inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordina...
...llowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements
listbox,
listcell,
listcol,
listcols,
listhead,
listitem ...
Listening to events on all tabs
firefox 3.5 adds support for
listening to progress events on all tabs. adding a
listener to
listen to progress events on all tabs, call the browser's addtabsprogress
listener() method: gbrowser.addtabsprogress
listener(myprogress
listener); myprogress
listener is an object that implements the callbacks used to provide notifications of progress events. removing a
listener to remove a previously installed progress
listener, call removetabsprogress
listener(): gbrowser.removetabsprogress
listener(myprogress
listener); implementing a
listener the
listener object itself has five methods it can implement to handle various events: onlocationchange called when the uri of the document displayed in the tab changes. void onlocationchange( nsidomxulelement abrowser, nsiwebprogress awebprogress, nsireque...
... nsirequest arequest, unsigned long astate ); parameters abrowser the browser that fired the notification. awebprogress the nsiwebprogress instance that fired the notification. arequest the nsirequest that has new security state. astate a value composed of the security state flags and the security strength flags described in the documentation for nsiwebprogress
listener. onstatechange notification indicating the state has changed for one of the requests associated with awebprogress. void onstatechange( nsidomxulelement abrowser, nsiwebprogress awebprogress, nsirequest arequest, unsigned long astateflags, nsresult astatus ); parameters abrowser the browser that fired the notification. awebprogress the nsiwebprogress instance...
...fication. awebprogress the nsiwebprogress instance that fired the notification. arequest the nsirequest that has changed state. this parameter may be null. need more information on what null means. astateflags flags indicating the new state. this value is a combination of one of the state transition flags and one or more of the state type flags defined in the nsiwebprogress
listener documentation. any undefined bits are reserved for future use. astatus error status code associated with the state change; this indicates whether or not the request was successful. this parameter should be ignored unless astateflags includes the state_stop bit. note: astatus may be a success code even for server generated errors, such as the http 404 file not found error. in such c...
...interface does not define the set of possible status codes. note: some status values are defined by nsitransport and nsisockettransport. amessage localized text corresponding to astatus. onrefreshattempted notification that a refresh or redirect has been requested in awebprogress for example, via a <meta http-equiv="refresh"> or an http refresh: header. if any registered progress
listener returns false from this method then the attempt to refresh will be blocked. boolean onrefreshattempted( nsidomxulelement abrowser, nsiwebprogress webprogress, nsiuri arefreshuri, long amillis, boolean asameuri ); parameters abrowser the browser that fired the notification. awebprogress the nsiwebprogress instance that fired the notification. arefreshuri ...
InstallListener
install
listeners are notified of an addoninstall's progress. they may be registered to hear events from all addoninstalls through addinstall
listener or to a single addoninstall through add
listener. method overview void onnewinstall(in addoninstall install) void ondownloadstarted(in addoninstall install) void ondownloadprogress(in addoninstall install) void ondownloadended(in addoninstall install) void ondownloadcancelled(in addoninstall install) void ondownloadfailed(in addoninstall install) void oninstallstarted(in addoninstall install) void oninstallended(in addoninstall install, in addon addon) void oninstallcancelled(in addoninstall install) void oninstallfailed(in addoninstall install) vo...
... methods onnewinstall() called when a new instance of addoninstall is created, primarily so ui can display some kind of progress for all installs. void onnewinstall( in addoninstall install ) parameters install the addoninstall representing the install ondownloadstarted() called when downloading begins for an add-on install. only called for add-ons that need to be downloaded. ...
... void ondownloadprogress( in addoninstall install ) parameters install the addoninstall representing the install ondownloadended() called when downloading completes successfully for an add-on install. only called for add-ons that need to be downloaded. ...
...install install ) parameters install the addoninstall representing the install ondownloadfailed() called if there is some error downloading the add-on. only called for add-ons that need to be downloaded. void ondownloadfailed( in addoninstall install ) parameters install the addoninstall representing the install oninstallstarted() called when installation of an add-on begins. a
listener may return false to cancel the install. void oninstallstarted( in addoninstall install ) parameters install the addoninstall representing the install oninstallended() called when installation of an add-on is complete. the newly installed add-on may require a restart in order to become active. void oninstallended( in addoninstall install in addon addon ) parameters install ...
TPS History Lists
date: required. an integer representing when the visit took place, expressed in hours from the present. for example, 0 is now, -24 is 24 hours in the past. ...
...date: required. an integer representing when the visit took place, expressed in hours from the present. for example, 0 is now, -24 is 24 hours in the past. ...
...urs from the present. for example, 0 is now, -24 is 24 hours in the past. for example: var history_initial = [ { uri: "http://www.google.com/", title: "google", visits: [ { type: 1, date: 0 }, { type: 2, date: -1 } ] }, { uri: "http://www.cnn.com/", title: "cnn", visits: [ { type: 1, date: -1 }, { type: 2, date: -36 } ] }, ]; the history
list used for deletions looks different. it's an array of objects, each of which represents a type of history to delete. there are three different types: to delete all references to a specific page from history, use an object with a uri property to delete all references to all pages from a specific host, use an object with a host property to delete all history in a certain time period, use an object ...
...ll pages from a specific host, use an object with a host property to delete all history in a certain time period, use an object 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 Pref Lists
for a more detailed test example, see the tps prefs unit test. ...
... for a more detailed test example, see the tps prefs unit test. ...
... for a more detailed test example, see the tps prefs unit test. ...
...fs1 = [ { name: "browser.startup.homepage", value: "http://www.getfirefox.com" }, { name: "browser.urlbar.maxrichresults", value: 20 }, { name: "browser.tabs.autohide", value: true } ]; pref
lists and phase actions the only actions supported for preference asset
lists are modify and verify: prefs.modify prefs.verify sync only syncs certain preferences. to find the
list of valid preferences, go to about:config on a browser that has weave installed, and search for services.sync.prefs.sync. for a more detailed test example, see the tps prefs unit test. ...
nsICurrentCharsetListener
intl/uconv/idl/nsicurrentcharset
listener.idlscriptable please add a summary to this article. inherits from: nsisupports last changed in gecko 1.7 implemented by: @mozilla.org/intl/currentcharset
listener;1. ...
... intl/uconv/idl/nsicurrentcharset
listener.idlscriptable please add a summary to this article. inherits from: nsisupports last changed in gecko 1.7 implemented by: @mozilla.org/intl/currentcharset
listener;1. ...
... intl/uconv/idl/nsicurrentcharset
listener.idlscriptable please add a summary to this article. inherits from: nsisupports last changed in gecko 1.7 implemented by: @mozilla.org/intl/currentcharset
listener;1. ...
...urrentcharset
listener.idlscriptable please add a summary to this article. inherits from: nsisupports last changed in gecko 1.7 implemented by: @mozilla.org/intl/currentcharset
listener;1. ...
Folders and message lists
selected messages. like selectedmessages, this also includes messages in selected collapsed threads when so enabled. changing the current message selection in addition to getting the currently-selected messages, you can also change the selection: gfolderdisplay.selectmessage(msghdr): selects a single message, as specified by msghdr (an nsimsgdbhdr) and scrolls to its position in the message
list. ...
...it's used like this: // import the fixiterator() function. ...
...it's used like this: // import the fixiterator() function. ...
...derdisplay.selectmessages(arrayofmsghdrs): selects all the messages in the array arrayofmsghdrs. like selectmessage, this function will attempt to scroll the view so the entire selection is visible (which may not be possible for large selections). gfolderdisplay.clearselection(): clears the
list of selected messages.
listing messages in a folder if you have a message folder, and would like to
list all the messages in that folder, you can use the .messages attribute, which returns an nsisimpleenumerator. it's used like this: // import the fixiterator() function. components.utils.import("resource:///modules/iteratorutils.jsm"); for (let msghdr in fixiterator(myfolder.messages, components.interfaces.nsimsgdbhdr)) { // do something with msghdr... } ...
Set event listener breakpoints - Firefox Developer Tools
starting with firefox 69, debugging an application that includes event handlers is simplified because the debugger now includes the ability to automatically break when the code hits an event handler. this article explains how to use it. using a standard event breakpoint to use an event breakpoint, you open up the javascript debugger, and find and expand the event
listener breakpoints section in the right hand column. to break when event
listeners are hit, check the boxes next the events you are interested in. all of the standard events supported in your version of firefox are
listed, arranged by which api or api area they're part of. now when a keydown, keyup, keypress, or input event occurs, execution will pause as soon as it enters the
listener code. when execution pauses, the sour...
...
listener code. when execution pauses, the source pane displays the highlighted line of the javascript code that is next to be executed, along with the surrounding code for context. in addition, you get a box overlaid on the viewport saying "paused on event breakpoint", with buttons to step over that line of code or resume execution. you could add regular breakpoints at the entry point of the
listener to achieve the same effect. if however you have multiple elements, all of which have event
listeners attached that you want to break on, this becomes an enormous time saver. this is also useful when debugging code that you're unfamiliar with, to save time over hunting down your event handler within your code, or when trying to understand why a web site isn't working as expected in your brows...
... time over hunting down your event handler within your code, or when trying to understand why a web site isn't working as expected in your browser. use event breakpoints to stop execution at the triggering event for the action that fails, then step through the code or watch the console to see what happens. logging on events in firefox 71 onwards, the “log” checkbox is available in the event
listener breakpoints
list. selecting this and then choosing some events to break on will mean that when you step through code, information about events fired will be logged to the console instead of the devtools breaking on each one. so if we choose to log keyboard events, for example, the code no longer pauses as each event is fired: instead, we can then switch to the console, and whenever we pre...
...y that fired the event. this can be done by finding jquery.js in the sources panel, and choosing the ignore source option from its context menu. now the logs will show where in your app jquery was called, rather than where in jquery the event was fired: filter by event type also added to firefox 71 is a new filter by event type... text input, which can also be found at the top of the event
listener breakpoints
list. when you click in this input and type a search term, the
list of event
listener types will filter by that term allowing you to find the events you want to break on more easily. inline variable preview new in firefox 71, the source pane now gives you an instant preview of the variables on each line of code you've stepped through. see set a breakpoint > inline variable pre...
AudioTrackList: change event - Web APIs
the change event is fired when an audio track is enabled or disabled, for example by changing the track's enabled property. ...
... the change event is fired when an audio track is enabled or disabled, for example by changing the track's enabled property. ...
...er property onchange examples using addevent
listener(): const videoelement = document.queryselector('video'); videoelement.audiotracks.addevent
listener('change', (event) => { console.log(`'${event.type}' event fired`); }); // changing the value of `enabled` will trigger the `change` event const toggletrackbutton = document.queryselector('.toggle-track'); toggletrackbutton.addevent
listener('click', () => { const track = videoelement.audiotracks[0]; track.enabled = !track.enabled; }); using the onchange event handler property: const videoelement = document.queryselector('video'); videoelement.audiotracks.onchange = (event) => { console.log(`'${event.type}' event fired`); }; // changing the value of `enabled` will trigger the `change` event const toggletrackbutton = d...
... living standard ...
AudioTrackList.onaddtrack - Web APIs
the audiotrack
list property onaddtrack is an event handler which is called when the addtrack event occurs, indicating that a new audio track has been added to the media element whose audio tracks the audiotrack
list represents. the event is passed into the event handler in the form of a trackevent object, whose track property identifies the newly-added track. note: you can also add a handler for the addtrack event using addevent
listener(). syntax audiotrack
list.onaddtrack = eventhandler; value set onaddtrack to a function that accepts as input a trackevent object which indicates in its track property which audio track has been added to the media. usage notes the addtrack event is called whenever a new track is added to the media element whose audio tracks are represented by the audio...
...track event using addevent
listener(). syntax audiotrack
list.onaddtrack = eventhandler; value set onaddtrack to a function that accepts as input a trackevent object which indicates in its track property which audio track has been added to the media. usage notes the addtrack event is called whenever a new track is added to the media element whose audio tracks are represented by the audiotrack
list object. this happens when tracks are added to the element when the media is first attached to the element; one addtrack event will occur for each audio track in the media resource. example this snippet establishes a handler for the addtrack event that calls a function, addtotrack
list(), passing in the audiotrack object representing the newly-added track. in this scenario, that function's role i...
...racks are added to the element when the media is first attached to the element; one addtrack event will occur for each audio track in the media resource. example this snippet establishes a handler for the addtrack event that calls a function, addtotrack
list(), passing in the audiotrack object representing the newly-added track. in this scenario, that function's role is to add the new track to a
list of audio tracks available to choose from. ...
...he media resource. example this snippet establishes a handler for the addtrack event that calls a function, addtotrack
list(), passing in the audiotrack object representing the newly-added track. in this scenario, that function's role is to add the new track to a
list of audio tracks available to choose from. document.queryselector("video").audiotracks.onaddtrack = function(event) { addtotrack
list(event.track); }; specifications specification status comment html living standardthe definition of 'audiotrack
list.onaddtrack' in that specification. living standard html5the definition of 'audiotrack
list.onaddtrack' in that specification. recommendation ...
CSSValueList - Web APIs
the cssvalue
list interface derives from the cssvalue interface and provides the abstraction of an ordered collection of css values. some properties allow an empty
list in their syntax. in that case, these properties take the none identifier. so, an empty
list means that the property has the value none. the items in the cssvalue
list are accessible via an integral index, starting from 0. <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/cssvalue" target="_top"><rect x="1" y="1" width="80" height="50" fill="#fff"...
...t="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="41" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">cssvalue</text></a><polyline points="81,25 91,20 91,30 81,25" stroke="#d4dde4" fill="none"/><line x1="91" y1="25" x2="121" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/cssvalue
list" target="_top"><rect x="121" y="1" width="120" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="181" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">cssvalue
list</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties fr...
...width="120" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="181" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">cssvalue
list</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, cssvalue. cssvalue
list.lengthread only an unsigned long representing the number of cssvalues in the
list. methods cssvalue
list.item() this method is used to retrieve a cssvalue by ordinal index. the order in this collection represents the order of the values in the css style property. if index is greater than or equal to the number of values in the
list, this returns null. specifications specificati...
...() this method is used to retrieve a cssvalue by ordinal index. the order in this collection represents the order of the values in the css style property. if index is greater than or equal to the number of values in the
list, this returns null. specifications specification status comment document object model (dom) level 2 style specificationthe definition of 'cssvalues
list' in that specification. obsolete initial definition ...
DOMTokenList.forEach() - Web APIs
the foreach() method of the domtoken
list interface calls the callback given in parameter once for each value pair in the
list, in insertion order. syntax token
list.foreach(callback [, thisarg]); parameters callback function to execute for each element, eventually taking three arguments: currentvalue the current element being processed in the array. currentindex the index of the current element being processed in the array.
listobj the array that foreach() is being applied to. thisarg optional value to use as this when executing callback. return value undefined. example in the following example we retrieve the
list of classes set on a <span> element as a domtoken
list using element.class
list. we when retrieve an iterator containing the values using foreach(), wr...
...mple in the following example we retrieve the
list of classes set on a <span> element as a domtoken
list using element.class
list. we when retrieve an iterator containing the values using foreach(), writing each one to the <span>'s node.textcontent inside the foreach() inner function. ...
...lement as a domtoken
list using element.class
list. we when retrieve an iterator containing the values using foreach(), writing each one to the <span>'s node.textcontent inside the foreach() inner function. ...
...nner function. html <span class="a b c"></span> javascript let span = document.queryselector("span"); let classes = span.class
list; let iterator = classes.values(); classes.foreach( function(value, key,
listobj) { span.textcontent += `${value} ${key}/${this} ++ `; }, "arg" ); result polyfill this polyfill adds compatibility to all browsers supporting es5: if (window.domtoken
list && !domtoken
list.prototype.foreach) { domtoken
list.prototype.foreach = function (callback, thisarg) { thisarg = thisarg || window; for (var i = 0; i < this.length; i++) { callback.call(thisarg, this[i], i, this); } }; } specifications specification status comment domthe definition of 'foreach() (as iterable<node>)' in that specification. liv...
DOMTokenList.replace() - Web APIs
the replace() method of the domtoken
list interface replaces an existing token with a new token. if the first token doesn't exist, replace() returns false immediately, without adding the new token to the token
list. syntax token
list.replace(oldtoken, newtoken); parameters oldtoken a domstring representing the token you want to replace. newtoken a domstring representing the token you want to replace oldtoken with. return value a boolean value, which is true if oldtoken was successfully replaced, or false if not. note: in older browsers, replace() returns void. examples in the following example we retrieve the
list of classes set on a <span> element as a domtoken
list using element.class
list. ...
...ewtoken a domstring representing the token you want to replace oldtoken with. return value a boolean value, which is true if oldtoken was successfully replaced, or false if not. note: in older browsers, replace() returns void. examples in the following example we retrieve the
list of classes set on a <span> element as a domtoken
list using element.class
list. we then replace a token in the
list, and write the
list into the <span>'s node.textcontent. ...
...r browsers, replace() returns void. examples in the following example we retrieve the
list of classes set on a <span> element as a domtoken
list using element.class
list. we then replace a token in the
list, and write the
list into the <span>'s node.textcontent. first, the html: <span class="a b c"></span> now the javascript: let span = document.queryselector("span"); let classes = span.class
list; let result = classes.replace("c", "z"); console.log(result); if (result) { span.textcontent = classes; } else { span.textcontent = 'token not replaced successfully'; } the output looks like this: polyfill the following polyfill will add the replace method to the domtoken
list class. the following code will only work with ie10-11. to use with earlier versions of ie, refer to the polyfi...
...sses.replace("c", "z"); console.log(result); if (result) { span.textcontent = classes; } else { span.textcontent = 'token not replaced successfully'; } the output looks like this: polyfill the following polyfill will add the replace method to the domtoken
list class. the following code will only work with ie10-11. to use with earlier versions of ie, refer to the polyfill at element.class
list#polyfill domtoken
list.prototype.replace = function (a, b) { if (this.contains(a)) { this.add(b); this.remove(a); return true; } return false; } specifications specification status comment domthe definition of 'replace()' in that specification. living standard initial definition ...
EventListener - Web APIs
example html <button id="btn">click here!</button> javascript const buttonelement = document.getelementbyid('btn'); // add a handler for the 'click' event by providing a callback function. ...
...bject that can handle an event dispatched by an eventtarget object. note: due to the need for compatibility with legacy content, event
listener accepts both a function and an object with a handleevent() property function. this is shown in the example below. properties this interface neither implements, nor inherits, any properties. methods this interface doesn't inherit any methods. event
listener.handleevent() a function that is called whenever an event of the specified type occurs. example html <button id="btn">click here!</button> javascript const buttonelement = document.getelementbyid('btn'); // add a handler for the 'click' event by providing a callback function. // whenever the element is clicked, a pop-up with "element clicked!" will // appear. buttonelement.addeventlis...
...er for the 'click' event by providing a callback function. // whenever the element is clicked, a pop-up with "element clicked!" will // appear. buttonelement.addevent
listener('click', function (event) { alert('element clicked through function!'); }); // for compatibility, a non-function object with a `handleevent` property is // treated just the same as a function itself. buttonelement.addevent
listener('click', { handleevent: function (event) { alert('element clicked through handleevent property!'); } }); result see also: addevent
listener specifications specification status comment domthe definition of 'event
listener' in that specification. living standard no change. document object model (dom) level 2 events specificationthe def...
... handleevent: function (event) { alert('element clicked through handleevent property!'); } }); result see also: addevent
listener specifications specification status comment domthe definition of 'event
listener' in that specification. living standard no change. document object model (dom) level 2 events specificationthe definition of 'event
listener' in that specification. obsolete initial definition. ...
HTMLDataListElement - Web APIs
the htmldata
listelement interface provides special properties (beyond the htmlelement object interface it also has available to it by inheritance) to manipulate <data
list> elements and their content. <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarg...
...andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlelement</text></a><polyline points="491,25 501,20 501,30 491,25" stroke="#d4dde4" fill="none"/><line x1="501" y1="25" x2="509" y2="25" stroke="#d4dde4"/><line x1="509" y1="25" x2="509" y2="90" stroke="#d4dde4"/><line x1="509" y1="90" x2="492" y2="90" stroke="#d4dde4"/><a xlink:href="/docs/web/api/htmldata
listelement" target="_top"><rect x="301" y="65" width="190" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="396" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmldata
listelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherit...
..." height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="396" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmldata
listelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement htmldata
listelement.options read only is a htmlcollection representing a collection of the contained option elements. methods no specific method; inherits methods from its parent, htmlelement. specifications specification status comment html living standardthe definition of 'htmldata
listelement' in that specification. living standard html5the definition of 'html...
...ent.options read only is a htmlcollection representing a collection of the contained option elements. methods no specific method; inherits methods from its parent, htmlelement. specifications specification status comment html living standardthe definition of 'htmldata
listelement' in that specification. living standard html5the definition of 'htmldata
listelement' in that specification. recommendation initial definition ...
PerformanceObserverEntryList - Web APIs
the performanceobserverentry
list interface is a
list of peformance events that were explicitly observed via the observe() method. note: this interface is exposed to window and worker. methods performanceobserverentry
list.getentries() returns a
list of explicitly observed performanceentry objects based on the given filter. performanceobserverentry
list.getentriesbytype() returns a
list of explicitly observed performanceentry objects of the given entry type. performanceobserverentry
list.getentriesbyname() returns a
list of explicitly observed performanceentry objects based on the given name and entry type. ...
...nceentry objects based on the given filter. performanceobserverentry
list.getentriesbytype() returns a
list of explicitly observed performanceentry objects of the given entry type. performanceobserverentry
list.getentriesbyname() returns a
list of explicitly observed performanceentry objects based on the given name and entry type. ...
...ter. performanceobserverentry
list.getentriesbytype() returns a
list of explicitly observed performanceentry objects of the given entry type. performanceobserverentry
list.getentriesbyname() returns a
list of explicitly observed performanceentry objects based on the given name and entry type. ...
...eturns a
list of explicitly observed performanceentry objects of the given entry type. performanceobserverentry
list.getentriesbyname() returns a
list of explicitly observed performanceentry objects based on the given name and entry type. example // create observer for all performance event types //
list is of type performanceobserveentry
list var observe_all = new performanceobserver(function(
list, obs) { var perfentries =
list.getentries(); for (var i = 0; i < perfentries.length; i++) { print_perf_entry(perfentries[i]); // do something with it } }) specifications specification status comment performance timeline level 2the definition of 'performanceobserverentry
list' in that specification. candidate recommendation initial definition. ...
RadioNodeList.value - Web APIs
if the underlying element collection contains radio buttons, the radionode
list.value property represents the checked radio button. on retrieving the value property, the value of the currently checked radio button is returned as a string. if the collection does not contain any radio buttons or none of the radio buttons in the collection is in checked state, the empty string is returned. on setting the value property, the first radio button input element whose value property is equal to the new value will be set to checked. ...
... property, the value of the currently checked radio button is returned as a string. if the collection does not contain any radio buttons or none of the radio buttons in the collection is in checked state, the empty string is returned. on setting the value property, the first radio button input element whose value property is equal to the new value will be set to checked. ...
...of the currently checked radio button is returned as a string. if the collection does not contain any radio buttons or none of the radio buttons in the collection is in checked state, the empty string is returned. on setting the value property, the first radio button input element whose value property is equal to the new value will be set to checked. ...
... living standard initial definition. ...
TouchList.identifiedTouch() - Web APIs
return value touchitem a touch object matching the specified id. ...
... return value touchitem a touch object matching the specified id. ...
... return value touchitem a touch object matching the specified id. ...
... return value touchitem a touch object matching the specified id. ...
TouchList.item() - Web APIs
the item() method returns the touch object at the specified index in the touch
list. syntax var touchpoint = touch
list.item(index); parameters index the index of the touch object to retrieve. the index is a number in the range of 0 to one less than the length of the touch
list. return value touchpoint the requested touch object from the touch
list. returns null if the index is not less than the length of the
list. example this code example illustrates the use of the touch
list interface's item method and the length property. ...
...dex is a number in the range of 0 to one less than the length of the touch
list. return value touchpoint the requested touch object from the touch
list. returns null if the index is not less than the length of the
list. example this code example illustrates the use of the touch
list interface's item method and the length property. ...
... touch events recommendation initial definition. ...
... touch events recommendation initial definition. ...
VideoTrackList: change event - Web APIs
the change event is fired when a video track is made active or inactive, for example by changing the track's selected property. ...
... the change event is fired when a video track is made active or inactive, for example by changing the track's selected property. ...
...r property onchange examples using addevent
listener(): const videoelement = document.queryselector('video'); videoelement.videotracks.addevent
listener('change', (event) => { console.log(`'${event.type}' event fired`); }); // changing the value of `selected` will trigger the `change` event const toggletrackbutton = document.queryselector('.toggle-track'); toggletrackbutton.addevent
listener('click', () => { const track = videoelement.videotracks[0]; track.selected = !track.selected; }); using the onchange event handler property: const videoelement = document.queryselector('video'); videoelement.videotracks.onchange = (event) => { console.log(`'${event.type}' event fired`); }; // changing the value of `selected` will trigger the `change` event const toggletrackbutton ...
... living standard ...
Intlā.ListFormat.prototypeā.format() - JavaScript
the format() method returns a string with a language-specific representation of the
list. syntax
listformat.format([
list]); parameters
list an iterable object, such as an array return value a language-specific formatted string representing the elements of the
list description the format() method returns a string that has been formatted based on parameters provided in the intl.
listformat object. the locales and options parameters customize the behavior of format() and let applications specify the language conventions that should be used to format the
list. examples using format the following example shows how to create a
list formatter using the english language. ...
...format() method returns a string that has been formatted based on parameters provided in the intl.
listformat object. the locales and options parameters customize the behavior of format() and let applications specify the language conventions that should be used to format the
list. examples using format the following example shows how to create a
list formatter using the english language. ...
...ed on parameters provided in the intl.
listformat object. the locales and options parameters customize the behavior of format() and let applications specify the language conventions that should be used to format the
list. examples using format the following example shows how to create a
list formatter using the english language. ...
...s and options parameters customize the behavior of format() and let applications specify the language conventions that should be used to format the
list. examples using format the following example shows how to create a
list formatter using the english language. const
list = ['motorcycle', 'bus', 'car']; console.log(new intl.
listformat('en-gb', { style: 'long', type: 'conjunction' }).format(
list)); // > motorcycle, bus and car console.log(new intl.
listformat('en-gb', { style: 'short', type: 'disjunction' }).format(
list)); // > motorcycle, bus or car console.log(new intl.
listformat('en-gb', { style: 'narrow', type: 'unit' }).format(
list)); // > motorcycle bus car specifications specification intl.
listformatthe definition of 'format()' in that specification. ...
listhead - Archive of obsolete content
attributes disabled properties acesssibletype, disabled examples (example needed) attributes disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the element is disabled. disabled elements are usually drawn with grayed-out text. if the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire. in the case of form elements, it will not be submitted. ...
...llowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements
listbox,
listcell,
listcol,
listcols,
listheader,
listitem ...
TPS Formdata Lists
a formdata asset
list is an array of objects, each with the following properties: fieldname: required. value: required. date: the date the form data was used, expressed in hours from the present, so 0 means now, and -24 means 24 hours ago. optional, defaults to 0. ...
...quired. value: required. date: the date the form data was used, expressed in hours from the present, so 0 means now, and -24 means 24 hours ago. optional, defaults to 0. ...
...he present, so 0 means now, and -24 means 24 hours ago. optional, defaults to 0. 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. note 2, sync currently does not sync formdata dates, so the date field is ignored w...
nsIClipboardDragDropHookList
it provides basic operations such as adding, removing and enumerating clipboard hooks for the nsiclipboarddragdrophooks interface. inherits from: nsisupports last changed in gecko 1.7 note: this interface is not intended for direct use by embedders; it is an implementation detail. you should access these capabilities indirectly by sending commands using the nsiclipboarddragdrophooks interface. within gecko, this interface is used by calling get_interface on a docshell. ...
...dragdrophooks interface. within gecko, this interface is used by calling get_interface on a docshell. method overview void addclipboarddragdrophooks(in nsiclipboarddragdrophooks ahooks); nsisimpleenumerator gethookenumerator(); void removeclipboarddragdrophooks(in nsiclipboarddragdrophooks ahooks); methods addclipboarddragdrophooks() this method adds a hook to the
list. void addclipboarddragdrophooks( in nsiclipboarddragdrophooks ahooks ); parameters ahooks implementation of hooks. gethookenumerator() this method retrieves an enumerator for all hooks which have been added. nsisimpleenumerator gethookenumerator(); parameters none. return value returns nsisimpleenumerator for nsiclipboarddragdrophooks. removeclipboarddragdrophooks() this method remo...
...ragdrophooks( in nsiclipboarddragdrophooks ahooks ); parameters ahooks implementation of hooks. gethookenumerator() this method retrieves an enumerator for all hooks which have been added. nsisimpleenumerator gethookenumerator(); parameters none. return value returns nsisimpleenumerator for nsiclipboarddragdrophooks. removeclipboarddragdrophooks() this method removes a hook from the
list. note: if this implementation is not present in the
list then removal will be ignored. void removeclipboarddragdrophooks( in nsiclipboarddragdrophooks ahooks ); parameters ahooks implementation of hooks. see also nsiclipboarddragdrophooks nsiclipboard nsisimpleenumerator ...
nsIFeedProgressListener
toolkit/components/feeds/public/nsifeed
listener.idlscriptable this interface defines callbacks used during the processing of an rss or atom feed. programs using the feed content access api do not have to implement any of these callbacks; they are optional, but allow you to provide feedback during the parsing process. ...
... toolkit/components/feeds/public/nsifeed
listener.idlscriptable this interface defines callbacks used during the processing of an rss or atom feed. programs using the feed content access api do not have to implement any of these callbacks; they are optional, but allow you to provide feedback during the parsing process. ...
...) called by the feed processor when a fatal xml parsing error occurs, or if the document isn't a feed. void reporterror( in astring errortext, in long linenumber, in boolean bozo ); parameters errortext a short description of the error. linenumber the line on which the error occurred. bozo the bozo bit will be set if the error was due to a fatal error. see also nsifeedresult
listener interwiki lin ...
nsIJumpListItem
widget/public/nsijump
listitem.idlscriptable implements windows 7 taskbar jump
list item interfaces. 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) note: to consumers: it's reasonable to expect we'll need support for other types of jump
list items (an audio file, an email message, etc.). to add types, create the specific interface here, add an implementation class to winjump
listitem, and add support to add
listbuild and removed items processing. method overview boolean equals(in nsijump
listitem item); attributes attribute type description type short retrieves the jump
list item type. read only. ...
...e, an email message, etc.). to add types, create the specific interface here, add an implementation class to winjump
listitem, and add support to add
listbuild and removed items processing. method overview boolean equals(in nsijump
listitem item); attributes attribute type description type short retrieves the jump
list item type. read only. constants constant value description jump
list_item_empty 0 empty
list item. jump
list_item_separator 1 separator. jump
list_item_link 2 web link item. jump
list_item_shortcut 3 application shortcut. methods equals() compare this item to another. ...
...ption jump
list_item_empty 0 empty
list item. jump
list_item_separator 1 separator. jump
list_item_link 2 web link item. jump
list_item_shortcut 3 application shortcut. methods equals() compare this item to another. compares the type and other properties specific to this item's type: separator - type link - type, uri, title shortcut - type, handler application boolean equals( in nsijump
listitem item ); parameters item another nsijump
listitem to compare to. return value true if items are the same, otherwise false ...
nsIMessageListener
methods void receivemessage(); receivemessage() this is for js only. this function receives a message from one of the three message-sending functions in the message manager framework: broadcastasyncmessage sendasyncmessage sendsyncmessage. ...
...methods void receivemessage(); receivemessage() this is for js only. this function receives a message from one of the three message-sending functions in the message manager framework: broadcastasyncmessage sendasyncmessage sendsyncmessage. ...
...therwise. data a structured clone of the message payload: the second argument passed into the message-sending function. json same as data. deprecated. objects an object whose properties are any cross process object wrappers exposed by the sender as the third argument to the message-sending function. principal principal for the window app. each
listener is invoked with its own copy of the message parameter. when the
listener is called, 'this' value is the target of the message. if the message is synchronous, the possible return value is returned as json (will be changed to use structured clones). when there are multiple
listeners to synchronous messages, each
listener's return value is sent back as an element in an array. undefined retur...
nsIWebSocketListener
netwerk/protocol/websocket/nsiwebsocket
listener.idlscriptable implement this interface to receive websocket traffic events asynchronously after calling nsiwebsocketchannel.asyncopen(). 1.0 66 introduced gecko 8.0 inherits from: nsisupports last changed in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) method overview void onacknowledge(in nsisupports acontext, in pruint32 asize); void onbinarymessageavailable(in nsisupports acontext, in acstring amsg); void onmessageavailable(in nsisupports acontext, in autf8string amsg); void onserverclose(in nsisupports acontext, in unsigned short acode, in autf8string areason); void onstart(in nsisupports acontext); void onstop(in nsisupports acontext, in nsresul...
...utf8string amsg ); parameters acontext user defined context. amsg the message data, as a utf-8 string. onserverclose() called when the server sends a close message. in the case of errors, onstop() may be called without this method ever getting called. no additional messages through onmessageavailable(), onbinarymessageavailable()() or onacknowledge()() will be delievered to the
listener after onserverclose() is called, but outgoing messages can still be sent through the nsiwebsocketchannel connection. void onserverclose( in nsisupports acontext, in unsigned short acode, in autf8string areason ); parameters acontext user defined context. acode the websocket closing handshake status code; see status codes for possible values. areason a text stri...
...rclose( in nsisupports acontext, in unsigned short acode, in autf8string areason ); parameters acontext user defined context. acode the websocket closing handshake status code; see status codes for possible values. areason a text string explaining the reason for the closure of the connection. onstart() called to signify the establishment of the message stream. any
listener that receives onstart() will also receive onstop(). void onstart( in nsisupports acontext ); parameters acontext user defined context. onstop() called to signify the completion of the message stream. this is the final notification the
listener will receive; once it's been received, the websocket connection is complete. this event can be received in error cases even if nsiwebsocke...
CSSRuleList - Web APIs
a cssrule
list is an (indirect-modify only) array-like object containing an ordered collection of cssrule objects. description each cssrule can be accessed as rules.item(index), or simply rules[index], where rules is an object implementing the cssrule
list interface (such as cssstylesheet.cssrules), and index is the 0-based index of the rule, in the order as it appears in the style sheet css. the number of rules in the
list is rules.length. note that being indirect-modify (changeable but only having read-methods), rules are not added or removed from the
list directly, but instead here, only via its parent stylesheet. in fact, .insertrule() and .deleterule() are not even methods of cssrule
list, but only of cssstylesheet. ...
... appears in the style sheet css. the number of rules in the
list is rules.length. note that being indirect-modify (changeable but only having read-methods), rules are not added or removed from the
list directly, but instead here, only via its parent stylesheet. in fact, .insertrule() and .deleterule() are not even methods of cssrule
list, but only of cssstylesheet. if however, for some reason the
list does need to be modified but has no parent stylesheet (perhaps being a livecopy of a
list that does), it cannot just be assigned one (as it has no such property), and neither can it be assigned to one (as stylesheet.cssrules is read-only), but it must unfortunately be inserted into one, rule by rule, and unless combining
lists, after any existing
list therein is deleted, rule by rule. example /...
...d one (as it has no such property), and neither can it be assigned to one (as stylesheet.cssrules is read-only), but it must unfortunately be inserted into one, rule by rule, and unless combining
lists, after any existing
list therein is deleted, rule by rule. example // get the first style sheet’s first rule var first_rule = document.stylesheets[0].cssrules[0]; see also cssrule cssrule
list implementations there are multiple properties in the cssom that will return a cssrule
list. they are: cssstylesheet property cssrules cssmediarule property cssrules csskeyframesrule property cssrules cssmozdocumentrule property cssrules specifications specification status comment css object model (cssom)the definition of 'cssrule
list' in that specification. ...
DOMTokenList.remove() - Web APIs
the remove() method of the domtoken
list interface removes the specified tokens from the
list. syntax token
list.remove(token1[, token2[, ...tokenn]]); parameters tokenn a domstring representing the token you want to remove from the
list. if the string is not in the
list, no error is thrown, and nothing happens. return value undefined examples in the following example we retrieve the
list of classes set on a <span> element as a domtoken
list using element.class
list. we then remove a token from the
list, and write the
list into the <span>'s node.textcontent. ...
... happens. return value undefined examples in the following example we retrieve the
list of classes set on a <span> element as a domtoken
list using element.class
list. we then remove a token from the
list, and write the
list into the <span>'s node.textcontent. first, the html: <span class="a b c"></span> now the javascript: let span = document.queryselector("span"); let classes = span.class
list; classes.remove("c"); span.textcontent = classes; the output looks like this: to remove multiple classes at once, you can supply multiple tokens. ...
...pan>'s node.textcontent. first, the html: <span class="a b c"></span> now the javascript: let span = document.queryselector("span"); let classes = span.class
list; classes.remove("c"); span.textcontent = classes; the output looks like this: to remove multiple classes at once, you can supply multiple tokens. the order you supply the tokens doesn't have to match the order they appear in the
list: let span2 = document.getelementsbytagname("span")[0] let classes2 = span.class
list; classes2.remove("c", "b"); span2.textcontent = classes; specifications specification status comment domthe definition of 'remove()' in that specification. living standard initial definition ...
FeaturePolicy.getAllowlistForFeature() - Web APIs
errors the function will raise a warning if the specified feature policy directive name is not known. however, it will also return empty array, inditating that no origin is allowed to use the feature. example the followin example prints all the origins that are allowed to use camera api by the feature policy. ...
... errors the function will raise a warning if the specified feature policy directive name is not known. however, it will also return empty array, inditating that no origin is allowed to use the feature. example the followin example prints all the origins that are allowed to use camera api by the feature policy. ...
...wed to use the feature. example the followin example prints all the origins that are allowed to use camera api by the feature policy. please note that camera api might be restricted by the permissions api, if the user did not grant the corrsponding permission yet. // first, get the feature policy object const featurepolicy = document.featurepolicy // then query feature for specific const allow
list = featurepolicy.getallow
listforfeature("camera") for (const origin of allow
list){ console.log(origin) } specification specification status comment feature policythe definition of 'getallow
listforfeature' in that specification. editor's draft initial definition. ...
HTMLAnchorElement.relList - Web APIs
the htmlanchorelement.rel
list read-only property reflects the rel attribute. it is a live domtoken
list containing the set of link types indicating the relationship between the resource represented by the <a> element and the current document. the property itself is read-only, meaning you can't substitute the domtoken
list with another one, but its contents can still be changed. ...
...lement.rel
list read-only property reflects the rel attribute. it is a live domtoken
list containing the set of link types indicating the relationship between the resource represented by the <a> element and the current document. the property itself is read-only, meaning you can't substitute the domtoken
list with another one, but its contents can still be changed. ...
...elationship between the resource represented by the <a> element and the current document. the property itself is read-only, meaning you can't substitute the domtoken
list with another one, but its contents can still be changed. syntax var relstr = anchorelt.rel
list; example var anchors = document.getelementsbytagname("a"); var length = anchors.length; for (var i = 0; i < length; i++) { var
list = anchors[i].rel
list; var
listlength =
list.length; console.log("new anchor node found with",
listlength, "link types in rel
list."); for (var j = 0; j <
listlength; j++) { console.log(
list[j]); } } specifications specification status comment html living standardthe definition of 'rel
list' in that specification. living standard initial definition. ...
HTMLAreaElement.relList - Web APIs
the htmlareaelement.rel
list read-only property reflects the rel attribute. it is a live domtoken
list containing the set of link types indicating the relationship between the resource represented by the <area> element and the current document. the property itself is read-only, meaning you can't substitute the domtoken
list by another one, but the content of the returned
list can be changed. ...
...t read-only property reflects the rel attribute. it is a live domtoken
list containing the set of link types indicating the relationship between the resource represented by the <area> element and the current document. the property itself is read-only, meaning you can't substitute the domtoken
list by another one, but the content of the returned
list can be changed. ...
...etween the resource represented by the <area> element and the current document. the property itself is read-only, meaning you can't substitute the domtoken
list by another one, but the content of the returned
list can be changed. syntax var relstr = areaelt.rel
list; example var areas = document.getelementsbytagname("area"); var length = areas.length; for (var i = 0; i < length; i++) { var
list = areas[i].rel
list; var
listlength =
list.length; console.log("new area found."); for (var j = 0; j <
listlength; j++) { console.log(
list[j]); } } specifications specification status comment html living standardthe definition of 'rel
list' in that specification. living standard initial definition. ...
HTMLLinkElement.relList - Web APIs
the htmllinkelement.rel
list read-only property reflects the rel attribute. it is a live domtoken
list containing the set of link types indicating the relationship between the resource represented by the <link> element and the current document. the property itself is read-only, meaning you can substitute the domtoken
list by another one, but the content of the returned
list can be changed. ...
...ist read-only property reflects the rel attribute. it is a live domtoken
list containing the set of link types indicating the relationship between the resource represented by the <link> element and the current document. the property itself is read-only, meaning you can substitute the domtoken
list by another one, but the content of the returned
list can be changed. ...
...p between the resource represented by the <link> element and the current document. the property itself is read-only, meaning you can substitute the domtoken
list by another one, but the content of the returned
list can be changed. syntax var relstr = linkelt.rel
list; example var links = document.getelementsbytagname("link"); var length = links.length; for (var i = 0; i < length; i++) { var
list = links[i].rel
list; var
listlength =
list.length; console.log("new link found."); for (var j = 0; j <
listlength; j++) { console.log(
list[j]); } } specifications specification status comment html living standardthe definition of 'rel
list' in that specification. living standard initial definition. ...
MediaList - Web APIs
the media
list interface represents the media queries of a stylesheet, e.g. those set using a <link> element's media attribute. note: media
list is a live
list; updating the
list using properties or methods
listed below will immediately update the behavior of the document. properties media
list.mediatext a stringifier that returns a domstring representing the media
list as text, and also allows you to set a new media
list. media
list.length read only returns the number of media queries in the media
list. methods media
list.appendmedium() adds a media query to the media
list. media
list.deletemedium() removes a media query from the media
list. ...
...ocument. properties media
list.mediatext a stringifier that returns a domstring representing the media
list as text, and also allows you to set a new media
list. media
list.length read only returns the number of media queries in the media
list. methods media
list.appendmedium() adds a media query to the media
list. media
list.deletemedium() removes a media query from the media
list. media
list.item() a getter that returns a cssomstring representing a media query as text, given the media query's index value inside the media
list. examples the following would log to the console a textual representation of the media
list of the first stylesheet applied to the current document. const stylesheets = document.stylesheets; let stylesheet = stylesheets[0]; console.log(stylesheet.media.mediat...
...the media
list. examples the following would log to the console a textual representation of the media
list of the first stylesheet applied to the current document. const stylesheets = document.stylesheets; let stylesheet = stylesheets[0]; console.log(stylesheet.media.mediatext); specifications specification status comment css object model (cssom)the definition of 'media
list' in that specification. working draft ...
MediaQueryListEvent - Web APIs
the mediaquery
listevent object stores information on the changes that have happened to a mediaquery
list object — instances are available as the event object on a function referenced by a mediaquery
list.onchange property or mediaquery
list.add
listener() call. constructor mediaquery
listevent() creates a new mediaquery
listevent instance. properties the mediaquery
listevent interface inherits properties from its parent interface, event. mediaquery
listevent.matchesread only a boolean that returns true if the document currently matches the media query
list, or false if not. mediaquery
listevent.mediaread only a domstring representing a serialized media query. methods the mediaquery
listevent interface inherits methods from its parent interface, event. examples var mql = win...
... working draft initial definition ...
... working draft initial definition ...
NameList - Web APIs
obsolete since gecko 10.0 (firefox 10.0 / thunderbird 10.0 / seamonkey 2.7)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. note: although this interface was previously implemented in gecko, there was no way to actually create one. ...
...lete since gecko 10.0 (firefox 10.0 / thunderbird 10.0 / seamonkey 2.7)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. note: although this interface was previously implemented in gecko, there was no way to actually create one. ...
...e: although this interface was previously implemented in gecko, there was no way to actually create one. name
list has been removed, effective with gecko 10.0 the name
list interface provides an abstraction for an ordered collection of name and namespace value pairs. items can be accessed by a 0-based index. the dom spec does not specify how the collection is to be implemented. properties name
list.length read only methods name
list.contains() returns a boolean. name
list.containsns() returns a boolean. name
list.getname() returns a domstring. name
list.getnamespaceuri() returns a domstring. specifications specification status comment document object model (dom) level 3 core specificationthe definition of 'name
list' in that specification. obsolete i...
NodeList.entries() - Web APIs
the node
list.entries() method returns an iterator allowing to go through all key/value pairs contained in this object. the values are node objects. syntax
list.entries(); return value returns an iterator. ...
... through all key/value pairs contained in this object. the values are node objects. syntax
list.entries(); return value returns an iterator. ...
...values are node objects. syntax
list.entries(); return value returns an iterator. ...
NodeList.keys() - Web APIs
the node
list.keys() method returns an iterator allowing to go through all keys contained in this object. the keys are unsigned integer. syntax node
list.keys(); return value returns an iterator. ...
...g to go through all keys contained in this object. the keys are unsigned integer. syntax node
list.keys(); return value returns an iterator. ...
...ys are unsigned integer. syntax node
list.keys(); return value returns an iterator. ...
NodeList.values() - Web APIs
the node
list.values() method returns an iterator allowing to go through all values contained in this object. the values are node objects. syntax node
list.values(); return value returns an iterator. ...
...to go through all values contained in this object. the values are node objects. syntax node
list.values(); return value returns an iterator. ...
...es are node objects. syntax node
list.values(); return value returns an iterator. ...
SVGAnimatedLengthList - Web APIs
svg animated length
list interface the svganimatedlength
list interface is used for attributes of type svglength
list which can be animated. interface overview also implement none methods none properties readonly svglength
list baseval readonly svglength
list animval normative document svg 1.1 (2nd edition) properties name type description baseval svglength
list the base value of the given attribute before applying any animations. animval svglength
list a read only svglength
list representing the current animated value of the given attribute. if the given attribute is not currently being animated, then the svglength
list will have the same contents as baseval. the objec...
... browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
SVGAnimatedNumberList - Web APIs
svg animated number
list interface the svganimatednumber interface is used for attributes which take a
list of numbers and which can be animated. interface overview also implement none methods none properties readonly svgnumber
list baseval readonly svgnumber
list animval normative document svg 1.1 (2nd edition) properties svganimatednumber
list.baseval read only is a svgnumber
list that represents the base value of the given attribute before applying any animations. svganimatednumber
list.animval read only is a read only svgnumber
list that represents the current animated value of the given attribute. ...
...1.1 (2nd edition) properties svganimatednumber
list.baseval read only is a svgnumber
list that represents the base value of the given attribute before applying any animations. svganimatednumber
list.animval read only is a read only svgnumber
list that represents the current animated value of the given attribute. if the given attribute is not currently being animated, then the svgnumber
list will have the same contents as baseval. the object referenced by animval will always be distinct from the one referenced by baseval, even when the attribute is not animated. methods the svganimatednumber
list interface do not provide any specific methods. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, plea...
... browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
SVGAnimatedTransformList - Web APIs
svg animated transform
list interface the svganimatedtransform
list interface is used for attributes which take a
list of numbers and which can be animated. interface overview also implement none methods none properties readonly svgtransform
list baseval readonly svgtransform
list animval normative document svg 1.1 (2nd edition) properties name type description baseval svgtransform
list the base value of the given attribute before applying any animations. animval svgtransform
list a read only svgtransform
list representing the current animated value of the given attribute. ...
...g 1.1 (2nd edition) properties name type description baseval svgtransform
list the base value of the given attribute before applying any animations. animval svgtransform
list a read only svgtransform
list representing the current animated value of the given attribute. if the given attribute is not currently being animated, then the svgtransform
list will have the same contents as baseval. the object referenced by animval will always be distinct from the one referenced by baseval, even when the attribute is not animated. methods the svganimatedtransform
list interface doesn't provide any specific methods. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the d...
...rowser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
TextTrackList.onaddtrack - Web APIs
the texttrack
list property onaddtrack is an event handler which is called when the addtrack event occurs, indicating that a new text track has been added to the media element whose text tracks the texttrack
list represents. the event is passed into the event handler in the form of a trackevent object, whose track property identifies the newly-added track. note: you can also add a handler for the addtrack event using addevent
listener(). syntax texttrack
list.onaddtrack = eventhandler; value set onaddtrack to a function that accepts as input a trackevent object which indicates in its track property which video track has been added to the media. usage notes the addtrack event is called whenever a new track is added to the media element whose video tracks are represented by the texttrackl...
... is called whenever a new track is added to the media element whose video tracks are represented by the texttrack
list object. this happens when tracks are added to the element when the media is first attached to the element; one addtrack event will occur for each video track in the media resource. example this snippet establishes a handler for the addtrack event that calls a function, addtotrack
list(), passing in the videotrack object representing the newly-added track. in this scenario, that function's role is to add the new track to a
list of video tracks available to choose from. ...
...the media resource. example this snippet establishes a handler for the addtrack event that calls a function, addtotrack
list(), passing in the videotrack object representing the newly-added track. in this scenario, that function's role is to add the new track to a
list of video tracks available to choose from. document.queryselector("video").texttracks.onaddtrack = function(event) { addtotrack
list(event.track); }; specifications specification status comment html living standardthe definition of 'texttrack
list: onaddtrack' in that specification. living standard ...
TextTrackList: removeTrack event - Web APIs
the removetrack event is fired when a track is removed from a texttrack
list. ...
... the removetrack event is fired when a track is removed from a texttrack
list. ...
... the removetrack event is fired when a track is removed from a texttrack
list. ...
TouchList.length - Web APIs
the length read-only property indicates the number of items (touch points) in a given touch
list. syntax var numtouches = touch
list.length; return value numtouches the number of touch points in touch
list. example this code example illustrates the use of the touch
list interface's item method and the length property. ...
... the length read-only property indicates the number of items (touch points) in a given touch
list. syntax var numtouches = touch
list.length; return value numtouches the number of touch points in touch
list. example this code example illustrates the use of the touch
list interface's item method and the length property. ...
...h; return value numtouches the number of touch points in touch
list. example this code example illustrates the use of the touch
list interface's item method and the length property. target = document.getelementbyid("target"); target.addevent
listener('touchstart', function(ev) { // if this touchstart event started on element target, // set touch to the first item in the targettouches
list; // otherwise set touch to the first item in the touches
list var touch; if (ev.targettouches.length >= 1) touch = ev.targettouches.item(0); else touch = ev.touches.item(0); }, false); specifications specification status comment touch events – level 2 draft non-stable version. touch events recommendation initial definition. ...
VideoTrackList.onaddtrack - Web APIs
the videotrack
list property onaddtrack is an event handler which is called when the addtrack event occurs, indicating that a new video track has been added to the media element whose video tracks the videotrack
list represents. the event is passed into the event handler in the form of a trackevent object, whose track property identifies the newly-added track. note: you can also add a handler for the addtrack event using addevent
listener(). syntax videotrack
list.onaddtrack = eventhandler; value set onaddtrack to a function that accepts as input a trackevent object which indicates in its track property which video track has been added to the media. usage notes the addtrack event is called whenever a new track is added to the media element whose video tracks are represented by the video...
...track event using addevent
listener(). syntax videotrack
list.onaddtrack = eventhandler; value set onaddtrack to a function that accepts as input a trackevent object which indicates in its track property which video track has been added to the media. usage notes the addtrack event is called whenever a new track is added to the media element whose video tracks are represented by the videotrack
list object. this happens when tracks are added to the element when the media is first attached to the element; one addtrack event will occur for each video track in the media resource. example this snippet establishes a handler for the addtrack event that calls a function, addtotrack
list(), passing in the videotrack object representing the newly-added track. in this scenario, that function's role i...
...racks are added to the element when the media is first attached to the element; one addtrack event will occur for each video track in the media resource. example this snippet establishes a handler for the addtrack event that calls a function, addtotrack
list(), passing in the videotrack object representing the newly-added track. in this scenario, that function's role is to add the new track to a
list of video tracks available to choose from. document.queryselector("video").videotracks.onaddtrack = function(event) { addtotrack
list(event.track); }; specifications specification status comment html living standardthe definition of 'videotrack
list: onaddtrack' in that specification. living standard ...
Selector list - CSS: Cascading Style Sheets
the css selector
list (,) selects all the matching nodes. /* selects all matching elements */ span, div { border: red 2px solid; } to reduce the size of style sheets, one can group selectors in comma-separated
lists. syntax element, element, element { style properties } examples single line grouping grouping selectors in a single line using a comma-separated
lists. h1, h2, h3, h4, h5, h6 { font-family: helvetica; } multi line grouping grouping selectors in a multiple lines using a comma-separated
lists. ...
...p selectors in comma-separated
lists. syntax element, element, element { style properties } examples single line grouping grouping selectors in a single line using a comma-separated
lists. h1, h2, h3, h4, h5, h6 { font-family: helvetica; } multi line grouping grouping selectors in a multiple lines using a comma-separated
lists. #main, .content, article { font-size: 1.1em; } selector
list invalidation a downside to using selector
lists is that the following aren't equivalent: h1 { font-family: sans-serif } h2:maybe-unsupported { font-family: sans-serif } h3 { font-family: sans-serif } h1, h2:maybe-unsupported, h3 { font-family: sans-serif } this is because a single unsupported selector in a selector
list invalidates the whole rule. a way to remedy this us to use the :is() sel...
...ut at the cost of all selectors having the same specificity, because of how :is() calculates specificity. h1 { font-family: sans-serif } h2:maybe-unsupported { font-family: sans-serif } h3 { font-family: sans-serif } :is(h1, h2:maybe-unsupported, h3) { font-family: sans-serif } specifications specification status comment selectors level 4the definition of 'selector
lists' in that specification. working draft renamed to "selector
list" css level 1the definition of 'grouping' in that specification. recommendation initial definition ...
<listing> - HTML: Hypertext Markup Language
the html 2 standard recommended that lines shouldn't be broken when not greater than 132 characters. note: do not use this element. it is deprecated since html 3.2 and was neither implemented by all browsers, nor in a consistent way. even more it is obsoleted in html5 and may be rendered by conforming user-agents as the <pre> element, which will interpret the internal html! instead use the <pre> element or if semantically adequate the <code> element, eventually escaping the html '<' and '>' so that they don't get interpreted. ...
...or this element. browser compatibility the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... ...
Intlā.ListāFormatā.prototypeā.resolvedOptions() - JavaScript
description the object returned by resolvedoptions() has the following properties: locale the bcp 47 language tag for the locale actually used. if any unicode extension values were requested in the input bcp 47 language tag that led to this locale, the key-value pairs that were requested and are supported for this locale are included in locale. ...
... description the object returned by resolvedoptions() has the following properties: locale the bcp 47 language tag for the locale actually used. if any unicode extension values were requested in the input bcp 47 language tag that led to this locale, the key-value pairs that were requested and are supported for this locale are included in locale. ...
.... style the value provided for this property in the options argument of the constructor or the default value ("long"). its value is either "long", "short", or "narrow". type the value provided for this property in the options argument of the constructor or the default value ("conjunction"). its value is either "conjunction", "disjunction", or "unit". examples using resolvedoptions const de
listformatter = new intl.
listformat("de-de", { style: "short" }); const usedoptions = de.resolvedoptions(); console.log(usedoptions.locale); // "de-de" console.log(usedoptions.style); // "short" console.log(usedoptions.type); // "conjunction" (the default value) specifications specification intl.
listformatthe definition of 'resolvedoptions()' in that specification. ...
Listen for Page Load - Archive of obsolete content
you don't get direct access to any content hosted in the tab. to access tab content you need to attach a script to the tab using tab.attach(). this add-on attaches a script to all open tabs. ...
... to learn more about running scripts in tabs, see the tutorial on using tab.attach(). ...
nsIServerSocketListener
y calling the nsisockettransport.getaddress() method or by inspecting nsisockettransport.gethost(), which returns a string representation of the client's ip address, which may be either an ipv4 or an ipv6 address. ...
... in nsisockettransport atransport); void onstop
listening(in nsiserversocket aserv, in nsresult astatus); methods onsocketaccepted() this method is called when a client connection is accepted. void onsocketaccepted( in nsiserversocket aserv, in nsisockettransport atransport ); parameters aserv the server socket. atransport the connected socket transport. onstop
listening() this method is called when the
listening socket stops for some reason. the server socket is effectively dead after this notification. void onstop
listening( in nsiserversocket aserv, in nsresult astatus ); parameters aserv the server socket. astatus the reason why the server socket stopped
listening. if the server socket was manually closed, then this value will be ns_...
nsITransactionListener
editor/txmgr/idl/nsitransaction
listener.idlscriptable this interface is implemented by an object that tracks transactions. inherits from: nsisupports last changed in gecko 1.7 method overview void didbeginbatch(in nsitransactionmanager amanager, in nsresult aresult); void diddo(in nsitransactionmanager amanager, in nsitransaction atransaction, in nsresult adoresult); void didendbatch(in nsitransactionmanager amanager, in nsresult aresult); void didmerge(in nsitransactionmanager amanager, in nsitransaction atoptransaction, in nsitransaction atransactiontomerge, in boolean adidmerge, in nsresult amergeresult); void didredo(in nsitransactionmanager amanager, in nsitransaction atransaction, in nsresult aredoresult); void didundo(in nsitransactionmanager amanager, in ns...
...ion being redone. ...
nsIWebProgressListener2
an extended version of nsiwebprogress
listener. uriloader/base/nsiwebprogress
listener2.idlscriptable please add a summary to this article. last changed in gecko 1.9 (firefox 3) inherits from: nsiwebprogress
listener method overview void onprogresschange64(in nsiwebprogress awebprogress, in nsirequest arequest, in long long acurselfprogress, in long long amaxselfprogress, in long long acurtotalprogress, in long long amaxtotalprogress); boolean onrefreshattempted(in nsiwebprogress awebprogress, in nsiuri arefreshuri, in long amillis, in boolean asameuri); methods onprogresschange64() notification that the progress has changed for one of the requests associated with awebprogress. progress totals are reset to zero when all requests in awebprogress complete (corresponding to onstat...
...ng amillis, in boolean asameuri); methods onprogresschange64() notification that the progress has changed for one of the requests associated with awebprogress. progress totals are reset to zero when all requests in awebprogress complete (corresponding to onstatechange being called with astateflags including the state_stop and state_is_window flags). this function is identical to nsiwebprogress
listener.onprogresschange(), except that this function supports 64-bit values. note: if any progress value is unknown, then its value is replaced with -1. void onprogresschange64( in nsiwebprogress awebprogress, in nsirequest arequest, in long long acurselfprogress, in long long amaxselfprogress, in long long acurtotalprogress, in long long amaxtotalprogress ); parameters awebprogress th...
nsIWifiListener
netwerk/wifi/nsiwifi
listener.idlscriptable this interface is implemented by clients interested in receiving notifications when the
list of available wifi access points changes. 1.0 66 introduced gecko 1.9.1 inherits from: nsisupports last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) method overview void onchange([array, size_is(alen)] in nsiwifiaccesspoint accesspoints, in unsigned long alen); void onerror(in long error); methods onchange() called when the
list of available access points changes. void onchange( [array, size_is(alen)] in nsiwifiaccesspoint accesspoints, in unsigned long alen ); parameters accesspoints an array of nsiwifiaccesspoint objects representing all currently-available wifi access points. alen the ...
...void onerror( in long error ); parameters error the nsresult value indicating the error that occurred. ...
AudioTrackList.onremovetrack - Web APIs
the audiotrack
list onremovetrack event handler is called when the removetrack event occurs, indicating that an audio track has been removed from the media element, and therefore also from the audiotrack
list. the event is passed into the event handler in the form of a trackevent object, whose track property identifies the track that was removed from the media element's audiotrack
list. note: you can also add a handler for the removetrack event using addevent
listener(). syntax audiotrack
list.onremovetrack = eventhandler; value set onremovetrack to a function that accepts as input a trackevent object which indicates in its track property which audio track has been removed from the media element. example this simple example just fetches the current number of audio tracks in the media ele...
...ample this simple example just fetches the current number of audio tracks in the media element whenever a track is removed from the media element. document.queryselector("my-video").audiotracks.onremovetrack = function(event) { mytrackcount = document.queryselector("my-video").audiotracks.length; }; the current number of audio tracks remaining in the media element is obtained from audiotrack
list property length. specifications specification status comment html living standardthe definition of 'audiotrack
list.onremovetrack' in that specification. living standard html5the definition of 'audiotrack
list.onremovetrack' in that specification. recommendation ...
DOMTokenList.add() - Web APIs
the add() method of the domtoken
list interface adds the given token to the
list. syntax token
list.add(token1[, token2[, ...tokenn]]); parameters tokenn a domstring representing the token (or tokens) to add to the token
list. return value undefined examples in the following example we retrieve the
list of classes set on a <span> element as a domtoken
list using element.class
list. we then add a new token to the
list, and write the
list into the <span>'s node.textcontent. ...
...token
list. return value undefined examples in the following example we retrieve the
list of classes set on a <span> element as a domtoken
list using element.class
list. we then add a new token to the
list, and write the
list into the <span>'s node.textcontent. first, the html: <span class="a b c"></span> now the javascript: let span = document.queryselector("span"); let classes = span.class
list; classes.add("d"); span.textcontent = classes; the output looks like this: you can add multiple tokens as well: span.class
list.add("d", "e", "f"); specifications specification status comment domthe definition of 'add()' in that specification. living standard initial definition ...
DOMTokenList.contains() - Web APIs
the contains() method of the domtoken
list interface returns a boolean — true if the underlying
list contains the given token, otherwise false. syntax token
list.contains(token); parameters token a domstring representing the token you want to check for the existance of in the
list. return value a boolean, which is true if the calling
list contains token, otherwise false. examples in the following example we retrieve the
list of classes set on a <span> element as a domtoken
list using element.class
list. we then test for the existence of "c" in the
list, and write the result into the <span>'s node.textcontent. ...
...en, otherwise false. examples in the following example we retrieve the
list of classes set on a <span> element as a domtoken
list using element.class
list. we then test for the existence of "c" in the
list, and write the result into the <span>'s node.textcontent. first, the html: <span class="a b c"></span> now the javascript: let span = document.queryselector("span"); let classes = span.class
list; let result = classes.contains("c"); if (result) { span.textcontent = "the class
list contains 'c'"; } else { span.textcontent = "the class
list does not contain 'c'"; } the output looks like this: specifications specification status comment domthe definition of 'contains()' in that specification. living standard initial definition ...
DOMTokenList.entries() - Web APIs
the domtoken
list.entries() method returns an iterator allowing you to go through all key/value pairs contained in this object. the values are domstring objects, each representing a single token. syntax token
list.entries(); return value returns an iterator. examples in the following example we retrieve the
list of classes set on a <span> element as a domtoken
list using element.class
list. we when retrieve an iterator containing the key/value pairs using entries(), then iterate through each one using a for...of loop, writing them to the <span>'s node.textcontent. ...
... living standard initial definition. ...
DOMTokenList.item() - Web APIs
the item() method of the domtoken
list interface returns an item in the
list by its index. syntax token
list.item(index) parameters index a domstring representing the index of the item you want to return. return value a domstring representing the returned item. it returns null if the number is greater than or equal to the length of the
list. examples in the following example we retrieve the
list of classes set on a <span> element as a domtoken
list using element.class
list. we then retrieve the last item in the
list using item(token
list.length - 1), and write it into the <span>'s node.textcontent. ...
...t. examples in the following example we retrieve the
list of classes set on a <span> element as a domtoken
list using element.class
list. we then retrieve the last item in the
list using item(token
list.length - 1), and write it into the <span>'s node.textcontent. first, the html: <span class="a b c"></span> now the javascript: let span = document.queryselector("span"); let classes = span.class
list; let item = classes.item(classes.length-1); span.textcontent = item; the output looks like this: specifications specification status comment domthe definition of 'item()' in that specification. living standard initial definition ...
DOMTokenList.keys() - Web APIs
the keys() method of the domtoken
list interface returns an iterator allowing to go through all keys contained in this object. the keys are of type unsigned integer. syntax token
list.keys(); parameters none. return value returns an iterator. examples in the following example we retrieve the
list of classes set on a <span> element as a domtoken
list using element.class
list. we when retrieve an iterator containing the keys using values(), then iterate through those keys using a for ... of loop, writing each one to the <span>'s node.textcontent. ...
...eve the
list of classes set on a <span> element as a domtoken
list using element.class
list. we when retrieve an iterator containing the keys using values(), then iterate through those keys using a for ... of loop, writing each one to the <span>'s node.textcontent. first, the html: <span class="a b c"></span> now the javascript: var span = document.queryselector("span"); var classes = span.class
list; var iterator = classes.keys(); for(var value of iterator) { span.textcontent += value + ' ++ '; } the output looks like this: specifications specification status comment domthe definition of 'keys() (as iterable<node>)' in that specification. living standard initial definition ...
DOMTokenList.values() - Web APIs
the values() method of the domtoken
list interface returns an iterator allowing developers to go through all values contained in the domtoken
list. the individual values are domstring objects. syntax token
list.values(); parameters none. return value returns an iterator. examples in the following example we retrieve the
list of classes set on a <span> element as a domtoken
list using element.class
list. we when retrieve an iterator containing the values using values(), then iterate through those values using a for ... of loop, writing each one to the <span>'s node.textcontent. ...
...the
list of classes set on a <span> element as a domtoken
list using element.class
list. we when retrieve an iterator containing the values using values(), then iterate through those values using a for ... of loop, writing each one to the <span>'s node.textcontent. first, the html: <span class="a b c"></span> now the javascript: var span = document.queryselector("span"); var classes = span.class
list; var iterator = classes.values(); for(var value of iterator) { span.textcontent += value + ' ++ '; } the output looks like this: specifications specification status comment domthe definition of 'values() (as iterable<node>)' in that specification. living standard initial definition ...
DataTransferItemList - Web APIs
the datatransferitem
list object is a
list of datatransferitem objects representing items being dragged. during a drag operation, each dragevent has a datatransfer property and that property is a datatransferitem
list. this interface has no constructor. properties datatransferitem
list.length read only an unsigned long that is the number of drag items in the
list. methods datatransferitem
list.add() adds an item (either a file object or a string) to the drag item
list and returns a datatransferitem object for the new item. datatransferitem
list.remove() removes the drag item from the
list at the given index. datatransferitem
list.clear() removes all of the drag items from the
list. datatransferitem
list.datatransferitem() getter that returns a datatransferitem at the given index. ...
...es all of the drag items from the
list. datatransferitem
list.datatransferitem() getter that returns a datatransferitem at the given index. example each of this interface's methods and properties has a reference page, and each reference page has an example of its usage. specifications specification status comment html living standardthe definition of 'datatransferitem
list' in that specification. living standard html 5.1the definition of 'datatransferitem
list' in that specification. recommendation not included in w3c html5 recommendation ...
Document.createTouchList() - Web APIs
note: before gecko 25.0, this method was defined on the documenttouch mixin. the document.createtouch
list() method creates and returns a new touch
list object. syntax var
list = documenttouch.createtouch
list([touch1 [, touch2 [, ...]]]); parameters touches zero or more touch objects. note: firefox also accepts an array of touch objects. return value
list a touch
list object containing the touch objects specified by the touches parameter. example this example illustrates using the document.createtouch
list() method to create touch
list objects. in following code snippet, some touch objects are created for the target element and those touch points are then used to create some touch
list objects. var target = document.getelementbyid("target"); // create some touch points var ...
...ts. in following code snippet, some touch objects are created for the target element and those touch points are then used to create some touch
list objects. var target = document.getelementbyid("target"); // create some touch points var touch1 = document.createtouch(window, target, 1, 15, 20, 35, 40); var touch2 = document.createtouch(window, target, 2, 25, 30, 45, 50); // create an empty touch
list objects var
list0 = document.createtouch
list(); // create a touch
list with only one touch object var
list1 = document.createtouch
list(touch1); // create a
list with two touch objects var
list2 = document.createtouch
list(touch1, touch2); specifications specification status comment touch eventsthe definition of 'document.createtouch
list()' in that specification. ...
MediaQueryList.onchange - Web APIs
the onchange property of the mediaquery
list interface is an event handler property representing a function that is invoked when the change event fires, i.e when the status of media query support changes. the event object is a mediaquery
listevent instance, which is recognised as a media
listquery instance in older browsers, for backwards compatibility purposes. syntax mediaquery
list.onchange = function() { ... ...
...ting a function that is invoked when the change event fires, i.e when the status of media query support changes. the event object is a mediaquery
listevent instance, which is recognised as a media
listquery instance in older browsers, for backwards compatibility purposes. syntax mediaquery
list.onchange = function() { ... ...
MediaQueryListEvent.matches - Web APIs
the matches read-only property of the mediaquery
listevent interface is a boolean that returns true if the document currently matches the media query
list, or false if not. syntax var matches = mediaquery
listevent.matches; value a boolean; returns true if the document currently matches the media query
list, false if not. examples var mql = window.matchmedia('(max-width: 600px)'); function screentest(e) { if (e.matches) { /* the viewport is 600 pixels wide or less */ para.textcontent = 'this is a narrow screen — less than 600px wide.'; document.body.style.backgroundcolor = 'red'; } else { /* the viewport is more than than 600 pixels wide */ para.textcontent = 'this is a wide screen — more than 600px wide.'; document.body.style.backgroundcolor = 'blue'; }...
... working draft initial definition ...
MediaQueryListEvent.media - Web APIs
the media read-only property of the mediaquery
listevent interface is a domstring representing a serialized media query. syntax var media = mediaquery
listevent.media; value a domstring representing a serialized media query. ...
... working draft initial definition ...
NodeList.item() - Web APIs
returns a node from a node
list by index. this method doesn't throw exceptions as long as you provide arguments. a value of null is returned if the index is out of range, and a typeerror is thrown if no argument is provided. syntax nodeitem = node
list.item(index) node
list is a node
list. this is usually obtained from another dom property or method, such as childnodes. index is the index of the node to be fetched. the index is zero-based. nodeitem is the indexth node in the node
list returned by the item method. ...
...ax nodeitem = node
list.item(index) node
list is a node
list. this is usually obtained from another dom property or method, such as childnodes. index is the index of the node to be fetched. the index is zero-based. nodeitem is the indexth node in the node
list returned by the item method. alternate syntax javascript also offers an array-like bracketed syntax for obtaining an item from a node
list by index: nodeitem = node
list[index] example var tables = document.getelementsbytagname("table"); var firsttable = tables.item(1); // or simply tables[1] - returns the second table in the dom specifications specification status comment domthe definition of 'node
list: item' in that specification. living standard ...
NodeList.length - Web APIs
the node
list.length property returns the number of items in a node
list. syntax numitems = node
list.length numitems is an integer value representing the number of items in a node
list. example the length property is often useful in dom programming. it's often used to test the length of a
list, to see if it exists at all. it's also commonly used as the iterator in a for loop, as in this example. ...
...ems is an integer value representing the number of items in a node
list. example the length property is often useful in dom programming. it's often used to test the length of a
list, to see if it exists at all. it's also commonly used as the iterator in a for loop, as in this example. // all the paragraphs in the document var items = document.getelementsbytagname("p"); // for each item in the
list, // append the entire element as a string of html var gross = ""; for (var i = 0; i < items.length; i++) { gross += items[i].innerhtml; } // gross is now all the html for the paragraphs specifications specification status comment domthe definition of 'node
list: length' in that specification. living standard ...
SpeechRecognitionResultList - Web APIs
the speechrecognitionresult
list interface of the web speech api represents a
list of speechrecognitionresult objects, or a single one if results are being captured in continuous mode. properties speechrecognitionresult
list.length read only returns the length of the "array" — the number of speechrecognitionresult objects in the
list. methods speechrecognitionresult
list.item a standard getter that allows speechrecognitionresult objects in the
list to be accessed via array syntax. examples this code is excerpted from our speech color changer example. recognition.onresult = function(event) { // the speechrecognitionevent results property returns a speechrecognitionresult
list object // the speechrecognitionresult
list object contains speechrecognitionresult objects. // it ...
...echrecognitionalternative at position 0. // we then return the transcript property of the speechrecognitionalternative object var color = event.results[0][0].transcript; diagnostic.textcontent = 'result received: ' + color + '.'; bg.style.backgroundcolor = color; } specifications specification status comment web speech apithe definition of 'speechrecognitionresult
list' in that specification. draft ...
StyleSheetList - Web APIs
it is an array-like object but can't be iterated over using array methods. however it can be iterated over in a standard for loop over its indices, or converted to an array. examples get document stylesheet objects with for loop for (let i = 0; i < document.stylesheets.length; i++) { let stylesheet = document.stylesheets[i]; } get all css rules for the document using array methods const allcss = [...document.stylesheets] .map(stylesheet => { try { return [...stylesheet.cssrules] .map(rule => rule.csstext) .join(''); } catch (e) { console.log('access to stylesheet %s is denied. ...
... working draft ...
TextTrackList.onchange - Web APIs
the texttrack
list property onchange is an event handler which is called when the change event occurs, indicating that a change has occurred on a texttrack in the videotrack
list. note: you can also add a handler for the change event using addevent
listener(). syntax texttrack
list.onchange = eventhandler; example this snippet establishes a handler for the change event that looks at each of the tracks in the
list, calling a function to update the state of a user interface control that indicates the current state of the track. var track
list = document.queryselector("video, audio").texttracks; track
list.onchange = function(event) { .... ...
... the tracks in the
list, calling a function to update the state of a user interface control that indicates the current state of the track. var track
list = document.queryselector("video, audio").texttracks; track
list.onchange = function(event) { .... /* do something */ }; specifications specification status comment html living standardthe definition of 'texttrack
list: onchange' in that specification. living standard ...
TextTrackList.onremovetrack - Web APIs
the texttrack
list onremovetrack event handler is called when the removetrack event occurs, indicating that a text track has been removed from the media element, and therefore also from the texttrack
list. the event is passed into the event handler in the form of a trackevent object, whose track property identifies the track that was removed from the media element's texttrack
list. note: you can also add a handler for the removetrack event using addevent
listener(). syntax texttrack
list.onremovetrack = eventhandler; value set onremovetrack to a function that accepts as input a trackevent object which indicates in its track property which text track has been removed from the media element. example this simple example just fetches the current number of text tracks in the first media eleme...
...ample just fetches the current number of text tracks in the first media element whenever a track is removed from the media element. document.queryselectorall("video, audio")[0].texttracks.onremovetrack = function(event) { mytrackcount = document.queryselectorall("video, audio")[0].texttracks.length; }; the current number of text tracks remaining in the media element is obtained from texttrack
list property length. specifications specification status comment html living standardthe definition of 'texttrack
list: onremovetrack' in that specification. living standard ...
VideoTrackList.onremovetrack - Web APIs
the videotrack
list onremovetrack event handler is called when the removetrack event occurs, indicating that a video track has been removed from the media element, and therefore also from the videotrack
list. the event is passed into the event handler in the form of a trackevent object, whose track property identifies the track that was removed from the media element's videotrack
list. note: you can also add a handler for the removetrack event using addevent
listener(). syntax videotrack
list.onremovetrack = eventhandler; value set onremovetrack to a function that accepts as input a trackevent object which indicates in its track property which video track has been removed from the media element. example this simple example just fetches the current number of video tracks in the media elem...
...ample this simple example just fetches the current number of video tracks in the media element whenever a track is removed from the media element. document.queryselector("my-video").videotracks.onremovetrack = function(event) { mytrackcount = document.queryselector("my-video").videotracks.length; }; the current number of video tracks remaining in the media element is obtained from videotrack
list property length. specifications specification status comment html living standardthe definition of 'videotrack
list: onremovetrack' in that specification. living standard ...
mssitemodejumplistitemremoved - Web APIs
non-standard this feature is non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. the mssitemodejump
listitemremoved event occurs when mssitemodeshowjump
list is called and an item has been removed from a jump
list by the user. ...
...ibilities between implementations and the behavior may change in the future. the mssitemodejump
listitemremoved event occurs when mssitemodeshowjump
list is called and an item has been removed from a jump
list by the user. this proprietary method is specific to internet explorer and microsoft edge. syntax event property object.oncandidatewindowhide = handler; addevent
listener method object.addevent
listener("mssitemodejump
listitemremoved", handler, usecapture) general info synchronous no bubbles no cancelable no note this event is raised once for every item that has been removed since the last time mssitemodeshowjump
list was called. this event is not triggered if mssitemodeclearjump
list has been called. parameters pevtobj [in] type: ihtm...
CSS Lists - CSS: Cascading Style Sheets
css
lists is a module of css that defines how
lists can be laid out and styled. reference properties
list-style-image
list-style-type
list-style-position
list-style guides consistent
list indentation explains how to achieve consistent
list indentation across different browsers. using css counters explains how to use the css counter properties to control
list counters. ...
...and styled. reference properties
list-style-image
list-style-type
list-style-position
list-style guides consistent
list indentation explains how to achieve consistent
list indentation across different browsers. using css counters explains how to use the css counter properties to control
list counters. ...
<display-listitem> - CSS: Cascading Style Sheets
the
list-item keyword causes the element to generate a ::marker pseudo-element with the content specified by its
list-style properties (for example a bullet point) together with a principal box of the specified type for its own contents. syntax a single value of
list-item will cause the element to behave like a
list item. this can be used together with
list-style-type and
list-style-position.
list-item can also be combined with any <display-outside> keyword and the flow or flow-root <display-inside> keywords. note: in browsers that support the two-value syntax, if no inner value is specified it will default to flow. if no outer value is specified, the principal box will have an outer display type of block. ...
...
list-style-type and
list-style-position.
list-item can also be combined with any <display-outside> keyword and the flow or flow-root <display-inside> keywords. note: in browsers that support the two-value syntax, if no inner value is specified it will default to flow. if no outer value is specified, the principal box will have an outer display type of block. examples html <div class="fake-
list">i will display as a
list item</div> css .fake-
list { display:
list-item;
list-style-position: inside; } result specifications specification status css display module level 3the definition of 'display-
listitem' in that specification. candidate recommendation ...
SyntaxError: missing } after property list - JavaScript
might be in fact a missing curly bracket, but could also be a missing comma, for example. also check if any closing curly brackets or parenthesis are in the correct order. indenting or formatting the code a bit nicer might also help you to see through the jungle. ...
...might be in fact a missing curly bracket, but could also be a missing comma, for example. also check if any closing curly brackets or parenthesis are in the correct order. indenting or formatting the code a bit nicer might also help you to see through the jungle. ...
SyntaxError: missing ) after argument list - JavaScript
the javascript exception "missing ) after argument
list" occurs when there is an error with how a function is called. this might be a typo, a missing operator, or an unescaped string. message syntaxerror: expected ')' (edge) syntaxerror: missing ) after argument
list (firefox) error type syntaxerror. what went wrong? there is an error with how a function is called. this might be a typo, a missing operator, or an unescaped string, for example. examples because there is no "+" operator to concatenate the string, javascript expects the argument for the log function to be just "pi: ". in that case, it should be terminated by a closing parenthesis. console.log('pi: ' math.pi); // syntaxerror: missing ) after argument
list you can correct the log call by adding the "+" operator: consol...
...o be just "pi: ". in that case, it should be terminated by a closing parenthesis. console.log('pi: ' math.pi); // syntaxerror: missing ) after argument
list you can correct the log call by adding the "+" operator: console.log('pi: ' + math.pi); // "pi: 3.141592653589793" unterminated strings console.log('"java" + "script" = \"' + 'java' + 'script\"); // syntaxerror: missing ) after argument
list here javascript thinks that you meant to have ); inside the string and ignores it, and it ends up not knowing that you meant the ); to end the function console.log. to fix this, we could put a' after the "script" string: console.log('"java" + "script" = \"' + 'java' + 'script\"'); // '"java" + "script" = "javascript"' ...
Intl.ListFormat.supportedLocalesOf() - JavaScript
for the general form of the locales argument, see the intl page. options optional. an object that may have the following property: localematcher the locale matching algorithm to use. possible values are "lookup" and "best fit"; the default is "best fit". for information about this option, see the intl page. ...
... is unlikely to be supported. note the specification of the "lookup" algorithm here — a "best fit" matcher might decide that indonesian is an adequate match for balinese since most balinese speakers also understand indonesian, and therefore return the balinese language tag as well. const locales = ['ban', 'id-u-co-pinyin', 'de-id']; const options = { localematcher: 'lookup' }; console.log(intl.
listformat.supportedlocalesof(locales, options).join(', ')); // → "id-u-co-pinyin, de-id" specifications specification intl.
listformatthe definition of 'supportedlocalesof()' in that specification. ...
Listening for Load and Unload - Archive of obsolete content
grade downgrade exports.onunload() if your add-on exports a function called onunload(), that function will be called when the add-on is unloaded. exports.onunload = function (reason) {}; reason reason is one of the following strings describing the reason your add-on was unloaded: uninstall disable shutdown upgrade downgrade if your add-on is disabled, then uninstalled, your onunload
listener will only be called once, with the disable reason. this happens because disabling an add-on also disables its onunload
listeners, so there is no
listener remaining when the add-on is uninstalled. for more, see bug 627432, in particular comment 12 on that bug. ...
Index - Archive of obsolete content
sdk, add-ons, extensions, reference provides access to button, toolbar, and sidebar ui objects. 64 url add-on sdk construct, validate, and parse urls. 66 widget add-on sdk create a simple user interface for an add-on in firefox's add-on bar. 67 windows add-on sdk enumerate and examine open browser windows, open new windows, and
listen for window events. 68 low-level apis no summary! 69 /loader create commonjs module loaders. 70 chrome the chrome module gives an add-on sdk add-on access to the components object, which in turn gives it access to a large set of privileged low-level firefox apis. 71 console/plain-text constructor for a consol...
...ality. 96 places/bookmarks create, modify, and retrieve bookmarks. 97 places/favicon helper functions for working with favicons. 98 places/history access the user's browsing history. 99 platform/xpcom implement xpcom objects, factories, and services. 100 preferences/event-target add-on sdk
listen to changes to the preferences system in firefox. 101 preferences/service add-on sdk, jetpack, sdk access the preferences system in firefox. 102 remote/child module, reference, sdk enables an sdk module loaded into a child process to access web content in the child process and communicate with modules in the main process. 103 remote/parent ...
...be added to a designated area of the firefox user interface. 121 ui/id create ui component ids. 122 ui/sidebar enables you to create sidebars. 123 ui/toolbar add a toolbar to the firefox user interface. 124 util/array helper functions for working with arrays. 125 util/collection a simple
list-like class and utilities for using it. 126 util/deprecate functions to deprecate code. 127 util/
list building blocks for composing
lists. 128 util/match-pattern test strings containing urls against simple patterns. 129 util/object functions for working with objects. 130 util/uuid generate...
...And 81 more matches
Index
ts.manager xpcom:language bindings, xpconnect components.manager is a convenience reflection of the global native component manager service. the scriptable methods on the nsicomponentmanager interface can be called directly on this object. 27 components.results xpcom:language bindings, xpconnect components.results is a read-only object whose properties are the names
listed as the first parameters of the macros in js/xpconnect/src/xpc.msg (also at table of errors), with the value of each corresponding to that constant's value. 28 components.returncode xpcom:language bindings, xpconnect no summary! 29 components.stack xpcom:language bindings, xpconnect components.stack is a read only property of type nsistackframe (idl defi...
...ubsequent chapters, we can begin to work on the example weblock component functionality itself. 105 finishing the component xpcom at this point you have created most of the infrastructure of the component. the component will be recognized by xpcom and registered with the category manager so that it starts up when xpcom initializes. when the component starts up, it populates a
list of urls read in from a file stored next to the gecko binary on the local system. 106 packaging weblock xpcom in this final part of the tutorial, we'll put all of the pieces of the web locking component - the library itself, the type library, the header file, and the user interface resources - into a package that can be installed on other systems. the first section, component ...
... example, the introduction includes a discussion of components and what they are, and the first chapter - in which you compile the basic code and register it with mozilla - prompts a discussion of the relationship between components and modules, of xpcom interfaces, and of the registration process in general. 108 resources guide, xpcom this last section of the book provides a
list of resources referred to in the tutorial and other links that may be useful to the gecko developer. 109 setting up the gecko sdk needsupdate, tutorial, xpcom this chapter provides basic setup information for the gecko software development kit (sdk) used to build the weblock component in this tutorial. the following four sections tell the developer how to download and organize...
...And 76 more matches
How to build custom form controls - Learn web development
the tabindex attribute is what allows the user to focus the control. we'll see later that it's better to set it through javascript. --> <div class="select" tabindex="0"> <!-- this container will be used to display the current value of the control --> <span class="value">cherry</span> <!-- this container will contain all the options available for our control. ...
...control. we'll see later that it's better to set it through javascript. --> <div class="select" tabindex="0"> <!-- this container will be used to display the current value of the control --> <span class="value">cherry</span> <!-- this container will contain all the options available for our control. because it's a
list, it makes sense to use the ul element. ...
...portant to make sure that we don't bind our css and javascript to a strong html structure, so that we can make implementation changes later without breaking code that uses the control. for example, what if you wish to implement the equivalent of the <optgroup> element later on? class names, however, provide no semantic value. in this current state, the screen reader user only "sees" an unordered
list. we will add aria semantics in a bit. creating the look and feel using css now that we have a structure, we can start designing our control. the whole point of building this custom control is to be able to style it exactly how we want. to that end, we will split our css work into two parts: the first part will be the css rules absolutely necessary to make our control behave like a <select> elem...
...And 63 more matches
Chapter 3: Introduction to XUL—How to build a more intuitive UI - Archive of obsolete content
based content also used xul. for example, there is the mozilla amazon browser, which helps with shopping at amazon, and the presentation method in xul, a tool for writing and displaying presentations to try out the code samples in this chapter, save them as text files with .xul extensions and drag and drop them into the firefox browser window. fixme: explain how setting this option and use next
listings if we want to run firefox displaying none of its gui and only the contents of a certain xul file, we can launch firefox and set the option: -chrome file_url.xul another way, as shown in
listing 1, is to use the window.opendialog() method, which can be used only within a xul window. this is used by extensions to open a separate window. window.opendialog('another.xul', '_blank','chrome,all,d...
...nt to run firefox displaying none of its gui and only the contents of a certain xul file, we can launch firefox and set the option: -chrome file_url.xul another way, as shown in
listing 1, is to use the window.opendialog() method, which can be used only within a xul window. this is used by extensions to open a separate window. window.opendialog('another.xul', '_blank','chrome,all,dialog=no');
listing 1: opening a window without the firefox gui xul as an xml application
listing 2 shows an example of a gui definition file marked up in xul (a "xul document"). the root element in xul is generally the "window" element. the namespace uri is : http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul if the character encoding is utf-8, both the encoding specifier and the xml declaration ...
...tity references, the xml document's contents are modularized; combined with other xml-related technologies, such as dom, xlink, or xslt, you can use it for a number of different applications. <?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet href="chrome://global/skin/"?> <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <!-- contents go here. ...
...And 56 more matches
Chapter 5: Let's build a Firefox extension - Archive of obsolete content
outputs javascript errors to the error console. true javascript.options.strict (present in firefox 3.5+) enforces strict error output from javascript true table 1: preferences to set for developing extensions to make these changes, start your development profile, type about:config into firefox’s location bar and open the preferences window; find the preferences
listed in table 1 and double-click on them to set them accordingly. some of these preferences do not exist—to create them, right-click, select “new>boolean”, and type in the name and set the value accordingly. install the dom inspector the dom inspector is an extension that lets you examine html and xul dom tree structures, javascript objects and css properties, etc. this is not required for d...
...overlays. content/overlay.xul xul file that will be overlaid on the firefox browser window, adding buttons, menu items, etc. content/clock.xul content/clock.js the xul to display a clock in the window, and the javascript to control its operation (these files will be used in phase 2). create install manifest fill in the install.rdf file as shown in
listing 1.
listing 1: content for install.rdf <?xml version="1.0"?> <rdf xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"> <description about="urn:mozilla:install-manifest"> <!-- unique id for extension. can be in e-mail address format or guid format --> <em:id>helloworld@xuldev.org</em:id> <!-- indicates that this add-on is an extensio...
...here, helloworld is a package name, and content/ is a relative path to the folder where the...
...And 50 more matches
Chapter 4: Using XPCOM—Implementing advanced processes - Archive of obsolete content
and was originally published in japanese for the firefox developers conference summer 2007. mr. shimoda is a co-author of firefox 3 hacks (o'reilly japan, 2008). this chapter explains how to use xpcom to implement advanced processes using only javascript. introduction javascript lacks functions for opening files and character-code conversion, among other things. ...
...n to the corba idl. you can perform a full-text search of the firefox source code in mozilla cross-reference using character strings, filenames, etc as search keys. if you’re having trouble with any of the details of the interface, it is helpful to search on the source code for usage examples within firefox. note: to look at the firefox 3 source code, choose "firefox 3" in the starting points
list. for firefox 3.5 choose "mozilla 1.9.1." for the current development trunk of firefox, choose "mozilla central" and for thunderbird, choose "comm. central". calling xpcom from xpconnect use the xpconnect technology to use xpcom in javascript.
listing 1 shows how you can use xpconnect to acquire references to xpcom services and create new xpcom objects. each component is identified with a con...
...ipulate the user's bookmarks. those should be accessed with getservice(). for other components, you can create as many instances as you need. for instance, this is the case for files (nsilocalfile). those are created with createinstance(). it's important to know whether a component should be created with getservice() or createinstance(), because using one instead of the other can cause problems. ...
...And 44 more matches
nsIMsgFolder
to interact with folders in thunderbird. this page is out of date. check //github.com/realityripple/uxp/blob/master/mailnews/base/public/nsimsgfolder.idl for the newer methods (esp. isspecialfolder and such). ...
...ith folders in thunderbird. this page is out of date. check //github.com/realityripple/uxp/blob/master/mailnews/base/public/nsimsgfolder.idl for the newer methods (esp. isspecialfolder and such). ...
...eck //github.com/realityripple/uxp/blob/master/mailnews/base/public/nsimsgfolder.idl for the newer methods (esp. isspecialfolder and such). ...
...And 42 more matches
AddonManager
urce://gre/modules/addonmanager.jsm"); method overview promise? getinstallforurl(in string url, in installcallback? callback, in string mimetype, in string hash, in string name, in string iconurl, in string version, in nsiloadgroup loadgroup) promise? getinstallforfile(in nsifile file, in installcallback? callback, in string mimetype) promise? getallinstalls(in install
listcallback? callback) promise? getinstallsbytypes(in string types[], in install
listcallback? callback) void installaddonsfromwebpage(in string mimetype, in nsidomwindow source, in nsiuri uri, in addoninstall installs[]) void addinstall
listener(in install
listener
listener) void removeinstall
listener(in install
listener
listener) promise? getalladdons(in add...
...llback? callback) promise? getinstallsbytypes(in string types[], in install
listcallback? callback) void installaddonsfromwebpage(in string mimetype, in nsidomwindow source, in nsiuri uri, in addoninstall installs[]) void addinstall
listener(in install
listener
listener) void removeinstall
listener(in install
listener
listener) promise? getalladdons(in addon
listcallback? callback) promise? getaddonbyid(in string id, in addoncallback? callback) promise? getaddonbysyncguid(in string id, in addoncallback? callback) promise? getaddonsbyids(in string ids[], in addon
listcallback? callback) promise? getaddonsbytypes(in string types[], in addon
listcallback? callback) promise? getaddonswithoperationsbytypes(in string ...
...k) promise? getaddonbyid(in string id, in addoncallback? callback) promise? getaddonbysyncguid(in string id, in addoncallback? callback) promise? getaddonsbyids(in string ids[], in addon
listcallback? callback) promise? getaddonsbytypes(in string types[], in addon
listcallback? callback) promise? getaddonswithoperationsbytypes(in string types[], in addon
listcallback? ...
...And 40 more matches
Index - Archive of obsolete content
4 lastpage xul attributes, xul reference no summary! 175 left xul attributes, xul reference no summary! 176 lightweightthemes lightweight themes, xul attributes, xul reference no summary! 177 lightweightthemesfooter no summary! 178 linkedpanel xul attributes, xul reference no summary! 179
listcell.type xul attributes, xul reference no summary! 180
listitem.type xul attributes, xul reference no summary! 181 matchcaseaccesskey no summary! 182 max xul attributes, xul reference no summary! 183 maxheight xul attributes, xul reference no summary! 184 maxlength xul attributes, xul ref...
...ence no summary! 215 observes xul attributes, xul reference no summary! 216 onbeforeaccept xul attributes, xul reference no summary! 217 onbookmarkgroup xul attributes, xul reference no summary! 218 onchange needshelp, reference, référence(2), xul attributes, xul reference an onchange attribute is an event
listener to the object for the event change. a change event is fired in different ways for different xul input elements as
listed below: 219 onclick xul attributes, xul reference no summary! 220 onclosetab xul attributes, xul reference no summary! 221 oncommand xul attributes, xul reference no summary! 222 oncommandupdate xu...
...or absence of controls in the main window is not hardwired into the application, but loaded from a separate ui description. in fact, most of mozilla's windows (and dialogs) will be described using this mechanism. xul (pronounced "zool," as if that spelling helped any, and short for "xml user interface language") is our name for the language in which these ui descriptions are built. 439
list of commands xul the following
lists commands which might be usable by <command> or command dispatchers/controllers. 440 menus add-ons, extensions, needscontent, reference, référence(2), xul an extension will often wish to attach a new command to a menu. to do this, the new menu will need to be laid over the existing menu which the item should be displayed upon. fo...
...And 37 more matches
nsIMsgDatabase
chesize(in unsigned long size); nsimsgdbhdr getmsghdrforkey(in nsmsgkey key); nsimsgdbhdr getmsghdrformessageid(in string messageid); boolean containskey(in nsmsgkey key); nsimsgdbhdr createnewhdr(in nsmsgkey key); void addnewhdrtodb(in nsimsgdbhdr newhdr, in boolean notify); nsimsgdbhdr copyhdrfromexistinghdr(in nsmsgkey key, in nsimsgdbhdr existinghdr, in boolean addhdrtodb); void
listallkeys(in nsmsgkeyarrayref outputkeys); native code only! nsisimpleenumerator enumeratemessages(); nsisimpleenumerator enumeratethreads(); void synccounts; nsimsgthread getthreadcontainingmsghdr(in nsimsgdbhdr msghdr); void markhdrread(in nsimsgdbhdr msghdr, in boolean bread, in nsidbchange
listener instigator); void markhdrreplied(in nsimsgdbhdr msghdr, in boolean breplied, in nsidbch...
...eys(in nsmsgkeyarrayref outputkeys); native code only! ...
...; nsisimpleenumerator enumeratethreads(); void synccounts; nsimsgthread getthreadcontainingmsghdr(in nsimsgdbhdr msghdr); void markhdrread(in nsimsgdbhdr msghdr, in boolean bread, in nsidbchange
listener instigator); void markhdrreplied(in nsimsgdbhdr msghdr, in boolean breplied, in nsidbchange
listener instigator); void markhdrmarked(in nsimsgdbhdr msghdr, in boolean mark,in nsidbchange
listener instigator); void markmdnneeded(in nsmsgkey key, in boolean bneeded,in nsidbchange
listener instigator); boolean ismdnneeded(in nsmsgkey key); void markmdnsent(in nsmsgkey key, in boolean bneeded, in nsidbchange
listener instigator); boolean ismdnsent(in nsmsgkey key); void markread(in nsmsgkey key, in boolean bread, in nsidbchange
listener instigator); void markreplied(in nsmsgkey k...
...And 34 more matches
XUL Questions and Answers - Archive of obsolete content
development to allow servers to open up their site for cross-site access, but that's not yet done. hidechrome="true" doesn’t work on a mac? unfortunately, no simple solution to this was posted. a workaround is to open the content in a new window using "window.open" and send titlebar=”no” as one of the flags in the 3rd argument. ...
...rome="true" doesn’t work on a mac? ...
...nd titlebar=”no” as one of the flags in the 3rd argument. is it possible to have checkbox support for multi column
lists? the current issue is a person exploring if it is possible to have checkbox support for multi column
lists. ...
...And 32 more matches
Address Book examples
both of these functions may raise an ns_error_not_implemented exception if the collection has not implemented that function. this is currently true in the case of ldap, but may be true in other cases as well. how do i search for multiple contacts? formulate a boolean search string (see nsiabcard for built-in property names): var searchquery = "(or(primaryemail,bw,@v)(nickname,bw,@v)(and(ismail
list,=,true)(notes,bw,@v)))"; searchquery = searchquery.replace(/@v/g, encodeuricomponent("mystr") the search queries use lisp syntax with operators enumerated in nsabquerystringtoexpression.cpp. assuming you wish to search across multiple directories: let abmanager = components.classes["@mozilla.org/abmanager;1"] .getservice(components.interfaces.nsiabmanager); let allad...
... do with normal properties: card.setproperty("random1", "xyz"); card.setproperty("random2", "foo"); ... my value = card.getproperty("random1"); note: local (mork) address books are currently the only built-in type of address book that supports saving of non-built-in properties. however, outlook directories are the only other built-in write capable directories. ...
...s: card.setproperty("random1", "xyz"); card.setproperty("random2", "foo"); ... my value = card.getproperty("random1"); note: local (mork) address books are currently the only built-in type of address book that supports saving of non-built-in properties. however, outlook directories are the only other built-in write capable directories. ...
...And 30 more matches
nsIMsgMessageService
objects that implements nsimsgmessageservice give the user top level routines related to messages like copying, displaying, attachment's manipulation, printing, streaming the message content to eml format string, etc. ...
... objects that implements nsimsgmessageservice give the user top level routines related to messages like copying, displaying, attachment's manipulation, printing, streaming the message content to eml format string, etc. ...
... objects that implements nsimsgmessageservice give the user top level routines related to messages like copying, displaying, attachment's manipulation, printing, streaming the message content to eml format string, etc. ...
...And 29 more matches
Using Web Workers - Web APIs
any global objects from each script may then be used by the worker. if the script can't be loaded, network_error is thrown, and subsequent code will not be executed. previously executed code (including code deferred using window.settimeout()) will still be functional though. function declarations after the importscripts() method are also kept, since these are always eval...
...ct — an explicit port is opened that the scripts can use to communicate with the worker (this is done implicitly in the case of dedicated workers). the port connection needs to be started either implicitly by use of the onmessage event handler or explicitly with the start() method before any messages can be posted. calling start() is only needed if the message event is wired up via the addevent
listener() method. note: when using the start() method to open the port connection, it needs to be called from both the parent thread and the worker thread if two-way communication is needed. sending messages to and from a shared worker now messages can be sent to the worker as before, but the postmessage() method has to be invoked through the port object (again, you'll see similar constructs in ...
...on can't — like circular references. 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 28 more matches
WebRequest.jsm
you can use this api to implement a content policy in an add-on (for example, an ad or script blocker), as you could using nsicontentpolicy. more generally, you can also use this api instead of http request observers. you can use webrequest.jsm in either the chrome or content processes. the webrequest api is modeled on chrome's webrequest extension api, which makes it easier to write cross-browser add-on code. ...
...it takes one mandatory argument and two optional arguments, as detailed below. name type description callback function the callback argument is a function to be called when the event is triggered. it's passed a...
...it takes one mandatory argument and two optional arguments, as detailed below. name type description callback function the callback argument is a function to be called when the event is triggered. it's passed an object whose structure will vary depending on the e...
...And 26 more matches
NSS functions
other sources of information: the nss_reference documents the functions most commonly used by applications to support ssl. ...
... other sources of information: the nss_reference documents the functions most commonly used by applications to support ssl. ...
... is a composite page. section headings are links to the individual pages where you can edit them. keywords: deprecated - function should no longer be used. updated - function has new arguments such as new flag or addition to structure. ssl functions the public functions
listed here are used to configure sockets for communication via the ssl and tls protocols. ...
...And 26 more matches
Linear-gradient Generator - CSS: Cascading Style Sheets
position: relative; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; user-select: none; } .ui-dropdown:hover { cursor: pointer; background-color: #208b20; } /* dropdown select button */ .ui-dropdown-select { padding: 0 0.75em; color: #fff; line-height: 2em; } /* dropdown
list */ .ui-dropdown-
list { width: 100%; height: 150px; max-height: 150px; margin: 0; padding: 0 0.3em; border: 1px solid #3490d2; border-color: #208b20; background: #666; background-color: #eef1f5; color: #000; position: absolute; top: 100%; left: 0; z-index: 100; overflow: hidden; transition: all 0.3s; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: b...
...idth: 100%; height: 150px; max-height: 150px; margin: 0; padding: 0 0.3em; border: 1px solid #3490d2; border-color: #208b20; background: #666; background-color: #eef1f5; color: #000; position: absolute; top: 100%; left: 0; z-index: 100; overflow: hidden; transition: all 0.3s; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } .ui-dropdown-
list:hover { overflow: auto; } .ui-dropdown-
list[data-hidden='true'] { height: 0 !important; opacity: 0; visibility: hidden; } .ui-dropdown[data-position='left'] .ui-dropdown-
list { left: -100%; top: 0; } .ui-dropdown[data-position='right'] .ui-dropdown-
list { left: 100%; top: 0; } .ui-dropdown-
list > div { width: 80%; height: 1.6em; margin: 0.3em 0; padding: 0.3em 10%; line-height: 1...
...to; } .ui-dropdown-
list[data-hidden='true'] { height: 0 !important; opacity: 0; visibility: hidden; } .ui-dropdown[data-position='left'] .ui-dropdown-
list { left: -100%; top: 0; } .ui-dropdown[data-position='right'] .ui-dropdown-
list { left: 100%; top: 0; } .ui-dropdown-
list > div { width: 80%; height: 1.6em; margin: 0.3em 0; padding: 0.3em 10%; line-height: 1.6em; } .ui-dropdown-
list > div:hover { background: #3490d2; color:#fff; border-radius: 2px; cursor: pointer; } /* * color picker tool */ body { width: 100%; height: 100%; margin: 0 auto; font-family: "segoe ui", arial, helvetica, sans-serif; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; user-select: none; } body[data-dragging="true"] { } /** * resize handle */ .resize-ha...
...And 26 more matches
HTML text fundamentals - Learn web development
previous overview: introduction to html next one of html's main jobs is to give text structure and meaning (also known as semantics) so that a browser can display it correctly. this article explains the way html can be used to structure a page of text by adding headings and paragraphs, emphasizing words, creating
lists, and more. prerequisites: basic html familiarity, as covered in getting started with html. objective: learn how to mark up a basic page of text to give it structure and meaning—including paragraphs, headings,
lists, emphasis, and quotations. the basics: headings and paragraphs most structured text consists of headings and paragraphs, whether you are reading a story, a newspaper, a college textbook, a magazine, etc. structured conte...
...y can't see anything useful within a few seconds, they'll likely get frustrated and go somewhere else. search engines indexing your page consider the contents of headings as important keywords for influencing the page's search rankings. without headings, your page will perform poorly in terms of seo (search engine optimization). ...
... to style content with css, or make it do interesting things with javascript, you need to have elements wrapping the relevant content, so css/javascript can effectively target it. we therefore need to give our content structural markup. ...
...And 25 more matches
ui/frame - Archive of obsolete content
pt to the add-on, use window.parent.postmessage(). this takes two arguments, the message itself and a target origin. if the frame script initiates the conversation, you need to specify "*" as the origin: window.parent.postmessage("ping", "*"); if the frame script has received a message from the add-on already, it can use the origin property of the event object passed to the message hander: //
listen for messages from the add-on, and send a reply window.addevent
listener("message", function(event) { event.source.postmessage("pong", event.origin) }, false); this frame script
listens to change events on the "city-selector" <select> element, and sends a message to the add-on containing the value for the newly selected element. // city-info.js var cityselector = window.document.getelementbyi...
...the data property of the event is the message payload. ...
...the data property of the event is the message payload. ...
...And 24 more matches
Message manager overview
ager in the chrome process. this operates on all frames, in all content tabs. if you load a frame script using the global frame message manager, the script gets loaded separately into every open tab: three times, in the diagram above. ...
...en delivered to any frame scripts that are
listening for it. ...
... frame scripts that are
listening for it. ...
...And 24 more matches
Back to the Server: Server-Side JavaScript On The Rise - Archive of obsolete content
ng a mysql database for some employee contact information. it is assumed that you have already downloaded, extracted, and consumed the necessary documentation to get up and running with some basic rhino scripts. if you don’t already have it, you’ll need to also download the jdbc driver for mysql, extract the class files, and include the path in your classpath environment variable. ...
...med the necessary documentation to get up and running with some basic rhino scripts. if you don’t already have it, you’ll need to also download the jdbc driver for mysql, extract the class files, and include the path in your classpath environment variable. the code in
listing 1 is a sample javascript script which incorporates java classes to handle the database query. ...
...cluding all the classes in the java.sql namespace in the script. the appropriate database driver for mysql is loaded and the connection string to a database named rhino on my local machine is configured using the user account urhino with the password of prhino. the sql statement is prepared, executed, and printed with the help of the metadata obtained from the resultset. ...
...And 23 more matches
NSS tools : modutil
this documentation is still work in progress. please contribute to the initial review in mozilla nss bug 836477[1] description the security module database tool, modutil, is a command-line utility for managing pkcs #11 module information both within secmod.db files and within hardware tokens. modutil can add and delete pkcs #11 modules, change passwords on security databases, set defaults,
list module contents, enable or disable slots, enable or disable fips 140-2 compliance, and assign default providers for cryptographic operations. this tool can also create certificate, key, and module security database files. the tasks associated with security module database management are part of a process that typically also involves managing key databases and certificate databases. option...
...to be installed, the module's name, the mechanism flags, and the cipher flags, as well as any files to be installed on the target machine, including the pkcs #11 module library file and other files such as documentation. this is covered in the jar installation file section in the man page, which details the special script needed to perform an installation through a server or with modutil. -
list [modulename] display basic information about the contents of the secmod.db file. specifying a modulename displays detailed information about a particular module and its slots and tokens. -rawadd add the module spec string to the secmod.db database. -raw
list display the module specs for a specified module or for all loadable modules. -undefault modulename specify the security mechanisms ...
...s for a specified module or for all loadable modules. -undefault modulename specify the security mechanisms for which the named module will not be a default provider. the security mechanisms are specified with the -mechanisms argument. arguments module give the security module to access. modulespec give the security module spec to load into the security database. -ciphers cipher-enable-
list enable specific ciphers in a module that is being added to the database. the cipher-enable-
list is a colon-delimited
list of cipher names. enclose this
list in quotation marks if it contains spaces. -dbdir [sql:]directory specify the database directory in which to access or create security module database files. modutil supports two types of databases: the legacy security databases (cert...
...And 23 more matches
Starting WebLock
as the string "xpcom-shutdown". if your object would like to register for this or other events, it first must implement the nsiobserver interface. once you do this, the observer service implementing nsiobserverservice can notify your object of registered events by means of this interface, as in the figure below. the observer interfaces the above figure shows the observer service maintaining a
list of all registered nsiobserver objects. when the notification is made, the nsiobserverservice broadcasts the notification from the caller of the notifyobserver() to the nsiobserver object's observe() method. this is a very useful decoupling of different objects. the nsiobserver is a generic interface for passing messages between two or more objects without defining a specific frozen interface, and...
.... but weblock needs to be instantiated and added to the observer service automatically, which also implies some sort of persistent data (after all, we want to have the component start up every time the application does). this is where a new service that manages sets of related data comes in handy. this service, the nsicategoryservice, is what xpcom and gecko embedding applications use to persist
lists of nsiobserver components that want to have startup notification. the nsicategoryservice maintains sets of name-value pairs like the one below. the category manager every category is identified by a string that represents the name of the category. each category contains a set of name-value pairs. for example, you might have a category named "important people" in which the name-value pairs w...
...ng &previous); if (previous) nsmemory::free(previous); // free the memory the replaced value might have used the unregistration, which should occur in the unregistration callback, looks like this: rv = catman->deletecategoryentry("xpcom-startup", "weblock", pr_true); // persist a complete code
listing for registering weblock as a startup observer follows: #define mozilla_strict_api #include "nsigenericfactory.h" #include "nscomptr.h" #include "nsxpcom.h" #include "nsiservicemanager.h" #include "nsicategorymanager.h" #include "nsmemory.h" #include "nsiobserver.h" #include "nsembedstring.h" #define weblock_cid \ { 0x777f7150, 0x4a2b, 0x4301, \ { 0xad, 0x10, 0x5e, 0xab, 0x25, 0xb3, 0x22...
...And 23 more matches
Border-image generator - CSS: Cascading Style Sheets
; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; user-select: none; } .ui-dropdown:hover { cursor: pointer; background-color: #208b20; } /* dropdown select button */ .ui-dropdown-select { height: inherit; padding: 0 0.75em; color: #fff; line-height: 2em; } /* dropdown
list */ .ui-dropdown-
list { width: 100%; height: 150px; max-height: 150px; margin: 0; padding: 0 0.3em; border: 3px solid #3490d2; border-color: #208b20; background: #666; background-color: #eef1f5; color: #000; position: absolute; top: 2em; left: 0; z-index: 100; overflow: hidden; transition: all 0.3s; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: bo...
...width: 100%; height: 150px; max-height: 150px; margin: 0; padding: 0 0.3em; border: 3px solid #3490d2; border-color: #208b20; background: #666; background-color: #eef1f5; color: #000; position: absolute; top: 2em; left: 0; z-index: 100; overflow: hidden; transition: all 0.3s; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } .ui-dropdown-
list:hover { overflow: auto; } .ui-dropdown-
list[data-hidden='true'] { height: 0 !important; opacity: 0; visibility: hidden; } .ui-dropdown[data-position='left'] .ui-dropdown-
list { left: -100%; top: 0; } .ui-dropdown[data-position='right'] .ui-dropdown-
list { left: 100%; top: 0; } .ui-dropdown-
list > div { width: 100%; height: 1.6em; margin: 0.3em 0; padding: 0.3em; line-height: 1em;...
...visibility: hidden; } .ui-dropdown[data-position='left'] .ui-dropdown-
list { left: -100%; top: 0; } .ui-dropdown[data-position='right'] .ui-dropdown-
list { left: 100%; top: 0; } .ui-dropdown-
list > div { width: 100%; height: 1.6em; margin: 0.3em 0; padding: 0.3em; line-height: 1em; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } .ui-dropdown-
list > div:hover { background: #3490d2; color:#fff; border-radius: 2px; cursor: pointer; } /*************************************************************************************/ /*************************************************************************************/ /* * ui button */ /* checkbox */ .ui-checkbox { text-align: center; font-size: 16px; font-family: "segoe ui", arial, helvet...
...And 23 more matches
Using files from web applications - Web APIs
<input type="file"> element or by drag and drop. if you want to use the dom file api from extensions or other browser chrome code, you can; however, note there are some additional features to be aware of. see using the dom file api in chrome code for details. ...
...le
list containing file objects representing the files selected by the user. the multiple attribute on the input element allows the user to select multiple files. accessing the first selected file using a classical dom selector: const selectedfile = document.getelementbyid('input').files[0]; accessing selected file(s) on a change event it is also possible (but not mandatory) to access the file
list through the change event. ...
...he user. the multiple attribute on the input element allows the user to select multiple files. accessing the first selected file using a classical dom selector: const selectedfile = document.getelementbyid('input').files[0]; accessing selected file(s) on a change event it is also possible (but not mandatory) to access the file
list through the change event. ...
...And 22 more matches
Background audio processing using AudioWorklet - Web APIs
alls to registerprocessor(). as long as each has its own unique name, this will work just fine. it's also more efficient than loading multiple modules from over the network or even the user's local disk. ...
...sterprocessor(). as long as each has its own unique name, this will work just fine. it's also more efficient than loading multiple modules from over the network or even the user's local disk. ...
...your call to audioworklet.addmodule(). this call to registerprocessor() registers your class as the basis for any audioworkletprocessors created when audioworkletnodes are set up. this is the barest framework and actually has no effect until code is added into process() to do something with those inputs and outputs. which brings us to talking about those inputs and outputs. the input and output
lists the
lists of inputs and outputs can be a little confusing at first, even though they're actually very simple once you realize what's going on. let's start at the inside and work our way out. fundamentally, the audio for a single audio channel (such as the left speaker or the subwoofer, for example) is represented as a float32array whose values are the individual audio samples. by specification...
...And 22 more matches
<input>: The Input (Form Input) element - HTML: Hypertext Markup Language
every <input> element, regardless of type, is based on the htmlinputelement interface, they technically share the exact same set of attributes. however, in reality, most attributes have an effect on only a specific subset of input types. in addition, the way some attributes impact an input depends on the input type, impacting different input types in different ways. this section provides a table
listing all the attributes with a brief description. this table is followed by a
list describing each attribute in greater detail, along with which input types they are associated with.those that are common to most or all input types are defined in greater detail below. attributes that are unique to particular input types—or attributes which are common to all input types but have special behaviors w...
... form data set encoding type to use for form submission formmethod image, submit http method to use for form submission formnovalidate image, submit bypass form control validation for form submission formtarget image, submit browsing context for form submission height image same as height attribute for <img>; vertical dimension
list almost all value of the id attribute of the <data
list> of autocomplete options max numeric types maximum value maxlength password, search, tel, text, url maximum length (number of characters) of value min numeric types minimum value minlength password, search, tel, text, url minimum length (number of characters) of value m...
...same as src attribute for <img>; address of image resource step numeric types incremental values that are valid. type all type of form control value all current value of the form control. submitted with the form as part of a name/value pair. width image same as width attribute for <img> a few additional non-standard attributes are
listed following the descriptions of the standard attributes. individual attributes accept valid for the file input type only, the accept attribute defines which file types are selectable in a file upload control. see the file input type. alt valid for the image button only, the alt attribute provides alternative text for the image, displaying the value of the attribute if the image src i...
...And 22 more matches
ui/sidebar - Archive of obsolete content
main add-on code and scripts loaded into your sidebar. on the sidebar end of the conversation, sidebar scripts get a global variable addon that contains a port for sending and receiving messages. on the add-on side, you need to get a worker object for the sidebar before you can send or receive messages. there are two events emitted by the sidebar which will give you a worker: attach and ready.
listen to attach if the first message in your add-on goes from the sidebar scripts to the main add-on code, and
listen to ready if the first message goes from the main add-on code to the sidebar script. using attach the attach event is triggered whenever the dom for a new sidebar instance is loaded and its scripts are attached. the sidebar script may not be initialized yet, so you can't reliably se...
...r scripts to the main add-on code, and
listen to ready if the first message goes from the main add-on code to the sidebar script. using attach the attach event is triggered whenever the dom for a new sidebar instance is loaded and its scripts are attached. the sidebar script may not be initialized yet, so you can't reliably send messages to the sidebar script right away: however, you can start
listening to messages from the script. here's a simple but complete add-on that shows how to set up communication between main.js and a script in a sidebar, in the case where the sidebar script initiates communication: the html file includes just a script, "sidebar.js": <!doctype html> <html> <body> content for my sidebar <script type="text/javascript" src="sidebar.js"></script> </body>...
...een main.js and a script in a sidebar, in the case where the sidebar script initiates communication: the html file includes just a script, "sidebar.js": <!doctype html> <html> <body> content for my sidebar <script type="text/javascript" src="sidebar.js"></script> </body> </html> the "sidebar.js" file sends a ping message to main.js using port.emit() as soon as it loads, and adds a
listener to the pong message. addon.port.emit("ping"); addon.port.on("pong", function() { console.log("sidebar script got the reply"); }); the "main.js" file creates a sidebar object and adds a
listener to its attach event. on attach, "main.js" starts
listening to the ping message, and responds with a pong: var sidebar = require("sdk/ui/sidebar").sidebar({ id: 'my-sidebar', title: 'my sideba...
...And 21 more matches
Index - Learn web development
nt, dns, http, ip, infrastructure, learn, server, tcp, l10n:priority this theory is not essential to writing web code in the short term, but before long you'll really start to benefit from understanding what's happening in the background. 41 installing basic software beginner, browser, learn, setup, tools, webmechanics, l10n:priority, text editor that looks like a scary
list, but fortunately, you can get started in web development without knowing anything about most of these. in this article, we'll just set you up with a bare minimum — a text editor and some modern web browsers. 42 javascript basics beginner, codingscripting, javascript, learn, web, l10n:priority javascript ("js" for short) is a full-fledged dynamic programming language that ca...
...give you a crash course in the basic features of javascript via a completely practical tutorial. here you'll build up a simple "guess the number" game, step by step. 77 arrays arrays, article, beginner, codingscripting, javascript, join, learn, pop, push, l10n:priority, shift, split, unshift in the final article of this module, we'll look at arrays — a neat way of storing a
list of data items under a single variable name. here we look at why this is useful, then explore how to create an array, retrieve, add, and remove items stored in an array, and more besides. 78 basic math in javascript — numbers and operators article, beginner, codingscripting, guide, javascript, learn, math, operators, augmented, increment, l10n:priority, maths, modulo in this...
...the location of content in the document. 110 pseudo-classes and pseudo-elements beginner, css, learn, pseudo, pseudo-class, pseudo-element, selectors the next set of selectors we will look at are referred to as pseudo-classes and pseudo-elements. there are a large number of these, and they often serve quite specific purposes. once you know how to use them, you can look at the
list to see if there is something which works for the task you are trying to achieve. once again the relevant mdn page for each selector is helpful in explaining browser support. 111 test your skills: selectors beginner, css the aim of this task is to help you check your understanding of selectors in css. 112 test your skills: the box model beginner, css the a...
...And 21 more matches
Introduction to events - Learn web development
event reference) that there are a lot of events that can be responded to. each available event has an event handler, which is a block of code (usually a javascript function that you as a programmer create) that runs when the event fires. when such a block of code is defined to run in response to an event, we say we are registering an event handler. note: event handlers are sometimes called event
listeners — they are pretty much interchangeable for our purposes, although strictly speaking, they work together. the
listener
listens out for the event happening, and the handler is the code that is run in response to it happening. note: web events are not part of the core javascript language — they are defined as part of the apis built into the browser. a simple example let's look at a sim...
...col; } in this code, we store a reference to the button inside a constant called btn, using the document.queryselector() function. we also define a function that returns a random number. the third part of the code is the event handler. the btn constant points to a <button> element, and this type of object has a number of events that can fire on it, and therefore, event handlers available. we are
listening for the click event firing, by setting the onclick event handler property to equal an anonymous function containing code that generates a random rgb color and sets the <body> background-color equal to it. this code is run whenever the click event fires on the <button> element, that is, whenever a user selects it. the example output is as follows: it's not just web pages another thing w...
...nd of event model, and the way the model works often differs from javascript's way. in fact, the event model in javascript for web pages differs from the event model for javascript as it is used in other environments. for example, node.js is a very popular javascript runtime that enables developers to use javascript to build network and server-side applications. 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. the http connect event docs provide a good example. you don't need to understand anything about other such environm...
...And 21 more matches
NSS tools : modutil
cs #11 module information within the security module database. synopsis modutil [options] arguments description the security module database tool, modutil, is a command-line utility for managing pkcs #11 module information both within secmod.db files and within hardware tokens. modutil can add and delete pkcs #11 modules, change passwords on security databases, set defaults,
list module contents, enable or disable slots, enable or disable fips 140-2 compliance, and assign default providers for cryptographic operations. this tool can also create certificate, key, and module security database files. the tasks associated with security module database management are part of a process that typically also involves managing key databases and certificate dat...
...ags, and the cipher flags, as well as any files to be installed on the target machine, including the pkcs #11 module library file and other files such as documentation. this is covered in the jar installation file section in the man page, which details the special script needed to perform an installation through a server or with modutil. ...
... -undefault modulename specify the security mechanisms for which the named module will not be a default provider. ...
...And 21 more matches
Using the Browser API
vtools. it consists of two major parts: custom <iframe> attributes: by adding a mozbrowser attribute to the <iframe> element we can make it appear like a top-level browser window to the embedded content. this means that window.top, window.parent, window.frameelement, etc. should not reflect the frame hierarchy. api extensions: the api includes several new methods and events to manipulate and
listen for changes to the embedded content's state, interited by the htmliframeelement interface. note: an iframe enhanced by the browser api is commonly referred to as a "browser iframe". we'll be using this term throughout the current article, and other parts of the documentation. demo to demonstrate basic usage of this api, we have created a simple browser api demo that provides buttons allow...
...n being compromised by a malicious web site. it is implied for webextensions, which always run in a separate content process from web content. aside from the iframe, there are some basic controls: <button> elements, a simple <form> to implement the browser controls, and a search bar. the search bar also contains buttons, as well as a form to type search requests into. ...
... there are some basic controls: <button> elements, a simple <form> to implement the browser controls, and a search bar. the search bar also contains buttons, as well as a form to type search requests into. you can see the full html
listing here. ...
...And 20 more matches
Using IndexedDB - Web APIs
s used by indexeddb, as well as the methods of the asynchronous api (the synchronous api was removed from spec). basic pattern the basic pattern that indexeddb encourages is the following: open a database. create an object store in the database. start a transaction and make a request to do some database operation, like adding or retrieving data. wait for the operation to complete by
listening to the right kind of dom event. do something with the results (which can be found on the request object). with these big concepts under our belts, we can get to more concrete stuff. creating and structuring the store using an experimental version of indexeddb in case you want to test your code in browsers that still use a prefix, you can use the following code: // in the foll...
... note: older experimental implementations use the deprecated constant idbtransaction.read_write instead of "readwrite". // in case you want to support such an implementation, you can write: // var transaction = db.transaction(["customers"], idbtransaction.read_write); the transaction() function takes two arguments (though one is optional) and returns a transaction object. the first argument is a
list of object stores that the transaction will span. you can pass an empty array if you want the transaction to span all object stores, but don't do it because the spec says an empty array should generate an invalidaccesserror. if you don't specify anything for the second argument, you get a read-only transaction. since you want to write to it here you need to pass the "readwrite" flag. now that you...
...'s a lot of code for a "simple" retrieval. here's how you can shorten it up a bit, assuming that you handle errors at the database level: db.transaction("customers").objectstore("customers").get("444-44-4444").onsuccess = function(event) { console.log("name for ssn 444-44-4444 is " + event.target.result.name); }; see how this works? since there's only one object store, you can avoid passing a
list of object stores you need in your transaction and just pass the name as a string. also, you're only reading from the database, so you don't need a "readwrite" transaction. calling transaction() with no mode specified gives you a "readonly" transaction. another subtlety here is that you don't actually save the request object to a variable. since the dom event has the request as its target you can ...
...And 20 more matches
Interacting with page scripts - Archive of obsolete content
version of the sdk. expose objects to page scripts until firefox 30, you could use unsafewindow to perform the reverse procedure, and make objects defined in content scripts available to page scripts: // content-script.js unsafewindow.contentscriptobject = {"greeting" : "hello from add-on"}; // page-script.js var button = document.getelementbyid("show-content-script-var"); button.addevent
listener("click", function() { // access object defined by content script console.log(window.contentscriptobject.greeting); // "hello from add-on" }, false); after firefox 30, you can still do this for primitive values, but can no longer do it for objects. instead, you need to use the global cloneinto() function to clone the object into the page script's scope. cloneinto() creates a structure...
...s it to unsafewindow twice: the first time using cloneinto(), the second time using simple assignment: // content-script.js var contentscriptobject = {"greeting" : "hello from add-on"}; unsafewindow.clonedcontentscriptobject = cloneinto(contentscriptobject, unsafewindow); unsafewindow.assignedcontentscriptobject = contentscriptobject; the "page.html" file adds two buttons and assigns an event
listener to each: one
listener displays a property of the cloned object, and the other
listener displays a property of the assigned object: <html> <head> </head> <body> <input id="works" type="button" value="i will work"/> <input id="fails" type="button" value="i will not work"/> <script> var works = document.getelementbyid("works"); works.addevent
listener("click", func...
...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 ...
...And 19 more matches
Storing annotations - Archive of obsolete content
this is implemented as a panel that's shown in response to the widget's right-click message. the panel has three new files associated with it: a content-script which builds the panel content a simple html file used as a template for the panel's content...
...nnotations. this is implemented as a panel that's shown in response to the widget's right-click message. the panel has three new files associated with it: a content-script which builds the panel content a simple html file used as a template for the panel's content a simple css file to provide some basic styling. these three files can all go in a new subdirectory of data which we will call
list. ...
...s implemented as a panel that's shown in response to the widget's right-click message. the panel has three new files associated with it: a content-script which builds the panel content a simple html file used as a template for the panel's content a simple css file to provide some basic styling. these three files can all go in a new subdirectory of data which we will call
list. ...
...And 19 more matches
Useful string methods - Learn web development
ods available on those objects to manipulate strings. strings as objects most things are objects in javascript. when you create a string, for example by using let string = 'this is my string'; your variable becomes a string object instance, and as a result has a large number of properties and methods available to it. you can see this if you go to the string object page and look down the
list on the side of the page! now, before your brain starts melting, don't worry! you really don't need to know about most of these early on in your learning journey. but there are a few that you'll potentially use quite often that we'll look at here. let's enter some examples into the browser developer console. finding the length of a string this is easy — you simply use the length property. t...
...— which character number of the main string the substring starts at. if the substring is not found inside the main string, it returns a value of -1. try this: browsertype.indexof('zilla'); this gives us a result of 2, because the substring "zilla" starts at position 2 (0, 1, 2 — so 3 characters in) inside "mozilla". such code could be used to filter strings. for example, we may have a
list of web addresses and only want to print out the ones that contain "mozilla". this can be done in another way, which is possibly even more effective. try the following: browsertype.indexof('vanilla'); this should give you a result of -1 — this is returned when the substring, in this case 'vanilla', is not found in the main string. you could use this to find all instances of strings ...
...ation; it doesn't just update the substring value automatically. so you'd have to actually write this: browsertype = browsertype.replace('moz','van'); active learning examples in this section we'll get you to try your hand at writing some string manipulation code. in each exercise below, we have an array of strings, and a loop that processes each value in the array and displays it in a bulleted
list. you don't need to understand arrays or loops right now — these will be explained in future articles. all you need to do in each case is write the code that will output the strings in the format that we want them in. each example comes with a "reset" button, which you can use to reset the code if you make a mistake and can't get it working again, and a "show solution" button you can press to s...
...And 19 more matches
NSS Tools modutil
using the security module database (modutil) newsgroup: mozilla.dev.tech.crypto the security module database tool is a command-line utility for managing pkcs #11 module information within secmod.db files or within hardware tokens. you can use the tool to add and delete pkcs #11 modules, change passwords, set defaults,
list module contents, enable or disable slots, enable or disable fips 140-2 compliance, and assign default providers for cryptographic operations. this tool can also create key3.db, cert8.db, and secmod.db security database files. the tasks associated with security module database management are part of a process that typically also involves managing key databases (key3.db files) and certificate databases (cert8.db files). the key, certificate, and pkcs #11 module ...
...tabase management. for information on certificate database and key database management, see using the certificate database tool. availability this tool is known to build on solaris 2.5.1 (sunos 5.5.1) and windows nt 4.0. syntax to run the security module database tool, type the command modutil option [arguments] where option and arguments are combinations of the options and arguments
listed in the following section. each command takes one option. each option may take zero or more arguments. to see a usage string, issue the command without options. options and arguments options specify an action. option arguments modify an action. the options and arguments for the modutil command are defined as follows: options -create create new secmod.db, key3.db, and cert8.db files.
... options specify an action. option arguments modify an action. the options and arguments for the modutil command are defined as follows: options -create create new secmod.db, key3.db, and cert8.db files. use the -dbdir directory argument to specify a directory. if any of these databases already exist in a specified directory, the security module database tool displays an error message. -
list [modulename] display basic information about the contents of the secmod.db file. use modulename to display detailed information about a particular module and its slots and tokens. -add modulename add the named pkcs #11 module to the database. use this option with the -libfile, -ciphers, and -mechanisms arguments. -jar jar-file add a new pkcs #11 module to the database using the named jar file...
...And 19 more matches
Drag Operations - Web APIs
the draggable attribute in a web page, there are certain cases where a default drag behavior is used. these include text selections, images, and links. when an image or link is dragged, the url of the image or link is set as the drag data, and a drag begins. ...
...set as the drag data, and a drag begins. for other elements, they must be part of a selection for a default drag to occur. to see this in effect, select an area of a webpage, and then click and hold the mouse and drag the selection. an os-specific rendering of the selection will appear and follow the mouse pointer as the drag occurs. however, this behavior is only the default drag behavior, if no
listeners adjust the data to be dragged. in html, apart from the default behavior for images, links, and selections, no other elements are draggable by default. to make other html elements draggable, three things must be done: set the draggable="true" on the element that you wish to make draggable. add a
listener for the dragstart event. set the drag data in the above
listener. here is an exa...
...only use the draggable attribute with a value of false to disable dragging of these elements. note: when an element is made draggable, text or other elements within it can no longer be selected in the normal way by clicking and dragging with the mouse. instead, the user must hold down the alt key to select text with the mouse, or use the keyboard. ...
...And 19 more matches
CustomizableUI.jsm
e:///modules/customizableui.jsm"); introduction the module is intended for two primary purposes: allow adding, moving and removing customizable widgets. manage the areas in which these widgets are shown. note that it is expressly not really aware about the specific ui used by users to make customizations. this is handled by customizemode.jsm, which interacts with customizableui through a
listener mechanism. areas areas are parts of the user interface in which customizable widgets can be placed. customizableui assumes that each area it is told about is present in every browser window. customizableui is aware of two types of areas: toolbars and the menu panel. areas are registered using the registerarea method and unregistered using the unregisterarea method. when a customizable tool...
...ethod and unregistered using the unregisterarea method. when a customizable toolbar's xbl binding is constructed (generally, that is when a <toolbar customizable="true"/> node is appended to the document and isn't invisible), the binding will call into customizableui and register the toolbar's node as being one of the concrete instances of its area. for each area, customizableui keeps track of a
list of the widgets they contain, generally refered to as 'placements'. this is analogous to the old currentset attribute. if consumers make a change to the placements in an area, customizableui will update the actual nodes in each area instance for them. toolbars generally function the same way they always have. however, they can now be 'overflowable', that is, if there are too many widgets to fit i...
...parator>, <toolbarspring> and <toolbarspacer> elements. customizableui provides apis to add, move and remove all these different widgets, and mostly abstracts the dom away from you. the lifetime of your widget should be identical to the lifetime of the add-on - it's process-global, so if you call createwidget on bootstrap's "startup" and destroywidget on bootstrap's "shutdown", that's enough.
listeners customizableui provides a way to
listen for various bits of customization happening. this can be useful if other parts of the code need to react to changes in the customization of the user interface. in order to use this facility, you should create a plain js object which defines some of the event handlers defined below. not all event handler methods need to be defined. customizableui will...
...And 18 more matches
nsIDeviceMotion
system/nsidevicemotion.idlscriptable this interface is used to implement accelerometer support. 1.0 66 introduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) note: this interface was named nsidevicemotion prior to gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3). ...
...criptable this interface is used to implement accelerometer support. 1.0 66 introduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) note: this interface was named nsidevicemotion prior to gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3). ...
... this interface is used to implement accelerometer support. 1.0 66 introduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) note: this interface was named nsidevicemotion prior to gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3). ...
...And 18 more matches
Mail composition back end
warning: the content of this article may be out of date. it was imported from mozilla.org and last updated in 2000. by richard h. pizzarro <rhp@netscape.com> contents overview sending messages nsimsgsend sending
listener interfaces nsimsgsend
listener nsimsgcopyservice
listener copy operations copy to sent folder drafts templates "send later" sending unsent messages sending unsent messages
listener quoting sample programs overview i've done considerable work in the past few weeks reorganizing the mail composition back end, so i thought it would be helpful to put together a small doc on the new interfaces and how one can use them. the mail composition back end is responsible for the assembly and creation of...
...nd services. also, i will talk about some features though they may not be complete as of yet. i will try to make comments for these exceptions. sending messages the primary responsibility of the back end is for the creation and sending of rfc822 messages. the interface that accomplishes this task is the nsimsgsend interface. the feedback mechanism is provided by a nsimsgsend
listener which is implemented by the caller. the caller has the ability to add or remove
listener interfaces to the nsimsgsend object and the interface can support multiple
listeners. (for detailed information on the
listener interfaces, see the
listener interfaces section of this document) nsimsgsend the following describes the methods of the nsimsgsend interface. all of these ...
... structures. const struct nsmsgattachedfile *preloaded_attachments, - attachments that are already locally stored on disk (note: both attachments and preloaded_attachments cannot be specified on a single call void *relatedpart /* nsmsgsendpart */, - a related part for multipart related operations nsimsgsend
listener **a
listenerarray) = 0; - an array of
listeners for the send operation. this can be nsnull if you want to do the delivery operation "blind" sendmessagefile the sendmessagefile method will let the caller send a message that has been created by another process (note: createandsendmessage can accomplish this task). ns_imethod sendmessagefile( ...
...And 18 more matches
Color picker tool - CSS: Cascading Style Sheets
tcolor = function getcolor() { if (this.a | 0 === 1) return this.gethexa(); return this.getrgba(); }; /*=======================================================================*/ /*=======================================================================*/ /*========== capture mouse movement ==========*/ var setmousetracking = function setmousetracking(elem, callback) { elem.addevent
listener('mousedown', function(e) { callback(e); document.addevent
listener('mousemove', callback); }); document.addevent
listener('mouseup', function(e) { document.removeevent
listener('mousemove', callback); }); }; /*====================*/ // color picker class /*====================*/ function colorpicker(node) { this.color = new color(); this.node = node; this.subscribers...
...ment.createelement('div'); var input = document.createelement('input'); var info = document.createelement('span'); wrapper.classname = 'input'; wrapper.setattribute('data-topic', topic); info.textcontent = title; info.classname = 'name'; input.setattribute('type', 'text'); wrapper.appendchild(info); wrapper.appendchild(input); this.node.appendchild(wrapper); input.addevent
listener('change', onchangefunc); input.addevent
listener('click', function() { this.select(); }); this.subscribe(topic, function(value) { input.value = value; }); }; colorpicker.prototype.createchangemodebutton = function createchangemodebutton() { var button = document.createelement('div'); button.classname = 'switch_mode'; button.addevent
listener('click', function() { if ...
...unsubscribe, setpickermode : setpickermode }; })(); /** * ui-slidersmanager */ var inputslidermanager = (function inputslidermanager() { var subscribers = {}; var sliders = []; var inputcomponent = function inputcomponent(obj) { var input = document.createelement('input'); input.setattribute('type', 'text'); input.style.width = 50 + obj.precision * 10 + 'px'; input.addevent
listener('click', function(e) { this.select(); }); input.addevent
listener('change', function(e) { var value = parsefloat(e.target.value); if (isnan(value) === true) setvalue(obj.topic, obj.value); else setvalue(obj.topic, value); }); return input; }; var slidercomponent = function slidercomponent(obj, sign) { var slider = document.createelement('div'); var startx ...
...And 18 more matches
Realizing common layouts using CSS Grid Layout - CSS: Cascading Style Sheets
as you can see from this set of examples, there is often more than one way to achieve the result you want with grid layout. ...
...gation, sidebar, and a block into which i am intending to place advertising. ...
...m starting with the same markup as used for the grid template areas example. ...
...And 18 more matches
Codecs used by WebRTC - Web media technologies
automatic light level), and so on. note: these requirements are for web browsers and other fully-webrtc compliant products. non-webrtc products that are able to communicate with webrtc to some extent may or may not support these codecs, although they're encouraged to by the specification documents. in addition to the mandatory codecs, some browsers support additional codecs as well. those are
listed in the following table. other video codecs codec name profile(s) browser compatibility vp9 — chrome (48+), firefox vp8 vp8, which we describe in general in the main guide to video codecs used on the web, has some specific requirements that must be followed when using it to encode or decode a video track on a webrtc connection. unless signaled other...
...ebrtc-compatible browsers must support are shown in the table below. ...
... mandatory audio codecs codec name browser compatibility opus chrome, edge, firefox, safari g.711 pcm (a-law) chrome, firefox, safari g.711 pcm (µ-law) chrome, firefox, safari see below for more details about any webrtc-specific considerations that exist for each codec
listed above. it's useful to note that rfc 7874 defines more than a
list of audio codecs that a webrtc-compliant browser must support; it also provides recommendations and requirements for special audio features such as echo cancelation, noise reduction, and audio leveling. note: the
list above indicates the minimum required set of codecs that all webrtc-compatible endpoints are required to implement. a given browser may also support other codecs; however, cross-pla...
...And 18 more matches
SVG documentation index - SVG: Scalable Vector Graphics
css, guide, html, svg modern browsers support using svg within css styles to apply graphical effects to html content. 3 compatibility sources svg the following sources are used for the compatibility tables on svg elements and attributes: 4 content type needstechnicalreview, svg, types, data types svg makes use of a number of data types. this article
lists these types along with their syntax and descriptions of what they're used for. 5 linking guide, svg the target attribute on the svg <a> element doesn't work in mozilla firefox 1.5. when svg documents are embedded within a parent html document using the tag: 6 namespaces crash course svg, xml as an xml dialect, svg is namespaced. it is important to unders...
..., xml in this example, we use xhtml, svg, javascript, and the dom to animate a swarm of "motes". these motes are governed by two simple principles. first, each mote tries to move towards the mouse cursor, and second each mote tries to move away from the average mote position. combined, we get this very natural-looking behavior. 8 other resources reference, svg here is a
list of additional resources on svg: 9 project svg no summary! 10 replaced element svg this page was auto-generated because a user created a sub-page to this page. 11 svg 1.1 support in firefox firefox, svg you can find some basic examples of svg syntax and usage in the w3c svg test suite. 12 svg 2 support in mozilla firefox...
...se to flood the current filter primitive subregion. 78 flood-opacity svg, svg attribute, svg filter the flood-opacity attribute indicates the opacity value to use across the current filter primitive subregion. 79 font-family svg, svg attribute the font-family attribute indicates which font family will be used to render the text, specified as a prioritized
list of font family names and/or generic family names. 80 font-size svg, svg attribute the font-size attribute refers to the size of the font from baseline to baseline when multiple lines of text are set solid in a multiline layout environment. 81 font-size-adjust svg, svg attribute the font-size-adjust attribute allows authors to specify an aspect value for a...
...And 18 more matches
Elements - Archive of obsolete content
a xbl binding can add anonymous content, fields, properties, methods, and event handlers to html/xml elements. a single xbl binding c...
...g bug 119389. in that case, put the value of the display attribute into the extends attribute. inheritstyle - the inheritstyle attribute indicates whether style rules from the document will affect anonymous content generated by the xbl binding. if this attribute is true, styles from the document will also be applied to the xbl generated anonymous content. content <!element content any> <!att
list content id id #implied > a binding can specify new content that is placed inside the bound element. although you can see this content on screen as if it was directly in the file, this content is anonymous and is hidden from the normal dom. to access anonymous nodes on an xbl bound element, you can use the getanonymouselementbyattribute and getanonymousnodes functions.
... dom. to access anonymous nodes on an xbl bound element, you can use the getanonymouselementbyattribute and getanonymousnodes functions. the only xbl element that can appear inside the content tag is the children tag. attributes on the <content> element in the binding are set on the bound element. id - the id attribute is a document-unique identifier. children <!element children empty> <!att
list children id id #implied includes cdata #implied > specifies the location where any child elements of the bound element are placed in the generated content. normally, if the element bound to has its own content, the anonymous content is not generated. however, with a children element, you can merge the content from the...
...And 17 more matches
Textbox (XPFE autocomplete) - Archive of obsolete content
the autocomplete functionality is handled through one of more session objects, each of which can return a set of results given the current value of the textbox. ...
...s to: thunderbird and seamonkeyif true, the autocomplete popup will be displayed even when there are no matches. if false, the default value, the popup will be hidden. this attribute is obsolete as of gecko 1.9.1; to control the display of the popup, use the minresultsforpopup attribute instead. autocompletesearch new in thunderbird 2requires seamonkey 1.1 type: space-separated
list of values a space-separated
list of search component names, each of which implements the nsiautocompletesearch interface. the components are created using the name @mozilla.org/autocomplete/search;1?name= where name is
listed in this attribute. search-autocomplete requires seamonkey 2.1 the user's default search engine's suggestions are searched. places-tag-autocomp...
...set to true, the best match will be filled into the textbox as the user types. if false, the default, the value will not be filled in until the user selects an item. completedefaultindex new in thunderbird 3 requires seamonkey 2.0 type: boolean if true, the best match value will be filled into the textbox as the user types. if set to false or omitted, the value must be selected from the
list. crop type: boolean this attribute is not used and is only provided for compatibility with the menu
list element. disableautocomplete obsolete since gecko 1.9.1 type: boolean if true, the autocomplete behavior will be disabled. you might use a script to change this attribute. if false, the default, autocomplete is enabled. as of gecko 1.9.1, this attribute is now...
...And 17 more matches
Client-side storage - Learn web development
eryselector('.forget'); const form = document.queryselector('form'); const nameinput = document.queryselector('#entername'); const submitbtn = document.queryselector('#submitname'); const forgetbtn = document.queryselector('#forgetname'); const h1 = document.queryselector('h1'); const personalgreeting = document.queryselector('.personal-greeting'); next up, we need to include a small event
listener to stop the form from actually submitting itself when the submit button is pressed, as this is not the behavior we want. add this snippet below your previous code: // stop the form from submitting when a button is pressed form.addevent
listener('submit', function(e) { e.preventdefault(); }); now we need to add an event
listener, the handler function of which will run when the "say h...
... the comments explain in detail what each bit does, but in essence here we are taking the name the user has entered into the text input box and saving it in web storage using setitem(), then running a function called namedisplaycheck() that will handle updating the actual website text. ...
...n a function when the "forget" button is clicked — this is only displayed after the "say hello" button has been clicked (the two form states toggle back and forth). in this function we remove the name item from web storage using removeitem(), then again run namedisplaycheck() to update the display. add this to the bottom: // run function when the 'forget' button is clicked forgetbtn.addevent
listener('click', function() { // remove the stored name from web storage localstorage.removeitem('name'); // run namedisplaycheck() to sort out displaying the // generic greeting again and updating the form display namedisplaycheck(); }); it is now time to define the namedisplaycheck() function itself. here we check whether the name item has been stored in web storage by using localst...
...And 17 more matches
Arrays - Learn web development
previous overview: first steps next in the final article of this module, we'll look at arrays — a neat way of storing a
list of data items under a single variable name. here we look at why this is useful, then explore how to create an array, retrieve, add, and remove items stored in an array, and more besides. prerequisites: basic computer literacy, a basic understanding of html and css, an understanding of what javascript is. objective: to understand what arrays are and how to manipulate them in javascript. what is an array? arrays are generally described as "
list-like objects"; they are basically single objects that contain multiple values stored in a
list. array objects can be stored in variables and dealt with in much the same way as any other t...
...o understand what arrays are and how to manipulate them in javascript. what is an array? arrays are generally described as "
list-like objects"; they are basically single objects that contain multiple values stored in a
list. array objects can be stored in variables and dealt with in much the same way as any other type of value, the difference being that we can access each value inside the
list individually, and do super useful and efficient things with the
list, like loop through it and do the same thing to every value. maybe we've got a series of product items and their prices stored in an array, and we want to loop through them all and print them out on an invoice, while totaling all the prices together and printing out the total price at the bottom. if we didn't have arrays, we'd h...
...dd to the invoice it would already be annoying, but what about 100 items, or 1000? we'll return to this example later on in the article. as in previous articles, let's learn about the real basics of arrays by entering some examples into browser developer console. creating arrays arrays consist of square brackets and elements that are separated by commas. suppose we want to store a shopping
list in an array. paste the following code into the console: let shopping = ['bread', 'milk', 'cheese', 'hummus', 'noodles']; shopping; in the above example, each element is a string, but in an array we can store various data types — strings, numbers, objects, and even other arrays. we can also mix data types in a single array — we do not have to limit ourselves to storing only numbers in one...
...And 17 more matches
Communicating with frame scripts
x messages with your add-on's id. after the name, you can pass detailed data as a string or a json-serializable object, and after that you can pass any objects it wants to pass to content as cpows. ...
...ntaining details and tag properties, and exposes the event.target object as a cpow: // frame script addevent
listener("click", function (event) { sendasyncmessage("my-addon@me.org:my-e10s-extension-message", { details : "they clicked", tag : event.target.tagname }, { target : event.target }); }, false); to receive messages from content, a chrome script needs to add a message
listener using the message manager's addmessage
listener() api. the message passed to the
listener is an object containing the following properties: name string containing the message name. sync boolean declaring whether the message was send synchronously or aynchronously. data the json object passed as the second parameter to sendasyncmessage(). target ...
...ean declaring whether the message was send synchronously or aynchronously. data the json object passed as the second parameter to sendasyncmessage(). target the xul <browser> element from which this message was sent. ...
...And 17 more matches
NSS Sample Code Sample1
ple servers // or hosts. // // the management scheme assumes that one host is primary. it // generates the secret keys that will be used by all participating // hosts. the other hosts (secondary) request keys from the // primary host. as an alternative, new keys may be sent to the // current set of secondary hosts when they are generated by the // primary. in this case, the primary maintains a
list of the // secondary hosts. // // the sequence of events is: // 1. the primary host generates a new symmetric key. this key // may be used for an encryption mechanism (des or aes) or for // integrity (md5_hmac or sha1_hmac). this key needs to be // permanent, since it may be used during several runs of the // server. (currently nss doesn't store persistant keys. steps // 1a throu...
...ade to the primary // server. the example here shows how to create a permanent (token) // rsa key for this purpose. (this key will also be used for // storage of the keys, since nss does not support permanent symmetric // keys at the current time.) // 3. the secondary host sends its rsa public key to the primary host as // part of a request for a particular key, or to be added to a
list // of secondary hosts. // 4. the administrator of the primary host verifies that the rsa key // that was received belongs to a valid secondary host. the adminstrator // may do this by checking that the key was received in a signed email // message, or by checking a digest value with the adminstrator of the // secondary host. [need support for digest check values] // 5. the primar...
...) secitem_zfreeitem(mackey2, pr_true); if (enckey1) secitem_zfreeitem(enckey1, pr_true); if (enckey2) secitem_zfreeitem(enckey2, pr_true); return rv; } // private helper, retrieves the private key for the server // from the database. ...
...And 17 more matches
NSS tools : certutil
name certutil — manage keys and certificate in both nss databases and other nss tokens synopsis certutil [options] [[arguments]] description the certificate database tool, certutil, is a command-line utility that can create and modify certificate and key databases. it can specifically
list, generate, modify, or delete certificates, create or change the password, generate new public and private key pairs, display the contents of the key database, or delete key pairs within the key database. certificate issuance, part of the key and certificate management process, requires that keys and certificates be created in the key database. this document discusses certificate and key database management. for information on the security modu...
...ent discusses certificate and key database management. for information on the security module database management, see the modutil manpage. options and arguments running certutil always requires one and only one command option to specify the type of certificate operation. each option may take arguments, anywhere from none to multiple arguments. the command option -h will
list all the command options available and their relevant arguments. command options -a add an existing certificate to a certificate database. the certificate database should already exist; if one is not present, this command option will initialize one by default. -b run a series of commands from the specified batch file. thi...
...rivate key pair within a key database. the key database should already exist; if one is not present, this option will initialize one by default. some smart cards (for example, the litronic card) can store only one key pair. if you create a new key pair for such a card, the previous pair is overwritten. ...
...And 17 more matches
sslfnc.html
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. note that at least one of the functions
listed in ssl export policy functions must also be called during nss initialization. nss_init nss_initreadwrite nss_nodb_init ssl_optionsetdefault ssl_optiongetdefault ssl_cipherprefsetdefault ssl_cipherprefgetdefault ssl_clearsessioncache ssl_configserversessionidcache ssl_configmpserversidc...
...l3 and tls are enabled, all ssl3/tls ciphersuites that are enabled are enabled for both ssl3 and tls. ssl_optiongetdefault gets the value of a specified ssl default option. ssl_optiongetdefault is the complementary function for ssl_optionsetdefault. syntax #include "ssl.h" secstatus ssl_optiongetdefault(print32 option, prbool *on) parameters this function has the parameters
listed below. option the value of the option whose default setting you wish to get. for information about the options available and the possible values to pass in this parameter, see the description of the option parameter under ssl_optionsetdefault. on a pointer to the value of the option specified in the option parameter. pr_true indicate...
... there is a pkcs #11 module available with a fortezza-enabled token. the ssl_fortezza_ cipher suites will be removed in nss 3.11. ssl_cipherprefgetdefault gets the current default preference setting for a specified ssl2 or ssl3 cipher suite. syntax #include "ssl.h" secstatus ssl_cipherprefsetdefault(print32 cipher, prbool *enabled); parameters this function has the parameters
listed below. cipher the cipher suite whose default preference setting you want to get. for a
list of the cipher suites you can specify, see ssl_cipherprefsetdefault. enabled a pointer to the default value associated with the cipher specified in the cipher parameter. if nonzero, the specified cipher is enabled. if zero, the cipher is disabl...
...And 17 more matches
MediaDevices.ondevicechange - Web APIs
the mediadevices.ondevicechange property is an eventhandler which specifies a function to be called when the devicechange event occurs on a mediadevices instance. this happens whenever the set of media devices available to the user agent and, by extension, to the web site or app has changed. you can at any time use enumeratedevices() to get the updated
list of available devices. ...
...y extension, to the web site or app has changed. you can at any time use enumeratedevices() to get the updated
list of available devices. syntax mediadevices.ondevicechange = eventhandler; value a function you provide which accepts as input a event object describing the devicechange event that occurred. there is no information about the change included in the event object; to get the updated
list of devices, you'll have to use enumeratedevices(). example in this example, we create a function called updatedevice
list(), which is called once when mediadevices.getusermedia() successfully obtains a stream, and then is called any time the device
list changes. ...
...d. there is no information about the change included in the event object; to get the updated
list of devices, you'll have to use enumeratedevices(). example in this example, we create a function called updatedevice
list(), which is called once when mediadevices.getusermedia() successfully obtains a stream, and then is called any time the device
list changes. it displays in the browser window two
lists: one of audio devices and one of video devices, with both the device's label (name) and whether it's an input or an output device. because the example provides a handler for the devicechange event, the
list is refreshed any time a media device is attached to or removed from the device running the sample. html content <p>click the start button below to begin the demonstration.</p> <div id="sta...
...And 17 more matches
Signaling and video calling - Web APIs
ddition of the function sendtooneuser(). as the name suggests, this sends a stringified json message to a particular username. function sendtooneuser(target, msgstring) { var isunique = true; var i; for (i=0; i<connectionarray.length; i++) { if (connectionarray[i].username === target) { connectionarray[i].send(msgstring); break; } } } this function iterates over the
list of connected users until it finds one matching the specified username, then sends the message to that user. the parameter msgstring is a stringified json object. we could have made it receive our original message object, but in this example it's more efficient this way. since the message has already been stringified, we can send it with no further processing. each entry in connectionarray is a we...
...narray.length; i++) { connectionarray[i].send(msgstring); } } } this code now looks at the pending message to see if it has a target property. if that property is present, it specifies the username of the client to which the message is to be sent, and we call sendtooneuser() to send the message to them. otherwise, the message is broadcast to all users by iterating over the connection
list, sending the message to each user. as the existing code allows the sending of arbitrary message types, no additional changes are required. our clients can now send messages of unknown types to any specific user, letting them send signaling messages back and forth as desired. that's all we need to change on the server side of the equation. now let's consider the signaling protocol we will implem...
... uses the websocket connection to do its work: function sendtoserver(msg) { var msgjson = json.stringify(msg); connection.send(msgjson); } the message object passed into this function is converted into a json string by calling json.stringify(), then we call the websocket connection's send() function to transmit the message to the server. ...
...And 17 more matches
Inputs and input sources - Web APIs
ser has two controllers, which one will be tracked for manipulating ui elements, or will both? to manage input sources, then, you need to be able to enumerate input sources, examine profile information about each input source, and decide how to use each input controller. enumerating input sources the webxr session represented by the xrsession object has an inputsources property which is a live
list of the webxr input devices currently connected to the xr system. let inputsource
list = xrsession.inputsources; due to the fact that the contents of the xrinputsource objects representing each input source in the
list are read-only, changes to these inputs are made by the webxr system by deleting the source's record and adding a new one to replace it. an inputsourceschange event is sent to your ...
...e to the fact that the contents of the xrinputsource objects representing each input source in the
list are read-only, changes to these inputs are made by the webxr system by deleting the source's record and adding a new one to replace it. an inputsourceschange event is sent to your xrsession whenever one or more of the input sources change, or when an input source is added to or removed from the
list. ...
... the webxr system by deleting the source's record and adding a new one to replace it. an inputsourceschange event is sent to your xrsession whenever one or more of the input sources change, or when an input source is added to or removed from the
list. ...
...And 17 more matches
HTML documentation index - HTML: Hypertext Markup Language
generated by the keyboard). 9 autocapitalize autocapitalize, global attributes, html, reference the autocapitalize global attribute is an enumerated attribute that controls whether and how text input is automatically capitalized as it is entered/edited by the user. 10 class global attributes, html, reference the class global attribute is a space-separated
list of the case-sensitive classes of the element. classes allow css and javascript to select and access specific elements via the class selectors or functions like the dom method document.getelementsbyclassname. 11 contenteditable editing, global attributes, html, reference, text editing, contenteditable, text entry, text input the contenteditable global attribute is an enumerate...
...the language of an element: the language that non-editable elements are written in, or the language that the editable elements should be written in by the user. the attribute contains a single “language tag” in the format defined in tags for identifying languages (bcp47). 27 part global attributes, html, reference, part the part global attribute contains a space-separated
list of the part names of the element. part names allows css to select and style specific elements in a shadow tree via the ::part pseudo-element. 28 slot global attributes, html, reference the slot global attribute assigns a slot in a shadow dom shadow tree to an element: an element with a slot attribute is assigned to the slot created by the <slot> element whose name attribute's...
...ner, configuring, element attributes, elements, html, reference, settings, web elements in html have attributes; these are additional values that configure the elements or adjust their behavior in various ways to meet the criteria the users want. 37 html attribute: accept accept, attribute, file, input, reference the accept attribute takes as its value a comma-separated
list of one or more file types, or unique file type specifiers, describing which file types to allow. 38 html attribute: capture api, attribute, attributes, capture, constraint validation, html the capture attribute specifies that, optionally, a new file should be captured, and which device should be used to capture that new media of a type defined by the accept attribute. values...
...And 17 more matches
Document Loading - From Load Start to Finding a Handler - Archive of obsolete content
this document describes the beginning of the document loading process. we start with the request to load a particular link in a particular window, and proceed up to the point at which the data stream is dispatched to the proper handler. the final goal is to find the correct stream
listener to pump the data into when necko calls ondataavailable (e.g., we may find the html parser as the stream
listener to give the data to). dramatis personae this document focuses on the interaction of three classes with each other, but other mozilla components are also involved. main roles nsdocshell this class corresponds, basically, to a "window" object in javascript -- each frame, iframe, content area, tab, etc has its own docshell. a docshell can have a name associated with it (e.g. a named frame).
...ocshell. a docshell can have a name associated with it (e.g. a named frame). all loads that we consider in this document are initiated via the docshell. nsdocshell implements too many interfaces to count; the ones that matter to us most are nsiwebnavigation and nsilinkhandler. nsuriloader this is a service implementing nsiuriloader. ...
...this is the class that handles deciding where the data from the load should go. supporting roles necko this is the mozilla networking library. this handles actually going out and getting the data. ...
...And 16 more matches
Space Manager Detailed Design - Archive of obsolete content
of * available space, i.e. * {0, ayoffset, amaxsize.width, amaxsize.height} in the local * coordinate space * * @param ayoffset the y-offset of where the band begins. the coordinate is * relative to the upper-left corner of the local coordinate space * @param amaxsize the size to use to constrain the band data * @param abanddata [in,out] used to return the
list of trapezoids that * describe the available space and the unavailable space * @return ns_ok if successful and ns_error_failure if the band data is not * not large enough. the 'count' member of the band data struct * indicates how large the array of trapezoids needs to be */ nsresult getbanddata(nscoord ayoffset, const...
...rns ns_ok if successful, ns_error_invalid_arg if there is no region * tagged with aframe */ nsresult offsetregion(nsiframe* aframe, nscoord dx, nscoord dy); /** * remove the region associated with afrane. * * returns ns_ok if successful and ns_error_invalid_arg if there is no region * tagged with aframe */ nsresult removeregion(nsiframe* aframe); /** * clears the
list of regions representing the unavailable space. */ void clearregions(); /** * methods for dealing with the propagation of float damage during * reflow. */ prbool hasfloatdamage() { return !mfloatdamage.isempty(); } void includeindamage(nscoord aintervalbegin, nscoord aintervalend) { mfloatdamage.includeinterval(aintervalbegin + my, aintervalend + my); } prb...
... void includeindamage(nscoord aintervalbegin, nscoord aintervalend) { mfloatdamage.includeinterval(aintervalbegin + my, aintervalend + my); } prbool intersectsdamage(nscoord aintervalbegin, nscoord aintervalend) { return mfloatdamage.intersects(aintervalbegin + my, aintervalend + my); } #ifdef debug /** * dump the state of the spacemanager out to a file */ nsresult
list(file* out); void sizeof(nsisizeofhandler* ahandler, pruint32* aresult) const; #endif private: // structure that maintains information about the region associated // with a particular frame struct frameinfo { nsiframe* const mframe; nsrect mrect; // rectangular region frameinfo* mnext; frameinfo(nsiframe* aframe, const nsrect& arect); #ifdef ns_build_...
...And 16 more matches
Using Service Workers - Web APIs
ode inside then will be run, asynchronously. now for a real example — what if we wanted to load images dynamically, but we wanted to make sure the images were loaded before we tried to display them? this is a standard thing to want to do, but it can be a bit of a pain. we can use .onload to only display the image after it’s loaded, but what about events that start happening before we start
listening to them? we could try to work around this using .complete, but it’s still not foolproof, and what about multiple images? and, ummm, it’s still synchronous, so blocks the main thread. instead, we could build our own promise to handle this kind of case. (see our promises test example for the source code, or look at it running live.) note: a real service worker implementation would use ...
...ive. the one bit we’ll call out here is the promise (see app.js lines 22-47), which is a modified version of what you read about above, in the promises test demo. it is different in the following ways: in the original, we only passed in a url to an image we wanted to load. in this version, we pass in a json fragment containing all the data for a single image (see what they look like in image-
list.js). this is because all the data for each promise resolve has to be passed in with the promise, as it is asynchronous. if you just passed in the url, and then tried to access the other items in the json separately when the for() loop is being iterated through later on, it wouldn’t work, as the promise wouldn’t resolve at the same time as the iterations are being done (that is a synchronous p...
...he service worker being pointed to is on a different origin to that of your app. this is also not allowed. also note: the service worker will only catch requests from clients under the service worker's scope. the max scope for a service worker is the location of the worker. if your service worker is active on a client being served with the service-worker-allowed header, you can specify a
list of max scopes for that worker. in firefox, service worker apis are hidden and cannot be used when the user is in private browsing mode. install and activate: populating your cache after your service worker is registered, the browser will attempt to install then activate the service worker for your page/site. the install event is fired when an install is successfully completed. the install ...
...And 16 more matches
Web APIs
when writing code for the web, there are a large number of web apis available. below is a
list of all the apis and interfaces (object types) that you may be able to use while developing your web app or site. web apis are typically used with javascript, although this doesn't always have to be the case. specifications this is a
list of all the apis that are available. aambient light eventsbbackground tasksbattery api beaconbluetooth apibroadcast channel apiccss counter stylescss font loading api cssomcanvas apichannel messaging apiconsole apicredential management apiddomeencoding apiencrypted media extensionsffetch apifile system api frame timing apifullscreen apiggamepad api geolocation apihhtml drag and drop apihigh resolution timehistory apiiimage capture apiindexeddbinters...
... a angle_instanced_arrays abortcontroller abortsignal absoluteorientationsensor abstractrange abstractworker accelerometer addresserrors aescbcparams aesctrparams aesgcmparams aeskeygenparams ambientlightsensor analysernode animation animationeffect animationevent animationplaybackevent animationtimeline arraybuffervie...
...sensor abstractrange abstractworker accelerometer addresserrors aescbcparams aesctrparams aesgcmparams aeskeygenparams ambientlightsensor analysernode animation animationeffect animationevent animationplaybackevent animationtimeline arraybufferview attr audiobuffer audiobuffersourcenode audioconfiguration audiocontext audiocontextlatencycategory audiocontextoptions audiodestinationnode audio
listener audionode audionodeoptions audioparam audioparamdescriptor audioparammap audioprocessingevent audioscheduledsourcenode audiotrack audiotrack
list audioworklet audioworkletglobalscope audioworkletnode audioworkletnodeoptions audioworkletprocessor authenticatorassertionresponse authenticatorattestationresponse authenticatorresponse b baseaudiocontext basiccardrequest basiccardresponse b...
...And 16 more matches
<input type="email"> - HTML: Hypertext Markup Language
<input> elements of type email are used to let the user enter and edit an e-mail address, or, if the multiple attribute is specified, a
list of e-mail addresses. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the input value is automatically validated to ensure that it's either empty or a properly-formatted e-mail address (or
list of addresses) before the form can be submitted. the :valid and :invalid css pseudo-classes are automatically applied as appropriate to visually denote whether the current value of the field is a valid e-mail address or not. on browsers that don't support inputs of type email, a email inp...
...tomatically applied as appropriate to visually denote whether the current value of the field is a valid e-mail address or not. on browsers that don't support inputs of type email, a email input falls back to being a standard text input. value a domstring representing an e-mail address, or empty events change and input supported common attributes autocomplete,
list, maxlength, minlength, multiple, name,pattern, placeholder, readonly, required, size, and type idl attributes
list and value methods select() value the <input> element's value attribute contains a domstring which is automatically validated as conforming to e-mail syntax. more specifically, there are three possible value formats that will pass validation: an empt...
...erly-formed e-mail address. this doesn't necessarily mean the e-mail address exists, but it is at least formatted correctly. in simple terms, this means username@domain or username@domain.tld. there's more to it than that, of course; see validation for a regular expression that matches the e-mail address validation algorithm. if and only if the multiple attribute is specified, the value can be a
list of properly-formed comma-separated e-mail addresses. any trailing and leading whitespace is removed from each address in the
list. see validation for details on how e-mail addresses are validated to ensure that they're formatted properly. additional attributes in addition to the attributes that operate on all <input> elements regardless of their type, email inputs support the following attrib...
...And 16 more matches
Communicating With Other Scripts - Archive of obsolete content
n only content scripts associated with the same page can interact with each other: if two different matching pages are loaded, content scripts attached to page a cannot interact with those attached to page b. if an add-on loads two or more content scripts into the same page, or panel, using two different method (e.g. a page-mod and a context-menu) they can directly communicate by dispatching and
listening for customevents on dom objects they can access (e.g. the window object). this is true as long as both context scripts have direct access to the same dom objects. the web content has no access to objects created by the content script, unless the content script explicitly makes them available. for more discussion and an example please see content scripts: communicating with the add-on: con...
...ripts if a page includes its own scripts using <script> tags, either embedded in the page or linked to it using the src attribute, there are a couple of ways a content script can communicate with it: using the dom postmessage() api using custom dom events using the dom postmessage api note that before firefox 31 code in content scripts can't use window to access postmessage() and addevent
listener() and instead must use document.defaultview. see the section below on using postmessage() before firefox 31. you can communicate between the content script and page scripts using window.postmessage(). messaging from content script to page script suppose we have a page called "
listen.html" hosted at "my-domain.org", and we want to send messages from the add-on to a script embedded in that ...
...page script suppose we have a page called "
listen.html" hosted at "my-domain.org", and we want to send messages from the add-on to a script embedded in that page. in the main add-on code, we have a page-mod that attaches the content script "talk.js" to the right page: var data = require("sdk/self").data; var pagemod = require("sdk/page-mod"); pagemod.pagemod({ include: "http://my-domain.org/
listen.html", contentscriptfile: data.url("talk.js") }); the "talk.js" content script uses window.postmessage() to send the message to the page: // content-script (talk.js) window.postmessage("message from content script", "http://my-domain.org/"); the second argument may be '*' which will allow communication with any domain. ...
...And 15 more matches
React interactivity: Events and state - Learn web development
re html, css, and javascript languages, knowledge of the terminal/command line. objective: to learn about handling events and state in react, and use those to start making the case study app interactive. ...
... objective: to learn about handling events and state in react, and use those to start making the case study app interactive. handling events if you've only written vanilla javascript before now, you might be used to having a separate javascript file, where you query for some dom nodes and attach
listeners to them. for example: const btn = document.queryselector('button'); btn.addevent
listener('click', () => { alert("hi!"); }); in react, we write event handlers directly on the elements in our jsx, like this: <button type="button" onclick={() => alert("hi!")} > say hi! </button> note: this may seem counter-intuitive regarding best-practice advice that tends to advise against use of inline event handlers on html, but remember that jsx is actually part of your javascript. ...
...browser will show you an alert dialog with the words "hello, world!" — or whatever you chose to write there. callback props in react applications, interactivity is rarely confined to just one component: events that happen in one component will affect other parts of the app. when we start giving ourselves the power to make new tasks, things that happen in the <form /> component will affect the
list rendered in <app />. we want our handlesubmit() function to ultimately help us create a new task, so we need a way to pass information from <form /> to <app />. we can't pass data from child to parent in the same way as we pass data from parent to child using standard props. instead, we can write a function in <app /> that will expect some data from our form as an input, then pass that function ...
...And 15 more matches
Accessibility API cross-reference
an interesting problem is that mozilla, safari/khtml, opera, staroffice and other apps are cross-platform, but there is currently no cross-platform accessibility api. ...
... an interesting problem is that mozilla, safari/khtml, opera, staroffice and other apps are cross-platform, but there is currently no cross-platform accessibility api. ...
...tform, but there is currently no cross-platform accessibility api. the ipc mechanisms used by current generation api's are also not cross-platform, although communication for some cross-platform accessibility api of the future could be done through sockets. these tables describe how various accessibility apis define possible roles of an object, and states. all accessibility apis to date define a
list of possible object roles, or general types, such as button, menu item, text, etc. they also define a
list of possible object states, such as focused, read-only, checked, etc. this table is the start of a cross-reference, so we can spot the differences and similarities in the apis. aria is a standard developed as part of the web accessibility initiative, which uses markup syntax quite familiar to...
...And 15 more matches
certutil
name certutil — manage keys and certificate in the the nss database. synopsis certutil [options] arguments description the certificate database tool, certutil, is a command-line utility that can create and modify certificate and key database files. it can also
list, generate, modify, or delete certificates within the database, create or change the password, generate new public and private key pairs, display the contents of the key database, or delete key pairs within the key database. the key and certificate management process generally begins with creating keys in the key database, then generating and managing certificates in the certificate database. this document discusses certificate and key database management. for information security m...
...public and private key pair within a key database. the key database should already exist; if one is not present, this option will initialize one by default. some smart cards (for example, the litronic card) can store only one key pair. if you create a new key pair for such a card, the previous pair is overwritten. ...
... one is not present, this option will initialize one by default. some smart cards (for example, the litronic card) can store only one key pair. if you create a new key pair for such a card, the previous pair is overwritten. -h display a
list of the options and arguments used by the certificate database tool. -k
list the key id of keys in the key database. a key id is the modulus of the rsa key or the publicvalue of the dsa key. ids are displayed in hexadecimal ("0x" is not shown). -l
list all the certificates, or display information about a named certificate, in a certificate database. use the -h tokenname argument to specify the certificate databas...
...And 15 more matches
XPCOM Interface Reference
platform. ...
...pplicationcachenamespacensiapplicationcacheservicensiapplicationupdateservicensiarraynsiasyncinputstreamnsiasyncoutputstreamnsiasyncstreamcopiernsiasyncverifyredirectcallbacknsiauthinformationnsiauthmodulensiauthpromptnsiauthprompt2nsiauthpromptadapterfactorynsiauthpromptcallbacknsiauthpromptprovidernsiauthpromptwrappernsiautocompletecontrollernsiautocompleteinputnsiautocompleteitemnsiautocomplete
listenernsiautocompleteobservernsiautocompleteresultnsiautocompletesearchnsibadcert
listener2nsibidikeyboardnsibinaryinputstreamnsibinaryoutputstreamnsiblock
listpromptnsiblock
listservicensiboxobjectnsibrowserboxobjectnsibrowserhistorynsibrowsersearchservicensicrlinfonsicrlmanagernsicachensicachedeviceinfonsicacheentrydescriptornsicacheentryinfonsicache
listenernsicachemetadatavisitornsicacheservicensica...
...icensicrlinfonsicrlmanagernsicachensicachedeviceinfonsicacheentrydescriptornsicacheentryinfonsicache
listenernsicachemetadatavisitornsicacheservicensicachesessionnsicachevisitornsicachingchannelnsicancelablensicategorymanagernsichannelnsichanneleventsinknsichannelpolicynsicharsetresolvernsichromeframemessagemanagernsichromeregistrynsiclassinfonsiclipboardnsiclipboardcommandsnsiclipboarddragdrophook
listnsiclipboarddragdrophooksnsiclipboardhelpernsiclipboardownernsicollectionnsicommandcontrollernsicommandlinensicommandlinehandlernsicommandlinerunnernsicomponentmanagernsicomponentregistrarnsicompositionstringsynthesizernsiconsole
listenernsiconsolemessagensiconsoleservicensicontainerboxobjectnsicontentframemessagemanagernsicontentprefnsicontentprefcallback2nsicontentprefobservernsicontentprefservic...
...And 15 more matches
WebIDL bindings
notes: need to document the setup for indexed and named setters/creators/deleters. the webidl bindings are generated at build time based on two things: the actual webidl file and a configuration file that
lists some metadata about how the webidl should be reflected into gecko-internal code. all webidl files should be placed in dom/webidl and added to the
list in the moz.build file in that directory. note that if you're adding new interfaces, then the test at dom/tests/mochitest/general/test_interfaces.html will most likely fail. this is a signal that you need to get a review from a dom peer. resist the urge to just add your interfaces to the moz.build
list without the review; it will just annoy the dom peers and they'll make you get the review anyway. the configuration file, dom/...
...g: if your interface doesn't inherit from any other interfaces, inherit from nswrappercache and hook up the class to the cycle collector so it will trace the wrapper cache properly. note that you may not need to do this if your objects can only be created, never gotten from other objects. if you also inherit from nsisupports, make sure the nsisupports comes before the nswrappercache in your
list of parent classes. if your interface does inherit from another interface, just inherit from the c++ type that the other interface corresponds to. if you do need to hook up cycle collection, it will look like this in the common case of also inheriting from nsisupports: // add strong pointers your class holds here. if you do, change to using // ns_impl_cycle_collection_wrappercache. ns_impl_c...
...ect for security purposes; this is not usually ok for things that are exposed to web content. again, if you do not need wrapper caching you don't need to do this. the actual type returned from getparentobject must be defined in a header included from your implementation header, so that this type's definition is visible to the binding code. add the webidl for myinterface in dom/webidl and to the
list in dom/webidl/moz.build. add an entry to dom/bindings/bindings.conf that sets some basic information about the implementation of the interface. if the c++ type is not mozilla::dom::myinterface, you need to set the 'nativetype' to the right type. if the type is not in the header file one gets by replacing '::' with '/' and appending '.h', then add a corresponding 'headerfile' annotation (or heade...
...And 15 more matches
Microdata DOM API - Web APIs
from all browsers and are therefore deprecated. you can't use them anymore and this document is kept as information only. microdata becomes even more useful when scripts can use it to expose information to the user, for example offering it in a form that can be used by other applications. the document.getitems(typenames) method provides access to the top-level microdata items. it returns a node
list containing the items with the specified types, or all types if no argument is specified. each item is represented in the dom by the element on which the relevant itemscope attribute is found. these elements have their element.itemscope idl attribute set to true. the type(s) of items can be obtained using the element.itemtype idl attribute on the element with the itemscope attribute. methods doc...
...s, or all types if no argument is specified. each item is represented in the dom by the element on which the relevant itemscope attribute is found. these elements have their element.itemscope idl attribute set to true. the type(s) of items can be obtained using the element.itemtype idl attribute on the element with the itemscope attribute. methods document . getitems( [ types ] ) returns a node
list of the elements in the document that create items, that are not part of other items, and that are of the types given in the argument, if any are
listed. the types argument is interpreted as a space-separated
list of types. the document.getitems(typenames) method takes a string that contains an unordered set of unique space-separated tokens that are case-sensitive, representing types. when calle...
... create items, that are not part of other items, and that are of the types given in the argument, if any are
listed. the types argument is interpreted as a space-separated
list of types. the document.getitems(typenames) method takes a string that contains an unordered set of unique space-separated tokens that are case-sensitive, representing types. when called, the method must return a live node
list object containing all the elements in the document, in tree order, that are each top-level microdata items whose types include all the types specified in the method's argument, having obtained the types by splitting the string on spaces. if there are no tokens specified in the argument, then the method must return a node
list containing all the top-level microdata items in the document. when the m...
...And 15 more matches
ARIA Test Cases - Accessibility
ifically for testing aria. still, dojo's widgets implement aria, and the noted test files could be used as an "aria test file". new tests for internet explorer 8 rc1 on this msdn page the aria state/role mapping in ie8 to msaa roles can be directly checked. also, as a clever feature for at testing, the firing of events (like event_object_statechange) can be invoked from the examples. finally, a
list of currently non-mapped aria roles is given. documenting and filing bugs review the information on how to file a bug on an aria implementation. when documenting an issue, please also
list it in the relevant compatibility table below. when possible provide a link to the bug in the database so that its status can be reviewed. widget test cases alert simple alert complex alert real alert ex...
...ss - fail fail orca - n/a - - combobox testcases: editable combo 2 dojo nightly build (combobox) dojo nightly build (combobox with auto complete) expected at behavior: on focus, screen reader announces the label, the role and the current content of the combobox. ...
...her the
list is open or closed. when the combo box is opened or closed, the new open/closed state should be spoken. markup used: notes: results: at firefox ie opera safari jaws 9 - - n/a n/a jaws 10 fail. label and current content as well as role are spoken, also when typing in a new value, that gets reflected. but when dropping down the
lists of states in either example, after the second or so
list item, jaws turns off forms mode, and the user has to turn off v cursor to be able to make selections or tab to anything useful. - - - voiceover (leopard) n/a n/a - fail window-eyes - - - - nvda - n/a - - zoom (leopard) pass n/a pass pass z...
...And 15 more matches
Implementing a Microsoft Active Accessibility (MSAA) Server - Accessibility
practical tips for developers and how mozilla does it contents this document is for developers working to support msaa in an application in order to make it accessible with 3rd party assistive technologies, as well as for hackers wishing to be involved in mozilla's msaa support specifically. if you're implementing controls/widgets, you should also see the accessible toolkit check
list. if you're interested in more about gecko's msaa implementation, read gecko info for windows accessibility vendors to learn how msaa clients can utilize gecko's msaa support. intro: what is msaa? msaa is the microsoft active accessibility (msaa) api, used on windows operating systems to support assistive technologies for users with disabilities. third party assistive technology, such as screen reade...
...mportant] role_chart role_dialog [semi-important, not currently used by all at's] role_border role_grouping role_separator [important] role_toolbar role_statusbar [important] role_table [important] role_columnheader role_rowheader role_column role_row role_cell [important] role_link [important] role_helpballoon role_character role_
list [important] role_
listitem [important] role_outline [important] role_outlineitem [important] role_pagetab [important] role_propertypage [important] role_indicator role_graphic [important] role_statictext [important] role_text [important] role_pushbutton [important] role_checkbutton [important] role_radiobutton [important] role_combobox [important...
... role_
listitem [important] role_outline [important] role_outlineitem [important] role_pagetab [important] role_propertypage [important] role_indicator role_graphic [important] role_statictext [important] role_text [important] role_pushbutton [important] role_checkbutton [important] role_radiobutton [important] role_combobox [important] role_drop
list [important] role_progressbar [important] role_dial role_hotkeyfield role_slider role_spinbutton role_diagram role_animation role_equation role_buttondropdown role_buttonmenu role_buttondropdowngrid role_whitespace role_pagetab
list [important] role_clock role_splitbutton role_ipaddress role_nothing msaa object identifiers c...
...And 15 more matches
Working with Events - Archive of obsolete content
the add-on sdk supports event-driven programming. objects emit events on state changes that might be of interest to add-on code, such as browser windows opening, pages loading, network requests completing, and mouse clicks. by registering a
listener function to an event emitter an add-on can receive notifications of these events. we talk about content scripts in more detail in the working with content scripts guide. ...
... can receive notifications of these events. we talk about content scripts in more detail in the working with content scripts guide. additionally, if you're using content scripts to interact with web content, you can define your own events and use them to communicate between the main add-on code and the content scripts. ...
...ng with content scripts guide. additionally, if you're using content scripts to interact with web content, you can define your own events and use them to communicate between the main add-on code and the content scripts. in this case one end of the conversation emits the events, and the other end
listens to them. ...
...And 14 more matches
Enhanced Extension Installation - Archive of obsolete content
nstalled into only two locations: the firefox user's profile directory directory, e.g. ~/.mozilla/firefox/abcdefgh.default/extensions/ the firefox application directory, e.g. c:\program files\mozilla firefox\extensions extension metadata the extension system stores metadata in both of the two locations, in the following files: <location>/extensions/extensions.rdf - an xml/rdf datasource
listing all the extensions installed at that location. <location>/extensions.ini - an ini manifest
listing the directories for all the extensions and themes at the location (used by the component manager, preferences system, chrome registry etc to locate files during the startup process). in the profile directory, the file compatibility.ini stores information about the version of the application (b...
...ply xpcom components, preferences defaults etc. for extensions, on the next startup, the startup system notices the presence of the .autoreg file and starts the extension manager with a "dirty" flag, telling it to finish any install operations that may be pending. the extension manager loads the xml/rdf datasources (this is allowable and necessary because a major change has happened) and gets a
list of all items that need to be installed (tracked using a tobeinstalled flag on the item in the datasource). it locates the staged copy of the xpi file, extracts its contents (logging file additions as it goes into {guid}/uninstall/uninstall), loads the install manifest file and copies all metadata into the appropriate datasource. at this time a new extensions.ini file is written locating the exten...
...t start. the finalization process then notifies the startup process that finalization has changed this manifest, and that the application must be restarted to pick up changes specified therein. the startup process receives this "needsrestart" bit when the extension manager's startup completes, shuts down xpcom and relaunches the application. on the next restart, the xredirprovider now supplies a
list of directories to requesting systems
listing the new item's components, defaults and chrome manifests. 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 o...
...And 14 more matches
Introduction to SSL - Archive of obsolete content
d connection. these capabilities address fundamental concerns about communication over the internet and other tcp/ip networks: ssl server authentication allows a user to confirm a server's identity. ssl-enabled client software can use standard techniques of public-key cryptography to check that a server's certificate and public id are valid and have been issued by a certificate authority (ca)
listed in the client's
list of trusted cas. this confirmation might be important if the user, for example, is sending a credit card number over the network and wants to check the receiving server's identity. ssl client authentication allows a server to confirm a user's identity. using the same techniques as those used for server authentication, ssl-enabled server software can check that a client's ce...
...r, for example, is sending a credit card number over the network and wants to check the receiving server's identity. ssl client authentication allows a server to confirm a user's identity. using the same techniques as those used for server authentication, ssl-enabled server software can check that a client's certificate and public id are valid and have been issued by a certificate authority (ca)
listed in the server's
list of trusted cas. this confirmation might be important if the server, for example, is a bank sending confidential financial information to a customer and wants to check the recipient's identity. an encrypted ssl connection requires all information sent between a client and a server to be encrypted by the sending software and decrypted by the receiving software, thus providin...
... table 1. cipher suites supported by the ssl protocol that use the rsa key-exchange algorithm strength category and recommended use cipher s...
...And 14 more matches
Other form controls - Learn web development
prerequisites: basic computer literacy, and a basic understanding of html. objective: to understand the non-<input> form features, and how to implement them using html. ...
...esize reference page for a demonstration of how these work. drop-down controls drop-down controls are a simple way to let users select from many different options without taking up much space in the user interface. html has two forms of drop down content: the select box, and the autocomplete box. in both cases the interaction is the same — once the control is activated, the browser displays a
list of values the user can select between. note: you can find examples of all the drop-down box types on github at drop-down-content.html (see it live also). select box a simple select box is created with a <select> element with one or more <option> elements as its children, each of which specifies one of its possible values. <select id="simple" name="simple"> <option>banana</option> <opti...
... the data...
...And 14 more matches
Adding a new todo form: Vue events, methods, and models - Learn web development
ascript frameworks next we now have sample data in place, and a loop that takes each bit of data and renders it inside a todoitem in our app. what we really need next is the ability to allow our users to enter their own todo items into the app, and for that we'll need a text <input>, an event to fire when the data is submitted, a method to fire upon submission to add the data and rerender the
list, and a model to control the data. this is what we'll cover in this article. prerequisites: familiarity with the core html, css, and javascript languages, knowledge of the terminal/command line. vue components are written as a combination of javascript objects that manage the app's data and an html-based template syntax that maps to the underlying dom structure. for installa...
...x that maps to the underlying dom structure. 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. objective: to learn about handling forms in vue, and by association, events, models, and methods. creating a new to-do form we now have an app that displays a
list of to-do items. however, we can't update our
list of items without manually changing our code! let's fix that. let's create a new component that will allow us to add a new to-do item. in your components folder, create a new file called todoform.vue. add a blank <template> and a <script> tag like before: <template></template> <script> export default {}; </script> let's add ...
... if you fill it out and click the "add" button, the page will post the form back to the serv...
...And 14 more matches
Downloads.jsm
ling ongoing downloads, and retrieving download-related configuration. to use it, you first need to import the code module into your javascript scope: components.utils.import("resource://gre/modules/downloads.jsm"); method overview promise<download> createdownload(object aproperties); promise<void> fetch(asource, atarget, [optional] object aoptions); promise<download
list> get
list(atype); promise<downloadsummary> getsummary(atype); constants constant description public work on downloads that were not started from a private browsing window. private work on downloads that were started from a private browsing window. all work on both downloads.private and downloads.public downloads. properties ...
...vior of this function. you may pass an object with a subset of the following fields: isprivate: optional indicates whether the download originated from a private window. if omitted, the download is public. promise resolves to undefined when the download has finished successfully and you can access the target file. promise can be rejected with downloaderror if the download failed. ...
...th a subset of the following fields: isprivate: optional indicates whether the download originated from a private window. if omitted, the download is public. promise resolves to undefined when the download has finished successfully and you can access the target file. promise can be rejected with downloaderror if the download failed. get
list() retrieves the specified type of download
list object. ...
...And 14 more matches
XPCOM Interface Reference by grouping
grouping and category names were made by somewhat arbitrary decision by the author. (i'm fully aware that this will be a great point of discussion and probably will end in tears, but since i'm the first person to apparently take a swing at this, i get first dibs.) the primary sections consist of: browser this section contains elements associated with the view pane or the content of the "browser window" proper. it is wrapped by system, but displayed for convenience. ...
...lication level interfaces including calls to external support elements (such as device calls). this is the root element and may contain some functions defined in other groups. user this section contains elements specific to a given user's data storage. ...
...t nsidomhtmlformelement nsidomhtmlmediaelement nsidomhtmlsourceelement nsidomhtmltimeranges nsidomjswindow nsidomnode nsidomnshtmldocument nsidomstorageitem nsidomstoragemanager nsidomwindow nsidomwindow2 nsidomwindowinternal nsidomwindowutils nsidynamiccontainer nsieditor event nsidomevent nsidomeventgroup nsidomevent
listener nsidomeventtarget nsidommousescrollevent nsidommoztouchevent nsidomorientationevent nsidomprogressevent nsidomsimplegestureevent nsidragdrophandler nsidragservice nsidragsession html nsiaccessibilityservice nsiaccessiblecoordinatetype nsiaccessibledocument nsiaccessibleeditabletext nsiaccessibleevent nsiaccessiblehyperlink ...
...And 14 more matches
Index - Firefox Developer Tools
underbird, or by using ctrl/cmd+shift+i in either application. dom inspector is standalone; it supports all toolkit applications, and it's possible to embed it in your own xulrunner app. dom inspector can serve as a sanity check to verify the state of the dom, or it can be used to manipulate the dom by hand, if desired. 10 all keyboard shortcuts tools, l10n:priority this page
lists all keyboard shortcuts used by the developer tools built into firefox. 11 application application, debugging, devtools, firefox, guide, manifests, service workers the application panel provides tools for inspecting and debugging modern web apps (also known as progressive web apps). this includes inspection of service workers and web app manifests. 12 debugging ser...
... course of devtools development, we have added several experimental panels to try out new ideas. not all of these have had wide adoption, and due to the cost of maintenance, seldom used panels are eventually removed. 29 devtools api devtools the devtools api provides a way to register and access developer tools in firefox. 30 devtoolscolors css this chart
lists colors and css variables as implemented in the dark theme and light theme for developer tools. 31 eyedropper firefox, tools, web development:tools the eyedropper tool enables you to select colors in the current page. it works like a magnifying glass over the page, enabling you to select with pixel precision. underneath the magnifying glass it shows the color value for the cu...
...map view the tree map view provides a visual representation of the snapshot, that helps you quickly get an idea of which objects are using the most memory. 45 migrating from firebug firebug, migration when migrating from firebug to the firefox developer tools, you may wonder where the features you loved in firebug are available in the developer tools. the following
list aims to help firebug users to find their way into the developer tools. 46 network monitor debugging, dev tools, firefox, guide, networking, tools, l10n:priority the network monitor shows you all the network requests firefox makes (for example, when it loads a page, or due to xmlhttprequests), how long each request takes, and details of each request. 47 inspecting w...
...And 14 more matches
WAI-ARIA Roles - Accessibility
screen readers will instantly start reading out the updated content when the role is added. if the user is expected to close the alert, then the alertdialog role should be used instead.aria: application rolethe application role indicates to assistive technologies that an element and all of its children should be treated similar to a desktop application, and no traditional html interpretation techniques should be used. ...
...a feed enables screen readers to use the browse mode reading cursor to both read and scroll through a stream of rich content that may continue scrolling infinitely by loading more content as the user reads.aria: figure rolethe aria figure role can be used to identify a figure inside page content...
...posite widgets or applications, the document role can inform assistive technologies to switch context to a reading mode: the document role tells assistive technologies with reading or browse modes to use the document mode to read the content contained within this element.aria: feed rolea feed is a dynamic scrollable
list of articles in which articles are added to or removed from either end of the
list as the user scrolls. a feed enables screen readers to use the browse mode reading cursor to both read and scroll through a stream of rich content that may continue scrolling infinitely by loading more content as the user reads.aria: figure rolethe aria figure role can be used to identify a figure inside page content where appropriate semantics do not already exist. a figure is generally considere...
...And 14 more matches
Using the application cache - HTML: Hypertext Markup Language
; it’s in the process of being removed from the web platform. as of firefox 44+, when appcache is used to provide offline support for a page, a warning message displays in the console advising developers to use service workers instead (bug 1204581). introduction html5 provides an application caching mechanism that lets web applications run offline. this application cache (appcache) interface
lists resources that browsers should cache to be available offline. applications that are cached load and work correctly offline, even if users press the refresh button. an application cache gives the following benefits: offline browsing users can navigate a site even when they are offline. speed cached resources are local, and therefore load faster. reduced server load the browser only downl...
...uced server load the browser only downloads resources that have changed from the server. ...
...e in the <html> element: <html manifest="/example.appcache"> … </html> the manifest attribute references a url for a cache manifest file: a text file that
lists urls that browsers should cache for your application. you should include the manifest attribute on each page of your site that you want cached. the browser does not cache pages without the manifest attribute, unless such pages are
listed in the manifest file. you do not need to
list all pages you want cached in the manifest file, the browser implicitly adds every page that the user visits and that has the manifest attribute set to the application cache. some browsers (e.g., firefox) display a notification bar the first time a user loads an application that uses the application cache. the notification bar displays a message suc...
...And 14 more matches
context-menu - Archive of obsolete content
adds items, submenus, and menu separators to the page's context menu. usage instead of manually adding items when particular contexts occur and then removing them when those contexts go away, you bind items to contexts, and the adding and removing is automatically handled for you. items are bound to contexts in much the same way that event
listeners are bound to events. when the user invokes the context menu, all of the items bound to the current context are automatically added to the menu. if no items are bound, none are added. likewise, any items that were previously in the menu but are not bound to the current context are automatically removed from the menu. you never need to manually remove your items from the menu unless you want them to never appear again. for example, if your add-...
...large. specifying contexts as its name implies, the context menu should be reserved for the occurrence of specific contexts. contexts can be related to page content or the page itself, but they should never be external to the page. for example, a good use of the menu would be to show an "edit image" item when the user right-clicks an image in the page. a bad use would be to show a submenu that
listed all the user's tabs, since tabs aren't related to the page or the node the user clicked to open the menu. the page context first of all, you may not need to specify a context at all. when a top-level item does not specify a context, the page context applies. an item that is in a submenu is visible unless you specify a context. the page context occurs when the user invokes the context menu on...
...h your menu items are shown, you can use content scripts. like other apis in the sdk, the context-menu api uses content scripts to let your add-on interact with pages in the browser. each menu item you create in the top-level context menu can have a content script. a special event named "context" is emitted in your content scripts whenever the context menu is about to be shown. if you register a
listener function for this event and it returns true, the menu item associated with the
listener's content script is shown in the menu. for example, this item appears whenever the context menu is invoked on a page that contains at least one image: require("sdk/context-menu").item({ label: "this page has images", contentscript: 'self.on("context", function (node) {' + ' return !
...And 13 more matches
Appendix F: Monitoring DOM changes - Archive of obsolete content
this document lays out some alternatives which do not have such severe performance impacts. ...
...this document lays out some alternatives which do not have such severe performance impacts. ...
...this document lays out some alternatives which do not have such severe performance impacts. ...
...And 13 more matches
Intercepting Page Loads - Archive of obsolete content
tart with the simplest one, which is also the most common to use. note: performance is very important when it comes to add-ons and page loads. read the recommendations in appendix a regarding performance if you're planning on implementing any of these. the easy way: load events this comes from the tabbrowser code snippets page. in a nutshell, from the chrome code in the overlay we add an event
listener for the load event. this._loadhandler = function() {that._onpageload(); }; gbrowser.addevent
listener("load", this._loadhandler, true); gbrowser is a global object that corresponds to the tabbrowser element in the main browser window. it is full of useful functions, so you should always keep it in mind when you want to handle tabs and web content windows. attaching the load event handler t...
... this._loadhandler = function() {that._onpageload(); }; gbrowser.addevent
listener("load", this._loadhandler, true); gbrowser is a global object that corresponds to the tabbrowser element in the main browser window. it is full of useful functions, so you should always keep it in mind when you want to handle tabs and web content windows. attaching the load event handler to gbrowser allows us to
listen to these events for all tabs, without having to worry how many tabs are open. gbrowser exists in every browser window. we store the handler function in a private variable because later we want to remove it when we do not need it anymore. ...
...lways keep it in mind when you want to handle tabs and web content windows. attaching the load event handler to gbrowser allows us to
listen to these events for all tabs, without having to worry how many tabs are open. gbrowser exists in every browser window. we store the handler function in a private variable because later we want to remove it when we do not need it anymore. gbrowser.removeevent
listener("load", this._loadhandler, true); finally, the actual code for the handler, which is very simple: _onpageload : function(event) { // this is the content document of the loaded page. let doc = event.originaltarget; if (doc instanceof htmldocument) { // is this an inner frame? if (doc.defaultview.frameelement) { // frame within a tab was loaded. // find the root do...
...And 13 more matches
Sending forms through JavaScript - Learn web development
ascript and xml". how is it different? the xmlhttprequest (xhr) dom object can build http requests, send them, and retrieve their results. historically, xmlhttprequest was designed to fetch and send xml as an exchange format, which has since been superceded by json. but neither xml nor json fit into form data request encoding. form data (application/x-www-form-urlencoded) is made of url-encoded
lists of key/value pairs. for transmitting binary data, the http request is reshaped into multipart/form-data. note: the fetch api is often used in place of xhr these days — it is a modern, updated version of xhr, which works in a similar fashion but has some advantages. most of the xhr code you'll see in this article could be swapped out for fetch. if you control the front-end (the code that's ...
...lencodeddatapairs.push( encodeuricomponent( name ) + '=' + encodeuricomponent( data[name] ) ); } // combine the pairs into a single string and replace all %-encoded spaces to // the '+' character; matches the behaviour of browser form submissions. ...
...ce all %-encoded spaces to // the '+' character; matches the behaviour of browser form submissions. ...
...And 13 more matches
Video and Audio APIs - Learn web development
= 'visible'; these two lines remove the default browser controls from the video, and make the custom controls visible. playing and pausing the video let's implement probably the most important control — the play/pause button. first of all, add the following to the bottom of your code, so that the playpausemedia() function is invoked when the play button is clicked: play.addevent
listener('click', playpausemedia); now to define playpausemedia() — add the following, again at the bottom of your code: function playpausemedia() { if(media.paused) { play.setattribute('data-icon','u'); media.play(); } else { play.setattribute('data-icon','p'); media.pause(); } } here we use an if statement to check whether the video is paused. the htmlmediaelemen...
...lue on the play button to "u", which is a "paused" icon, and invoke the htmlmediaelement.play() method to play the media. on the second click, the button will be toggled back again — the "play" icon will be shown again, and the video will be paused with htmlmediaelement.pause(). stopping the video next, let's add functionality to handle stopping the video. add the following addevent
listener() lines below the previous one you added: stop.addevent
listener('click', stopmedia); media.addevent
listener('ended', stopmedia); the click event is obvious — we want to stop the video by running our stopmedia() function when the stop button is clicked. we do however also want to stop the video when it finishes playing — this is marked by the ended event firing, so we also set up a ...
...ener() lines below the previous one you added: stop.addevent
listener('click', stopmedia); media.addevent
listener('ended', stopmedia); the click event is obvious — we want to stop the video by running our stopmedia() function when the stop button is clicked. we do however also want to stop the video when it finishes playing — this is marked by the ended event firing, so we also set up a
listener to run the function on that event firing too. next, let's define stopmedia() — add the following function below playpausemedia(): function stopmedia() { media.pause(); media.currenttime = 0; play.setattribute('data-icon','p'); } there is no stop() method on the htmlmediaelement api — the equivalent is to pause() the video, and set its currenttime property to 0. setting ...
...And 13 more matches
Routing in Ember - Learn web development
't get to any of those fancy features, but we'll still make sure that the route provides the minimally required data to view a page. creating the "index" route did not add a route definition line to router.js, because like with url navigation and javascript module loading, "index" is a special word that indicates the default route to render, load, etc. ...
...ll still make sure that the route provides the minimally required data to view a page. creating the "index" route did not add a route definition line to router.js, because like with url navigation and javascript module loading, "index" is a special word that indicates the default route to render, load, etc. ...
...module loading, "index" is a special word that indicates the default route to render, load, etc. to adjust our old way of rendering the todo
list app, we'll first need to replace the todo
list component invocation from the application template with an {{outlet}} call, which means "any sub-route will be rendered in place here". go to the todomvc/app/templates/application.hbs file and replace <todo
list /> with {{outlet}} next, in our index.hbs, completed.hbs, and active.hbs templates (also found in the templates directory) we can for now just enter the todo
list component invocation. ...
...And 13 more matches
Introduction to client-side frameworks - Learn web development
olloquial understanding. react extends javascript with html-like syntax, known as jsx. start learning react why do frameworks exist? we've discussed the environment that inspired the creation of frameworks, but not really why developers felt the need to make them. exploring the why requires first examining the challenges of software development. consider a common kind of application: a to-do
list creator, which we'll look at implementing using a variety of frameworks in future chapters. this application should allow users to do things like render a
list of tasks, add a new task, and delete a task; and it must do this while reliably tracking and updating the data underlying the application. in software development, this underlying data is known as state. each of our goals is theoretically...
...; we can use an identifier to find, edit, or delete a task. when we remember that the application has to let the user to do all of these things through the browser, however, some cracks start to show. the real problem is this: every time we change our application’s state, we need to update the ui to match. we can examine the difficulty of this problem by looking at just one feature of our todo
list app: rendering a
list of tasks. the verbosity of dom changes building html elements and rendering them in the browser at the appropriate time takes a surprising amount of code. let's say that our state is an array of objects structured like this: const state = [ { id: 'todo-0', name: 'learn some frameworks!' } ] how do we show one of those tasks to our user? we want to represent e...
...g a
list of tasks. the verbosity of dom changes building html elements and rendering them in the browser at the appropriate time takes a surprising amount of code. let's say that our state is an array of objects structured like this: const state = [ { id: 'todo-0', name: 'learn some frameworks!' } ] how do we show one of those tasks to our user? we want to represent each task as a
list item – an html <li> element inside of an unordered
list element (a <ul>). how do we make it? that could look something like this: function buildtodoitemel(id, name) { const item = document.createelement('li'); const span = document.createelement('span'); const textcontent = document.createtextnode(name); span.appendchild(textcontent) item.id = id; item.appendchild(span); item.a...
...And 13 more matches
Advanced Svelte: Reactivity, lifecycle, accessibility - Learn web development
in this article we will add the app's final features and further componentize our app. we will learn how to deal with reactivity issues related to updating objects and arrays. to avoid common pitfalls, we'll have to dig a little deeper into svelte's reactivity system. we'll also look at solving some accessibility focus issues, and more besides. ...
...ective: learn some advanced svelte techniques involving solving reactivity issues, keyboard accessibility problems to do with component lifecycle, and more. we'll focus on some accessibility issues involving focus management. to do so, we'll utilize some techniques for accessing dom nodes and executing methods like focus() and select(). we will also see how to declare and clean-up event
listeners on dom elements. we also need to learn a bit about component lifecycle, to understand when these dom nodes get mounted and and unmounted from the dom and how we can access them. we will also learn about the action directive, which will allow us to extend the functionality of html elements in a reusable and declarative way. finally, we will learn a bit more about components. so far, we've s...
...behavior will be confusing at best. we'd also like to add some usability features, like disabling the save button when required fields are empty, giving focus to certain html elements or auto-selecting contents when a text input receives focus. to implement all these features we'll need programmatic access to dom nodes to run functions like focus() and select(). we will also have to use addevent
listener() and removeevent
listener() to run specific tasks when the control receives focus. the problem is that all these dom nodes are dynamically created by svelte at runtime. so we'll have to wait for them to be created and added to the dom in order to use them. to do so, we'll have to learn about the component lifecycle to understand when we can access them — more on this later. creating a new...
...And 13 more matches
Dynamic behavior in Svelte: working with variables and props - Learn web development
in this article we'll be using variables and props to make our app dynamic, allowing us to add and delete todos, mark them as complete, and filter them by status. prerequisites: at minimum, it is recommended that you are familiar with the core html, css, and javascript languages, and have knowledge of the terminal/command line. ...
...html, css, and javascript languages, and have knowledge of the terminal/command line. you'll need a terminal with node + npm installed to compile and build your app. objective: learn and put into practice some basic svelte concepts, like creating components, passing data using props, render javascript expressions into our markup, modify the components state and iterating over
lists. code along with us git clone the github repo (if you haven't already done it) with: git clone https://github.com/opensas/mdn-svelte-tutorial.git then to get to the current app state, run cd mdn-svelte-tutorial/03-adding-dynamic-behavior or directly download the folder's content: npx degit opensas/mdn-svelte-tutorial/03-adding-dynamic-behavior remember to run npm install && npm ru...
...: true }, { id: 2, name: 'create your first component', completed: true }, { id: 3, name: 'complete the rest of the tutorial', completed: false } ] let totaltodos = todos.length let completedtodos = todos.filter(todo => todo.completed).length </script> now let's do something with that information. let's start by showing a status message. find the <h2> heading with an id of
list-heading and replace the hardcoded number of active and completed tasks with dynamic expressions: <h2 id="
list-heading">{completedtodos} out of {totaltodos} items completed</h2> go to the app, and you should see the "2 out of 3 items completed" message as before, but this time the information is coming from the todos array. to prove it, go to that array, and try changing some of the...
...And 13 more matches
NSS Tools crlutil
for information on security module database management, see using the security module database tool. ...
...for information on security module database management, see using the security module database tool. ...
...for information on security module database management, see using the security module database tool. ...
...And 13 more matches
nsIMsgIncomingServer
nsimsgincomingserver mailnews/base/public/nsimsgincomingserver.idlscriptable ??? add brief description of interface ??? ...
...omingserver mailnews/base/public/nsimsgincomingserver.idlscriptable ??? add brief description of interface ??? ...
... ??? add brief description of interface ??? ...
...And 13 more matches
nsIWebBrowser
embedding/browser/webbrowser/nsiwebbrowser.idlscriptable this interface is implemented by web browser objects. embedders use this interface during initialization to associate the new web browser instance with the embedders chrome and to register any
listeners. the interface may also be used at runtime to obtain the content dom window and from that the rest of the dom. ...
... the embedders chrome and to register any
listeners. the interface may also be used at runtime to obtain the content dom window and from that the rest of the dom. inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) warning: this interface was frozen for a very long time, but was unfrozen for gecko 2.0. method overview void addwebbrowser
listener(in nsiweakreference a
listener, in nsiidref aiid); void removewebbrowser
listener(in nsiweakreference a
listener, in nsiidref aiid); attributes attribute type description containerwindow nsiwebbrowserchrome the chrome object associated with the browser instance. the embedder must create one chrome object for each browser object that is instantiat...
...e chrome object for each browser object that is instantiated. the embedder must associate the two by setting this property to point to the chrome object before creating the browser window via the browser's nsibasewindow interface. the chrome object must also implement nsiembeddingsitewindow. the chrome may optionally implement nsiinterfacerequestor, nsiwebbrowserchromefocus, nsicontextmenu
listener and nsitooltip
listener to receive additional notifications from the browser object. the chrome object may optionally implement nsiwebprogress
listener instead of explicitly calling addwebbrowser
listener() and removewebbrowser
listener() to register a progress
listener object. if the implementation does this, it must also implement nsiweakreference. note: the implementation should not re...
...And 13 more matches
nsIWindowMediator
mmon uses of nsiwindowmediator are, enumerating all windows of a given type and getting the most recent / any window of a given type. ...
...r are, enumerating all windows of a given type and getting the most recent / any window of a given type. ...
...merating all windows of a given type and getting the most recent / any window of a given type. ...
...And 13 more matches
ARIA: tab role - Accessibility
the aria tab role indicates an interactive element inside a tab
list that, when activated, displays its associated tabpanel. <button role="tab" aria-selected="true" aria-controls="tabpanel-id" id="tab-id">tab label</button> description an element with the tab role controls the visibility of an associated element with the tabpanel role. the common user experience pattern is a group of visual tabs above, or to the side of, a content area, and selecting a different tab changes the content and makes the selected tab more prominent than the other tabs. elements with the role tab must either be a child of an element with the tab
list role, or have their id part of the aria-owns property of a tab
list. this combination identifies to assistive technology that the element is part of a group of relate...
...lected tab more prominent than the other tabs. elements with the role tab must either be a child of an element with the tab
list role, or have their id part of the aria-owns property of a tab
list. this combination identifies to assistive technology that the element is part of a group of related elements. some assistive technology will provide a count of the number of tab role elements inside a tab
list, and inform users of which tab they currently have targeted. they should contain the aria-controls property identifying an element with the tabpanel role. when an element with the tabpanel role has focus, or a child of it has focus, that indicates that the connected element with the tab role is the active tab in a tab
list. when working with elements with the tab role, when they are selected or a...
... be set to false. when a tab is selected or active, its controlled tabpanel should have its aria-expanded and hidden attributes set to true, otherwise they should be set to false. associated roles and attributes aria-selected boolean aria-controls id of element with tabpanel role id content keyboard interaction key action tab when focus is outside of the tab
list moves focus to the active tab. if focus is on the active tab moves focus to the next element in the keyboard focus order, ideally the active tab's associated tabpanel. → focuses and optionally activates the next tab in the tab
list. if the current tab is the last tab in the tab
list it activates the first tab. ← focuses and optionally activates the previous tab in the ...
...And 13 more matches
Accessibility documentation index - Accessibility
found 105 pages: # page tags and summary 1 accessibility accessibility, landing accessibility (often abbreviated to a11y—as in "a" then 11 characters then "y") in web development means enabling as many people as possible to use web sites, even when those people's abilities are limited in some way. 2 aria aria, accessibility, html accessible rich internet applications (aria) is a set of attributes that define ways to make web content and web applications (especially those developed with javascript) more accessible to people with disabilities. ...
...s ways to make the web more accessible to people with disabilities. a few guidelines to follow that ensure better accessibility, like using drag and drop for placement of the widgets. 7 aria live regions aria, accessibility, arialive using javascript, it is possible to dynamically change parts of a page without requiring the entire page to reload — for instance, to update a
list of search results on the fly, or to display a discreet alert or notification which does not require user interaction. while these changes are usually visually apparent to users who can see the page, they may not be obvious to users of assistive technologies. aria live regions fill this gap and provide a way to programmatically expose dynamic content changes in a way that can be announced by assis...
...ot visible on the screen. if there is visible text labeling the element, use aria-labelledby instead. 22 using the aria-labelledby attribute aria, accessibility, broken link the aria-labelledby attribute establishes relationships between objects and their label(s), and its value should be one or more element ids, which refer to elements that have the text needed for labeling.
list multiple element ids in a space delimited fashion.this idea is similar to how the "for" attribute is used to link a label to an input.assistive technology, such as screen readers, use this attribute to catalog the objects in a document so that users can navigate between them. without an element id, the assistive technology cannot catalog the object. 23 using the aria-orientation attrib...
...And 13 more matches
system - CSS: Cascading Style Sheets
alphabetic; system: symbolic; system: additive; system: fixed; /* combined values */ system: fixed 3; system: extends decimal; this may take one of three forms: one of the keyword values cyclic, numeric, alphabetic, symbolic, additive, or fixed. the keyword value fixed along with an integer. the keyword value or extends along with a @counter-style name. cyclic cycles through the
list of symbols provided. once the end of the
list of symbols is reached, it will loop back to the beginning and start over. this system is useful for simple bullet styles with just one symbol, or for styles having multiple symbols. at least one symbol must be specified in the symbols descriptor, or the counter style is not valid. fixed defines a finite set of symbols are specified. once the system ...
...ols, it will fall back. this system is useful in cases where the counter values are finite. at least one symbol must be specified in the symbols descriptor or the counter style is not valid. also an optional <integer> can be specified after the the system, as the value of the first symbol. if this integer is omitted, value of the first integer is taken as 1. symbolic cycles through the provided
list of symbols. on each successive pass through the cycle, the symbols used for the counter representation are doubled, tripled, and so on. for example, if the original symbols provided were "ā½" and "ā¾", on each successive pass, they will become "ā½ā½" and "ā¾ā¾", "ā½ā½ā½" and "ā¾ā¾ā¾" and so on. at least one symbol must be specified in the symbols descriptor or the counter style is not...
...unter styles as extending from the decimal style. ...
...And 13 more matches
Creating a cross-browser video player - Developer guides
control set, also in html, which will be used to control the video. the control set most browser's default video controls have the following functionality: play/pause mute volume control progress bar skip ahead go fullscreen the custom control set will also support this functionality, with the addition of a stop button. ...
...t, also in html, which will be used to control the video. the control set most browser's default video controls have the following functionality: play/pause mute volume control progress bar skip ahead go fullscreen the custom control set will also support this functionality, with the addition of a stop button. ...
...l set most browser's default video controls have the following functionality: play/pause mute volume control progress bar skip ahead go fullscreen the custom control set will also support this functionality, with the addition of a stop button. once again the html is quite straightforward, using an unordered
list with
list-style-type:none set to enclose the controls, each of which is a
list item with float:left. for the progress bar, the progress element is taken advantage of, with a fallback provided for browsers that don't support it (e.g. ie8 and ie9). this
list is inserted after the <video> element, but inside the <figure> element (this is important for the fullscreen functionality, which is explained later on). <ul id="video-controls" class="controls"> <li><button id="playp...
...And 13 more matches
tabs - Archive of obsolete content
open, manipulate, and access tabs, and receive tab events. usage open a tab you can open a new tab, specifying various properties including location: var tabs = require("sdk/tabs"); tabs.open("http://www.example.com"); track tabs you can register event
listeners to be notified when tabs open, close, finish loading dom content, or are made active or inactive: var tabs = require("sdk/tabs"); //
listen for tab openings. tabs.on('open', function onopen(tab) { myopentabs.push(tab); }); //
listen for tab content loads. tabs.on('ready', function(tab) { console.log('tab is loaded', tab.title, tab.url); }); access tabs the module itself can be used as a
list of all opened tabs across all windows. in particular, you can enumerate it: var tabs = require('sdk/tabs'); for (let tab of tab...
...l tabs by index: var tabs = require('sdk/tabs'); tabs.on('ready', function () { console.log('first: ' + tabs[0].title); console.log('last: ' + tabs[tabs.length-1].title); }); you can access the currently active tab: var tabs = require('sdk/tabs'); tabs.on('activate', function () { console.log('active: ' + tabs.activetab.url); }); track a single tab given a tab, you can register event
listeners to be notified when the tab is closed, activated or deactivated, or when the page hosted by the tab is loaded or retrieved from the "back-forward cache": var tabs = require("sdk/tabs"); function onopen(tab) { console.log(tab.url + " is open"); tab.on("pageshow", logshow); tab.on("activate", logactivate); tab.on("deactivate", logdeactivate); tab.on("close", logclose); } function ...
... the active tab, and detach it again. the stylesheet is called "style.css" and is located in the add-on's "data" directory: var tabs = require("sdk/tabs"); var { attach, detach } = require('sdk/content/mod'); var { style } = require('sdk/stylesheet/style'); var { togglebutton } = require("sdk/ui/button/toggle"); var style = style({ uri: './style.css' }); var button = togglebutton({ id: "sty
list", label: "sty
list", icon: "./icon-16.png", onchange: function(state) { if (state.checked) { attach(style, tabs.activetab); } else { detach(style, tabs.activetab); } } }); private windows if your add-on has not opted into private browsing, then you won't see any tabs that are hosted by private browser windows. tabs hosted by private browser windows won't be s...
...And 12 more matches
event/target - Archive of obsolete content
eventtarget is the base class for all objects in sdk on which events are emitted. also see the tutorial on implementing event targets to get started with this api. instantiation it's easy to create event target objects, no special arguments are required. ...
...eventtarget is the base class for all objects in sdk on which events are emitted. also see the tutorial on implementing event targets to get started with this api. instantiation it's easy to create event target objects, no special arguments are required. ...
...uments are required. const { eventtarget } = require("sdk/event/target"); let target = eventtarget(); for a convenience though optional options arguments may be used, in which case all the function properties with keys like: onmessage, onmyevent... will be auto registered for associated 'message', 'myevent' events on the created instance. all other properties of options will be ignored. adding
listeners eventtarget interface defines on method, that can be used to register event
listeners on them for the given event type: target.on('message', function onmessage(message) { // note: `this` pseudo variable is an event `target` unless // intentionally overridden via `.bind()`. console.log(message); }); sometimes event
listener may care only about very first event of specific type. event...
...And 12 more matches
ui/toolbar - Archive of obsolete content
item in items must be an action button, a toggle button, or a frame instance. buttons each take up a fixed width. if more than one frame is supplied here, the frames each occupy an equal vertical strip of the toolbar. hidden boolean boolean indicating whether the frame should be hidden initially or not. defaults to false. ...
...ttons each take up a fixed width. if more than one frame is supplied here, the frames each occupy an equal vertical strip of the toolbar. hidden boolean boolean indicating whether the frame should be hidden initially or not. defaults to false. onattach function assign a
listener to the attach event. ondetach function assign a
listener to the detach event. ...
...frames each occupy an equal vertical strip of the toolbar. hidden boolean boolean indicating whether the frame should be hidden initially or not. defaults to false. onattach function assign a
listener to the attach event. ondetach function assign a
listener to the detach event. onshow function assign a
listener to the show event. onhide function assign a
listener to the hide event. ...
...And 12 more matches
Creating Event Targets - Archive of obsolete content
this tutorial describes the use of low-level apis. these apis are still in active development, and we expect to make incompatible changes to them in future releases. the guide to event-driven programming with the sdk describes how to consume events: that is, how to
listen to events generated by event targets. for example, you can
listen to the tabs module's ready event or the panel object's show event. with the sdk, it's also simple to implement your own event targets. this is especially useful if you want to build your own modules, either to organize your add-on better or to enable other developers to reuse your code. if you use the sdk's event framework for your event targets, users of your module can
listen for events using the sdk's standard event api. in this tutorial we'll create par...
... using the places api first, let's write some code using places api that logs the uris of bookmarks the user adds. ...
...this consists of...
...And 12 more matches
textbox (Toolkit autocomplete) - Archive of obsolete content
toolkit applications (such as firefox) use a different autocomplete mechanism than the mozilla suite. the example below will create an autocomplete textbox that will search the user's history. ...
...r this should be set to a character that is used as a shortcut key. this should be one of the characters that appears in the label attribute for the element. autocompletepopup type: id the id of a popup element used to hold autocomplete results for the element. autocompletesearch new in thunderbird 2requires seamonkey 1.1 type: space-separated
list of values a space-separated
list of search component names, each of which implements the nsiautocompletesearch interface. the components are created using the name @mozilla.org/autocomplete/search;1?name= where name is
listed in this attribute. search-autocomplete requires seamonkey 2.1 the user's default search engine's suggestions are searched. places-tag-autocomp...
...arched. autocompletesearchparam new in thunderbird 2 requires seamonkey 1.1 type: string a string which is passed to the search component. completedefaultindex new in thunderbird 3 requires seamonkey 2.0 type: boolean if true, the best match value will be filled into the textbox as the user types. if set to false or omitted, the value must be selected from the
list. completeselectedindex type: boolean if true, the text in the text field will be autocompleted as the user selects from the popup
list. crop type: boolean this attribute is not used and is only provided for compatibility with the menu
list element. disableautocomplete new in thunderbird 3requires seamonkey 2.0 type: boolean if true, the autocomplete be...
...And 12 more matches
Looping code - Learn web development
s.height = height; function random(number) { return math.floor(math.random()*number); } function draw() { ctx.clearrect(0,0,width,height); for (let i = 0; i < 100; i++) { ctx.beginpath(); ctx.fillstyle = 'rgba(255,0,0,0.5)'; ctx.arc(random(width), random(height), random(50), 0, 2 * math.pi); ctx.fill(); } } btn.addevent
listener('click',draw); </script> </body> </html> you don't have to understand all the code for now, but let's look at the part of the code that actually draws the 100 circles: for (let i = 0; i < 100; i++) { ctx.beginpath(); ctx.fillstyle = 'rgba(255,0,0,0.5)'; ctx.arc(random(width), random(height), random(50), 0, 2 * math.pi); ctx.fill(); } random(x), defined earlier in the c...
...: <label for="search">search by contact name: </label> <input id="search" type="text"> <button>search</button> <p></p> now on to the javascript: const contacts = ['chris:2232322', 'sarah:3453456', 'bill:7654322', 'mary:9998769', 'dianne:9384975']; const para = document.queryselector('p'); const input = document.queryselector('input'); const btn = document.queryselector('button'); btn.addevent
listener('click', function() { let searchname = input.value.tolowercase(); input.value = ''; input.focus(); for (let i = 0; i < contacts.length; i++) { let splitcontact = contacts[i].split(':'); if (splitcontact[0].tolowercase() === searchname) { para.textcontent = splitcontact[0] + '\'s number is ' + splitcontact[1] + '.'; break; } else { para.textcontent = 'cont...
...="search">search by contact name: </label> <input id="search" type="text"> <button>search</button> <p></p> <script> const contacts = ['chris:2232322', 'sarah:3453456', 'bill:7654322', 'mary:9998769', 'dianne:9384975']; const para = document.queryselector('p'); const input = document.queryselector('input'); const btn = document.queryselector('button'); btn.addevent
listener('click', function() { let searchname = input.value.tolowercase(); input.value = ''; input.focus(); for (let i = 0; i < contacts.length; i++) { let splitcontact = contacts[i].split(':'); if (splitcontact[0].tolowercase() === searchname) { para.textcontent = splitcontact[0] + '\'s number is ' + splitcontact[1] + '.'; break; } e...
...And 12 more matches
Componentizing our React app - Learn web development
components. react doesn’t have any hard rules for what is and isn’t a component – that’s up to you! in this article we will show you a sensible way to break our app up into components. prerequisites: familiarity with the core html, css, and javascript languages, knowledge of the terminal/command line. objective: to show a sensible way of breaking our todo
list app into components. defining our first component defining a component can seem tricky until you have some practice, but the gist is: if it represents an obvious "chunk" of your app, it's probably a component if it gets reused often, it's probably a component. that second bullet is especially valuable: making a component out of common ui elements allows you to change your code in on...
... that second bullet is especially valuable: making a component out of common ui elements allows you to change your code in one place and see those changes everywhere that component is used. you don't have to break everything out into components right away, either. let's take the second bullet point as inspiration and make a component out of the most reused, most important piece of the ui: a todo
list item. make a <todo /> before we can make a component, we should create a new file for it. in fact, we should make a directory just for our components. the following commands make a components directory and then, within that, a file called todo.js. make sure you're in the root of your app before you run these! mkdir src/components touch src/components/todo.js our new todo.js file is currently ...
...import react from "react"; since we're going to make a component called todo, you can start adding the code for that to todo.js too, as follows. ...
...And 12 more matches
Vue conditional rendering: editing existing todos - Learn web development
t to edit our todo item, via an event handler function called toggletoitemeditform(). this handler will set an isediting flag to true. to do that, we'll need to first define it inside our data() property. the "delete" button, when clicked, will delete the todo item via an event handler function called deletetodo(). in this handler we’ll emit an item-deleted event to our parent component so the
list can be updated. let's define our click handlers, and the necessary isediting flag. add isediting below your existing isdone data point: data() { return { isdone: this.done, isediting: false }; } now add your methods inside a methods property, right below your data() property: methods: { deletetodo() { this.$emit('item-deleted'); }, toggletoitemeditform() { ...
...to look like so: <to-do-item-edit-form v-else :id="id" :label="label" @item-edited="itemedited" @edit-cancelled="editcancelled"> </to-do-item-edit-form> updating and deleting todo items now we can toggle between the edit form and the checkbox. however, we haven’t actually handled updating the todoitems array back in app.vue. to fix that, we need to
listen for the item-edited event, and update the
list accordingly. we'll also want to handle the delete event so that we can delete todo items. add the following new methods to your app.vue's component object, below the existing methods inside the methods property: deletetodo(todoid) { const itemindex = this.todoitems.findindex(item => item.id === todoid); this.todoitems.splice(itemindex, 1); },...
... for item-edited, you'll need to pass the item.id and the special $event variable. this is a special vue variable used to pass event data to methods. when using native html events (like click), this will pass the native event object to your method. update the <to-do-item></to-do...
...And 12 more matches
XPCOM array guide
> any that has a default constructor and copy constructor no yes yes* yes can hold objects directly, in which case it owns them. when holding pointers, doesn't own the pointer. nsisupportsarray xpcom object yes no yes* no reference counted, strong (*) note: concrete c++ arrays can be made read-only by declaring them const. for example: // handle
list cannot modify the array because of const void handle
list(const nstarray<t>&); in-place enumeration most of the arrays presented here provide callback-style means to enumerate members of an array. instead of incrementally accessing each element of the array by its index, the arrays provide a way to pass in a callback function that will be called for each element in the array. for most concrete...
...ers or an array of strings. will your array store non-refcounted objects and be a fixed size? if so, just use a native c++ array unless you need the enumeration options on nstarray<t>. example: an array of error message static const char* pointers. are all the things you are storing interface pointers to instances of the same interface? if so, use nscomarray. example: a content node's
list of nsicontent children. otherwise use nsiarray and make liberal use of queryelementat(). the point of nscomarray is that it's a template, and all the pointers in it must be pointers to the same type; it's nice to be able to use it because you get type-safety and don't have to spend time and code qiing (like you have to with nsiarray). array guidelines here are a few simple rules which will k...
...s that modify the array have been broken out into nsimutablearray. an nsiarray implementation can be created from c++ or javascript using nsicomponentmanager.createinstance() and the contract id "@mozilla.org/array;1". the created array implements nsimutablearray and nsiarray. since nsimutablearray derives from nsiarray, the resulting array can be cast to a read-only array. ...
...And 12 more matches
nsIHTMLEditor
editor/idl/nsihtmleditor.idlscriptable please add a summary to this article. ...
... acanoutdent); void getinlineproperty(in nsiatom aproperty, in astring aattribute, in astring avalue, out boolean afirst, out boolean aany, out boolean aall); astring getinlinepropertywithattrvalue(in nsiatom aproperty, in astring aattribute, in astring avalue, out boolean afirst, out boolean aany, out boolean aall); nsisupportsarray getlinkedobjects(); void get
listitemstate(out boolean amixed, out boolean ali, out boolean adt, out boolean add); void get
liststate(out boolean amixed, out boolean aol, out boolean aul, out boolean adl); astring getparagraphstate(out boolean amixed); nsidomelement getselectedelement(in astring atagname); nsidomelement getselectioncontainer(); void ignorespuriousdragevent(in boolean ai...
...oid inserthtmlwithcontext(in astring ainputstring, in astring acontextstr, in astring ainfostr, in astring aflavor, in nsidomdocument asourcedoc, in nsidomnode adestinationnode, in long adestinationoffset, in boolean adeleteselection); void insertlinkaroundselection(in nsidomelement aanchorelement); boolean isanonymouselement(in nsidomelement aelement); void makeorchange
list(in astring a
listtype, in boolean entire
list, in astring abullettype); boolean nodeisblock(in nsidomnode node); void pastenoformatting(in long aselectiontype); void rebuilddocumentfromsource(in astring asourcestring); void removealldefaultproperties(); void removeallinlineproperties(); void removedefaultproperty(in nsiatom aproperty, in astring...
...And 12 more matches
Document - Web APIs
ml, xml, svg, …), a larger api is available: html documents, served with the "text/html" content type, also implement the htmldocument interface, whereas xml and svg documents implement the xmldocument interface. constructor document() creates a new document object. properties this interface also inherits from the node and eventtarget interfaces. document.anchorsread only returns a
list of all of the anchors in the document. document.body returns the <body> or <frameset> node of the current document. document.charactersetread only returns the character set being used by the document. document.compatmode read only indicates whether the document is rendered in quirks or strict mode. document.contenttype read only returns the content-type from the mime header of the cu...
...eread only returns the document type definition (dtd) of the current document. document.documentelementread only returns the element that is a direct child of the document. for html documents, this is normally the htmlhtmlelement object representing the document's <html> element. document.documenturiread only returns the document location as a string. document.embedsread only returns a
list of the embedded <embed> elements within the current document. document.fonts returns the fontfaceset interface of the current document. document.formsread only returns a
list of the <form> elements within the current document. document.headread only returns the <head> element of the current document. document.hiddenread only returns a boolean value indicating if the page is considered ...
...document. document.fonts returns the fontfaceset interface of the current document. document.formsread only returns a
list of the <form> elements within the current document. document.headread only returns the <head> element of the current document. document.hiddenread only returns a boolean value indicating if the page is considered hidden or not. document.imagesread only returns a
list of the images in the current document. document.implementationread only returns the dom implementation associated with the current document. document.laststylesheetsetread only returns the name of the style sheet set that was last enabled. ...
...And 12 more matches
Intersection Observer API - Web APIs
you would specify the array [0, 0.25, 0.5, 0.75, 1]. the default is 0 (meaning as soon as even one pixel is visible, the callback will be run). a value of 1.0 means that the threshold isn't considered passed until every pixel is visible. ...
...t to watch: let target = document.queryselector('#
listitem'); observer.observe(target); // the callback we setup for the observer will be executed now for the first time // it waits until we assign a target to our observer (even if the target is currently not visible) whenever the target meets a threshold specified for the intersectionobserver, the callback is invoked. ...
...check the value of the isintersecting property to see if the entry represents an element that currently intersects with the root. be aware that your callback is executed on the main thread. it should operate as quickly as possible; if anything time-consuming needs to be don...
...And 12 more matches
Capabilities, constraints, and settings - Web APIs
we call the constraint exerciser. the constraint exerciser lets you experiment with the results of different constraint sets being applied to the audio and video tracks coming from the computer's a/v input devices (such as its webcam and microphone). overview the process works like this (using mediastreamtrack as an example): if needed, call mediadevices.getsupportedconstraints() to get the
list of supported constraints, which tells you what constrainable properties the browser knows about. this isn't always necessary, since any that aren't known will simply be ignored when you specify them—but if you have any that you can't get by without, you can start by checking to be sure they're on the
list. once the script knows whether the property or properties it wishes to use are supported,...
...ill simply be ignored when you specify them—but if you have any that you can't get by without, you can start by checking to be sure they're on the
list. once the script knows whether the property or properties it wishes to use are supported, it can then check the capabilities of the api and its implementation by examining the object returned by the track's getcapabilities() method; this object
lists each supported constraint and the values or range of values which are supported. finally, the track's applyconstraints() method is called to configure the api as desired by specifying the values or ranges of values it wishes to use for any of the constrainable properties about which it has a preference. the track's getconstraints() method returns the set of constraints passed into the most rec...
.... for a complete representation of the track's current configuration, use getsettings(). in the media stream api, both mediastream and mediastreamtrack have constrainable properties. determining if a constraint is supported if you need to know whether or not a given constriant is supported by the user agent, you can find out by calling navigator.mediadevices.getsupportedconstraints() to get a
list of the constrainable properties which the browser knows, like this: let supported = navigator.mediadevices.getsupportedconstraints(); document.getelementbyid("framerateslider").disabled = !supported["framerate"]; in this example, the supported constraints are fetched, and a control that lets the user configure the frame rate is disabled if the framerate constraint isn't supported. how constra...
...And 12 more matches
:is() (:matches(), :any()) - CSS: Cascading Style Sheets
this is useful for writing large selectors in a more compact form. note that currently browsers support this functionality as :matches(), or through an older, prefixed pseudo-class — :any(), including older versions of chrome, firefox, and safari. :any() works in exactly the same way as :matches()/:is(), except that it requires vendor prefixes and doesn't support complex selectors. ...
...<compound-selector> ]*where <compound-selector> = [ <type-selector>? <subclass-selector>* [ <pseudo-element-selector> <pseudo-class-selector>* ]* ]!<combinator> = '>' | '+' | '~' | [ '|' ]where <type-selector> = <wq-name> | <ns-prefix>? '*'<subclass-selector> = <id-selector> | <clas...
...<compound-selector> ]*where <compound-selector> = [ <type-selector>? <subclass-selector>* [ <pseudo-element-selector> <pseudo-class-selector>* ]* ]!<combinator> = '>' | '+' | '~' | [ '|' ]where <type-selector> = <wq-name> | <ns-prefix>? '*'<subclass-selector> = <id-selector> | <class-selector> | <attribute-select...
...And 12 more matches
<input type="file"> - HTML: Hypertext Markup Language
idl attributes files and value dom interface htmlinputelement properties properties that apply only to elements of type file methods select() value a file input's value attribute contains a domstring that represents the path to the selected file(s). if the user selected multiple files, the value represents the first file in the
list of files they selected. the other files can be identified using the input's htmlinputelement.files property. note: if multiple files are selected, the string represents the first selected file. javascript can access the other files through the input's files property. if no file is yet selected, the string is "" (empty). the string is prefixed with c:\fakepath\, to prevent malicious software...
...r's file structure. additional attributes in addition to the common attributes shared by all <input> elements, inputs of type file also support the following attributes: attribute description accept one or more unique file type specifiers describing file types to allow capture what source to use for capturing image or video data files a file
list listing the chosen files multiple a boolean which, if present, indicates that the user may choose more than one file accept the accept attribute value is a string that defines the file types the file input should accept. this string is a comma-separated
list of unique file type specifiers. because a given file type may be identified in more than one manner, it's useful to prov...
...if this attribute is missing, the user agent is free to decide on its own what to do. if the requested facing mode isn't available, the user agent may fall back to its preferred default mode. note: capture was previously a boolean attribute which, if present, requested that the device's media capture device(s) such as camera or microphone be used instead of requesting a file input. files a file
list object that
lists every selected file. this
list has no more than one member unless the multiple attribute is specified. multiple when the multiple boolean attribute is specified, the file input allows the user to select more than one file. non-standard attributes in addition to the attributes
listed above, the following non-standard attributes are available on some browsers. you should try t...
...And 12 more matches
Communicating using "port" - Archive of obsolete content
ert', 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. on():
listen to a message. remove
listener(): stop
listening to a message. once():
listen to only the first occurrence of a message. accessing port accessing port in the content script note that the global self object is completely different from the self module, which provides an api for an add-on to access its data files and id. in the content script the port object is available as a property of the...
... instead, each time a content script is attached to a page, the worker associated with the page is supplied to the page-mod in its onattach function. by supplying a target for this function in the page-mod's constructor you can register to receive messages from the content script, and take a reference to the worker so as to emit messages to the content script. ...
...value that is serializable to json. ...
...And 11 more matches
Accessibility/XUL Accessibility Reference - Archive of obsolete content
testing with jaws 7.10, use of an iframe element causes many, unpredictable issues with xul inside of the iframe. okay to use html inside of iframe. see browser element for more info. ...
...f an iframe element causes many, unpredictable issues with xul inside of the iframe. okay to use html inside of iframe. see browser element for more info. ...
...predictable issues with xul inside of the iframe. okay to use html inside of iframe. see browser element for more info. ...
...And 11 more matches
XUL controls - Archive of obsolete content
the following table
lists the xul user interface controls. for a step-by-step guide on how to use these controls, see the xul tutorial. for more reference information, see the xul reference. <button> a button that can be pressed by the user. <button label="save" accesskey="s"/> more information about the button element. button reference <button type="menu"> a button that has a drop down menu attached to it. pressing the button opens the menu. <button type="menu" label="view"> <menupopup> <menuitem label="
list"/> <menuitem label="details"/> </menupopup> </button> more information about this type of menu button element. button reference related elements: menupopup menuitem ...
... reference <image> an image specified by a url. <image src="start.png"/> more information about the image element. image reference <label> adds a text label to a nearby control. <label control="volume" value="volume:"/> more information about the label element. ...
... <image> an image specified by a url. <image src="start.png"/> more information about the image element. image reference <label> adds a text label to a nearby control. <label control="volume" value="volume:"/> more information about the label element. ...
...And 11 more matches
tabbrowser - Archive of obsolete content
roup, onnewtab, tabmodalpromptshowing properties browsers, cangoback, cangoforward, contentdocument, contenttitle, contentvieweredit, contentviewerfile, contentwindow, currenturi, docshell, documentcharsetinfo, homepage, markupdocumentviewer, securityui, selectedbrowser, selectedtab, sessionhistory, tabcontainer, tabs, visibletabs, webbrowserfind, webnavigation, webprogress methods addprogress
listener, addtab, addtabsprogress
listener,appendgroup, getbrowseratindex, getbrowserindexfordocument, getbrowserfordocument, getbrowserfortab, geticon, getnotificationbox, gettabforbrowser, gettabmodalpromptbox, goback, gobackgroup, goforward, goforwardgroup, gohome, gotoindex, loadgroup, loadonetab, loadtabs, loaduri, loaduriwithflags, movetabto, pintab, reload, reloadalltabs, reloadtab, reloadwithfl...
... autocompletepopup type: id the id of a popup element used to hold autocomplete results for the element. autoscroll type: boolean set to false to d...
... autocompletepopup type: id the id of a popup element used to hold autocomplete results for the element. autoscroll type: boolean set to false to disable autoscroll for this browser. if ...
...And 11 more matches
Creating reftest-based unit tests
he harness will not be used. running reftest-based unit tests note: mach is a python2 script. if your use python3 as default you must edit the first line of mach. to run all the reftests, go to the directory where you save firefox's source code and run: ./mach reftest if you want to run a particular set of reftests, pass the path as an argument: ./mach reftest path/from/sourcedir/reftest.
list and to run a single reftest just pass the path to the test file (not the reference file): ./mach reftest path/from/sourcedir/reftest-name.html there is no reftest equivalent to mach mochitest --keep-open, but temporarily adding the reftest-wait class to a test (or disabling the script that removes it) will keep it open longer. running ipc reftests reftests can also be run in a separate proc...
...ript that removes it) will keep it open longer. running ipc reftests reftests can also be run in a separate process, which can differ from same-process rendering in significant ways. currently, ipc reftests are only being run on linux. to run: moz_layers_force_shmem_surfaces=1 make -c $(objdir) reftest-ipc note: right now, automation currently only runs layout/reftests/reftest-sanity/reftest.
list! if you try to run the full suite, you may experience stalls or other issues. creating reftest-based unit tests your first reftest it is a silly example, but this will step you through creating your first reftest. step 1 for now you must check out and build the browser in order to run the tests. see the build documentation for details on doing that. sorry about this, but the released buil...
...code tree) and make that your current directory (i.e. move to that directory). ...
...And 11 more matches
nsITraceableChannel
of http traffic. it is implemented by nsihttpchannel. ...
....0.4 the typical way to use this interface is as follows: register for the "http-on-examine-response" notification to track all http responses; skip redirects (responsestatus = 3xx on nsihttpchannel), since otherwise you may end up with two
listeners registered for a channel; qi the channel passed as the "subject" to your observer to nsitraceablechannel, and replace the default nsistream
listener (that passes the data to the original requester - e.g. to xmlhttprequest or to the browser tab that made the request) with your own implementation (see "implementing nsistream
listener" below). after that your nsistream
listener implementation will get the response data and will be able to pass the data on to the original nsistream
listener (possibly modifying it). see nsitraceablechannel, in...
...istream
listener implementation will get the response data and will be able to pass the data on to the original nsistream
listener (possibly modifying it). see nsitraceablechannel, intercept http traffic for a more detailed description with code samples. see modify url before loading page in firefox for an overview of how to modify a request before it is made. method overview nsistream
listener setnew
listener(in nsistream
listener a
listener); methods setnew
listener() replaces the channel's current
listener with a new one, returning the
listener previously assigned to the channel. nsistream
listener setnew
listener( in nsistream
listener a
listener ); parameters a
listener an nsistream
listener to be notified of events on the http channel. ...
...And 11 more matches
nsITransactionManager
editor/txmgr/idl/nsitransactionmanager.idlscriptable this interface is implemented by an object that wants to manage/track transactions. ...
... editor/txmgr/idl/nsitransactionmanager.idlscriptable this interface is implemented by an object that wants to manage/track transactions. ...
... editor/txmgr/idl/nsitransactionmanager.idlscriptable this interface is implemented by an object that wants to manage/track transactions. ...
...And 11 more matches
The HTML DOM API - Web APIs
to using the dom in the context of a web browser, as well as to using it to represent html documents specifically. among the things added to document by the html standard are: support for accessing various information provided by the http headers when loading the page, such as the location from which the document was loaded, cookies, modification date, referring site, and so forth. access to
lists of elements in the document's <head> block and body, as well as
lists of the images, links, scripts, etc. contained in the document. support for interacting with the user by examining focus and by executing commands on editable content. event handlers for document events defined by the html standard to allow access to mouse and keyboard events, drag and drop, media control, and more. event ha...
...pi includes a few interfaces and types to support the html element interfaces. html element interfaces these interfaces represent specific html elements (or sets of related elements which have the same properties and methods associated with them). ...
... to support the html element interfaces. html element interfaces these interfaces represent specific html elements (or sets of related elements which have the same properties and methods associated with them). ...
...And 11 more matches
Key Values - Web APIs
corresponding virtual keycodes for common platforms are included where available. learn how to use these key values in javascript using keyboardevent.key special values | modifier keys | whitespace keys | navigation keys | editing keys | ui keys | device keys | ime and composition keys | function keys | phone keys | multimedia keys | audio control keys | tv control keys | media controller keys | speech recognition keys | document keys | application selector keys | browser control keys | numeric keypad keys special values values of key which have special meanings other than identifying a specific key or character. ...
.... qt::key_context3 (0x01100002) "soft4" the fourth general-purpose virtual function key. qt::key_context4 (0x01100003) phone keys these keys represent buttons which commonly exist on modern smartphones. keyboardevent.key value description virtual keycode windows mac linux android "appswitch" presents a
list of recently-used applications which lets the user change apps quickly. keycode_app_switch (181) "call" the call key. dials the number which has been entered. qt::key_call (0x01100004) keycode_call (5) "camera" the camera key. activates the camera. qt::key_camera (0x01100020) keycode_camera (27) "camerafocus" the focus ...
..._mix_down (254) "tvaudiodescriptionmixup" increases the audio description's mixing volume; increases the volume of the audio descriptions relative to the program sound. keycode_tv_audio_description_mix_up (253) "tvcontentsmenu" displays or hides the media contents available for playback (this may be a channel guide showing the currently airing programs, or a
list of media files to play). keycode_tv_contents_menu (256) "tvdataservice" displays or hides the tv's data service menu. keycode_tv_data_service (230) "tvinput" [2] cycles the input mode on an external tv. keycode_tv_input (178) "tvinputcomponent1" switches to the input "component 1." keycode_tv_input_com...
...And 11 more matches
Web audio spatialization basics - Web APIs
the official term for this is spatialization, and this article will cover the basics of how to implement such a system. basics of spatialization in web audio, complex 3d spatializations are created using the pannernode, which in layman's terms is basically a whole lotta cool maths to make audio appear in 3d space. ...
...system. basics of spatialization in web audio, complex 3d spatializations are created using the pannernode, which in layman's terms is basically a whole lotta cool maths to make audio appear in 3d space. think sounds flying over you, creeping up behind you, moving across in front of you. that sort of thing. it's really useful for webxr and gaming. in 3d spaces, it's the only way to achieve rea
listic audio. libraries like three.js and a-frame harness its potential when dealing with sound. it's worth noting that you don't have to move sound within a full 3d space either — you could stick with just a 2d plane, so if you were planning a 2d game, this would still be the node you were looking for. note: there's also a stereopannernode designed to deal with the common use case of creating sim...
...ing quieter as it is moved away from the user or is rotated so the speakers are facing away from them, etc. this is done by setting the different properties of the pannernode object instance in relation to that movement, to emulate spacialization. note: the experience is much better if you use headphones, or have some kind of surround sound system to plug your computer into. creating an audio
listener so let's begin! the baseaudiocontext (the interface the audiocontext is extended from) has a
listener property that returns an audio
listener object. this represents the
listener of the scene, usually your user. you can define where they are in space and in which direction they are facing. they remain static. the pannernode can then calculate its sound position relative to the position of the...
...And 11 more matches
Testing media queries programmatically - CSS: Cascading Style Sheets
the dom provides features that can test the results of a media query programmatically, via the mediaquery
list interface and its methods and properties. once you've created a mediaquery
list object, you can check the result of the query or receive notifications when the result changes. creating a media query
list before you can evaluate the results of a media query, you need to create the mediaquery
list object representing the query. to do this, use the window.matchmedia method. ...
...ace and its methods and properties. once you've created a mediaquery
list object, you can check the result of the query or receive notifications when the result changes. creating a media query
list before you can evaluate the results of a media query, you need to create the mediaquery
list object representing the query. to do this, use the window.matchmedia method. ...
...k the result of the query or receive notifications when the result changes. creating a media query
list before you can evaluate the results of a media query, you need to create the mediaquery
list object representing the query. to do this, use the window.matchmedia method. ...
...And 11 more matches
appearance (-moz-appearance, -webkit-appearance) - CSS: Cascading Style Sheets
ugh it is supported in most modern browsers, its implementation varies widely. in older browsers, even the keyword none does not have the same effect on all form elements across different browsers, and some do not support it at all. the differences are smaller in the newest browsers. ...
...ser interface module level 4 values */ appearance: none; appearance: auto; appearance: menu
list-button; appearance: textfield; /* "compat-auto" values, which have the same effect as 'auto' */ appearance: button; appearance: searchfield; appearance: textarea; appearance: push-button; appearance: slider-horizontal; appearance: checkbox; appearance: radio; appearance: square-button; appearance: menu
list; appearance:
listbox; appearance: meter; appearance: progress-bar; /* partial
list of available values in gecko */ -moz-appearance: scrollbarbutton-up; -moz-appearance: button-bevel; /* partial
list of available values in webkit/blink (as well as gecko and edge) */ -webkit-appearance: media-mute-button; -webkit-appearance: caret; values standard keywords value demo browser ...
...iv> firefox chrome safari edge no special styling is applied. this is the default. auto div{ color: black; -moz-appearance: auto; -webkit-appearance: auto; appearance:auto; } <div>lorem</div> none the user agent selects the appropriate special styling based on the element. acts as none on elements with no special styling. menu
list-button div { color: black; -moz-appearance: menu
list-button; -webkit-appearance: menu
list-button; } <div>lorem</div> firefox chrome safari edge the element is styled as a button that would indicate a menu
list can be opened. textfield div { color: black; -moz-appearance: textfield; -webkit-appearance: textfield; } <div>lorem</div> ...
...And 11 more matches
<input type="range"> - HTML: Hypertext Markup Language
github.com/mdn/interactive-examples and send us a pull request. if the user's browser doesn't support type range, it will fall back and treat it as a text input. value a domstring containing the string representation of the selected numeric value; use valueasnumber to get the value as a number. ...
...ll request. if the user's browser doesn't support type range, it will fall back and treat it as a text input. value a domstring containing the string representation of the selected numeric value; use valueasnumber to get the value as a number. events change and input supported common attributes autocomplete,
list, max, min, and step idl attributes
list, value, and valueasnumber methods stepdown() and stepup() validation there is no pattern validation available; however, the following forms of automatic validation are performed: if the value is set to something which can't be converted into a valid floating-point number, validation fails because the input is suffering from a bad input. the value won't be less than min. th...
...lem.max - rangeelem.min)/2; if an attempt is made to set the value lower than the minimum, it is set to the minimum. similarly, an attempt to set the value higher than the maximum results in it being set to the maximum. ...
...And 11 more matches
<input type="url"> - HTML: Hypertext Markup Language
d css pseudo-classes are automatically applied as appropriate to visually denote whether the current value of the field is a valid url or not. on browsers that don't support inputs of type url, a url input falls back to being a standard text input. value a domstring representing a url, or empty events change and input supported common attributes autocomplete,
list, maxlength, minlength, pattern, placeholder, readonly, required and size idl attributes
list, value, selectionend, selectiondirection methods select(), setrangetext() and setselectionrange(). value the <input> element's value attribute contains a domstring which is automatically validated as conforming to url syntax. more specifically, there are two possible value ...
... but it is at least formatted correctly. in simple terms, this means urlscheme://restofurl. see validation for details on how urls are validated to ensure that they're formatted properly. ...
...ed correctly. in simple terms, this means urlscheme://restofurl. see validation for details on how urls are validated to ensure that they're formatted properly. ...
...And 11 more matches
JavaScript modules - JavaScript
liar. 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. returns an object containing the canvas's 2d context and the wrapper's id. createreport
list() — creates an unordered
list appended inside a specified wrapper element, which can be used to output report data into. returns the
list's id. square.js — contains: name — a constant containing the string 'square'. draw() — draws a square on a specified canvas, with a specified size, position, and color. returns an object containing the square's size, position, and color. ...
... aside — .mjs versus .js throughout this article, we've used .js extensions for our module files, but in other resources you may see the .mjs extension used instead. ...
... — contains: name — a constant containing the string 'square'. draw() — draws a square on a specified canvas, with a specified size, position, and color. returns an object containing the square's size, position, and color. reportarea() — writes a square's area to a specific report
list, given its length. reportperimeter() — writes a square's perimeter to a specific report
list, given its length. aside — .mjs versus .js throughout this article, we've used .js extensions for our module files, but in other resources you may see the .mjs extension used instead. v8's documentation recommends this, for example. the reasons given are: it is good for clarity, i.e. it makes it clear which files are modules, and which are regular javascript. it ensures that your mo...
...And 11 more matches
page-mod - Archive of obsolete content
de easier to maintain, secure, debug and review. a page-mod only attaches scripts to documents loaded in tabs. it will not attach scripts to add-on panels, page-workers, sidebars, or firefox hidden windows. to stop a page-mod from making any more modifications, call its destroy() method. the pagemod constructor takes a number of other options to control its behavior: contentstyle
lists stylesheets to attach, supplied as strings. contentstylefile
lists stylesheets to attach, supplied in separate files. contentscriptoptions defines read-only values accessible to content scripts. attachto controls whether to attach scripts to tabs that were already open when the page-mod was created, and whether to attach scripts to iframes as well as the topmo...
...ion is new in firefox 32. these options are documented in detail below. for all the details on content scripts, see the guide to content scripts. communicating with content scripts your add-on's "main.js" can't directly access the state of content scripts you load, but you can communicate between your add-on and its content scripts by exchanging messages. to do this, you'll need to
listen to the page-mod's attach event. this event is triggered every time the page-mod's content script is attached to a document. the
listener is passed a worker object that your add-on can use to send and receive messages. for example, the following add-on retrieves the html content of specific tags from documents that match the pattern. the main add-on code sends the desired tag to the content scr...
...; }); } }); /data/element-getter.js: self.port.on("getelements", function(tag) { var elements = document.getelementsbytagname(tag); for (var i = 0; i < elements.length; i++) { self.port.emit("gotelement", elements[i].innerhtml); } }); when the user loads a document hosted at "mozilla.org": the content script "element-getter.js" is attached to the document and runs. it adds a
listener to the getelements message. the attach event is sent to the "main.js" code. its event handler sends the getelements message to the content script, and then adds a
listener to the gotelement message. the content script receives the getelements message, retrieves all elements of that type, and for each element sends a gotelement message containing the element's innerhtml. the "main.js" code ...
...And 10 more matches
panel - Archive of obsolete content
rt of an add-on's user interface. usage this module exports a single constructor function panel() which constructs a new panel. a panel is a dialog. its content is specified as html and you can execute scripts in it, so the appearance and behavior of the panel is limited only by what you can do using html, css, and javascript. the screenshot below shows a panel whose content is built from the
list of currently open tabs: panels are useful for presenting temporary interfaces to users in a way that is easier for users to ignore and dismiss than a modal dialog, since panels are hidden the moment users interact with parts of the application interface outside them. a panel's content is loaded as soon as it is created, before the panel is shown, and the content remains loaded when a panel is...
...rts of the application interface outside them. a panel's content is loaded as soon as it is created, before the panel is shown, and the content remains loaded when a panel is hidden, so it is possible to keep a panel around in the background, updating its content as appropriate in preparation for the next time it is shown. your add-on can receive notifications when a panel is shown or hidden by
listening to its show and hide events. opening a panel will close any panel created by the panel() constructor that is already open, even if that panel was opened by a different add-on sdk based extension. if you want to close an existing panel without opening a new one, you can call the hide() or the destroy() method. panel content the panel's content is specified as html, which is loaded from th...
...icate with the script using either the postmessage() api or (preferably, usually) the port api. for example, here's an add-on whose content script intercepts mouse clicks on links inside the panel, and sends the target url to the main add-on code. the content script sends messages using self.port.emit() and the add-on script receives them using panel.port.on(). ...
...And 10 more matches
widget - Archive of obsolete content
on approved on amo. instead, keep the script in a separate file and load it using contentscriptfile. this makes your code easier to maintain, secure, debug and review. for example, suppose we want to implement a media player as an add-on. we could implement the main user interface as a widget hosting an array of buttons to control play/pause/stop functions. we can then use a content script to
listen for clicks on those buttons. 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. the widget's content is specified using html like this: <html> <body> <img src="play.png" id="play-button"> <img src="pause.png" id="pause-button"> <img src="s...
...t's content is specified using html like this: <html> <body> <img src="play.png" id="play-button"> <img src="pause.png" id="pause-button"> <img src="stop.png" id="stop-button"> </body> </html> we just include three icons, and assign an id to each one. this html file, and the icon files it references, are saved in the add-on's data directory. ...
...entbyid("pause-button"); pause_button.onclick = function() { self.port.emit("pause"); } var stop_button = document.getelementbyid("stop-button"); stop_button.onclick = function() { self.port.emit("stop"); } we save this file in the add-on's data directory as "button-script.js". finally. ...
...And 10 more matches
Interaction between privileged and non-privileged pages - Archive of obsolete content
sending data from unprivileged document to chrome an easy way to send data from a web page to an extension is by using custom dom events. in your extension's browser.xul overlay, write code which
listens for a custom dom event. here we call the event myextensionevent. var myextension = { my
listener: function(evt) { alert("received from web page: " + evt.target.getattribute("attribute1") + "/" + evt.target.getattribute("attribute2")); } } document.addevent
listener("myextensionevent", function(e) { myextension.my
listener(e); }, false, true); // the last value is a mozilla-specific value to indicate untrusted content is allowed to trigger the event. the data from the web page (unprivileged code) will be the values of attribute1 and attribute2. to trigger th...
... + evt.target.getattribute("attribute2")); } } document.addevent
listener("myextensionevent", function(e) { myextension.my
listener(e); }, false, true); // the last value is a mozilla-specific value to indicate untrusted content is allowed to trigger the event. the data from the web page (unprivileged code) will be the values of attribute1 and attribute2. ...
...om. values are set for two arbitrary attributes on the element. these can also be named anything you like, but we've chosen attribute1 and attribute2. finally, the code creates and dispatches a custom event named myextensionevent -- similar to the standard dom click event you catch with onclick handlers. the event bubbles up from the web page and reaches the extension (privileged code) where your
listener catches it and reads the attribute values from the dom element where the event originated. (to better ensure others do not also implement the same event with a different meaning, one might either attach a namespace to <myextensiondataelement/> and check on the event handler for the correct namespaceuri property, or as per the dom specification, use initevent() with an event name that is its...
...And 10 more matches
Monitoring downloads - Archive of obsolete content
t could be removed at any time. try to avoid using it.this interface is deprecated as of firefox 26. please use downloads.jsm instead. firefox 3 makes it easier than ever to monitor the status of downloads. although it was possible to do so in previous versions of firefox, it was previously only possible for one observer to do so at a time. firefox 3 introduces new api that allows any number of
listeners to observe downloads. this article demonstrates how to monitor downloads in firefox 3, using the download manager. as a nice bonus, it also demonstrates how to use the storage api to issue sqlite commands on a database. the result is a window you can open by choosing "download log" in the tools menu, which
lists all downloads that have been started since you installed the extension. in the ...
...eners to observe downloads. this article demonstrates how to monitor downloads in firefox 3, using the download manager. as a nice bonus, it also demonstrates how to use the storage api to issue sqlite commands on a database. the result is a window you can open by choosing "download log" in the tools menu, which
lists all downloads that have been started since you installed the extension. in the
list is the name of the file, the start and end times of the download, the download speed, and the status of the download. a tooltip is included that displays the full source url of the file. download the full sample. setting up when the extension loads, it will do some housekeeping chores. in particular, it needs to get an instance of the download manager's nsidownloadmanager interface and create ...
...wnloadmanager interface and create the database into which its data will be stored. ...
...And 10 more matches
RDF Datasources - Archive of obsolete content
the resource can be referred to using rdf:history as the datasource. ...
...the resource can be referred to using rdf:history as the datasource. ...
...the resource can be referred to using rdf:history as the datasource. ...
...And 10 more matches
How to enable locale switching in a XULRunner application - Archive of obsolete content
cale; later it can be overridden by the user */pref("general.useragent.locale", "en-gb"); note that some distributions of xulrunner or firefox don't honour the "intl.locale.matchos" setting, so in those cases you won't be able to override the os locale [debian iceweasel bug #417961]. 2. include a xul control for the locale selection the next step is to add a xul control to your application which
lists the available locales in the package and makes it possible for the user to select one of them. i chose a
listbox with a button. screenshot of sample locale switching control 3. populate the xul control with the available locales the available package locales are declared in the chrome manifest. sample chrome/chrome.manifest content localeswitchdemo content/ locale localeswitchdemo de-de...
...mple locale switching control 3. populate the xul control with the available locales the available package locales are declared in the chrome manifest. ...
...available locales the available package locales are declared in the chrome manifest. ...
...And 10 more matches
Organizing your CSS - Learn web development
mmon styling first in the stylesheet. this means all of the styles which will generally apply unless you do something special with that element. you will typically have rules set up for: body p h1, h2, h3, h4, h5 ul and ol the table properties links in this section of the stylesheet we are providing default styling for the type on the site, setting up a default style for data tables and
lists and so on. /* || general styles */ body { ... } h1, h2, h3, h4 { ... } ul { ... } blockquote { ... } after this section we could define a few utility classes, for example a class that removes the default
list style for
lists we're going to display as flex items or in some other way. if you have a few things you know you will want to apply to lots of different elements, they can come in th...
... then we can add everything that is used sitewide. that might be things like the basic page layout, the header, navigation styling, and so on. /* || sitewide */ .main-nav { ... ...
...le: none; margin: 0; padding: 0; } ... then we can add everything that is used sitewide. that might be things like the basic page layout, the header, navigation styling, and so on. /* || sitewide */ .main-nav { ... } .logo { ... } finally we will include css for specific things, broken down by the context, page or even component in which they are used. /* || store pages */ .product-
listing { ... } .product-box { ... } by ordering things in this way, we at least have an idea in which part of the stylesheet we will be looking for something that we want to change. avoid overly-specific selectors if you create very specific selectors you will often find that you need to duplicate chunks of your css to apply the same rules to another element. for example, you might have somethin...
...And 10 more matches
Getting started with CSS - Learn web development
rget and style an html element. we do this by targeting an element selector — this is a selector that directly matches an html element name. to target all paragraphs in the document you would use the selector p. to turn all paragraphs green you would use: p { color: green; } you can target multiple selectors at once, by separating the selectors with a comma. if i want all paragraphs and all
list items to be green my rule looks like this: p, li { color: green; } try this out in the interactive editor below (edit the code boxes), or in your local css document. changing the default behavior of elements when we look at a well-marked up html document, even something as simple as our example, we can see how the browser is making the html readable by adding some default styling. head...
... like this: p, li { color: green; } try this out in the interactive editor below (edit the code boxes), or in your local css document. changing the default behavior of elements when we look at a well-marked up html document, even something as simple as our example, we can see how the browser is making the html readable by adding some default styling. headings are large and bold and our
list has bullets. this happens because browsers have internal stylesheets containing default styles, which they apply to all pages by default; without them all of the text would run together in a clump and we would have to style everything from scratch. all modern browsers display html content by default in pretty much the same way. however, you will often want something other than the choice the bro...
...er in a clump and we would have to style everything from scratch. all modern browsers display html content by default in pretty much the same way. however, you will often want something other than the choice the browser has made. this can be done by simply choosing the html element that you want to change, and using a css rule to change the way it looks. a good example is our <ul>, an unordered
list. ...
...And 10 more matches
Advanced text formatting - Learn web development
previous overview: introduction to html next there are many other elements in html for formatting text, which we didn't get to in the html text fundamentals article. the elements described in this article are less known, but still useful to know about (and this is still not a complete
list by any means). here you'll learn about marking up quotations, description
lists, computer code and other related text, subscript and superscript, contact information, and more. ...
...ns, description
lists, computer code and other related text, subscript and superscript, contact information, and more. prerequisites: basic html familiarity, as covered in getting started with html. html text formatting, as covered in html text fundamentals. objective: to learn how to use lesser-known html elements to mark up advanced semantic features. description
lists in html text fundamentals, we walked through how to mark up basic
lists in html, but we didn't mention the third type of
list you'll occasionally come across — description
lists. the purpose of these
lists is to mark up a set of items and their associated descriptions, such as terms and definitions, or questions and answers. let's look at an example of a set of terms and definitions: soliloq...
...ss relaying them to the audience (but not to other characters.) monologue in drama, where a character speaks their thoughts out loud to share them with the audience and any other characters present. aside in drama, where a character shares a comment only with the audience for humorous or dramatic effect. this is usually a feeling, thought or piece of additional background information description
lists use a different wrapper than the other
list types — <dl>; in addition each term is wrapped in a <dt> (description term) element, and each description is wrapped in a <dd> (description definition) element. let's finish marking up our example: <dl> <dt>soliloquy</dt> <dd>in drama, where a character speaks to themselves, representing their inner thoughts or feelings and in the process relay...
...And 10 more matches
Server-side web frameworks - Learn web development
cluding routing urls to appropriate handlers, interacting with databases, supporting sessions and user authorization, formatting output (e.g. html, json, xml), and improving security against web attacks. the next section provides a bit more detail about how web frameworks can ease web application development. we then explain some of the criteria you can use for choosing a web framework, and then
list some of your options. what can a web framework do for you? web frameworks provide tools and libraries to simplify common web development operations. you don't have to use a server-side web framework, but it is strongly advised — it will make your life a lot easier. this section discusses some of the functionality that is often provided by web frameworks (not every framework will necessarily ...
... in terms of maintenance, because you can change the url used to deliver a particular feature without having to change the underlying code. different frameworks use different mechanisms for the mapping. for example, the flask (python) web framework adds routes to view functions using a decorator. @app.route("/") def hello(): return "hello world!" while django expects developers to define a
list of url mappings between a url pattern and a view function. urlpatterns = [ url(r'^$', views.index), # example: /best/myteamname/5/ url(r'^best/(?p<team_name>\w.+?)/(?p<team_number>[0-9]+)/$', views.best), ] make it easy to access data in the request data can be encoded in an http request in a number of ways. an http get request to get files or data from the server may encode what ...
...mple, the django web framework provides an orm, and refers to the object used to define the structure of a record as the model. the model specifies the field types to be stored, which may provide field-level validation on what information can be stored (e.g. an email field would only allow valid email addresses). the field definitions may also specify their maximum size, default values, selection
list options, help text for documentation, label text for forms etc. the model doesn't state any information about the underlying database as that is a configuration setting that may be changed separately of our code. the first code snippet below shows a very simple django model for a team object. this stores the team name and team level as character fields and specifies a maximum number of character...
...And 10 more matches
Ember interactivity: Events, classes and state - Learn web development
ng to think about interactivity, it's good to declare what each component's goals and responsibilities are. in the below sections we’ll do this for each component, and then walk you through how the functionality can be implemented. creating todos for our card-header / todo input, we'll want to be able to submit our typed in todo task when we press the enter key and have it appear in the todos
list. we want to be able to capture the text typed into the input. we do this so that our javascript code knows what we typed in, and we can save our todo and pass that text along to the todo
list component to display. we can capture the keydown event via the on modifier, which is just ember syntactic sugar around addevent
listener and removeevent
listener (see this explanation if needed). add the ne...
...that we can use to manage the storage of our todos and allow each of our components to access data from that application-level state. ember calls these constructs services, and they live for the entire lifetime of the page (a page refresh will clear them; persisting the data for longer is beyond the scope of this tutorial). ...
... and just like before, the add() function that will be called from the template gets annotated with the @action decorator to bind it to the class instance. this function's contents are fairly easy to understand — when the function is invoked, a new to...
...And 10 more matches
Accessibility in React - Learn web development
core html, css, and javascript languages, knowledge of the terminal/command line. objective: to learn about implementing keyboard accessibility in react. including keyboard users at this point, we've accomplished all of the features we set out to implement. a user can add a new task, check and uncheck tasks, delete tasks, or edit task names. and they can filter their task
list by all, active, or completed tasks. or, at least: they can do all of these things with a mouse. unfortunately, these features are not very accessible to keyboard-only users. let's explore this now. exploring the keyboard usability problem start by clicking on the input at the top of our app, as if you're going to add a new task. you'll see a thick, dashed outline around that input. this outlin...
...ch to the editing template. update your existing useeffect() hook so that it reads like this: useeffect(() => { if (isediting) { editfieldref.current.focus(); } }, [isediting]); these changes make it so that, if isediting is true, react reads the current value of the editfieldref and moves browser focus to it. we also pass an array into useeffect() as a second argument. this array is a
list of values useeffect() should depend on. with these values included, useeffect() will only run when one of those values changes. we only want to change focus when the value of isediting changes. try it now, and you'll see that when you click an "edit" button, focus moves to the corresponding edit <input>! moving focus back to the edit button at first glance, getting react to move focus back to ...
...ng, so we provide it in the array of dependencies. again try using the "edit" and "cancel" buttons to toggle between the templates of your <todo /> component; you'll see the browser focus indicator move appropriately, without the problem we discussed at the start of this section. ...
...And 10 more matches
Gecko info for Windows accessibility vendors
it's also used in the root pane object to show when the state_busy flag changes from loading new content. event_scrollingend is used to indicate when a document has scrolled, even if only 1 line. gecko fires this event when the scrolling is finished, rather than fire excessive events. event_scrollingstart is fired when the user has jumped to a named anchor within the page. the even...
...us where the role_system_row should exist in the tree when the html rowspan attribute is used to combine to cells in different rows. there are currently two techniques for parsing tables: 1) use acclocation() to get the coordinates for each cell and feed that into an algorithm that builds up your own table data structure, or 2) use isimpledomnode and parse the table see below for the complete
list of roles and notes about what we support intentional differences with internet explorer for the most part, where we support an msaa feature, we have tried to duplicate internet explorer's use of it. please let us know if you find any differences not
listed here: accessible relations are supported the accnavigate() method can be used with new constants defined for gecko. the result...
...indicates that the absence of state_checked should be spoken as // "unchecked", and that event_state_change will be fired in the event that the // checkbox is toggled. const unsigned long state_required = state_alert_low; // used on form controls // to indicate that this field must be filled out to submit the form const unsigned long state_invalid = state_alert_high; // u...
...And 10 more matches
DownloadSummary
progresstotalbytes read only number indicates the total number of bytes to be transferred before completing all the downloads that are currently in progress. ...
... progresstotalbytes read only number indicates the total number of bytes to be transferred before completing all the downloads that are currently in progress. ...
... progresstotalbytes read only number indicates the total number of bytes to be transferred before completing all the downloads that are currently in progress. ...
...And 10 more matches
AsyncTestUtils extended framework
this is likely ...
...he 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. for example, you would do "yield async_move_messages(...);" and be done with it. helpers for the asynchronous function contract it can be annoying to have to write interface boilerplate just to call async_driver. if you have the following types of
listeners you can use the following pre-defined helpers: nsiurl
listener: asyncurl
listener (predefined). if you need to wrap an existing url
listener or need a callback or fancy promise, create an instance of asyncurl
listener. copy
listener: asynccopy
listener. bringing messages into the picture synthetic set definitions most of the code involved in creating synthetic messages takes an object...
...there are more attributes you can specify; consult the documentation for more information. (see the bottom of this page for links to the source files.) count: 10 the number of messages that should be in the set. ...
...And 10 more matches
NSS Tools certutil
starting from nss 3.35, the database format was upgraded to support sqlite as described in this document. ...
...discusses certificate and key database management. for information security module database management, see using the security module database tool. availability see the release notes for the platforms this tool is available on. syntax to run the certificate database tool, type the command certutil option [arguments ] where options and arguments are combinations of the options and arguments
listed in the following section. each command takes one option. each option may take zero or more arguments. to see a usage string, issue the command without options, or with the -h option. options and arguments options specify an action and are uppercase. option arguments modify an action and are lowercase. certificate database tool command options and their arguments are defined as follows: ...
...eys, be sure to also remove any certificates associated with those keys from the certificate database, by using -d. some smart cards (for example, the litronic card) do not let you remove a public key you have generated. in such a case, only the private key is deleted from the key pair. you can display the public key with the command certutil -k -htokenname . -k
list the keyid of keys in the key database. a keyid is the modulus of the rsa key or the publicvalue of the dsa key. ids are displayed in hexadecimal ("0x" is not shown). -a add an existing certificate to a certificate database. the certificate database should already exist; if one is not present, this option will initialize one by default. -d ...
...And 10 more matches
Index
developed by the thunderbird community. these pages document thunderbird and the mailnews backend which is also used in other projects such as seamonkey and postbox. 2 account provisioner the account provisioner is the dialog that first comes up when starting thunderbird. the account provisioner gives the user the chance to search for and order a vanity email account from a
list of partner providers. if the user already has an email account, the user can switch to the original account setup wizard. 3 account examples extensions, thunderbird this article provides examples on accessing and manipulating thunderbird accounts. account interfaces provides an overview of the related interfaces. see an overview of thunderbird components for a general descrip...
...is article provides examples on accessing and manipulating thunderbird accounts. account interfaces provides an overview of the related interfaces. see an overview of thunderbird components for a general description of the thunderbird user interface and related programmatic interfaces. 4 account interfaces code snippets, extension development, thunderbird this page contains a
list of the interfaces that you'll will most likely use when writing extensions that work with email or other accounts. see account examples for examples and code snippets. 5 activity manager thunderbird 3, thunderbird the activity manager is a simple component that understands how to display a combination of user activity and history. the activity manager works in conjunction wit...
...scribes the programmatic interfaces behind the activity manager component. the functionality of the component is described on the activity manager page, and the activity manager examples page has code snippets. see nsiactivitymanager.idl and nsiactivity.idl files for source documentation. 7 address book interfaces mailnews, mozilla, seamonkey, thunderbird this page contains a
list of the interfaces that you'll will most likely hit when writing patches for the address book or writing extensions. the complete
list of interfaces for the address book can be found here. address book examples show how to perform various tasks and provide code snippets. 8 address book examples mailnews, seamonkey, thunderbird this article provides examples on accessing and ma...
...And 10 more matches
Mail event system
ample, when a folder gets a new message, its total message count increases. the folder pane needs to know that this changed so that it can update the message count so the user can see it. interfaces the key interfaces here are: nsifolder.idl is an interface for storing a hierarchy of objects with properties. this interface is not (should not be) mail-related. nsifolders each store individual
lists of folder
listeners which are maintained with add
listener() and remove
listener(). when a notification is fired on a folder, all of the folder's folder
listeners and the mail session itself is notified. nsifolder
listener.idl is an interface that an object can implement if it is interested in
listening to changes on single folder or on all folders. if the object just needs to be notified about on...
... with add
listener() and remove
listener(). when a notification is fired on a folder, all of the folder's folder
listeners and the mail session itself is notified. nsifolder
listener.idl is an interface that an object can implement if it is interested in
listening to changes on single folder or on all folders. if the object just needs to be notified about one folder, it should call that folder's add
listener method. if the object wants to know about all notifications on all folders, then it should register with the mail session. nsimsgmailsession.idl is a service that acts as a broadcaster for folder notifications. the mail session receives all notifications from all folders, and then forwards it on to any nsifolder
listeners that have registered themselves. the nsimsgmailsession interface actual...
...now about all notifications on all folders, then it should register with the mail session. nsimsgmailsession.idl is a service that acts as a broadcaster for folder notifications. the mail session receives all notifications from all folders, and then forwards it on to any nsifolder
listeners that have registered themselves. the nsimsgmailsession interface actually only allows adding and removal of
listeners - the notifications happen through the nsifolder
listener interface as well. methods each event type has a two methods associated with it: notify*<event> - in the nsifolder interface, and nsimsgmailsession interface. onitem*<event> - in the nsifolder
listener interface. the mail session implements this interface. where <event> is the type of event, such as boolpropertychanged or t...
...And 10 more matches
Using the Multiple Accounts API
warning: the content of this article may be out of date. it was imported from mozilla.org and last updated in 2003. by alec flett alecf@flett.org structure servers identities storage creating new accounts smtp servers appendix a:
listing of all preferences and properties structure the account system consists of: the account manager (nsimsgaccountmanager): there is a single account manager in the the client, which maintains the
list of accounts, servers, etc. it is also responsible for the creation of any new account-related objects. the account manager maintains the main
list of accounts. accounts (nsimsgaccount): an account consists of a single incoming server, and one or more identities. an account is merely a container to bind incoming servers a...
... above example would look like this: alecf on imap.mywork.com +- inbox +- trash +- (etc) alecf on pop.myisp.com +- inbox +- trash +- (etc) news.myisp.com +- comp.os.linux.announce +- etc.. ...
...x.announce +- etc.. news.mozilla.org +- netscape.public.mozilla.announce +- netscape.public.mozilla.mail-news relevant api calls: nsimsgaccount.incomingserver nsimsgaccountmanager.allservers: a
list of all servers held by all accounts. identities identities are used in the compose window. if identities are shared between accounts, you will only see that identity once in the
list. in the above example, the
list of identities would be as follows: alec flett <alecf@mywork.com>) alec flett <alecf@myisp.com>) alec flett <alecfnospam@myisp.com>) relevant api calls: nsimsgaccount.identities nsimsgaccountmanager.allservers: a
list of all servers across all accounts storage the accounts are stored in the preferences. the accounts, identities, and servers are ...
...And 10 more matches
Web Console remoting - Firefox Developer Tools
for communication between the server and the client we use the remote debugging protocol. this architecture allows you to connect a web console client instance to a server running on b2g, fennec or some other firefox instance. to better understand the architecture of the web console we recommend learning about the debugger architecture. the remote web console is a feature introduced in firefox 18. ...
...eclient lives in webconsoleclient.jsm (in toolkit/devtools/webconsole) and it is used by the web console when working with the web console actor. to see how the debugger is used in the web console code, look in browser/devtools/webconsole/webconsole.js, and search for webconsoleconnectionproxy. ...
...search for webconsoleconnectionproxy. the new web console actors are: the webconsoleactor allows js evaluation, autocomplete, start/stop
listeners, etc. the networkeventactor is used for each new network request. the client can request further network event details - like response body or request headers. to attach to the webconsoleactor, follow these steps: connecttoserver() // the usual
listtabs() pickthetabyouwant() debuggerclient.attachconsole(tab.consoleactor,
listeners, onattachconsole) the
listeners argument is an array which specifies
listeners you want to start in the web console. these can be: page errors, window.console api messages, network activity, and file activity. for example: ["pageerror", "consoleapi", "networkactivity", "fileactivity"] the web console actor doe...
...And 10 more matches
Using the Frame Timing API - Web APIs
eobserver object with a specific frame observer callback. in the following example, two observers for the "frame" performance entry type are created and the first observer constructor uses inline function syntax. ...
...n the following example, two observers for the "frame" performance entry type are created and the first observer constructor uses inline function syntax. ...
... registering for notifications after an observer...
...And 10 more matches
Example and tutorial: Simple synth keyboard - Web APIs
resented on the left side of the bar and place a label and an <input> element of type "range". the range element will typically be presented as a slider control; we configure it to allow any value between 0.0 and 1.0, stepping by 0.01 each position. <div class="settingsbar"> <div class="left"> <span>volume: </span> <input type="range" min="0.0" max="1.0" step="0.01" value="0.5"
list="volumes" name="volume"> <data
list id="volumes"> <option value="0.0" label="mute"> <option value="1.0" label="100%"> </data
list> </div> we specify a default value of 0.5, and we provide a <data
list> element which is connected to the range using the name attribute to find an option
list whose id matches; in this case, the data set is named "volume". this lets us provide a s...
... input { vertical-align: middle; } .right { width: 50%; position: absolute; right: 0; display: table-cell; vertical-align: middle; } .right span { vertical-align: middle; } .right input { vertical-align: baseline; } javascript the javascript code begins by initializing a number of variables. let audiocontext = new (window.audiocontext || window.webkitaudiocontext)(); let osc
list = []; let mastergainnode = null; audiocontext is set to reference the global audiocontext object (or webkitaudiocontext if necessary). osc
list is set up to be ready to contain a
list of all currently-playing oscillators. it starts off empty, since there are none playing yet. mastergainnode is set to null; during the setup process, it will be configured to contain a gainnode which all playin...
... if (!object.entries) { object.entries = function entries(o) { return reduce(keys(o), (e, k) => concat(e, typeof k === 'string' && isenumerable(o, k) ? [[k, o[k]]] : []), []); }; } building the keyboard the setup() function is responsible for building the keyboard and preparing the app to play music. function setup() { notefreq = createnotetable(); volumecontrol.addevent
listener("change", changevolume, false); mastergainnode = audiocontext.creategain(); mastergainnode.connect(audiocontext.destination); mastergainnode.gain.value = volumecontrol.value; // create the keys; skip any that are sharp or flat; for // our purposes we don't need them. each octave is inserted // into a <div> of class "octave". notefreq.foreach(function(keys, idx) { let keyl...
...And 10 more matches
Using the Web Speech API - Web APIs
cognition, and speech synthesis (also known as text to speech, or tts) — which open up interesting new possibilities for accessibility, and control mechanisms. this article provides a simple introduction to both areas, along with demos. speech recognition speech recognition involves receiving speech through a device's microphone, which is then checked by a speech recognition service against a
list of grammar (basically, the vocabulary you want to have recognised in a particular app.) when a word or phrase is successfully recognised, it is returned as a result (or
list of results) as a text string, and further actions can be initiated as a result. the web speech api has a main controller interface for this — speechrecognition — plus a number of closely-related interfaces for representi...
...ript in a bit more detail. chrome support as mentioned earlier, chrome currently supports speech recognition with prefixed properties, therefore at the start of our code we include these lines to feed the right objects to chrome, and any future implementations that might support the features without a prefix: var speechrecognition = speechrecognition || webkitspeechrecognition var speechgrammar
list = speechgrammar
list || webkitspeechgrammar
list var speechrecognitionevent = speechrecognitionevent || webkitspeechrecognitionevent the grammar the next part of our code defines the grammar we want our app to recognise. the following variable is defined to hold our grammar: var colors = [ 'aqua' , 'azure' , 'beige', 'bisque', 'black', 'blue', 'brown', 'chocolate', 'coral' ... ]; var grammar = '...
... through it quickly: the lines are separated by semi-colons, just like in javascript. the first line — #jsgf v1.0; — states the format and version used. this always needs to be included first. the second line indicates a type of term that we want to recognise. public declares that it is a public rule, the string in angle brackets defines the recognised name for this term (color), and the
list of items that follow the equals sign are the alternative values that will be recognised and accepted as appropriate values for the term. note how each is separated by a pipe character. you can have as many terms defined as you want on separate lines following the above structure, and include fairly complex grammar definitions. for this basic demo, we are just keeping things simple. plugging t...
...And 10 more matches
HTTP Index - HTTP
found 277 pages: # page tags and summary 1 http http, hypertext, reference, tcp/ip, web, web development, l10n:priority hypertext transfer protocol (http) is an application-layer protocol for transmitting hypermedia documents, such as html. it was designed for communication between web browsers and web servers, but it can also be used for other purposes. http follows a classical client-server model, with a client opening a connection to make a request, then waiting until it receives a response. http is a stateless protocol, meaning that the server does not keep any data (state) between two requests. ...
...ources. 9 mime types (iana media types) content-type, guide, http, mime types, meta, request header, response header, application/javascript, application/json, application/xml a media type (also known as a multipurpose internet mail extensions or mime type) is a standard that indicates the nature and format of a document, file, or assortment of bytes. 10 incomplete
list of mime types audio, file types, files, http, mime, mime types, php, reference, text, types, video here is a
list of mime types, associated by type of documents, ordered by their common extensions. 11 resource urls guide, http, intermediate, resource resource urls, urls prefixed with the resource: scheme, are used by firefox and firefox browser extensions to load re...
...ontent negotiation content negotiation, content negotiation reference, http, reference in http, content negotiation is the mechanism that is used for serving different representations of a resource at the same uri, so that the user agent can specify which is best suited for the user (for example, which language of a document, which image format, or which content encoding). 18
list of default accept values accept, content negotiation, http, reference this article documents the default values for the http accept header for specific inputs and browser versions. 19 cross-origin resource policy (corp) http, reference, security cross-origin resource policy is an opt-in mechanism that allows web applications to protect against certain cross-origin r...
...And 10 more matches
ui/button/action - Archive of obsolete content
sed on the device screen resolution and the place the icon appears. for example, in the screenshots above, firefox uses the small icon when the button is in the toolbar and the large icon when the button is in the menu panel. read more about specifying icons in the reference documentation for the actionbutton constructor. ...
...above, firefox uses the small icon when the button is in the toolbar and the large icon when the button is in the menu panel. read more about specifying icons in the reference documentation for the actionbutton constructor. responding to click events you can respond to click events by assigning a
listener to the button's click event. you can do this in the button's constructor, by assigning the
listener to the onclick option. ...
...bar and the large icon when the button is in the menu panel. read more about specifying icons in the reference documentation for the actionbutton constructor. responding to click events you can respond to click events by assigning a
listener to the button's click event. you can do this in the button's constructor, by assigning the
listener to the onclick option. ...
...And 9 more matches
Preferences - Archive of obsolete content
s to the mozilla suite, firefox, thunderbird, and possibly other mozilla-based applications. for more details on preferences in mozilla, see preferences system. if you haven't yet, read other documents about mozilla preferences on mdn (links below in resources section). note: this article doesn't cover all available methods for manipulating preferences; please refer to the xpcom reference pages
listed in resources section for the complete
list of methods. the interfaces dealing with preferences are fairly well documented, so using the methods not mentioned here should be straightforward. xpcom interfaces for preferences system mozilla exposes its preferences system through a few xpcom interfaces. look in the resources section below for the link to a
list of preferences-related interfaces. ...
...efilepref please see the file io article for details on nsilocalfile and nsirelativefilepref. default preferences fixme: someone should reword this section each preference may have up to two values — the current value and the default value. that means there are two "pref trees:" current and default, and each of them may or may not have a value for the preference in question. you can see the
list of preferences in about:config (where available). preferences that have a user value are bold, and those that don't have a user value are printed in normal font. you can get both trees using the nsiprefservice.getbranch() and nsiprefservice.getdefaultbranch() functions. see below for details. the effect of default preferences on get methods when one of the get methods of nsiprefbranch (assumin...
...service;1"] .getservice(components.interfaces.nsiprefservice); var branch = prefs.getbranch("acce"); var enablesound = branch.getboolpref("ssibility.typeaheadfind.enablesound"); this is the reason why you should usually pass strings ending with a dot to getbranch(), like prefs.getbranch("accessibility."). ...
...And 9 more matches
Chapter 6: Firefox extensions and XUL applications - Archive of obsolete content
tests, you will not be able to edit program files in your editor. and it’s probably for the best that you don’t use any filenames that have whitespace in them. usage an rpn calculator we’re going to implement a simple rpn3 calculator in javascript to see how this can be used. on the program side, we’ll create a class called rpncalc. first we’ll sketch out a simple interface for it (
listing 1). save this as a file called calc.js.
listing 1: calc.js (stage 1) function rpncalc() { } rpncalc.prototype = { init: function() { }, push: function(val) { }, plus: function() { }, pop: function() { } } implement the addition operation create test case begin by creating the test case. first, select the menu item tools:mozlab:open mozunit runner to bring up the mozunit w...
...function() { }, pop: function() { } } implement the addition operation create test case begin by creating the test case. first, select the menu item tools:mozlab:open mozunit runner to bring up the mozunit window. select the menu item file:new, and save test_calc.js in the same directory as the file that is the test target. ...
...st target. next, click the edit button to set up the “2 1+” test case (
listing 2). note that in this file, the method names serve as the test names. in junit and similar packages, methods containing tests that start with testhoge are recognized as tests. mozunit uses the same kind of notation, but you can also make the string the method name, making the test self-documenting. pretty clever. ...
...And 9 more matches
In-Depth - Archive of obsolete content
system colours css2 defines colours which are the same as your operating systems theme. a
list of the different operating system colours can be found on the w3c's web site. mozilla css properties mozilla.org created their own css properties to allow them to use the technology for the ui of mozilla. all of the properties follow the w3c's standards for vendor extensions, which is why they all begin with -moz. this is only a
list of properties which may be useful to you; it is in no way all of the mozilla specific properties available. other sites which
list mozilla specific css properties xulplanet.com [dead link, 26.03.13] mozilla-prefixed properties on the standard track 26.03.13 -moz-appearance makes a widget look like it's from your operating system. possible are (this is probably an...
... is only a
list of properties which may be useful to you; it is in no way all of the mozilla specific properties available. other sites which
list mozilla specific css properties xulplanet.com [dead link, 26.03.13] mozilla-prefixed properties on the standard track 26.03.13 -moz-appearance makes a widget look like it's from your operating system. possible are (this is probably an incomplete
list): none - (!important may be needed) will override the operating system default. use this when you want one or two controls to look different from the operating systems defaults. ...
...rd track 26.03.13 -moz-appearance makes a widget look like it's from your operating system. possible are (this is probably an incomplete
list): none - (!important may be needed) will override the operating system default. use this when you want one or two controls to look different from the operating systems defaults. ...
...And 9 more matches
Using the Editor from XUL - Archive of obsolete content
ts in a frameset at the same time. we detect that the document we want to edit has loaded successfully in nseditorshell::onenddocumentload(). after checking that we can actually edit this document, we go ahead and instantiate an editor on it (in nseditorshell::preparedocumentforediting()). as well as making the editor (which happens via nseditorshell::doeditormode()) we also hook up various
listeners and observers for ui updating and user interaction, and store a file specifier for the document we opened. the editor is now set up, and ready to go. one thing to note about editor initialization is that we pass into the editor's init() method an nsicontent* that corresponds to the root of the content tree that the editor is allowed to work with. when initializing the editor from the nsed...
...ng the editor from the nseditorshell, we pass null here (which tells the editor that it can edit everything under the <body> of the document). this parameter is more important when the editor is in a text widget, where it points to the the subtree of the parent document that corresponds to widget content. editor teardown window destruction, and hence editor teardown is initiated in two ways,
listed below. in both cases, the editorcanclose() method is the javascript is called, which causes the nseditorshell to display a dialog asking the user if they want to save the document, throw away their changes, or cancel. note that if they cancel, the close operation is aborted. the user clicks the close widget in their os/window manager. in this case, the onclose method on the <window> element ...
...he window is closed. when the last reference to the nseditorshell goes away (as a result of nseditorboxobject releasing its reference) it releases the owning reference on the editor. editor event handling editing operations happen in response to user events: mouse, key, drag and drop, and ime (international text input) events. in order to receive these events, the editor registers several event
listeners on the document being edited. in addition, editor actions in the user interface are propagated via the xul and javascript, and call methods on the nseditorshell. this editor command dispatching is described separately. the following event
listeners are registered: in nshtmleditor::installevent
listeners(), we install the following. these get installed for all types of editor (i.e. for ...
...And 9 more matches
Fundamental text and font styling - Learn web development
a fat alley rat had met its demise while staring point blank down the cavernous barrel of this awesome prowling machine. truly a wonder of nature this urban predator — tommy the cat had many a story to tell. but it was a rare occasion such as this that he did.</p> font families to set a different font on your text, you use the font-family property — this allows you to specify a font (or
list of fonts) for the browser to apply to the selected elements. the browser will only apply a font if it is available on the machine the website is being accessed on; if not, it will just use a browser default font. a simple example looks like so: p { font-family: arial; } this would make all paragraphs on a page adopt the arial font, which is found on any computer. web safe fonts speaking of ...
...specific control over the fonts used to display our text content. the problem is to find a way to know which font is available on the computer used to see our web pages. there is no way to know this in every case, but the web safe fonts are known to be available on nearly all instances of the most used operating systems (windows, macos, the most common linux distributions, android, and ios). ...
...ssibly older) version of the times new roman font called times. it's considered best practice to use both with times new roman as the preferred alternative. trebuchet ms sans-serif you should be careful with using this font — it isn't widely available on mobile oses. verdana sans-serif note: among various resources, the cssfontstack.com website maintains a
list of web safe fonts available on windows and macos operating systems, which can help you make your decision about what you consider safe for your usage. note: there is a way to download a custom font along with a webpage, to allow you to customize your font usage in any way you want: web fonts. this is a little bit more complex, and we will be discussing this in a separate article later on in th...
...And 9 more matches
Client-side form validation - Learn web development
ab?c—matches a, optionally followed by a single b, followed by c. ( ac or abc) ab*c—matches a, optionally followed by any number of bs, followed by c. ( ac , abc, abbbbbc, and so on). a|b — matches one character that is a or b. abc|xyz — matches exactly abc or exactly xyz (but not abcxyz or a or y, and so on). there are many more possibilities that we don't cover here. for a complete
list and many examples, consult our regular expressions documentation. let's implement an example. update your html to add a pattern attribute like this: <form> <label for="choose">would you prefer a banana or a cherry?</label> <input id="choose" name="i_like" required pattern="[bb]anana|[cc]herry"> <button>submit</button> </form> input:invalid { border: 2px dashed red; } input:valid { ...
...nse! if a non-empty value of the <input> doesn't match the regular expression's pattern, the input will match the :invalid pseudoclass. note: some <input> element types don't need a pattern attribute to be validated against a regular expression. specifying the email type, for example, validates the inputs value against a well-formed email address pattern or a pattern matching a comma-separated
list of email addresses if it has the multiple attribute. note: the <textarea> element doesn't support the pattern attribute. constraining the length of your entries you can constrain the character length of all text fields created by <input> or <textarea> by using the minlength and maxlength attributes. a field is invalid if it has a value and that value has fewer characters than the minlength ...
...e will make it fail silently when used with a number field. ...
...And 9 more matches
Making decisions in your code — conditionals - Learn web development
wear shorts! go to the beach, or the park, and get an ice cream.'; } else if (choice === 'rainy') { para.textcontent = 'rain is falling outside; take a rain coat and an umbrella, and don\'t stay out for too long.'; } el...
...ara.textcontent = 'it isn\'t raining, but the sky is grey and gloomy; it could turn any minute, so take a rain coat just in case.'; } else { para.textcontent = ''; } } here we've got an html <select> element allowing us to make different weather choices, and a simple paragraph. in the javascript, we are storing a reference to both the <select> and <p> elements, and adding an event
listener to the <select> element so that when its value is changed, the setweather() function is run. when this function is run, we first set a variable called choice to the current value selected in the <select> element. we then use a conditional statement to show different text inside the paragraph depending on what the value of choice is. notice how all the conditions are tested in else if() {...}...
...for example: if (x === 5 || 7 || 10 || 20) { // run my code } in this case the condition inside if(...) will always evaluate to true since 7 (or any other non-zero value) always evaluates to true. this condition is actually saying "if x equals 5, or 7 is true — which it always is". this is logically not what we want! to ...
...And 9 more matches
Componentizing our Svelte app - Learn web development
the central objective of this article is to look at how to break our app into manageable components and share information between them. we'll componentize our app, then add more functionality to allow users to update existing components. prerequisites: at minimum, it is recommended that you are familiar with the core html, css, and javascript languages, and have knowledge of the terminal/command line. you'll need a terminal with node + npm installed to compile and build your app. ...
..., and add the following import statement below your previous one: import todo from './todo.svelte' next, we need to update our {#each} block to include a <todo> component for each todo, rather than the code that has been moved out to todo.svelte. we are also passing the current todo object into the component as a prop. ...
...owing import statement below your previous one: import todo from './todo.svelte' next, we need to update our {#each} block to include a <todo> component for each todo, rather than the code that has been moved out to todo.svelte. we are also passing the current todo object into the component as a prop. ...
...And 9 more matches
Understanding client-side JavaScript frameworks - Learn web development
ning live version, see https://mdn.github.io/todo-react-build/. 1. getting started with react in this article we will say hello to react. we'll discover a little bit of detail about its background and use cases, set up a basic react toolchain on our local computer, and create and play with a simple starter app, learning a bit about how react works in the process. 2. beginning our react todo
list let's say that we’ve been tasked with creating a proof-of-concept in react – an app that allows users to add, edit, and delete tasks they want to work on, and also mark tasks as complete without deleting them. this article will walk you through putting the basic app component structure and styling in place, ready for individual component definition and interactivity, which we'll add later. ...
... to start updating our app from a completely static ui to one that actually allows us to interact and change things. in this article we'll do this, digging into events and state along the way. 5. react interactivity: editing, filtering, conditional rendering as we near the end of our react journey (for now at least), we'll add the finishing touches to the main areas of functionality in our todo
list app. this includes allowing you to edit existing tasks and filtering the
list of tasks between all, completed, and incomplete tasks. we'll look at conditional ui rendering along the way. 6. accessibility in react in our final tutorial article, we'll focus on (pun intended) accessibility, including focus management in react, which can improve usability and reduce confusion for both keyboard-only...
...ks between all, completed, and incomplete tasks. we'll look at conditional ui rendering along the way. 6. accessibility in react in our final tutorial article, we'll focus on (pun intended) accessibility, including focus management in react, which can improve usability and reduce confusion for both keyboard-only and screen reader users. 7. react resources our final article provides you with a
list of react resources that you can use to go further in your learning. ember tutorials note: ember tutorials last tested in may 2020, with ember/ember cli version 3.18.0. if you need to check your code against our version, you can find a finished version of the sample ember app code in the ember-todomvc-tutorial repository. for a running live version, see https://nullvoxpopuli.github.io/ember-t...
...And 9 more matches
Mozilla accessibility architecture
lla should use the api's programmatic interfaces to expose this information to an accessibility client (the assistive technology). each platform's accessibility api has made different assumptions, although there are a number of common characteristics. for example, they all expose an accessible name, or text representation, of each object, and they all use an enumerated integer value from a finite
list, to expose the role of an object. examples of accessible role constants are role_button, role_checkbox and role_
list, although they can have slightly different names and values in each api. in general, the accessibility apis use similar concepts, but use different method, constant and interfaces names. given that there is a fair amount of commonality between accessibility api toolkits, it made se...
...sary accessible children are not in the dom subtree for a node. this is the case for: nshtmlimageaccessible: in msaa an image accessible can have accessible children if it has an image map. the children are the image map areas, which are in a different part of the dom tree. nshtmlcomboboxaccessible: an html combo box doesn't have a dom node or anonymous content for its s textfield, button or
list. in the future xbl form controls may be used, in which case there will be dom content for these sub-parts, and we will not need to override the traversal methods. that is why we don't need to override these traversal methods for nsxulcomboboxaccessible (<menu
list>). nsouterdocaccessible: used for elements such as <iframe>, <browser> and <editor>, which spawn an entire new document, but don't ac...
...getters to return nothing, as we do in nsleafaccessible, nstextaccessible and other accessible implementations where we want to be sure to avoid children. returning nothing for leaf and text objects also helps speed up tree construction and traversal. 4. accessible events accessible events are dom events translated into the event mechanism of the given platform, using the enumerated event numbers
listed in nsiaccessibleeventreceiver.idl. the accessibility client can find out what kind of event occurred as well as what accessible node the event occured on. table of gecko event to accessible event translation accessible documents
listen for dom events on nodes within them, and consequently fire the appropriate accessible event. this happens in the handleevent() method. note: this chart is not ...
...And 9 more matches
NSS API Guidelines
s #11) splitting low key and high key components more clearly the crypto wrappers (pkcs #11 wrappers) and high key pkcs #12 and pkcs #5 libraries nss compiles into the libraries described below. the layer indicates the main layer, seen in the previous diagram, in which the library operates. the directory is the location of the library code in the nss source tree. the public headers is a
list of header files that contain types, and functions, that are publicly available to higer-level apis. library description layer directory public headers certdb provides all certificate handling functions and types. the certdb library manipulates the certificate database (add, create, delete certificates and crls). it also provides general certificate-handling routi...
... }; the second task is to determine if individual data fields, within the data structure, are part of the api. one example may be the peercert field, in an ssl data structure. accessor functions, for these data elements, should be added to the api. there can be legitimate exceptions to this 'make everything opaque' rule. for example, in container structures, such as secitem, or maybe linked
list data structures. these data structures need to be examined on a case by case basis, to determine if they are truly stable and will not change in future release it is necessary for the callers of the api to know the size of these structures, as they may allocate new ones and pass them down. memory allocation with arenas this section discusses memory allocation using arenas. nss code uses ar...
...hread a releases the arena back to the mark. thread b now finds itself with a pointer to released data. some thread -- doesn't matter which -- allocates some data from the arena; this may overlap the chunk thread b has. boom! threadmark code notes the thread id, whenever an arena is marked, and disallows any allocations or marks by any other thread. ...
...And 9 more matches
NSS tools : crlutil
the key and certificate management process generally begins with creating keys in the key database, then generating and managing certificates in the certificate database(see certutil tool) and continues with certificates expiration or revocation. ...
... the key and certificate management process generally begins with creating keys in the key database, then generating and managing certificates in the certificate database(see certutil tool) and continues with certificates expiration or revocation. ...
... the key and certificate management process generally begins with creating keys in the key database, then generating and managing certificates in the certificate database(see certutil tool) and continues with certificates expiration or revocation. ...
...And 9 more matches
NSS tools : signtool
certificates with 1024-byte keys in the internal token. however, you can use the -s option specify the required key size and the -t option to specify the token. for more information about the use of the -g option, see "generating test object-signing certificates""generating test object-signing certificates" on page 1241. -l
lists signing certificates, including issuing cas. if any of your certificates are expired or invalid, the
list will so specify. this option can be used with the -k option to
list detailed information about a particular signing certificate. the -l option is available in netscape signing tool 1.0 and later versions only. -j signs a directory o...
... the -j option, the default compression value is 6. note that versions 1.1 and later of netscape signing tool correctly recognizes the codebase attribute, allows paths to be expressed for the class and src attributes instead of filenames only, processes link tags and parses html correctly, and offers clearer error messages. -l
lists the certificates in your database. an asterisk appears to the left of the nickname for any certificate that can be used to sign objects with signtool. --leavearc retains the temporary .arc (archive) directories that the -j option creates. these directories are automatically erased by default. retaining the temporary directories can be a...
...d #2 for example, the -i option uses the equivalent of this line: + install-script: script.js this example associates a mime type with a file: movie.qt mime-type: video/quicktime for information about the way installer script information appears in the manifest file for a jar archive, see the jar format on netscape devedge. -m
lists the pkcs #11 modules available to signtool, including smart cards. the -m option is available in netscape signing tool 1.0 and later versions only. for information on using netscape signing tool with smart cards, see "using netscape signing tool with smart cards". for information on using the -m option to verify fips-140-1 validated mode, se...
...And 9 more matches
Redis Tips
cream -- it just gives the whaling industry a way to lump together people who don't use their products. so rather than thinking about redis as a database with some kind of non-existent relationship to sql, think of it as a data structure server with a rich set of commands for querying and manipulating those data structures over a network connection. 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. counters set, incr, incrby
list manipulation lpush, rpush, lpop, rpop, llen, linsert, lindex, etc. ...
...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. counters set, incr, incrby
list manipulation lpush, rpush, lpop, rpop, llen, linsert, lindex, etc. event logging
lists, zsets, pubsub queues
lists (rpush, blpop, blpoprpush, etc.) priority queues zsets membership sets, bitstrings state hashes heartbeats zsets hit counters zsets message broadcast pubsub search reverse indexes (never use keys in production) documentation redis has fantastic documentation. yet...
...rse indexes (never use keys in production) documentation redis has fantastic documentation. yet redis is so easy to learn and use that you'll seldom feel you need to consult it. there are three reasons to look at the docs for every command you use. time complexity - each command's complexity is given in big-o notation. this is immensely helpful. related commands - an ever-growing
list of related commands is given on the right-hand side of the page. recipes - at the bottom of many pages is a section that gives usage patterns or recipes for the command under discussion. there are many insightful ideas to be found here. getting started with redis before you go any further in this document, make sure you have played with redis for at least 5 or 10 minutes. if you have not, h...
...And 9 more matches
Gecko Roles
role constants are defined in the nsiaccessiblerole interface. role_nothing used when the accessible item doesn't have a strongly defined role. role_titlebar represents a title or caption bar for a window. used by msaa only, this is supported automatically by microsoft windows. role_menubar represents the menu bar (positioned beneath the title bar of a window on most platforms or at the top of the screen on mac os x) from which menus are selected by the user. role_scrollbar represents a vertical or horizontal scroll bar, which is part of the client area or used in a control. ...
...een contents of containers advertising this role. should be used for warning dialogs, etc. role_window represents the window frame, which contains child objects such as a title bar, client, and other objects contained in a window. the role is supported automatically by microsoft windows. role_internal_frame a sub-document. role_menupopup represents a menu, which presents a
list of options from which the user can make a selection to perform an action. role_menuitem represents a menu item, which is an entry in a menu that a user can choose to carry out a command, select an option. role_tooltip represents a tooltip that provides helpful hints; this is generally displayed at the mouse cursor position. role_application represents a main window for an ...
...a table. role_link represents a link to something else. this object might look like text or a graphic, but it acts like a button. role_helpballoon displays a help topic in the form of a tooltip or help balloon. role_character represents a cartoon-like graphic object, such as microsoft office assistant, which is displayed to provide help to users of an application. role_
list represents a
list box, allowing the user to select one or more items. role_
listitem represents an item in a
list. role_outline represents an outline or tree structure, such as a tree view control, that displays a hierarchical
list and allows the user to expand and collapse branches. role_outlineitem represents an item in an outline or tree structure. role_pagetab ...
...And 9 more matches
nsIAccessibleRole
d for warning dialogs, etc. the role is used by xul:browsermessage, role="alert", xforms:message. role_window 9 represents the window frame, which contains child objects such as a title bar, client, and other objects contained in a window. the role is supported automatically by ms windows. role_internal_frame 10 a sub-document or iframe. role_menupopup 11 represents a menu, which presents a
list of options from which the user can make a selection to perform an action. it is used for role="menu". role_menuitem 12 represents a menu item, which is an entry in a menu that a user can choose to carry out a command, select an option. it is used for xul:menuitem, role="menuitem". role_tooltip 13 represents a tooltip that provides helpful hints. role_application 14 represents a main window ...
...le_rowheader 26 represents a row header, which provides a visual label for a table row. it is used for role="rowheader". also, see role_table. role_column 27 represents a column of cells within a table. also, see role_table. role_row 28 represents a row of cells within a table. also, see role_table. role_cell 29 represents a cell within a table. it is used for html:td, xul:tree cell and xul:
listcell. also, see role_table. role_link 30 represents a link to something else. this object might look like text or a graphic, but it acts like a button. it is used for xul:label@class="text-link", html:a, html:area, xforms:trigger@appearance="minimal". role_helpballoon 31 displays a help topic in the form of a tooltip or help balloon. role_character 32 represents a cartoon-like graphic object...
...text or a graphic, but it acts like a button. it is used for xul:label@class="text-link", html:a, html:area, xforms:trigger@appearance="minimal". role_helpballoon 31 displays a help topic in the form of a tooltip or help balloon. role_character 32 represents a cartoon-like graphic object, such as microsoft office assistant, which is displayed to provide help to users of an application. ...
...And 9 more matches
nsIXULTemplateBuilder
the nsitemplatebuilder interface controls the display of elements using a xul template element and is automatically attached to an element containing a datasources attribute. a template builder, given an input source of data, a template, and a reference point, generates a
list of results from the input, and copies part of the template for each result. templates may generate content recursively, using the same template, but with the previous iteration's results as the reference point. as an example, for an xml data source the initial reference point would be a specific node in the dom tree and a template might generate a
list of all child nodes. for the next iteration, those children would be used to generate output for their child nodes and so forth. a template builder is attached to a...
... datasource nsisupports the opaque datasource object that is used for the template. this object is created by the getdatasource method of the query processor. may...
... datasource nsisupports the opaque datasource object that is used for the template. this object is created by the getdatasource method of the query processor. may be null if the datasourc...
...And 9 more matches
DataTransferItem.webkitGetAsEntry() - Web APIs
king for both. syntax datatransferitem.webkitgetasentry(); parameters none. return value a filesystementry-based object describing the dropped item. this will be either filesystemfileentry or filesystemdirectoryentry. ...
...bing the dropped item. this will be either filesystemfileentry or filesystemdirectoryentry. example in this example, a drop zone is created, which responds to the drop event by scanning through the dropped files and directories, outputting a hierarchical directory
listing. html content the html establishes the drop zone itself, which is a <div> element with the id "dropzone", and an unordered
list element with the id "
listing". <p>drag files and/or directories to the box below!</p> <div id="dropzone"> <div id="boxtitle"> drop files here </div> </div> <h2>directory tree:</h2> <ul id="
listing"> </ul> css content the styles used by the example are shown here. #dropzone { text-align: center; width: 300px; height: 100px; margin: 10px; padding: 10px; border: 4px dashed...
...n: center; color: black; font: bold 2em "arial", sans-serif; width: 300px; height: 100px; } body { font: 14px "arial", sans-serif; } javascript content first, let's look at the recursive scanfiles() function. ...
...And 9 more matches
FileSystemDirectoryReader.readEntries() - Web APIs
rcallback optional a callback function which is called if an error occurs while reading from the directory. it receives one input parameter: a fileerror object describing the error which occurred. return value undefined. ...
...rameter: a fileerror object describing the error which occurred. return value undefined. example in this example, a drop zone is created, which responds to the drop event by scanning through the dropped files and directories, outputting a hierarchical directory
listing. html content the html establishes the drop zone itself, which is a <div> element with the id "dropzone", and an unordered
list element with the id "
listing". <p>drag files and/or directories to the box below!</p> <div id="dropzone"> <div id="boxtitle"> drop files here </div> </div> <h2>directory tree:</h2> <ul id="
listing"> </ul> css content the styles used by the example are shown here. #dropzone { text-align: center; width: 300px; height: 100px; margin: 10px; padding: 10px; border: 4px dashed...
...n: center; color: black; font: bold 2em "arial", sans-serif; width: 300px; height: 100px; } body { font: 14px "arial", sans-serif; } javascript content first, let's look at the recursive scanfiles() function. ...
...And 9 more matches
Timing element visibility with the Intersection Observer API - Web APIs
ide> <nav> <ul> <li><a href="#link1">a link</a></li> <li><a href="#link2">another link</a></li> <li><a href="#link3">one more link</a></li> </ul> </nav> </aside> <main> </main> </div> this is the framework for the entire site. at the top is the site's header region, contained within a <header> block. below that, we define the site's sidebar as a
list of links within an <aside> block. finally comes the main body. we start with an empty <main> element here. this box will be populated using script later. styling the site with css with the structure of the site defined, we turn to the styling for the site. let's look at the style for each component of the page individually. the basics we provide styles for the <body> and <main> elements to d...
...our sidebar is used to present links to other pages on the site. none of them work in our example here, but they exist to help with the presentation of a blog-like experience. the sidebar is represented using an <aside> element, and is styled as follows: aside { grid-column: 1; grid-row: 2; background-color: cornsilk; padding: 5px 10px; } aside ul { padding-left: 0; } aside ul li {
list-style: none; } aside ul li a { text-decoration: none; } the most important thing to note here is that the grid-column is set to 1, to place the sidebar on the left-hand side of the screen. if you change this to -1, it will appear on the right (although some other elements will need some adjustments made to their margins to get the spacing just right). the grid-row is set to 2, to place it alo...
...ed as follows: contentbox a reference to the <main> element's htmlelement object in the dom. this is where we'll insert the articles and ads. nextarticleid each article is given a unique id number; this variable tracks the next id to use, starting with 1. visibleads a set which we'll use to track the ads currently visible on the screen. previouslyvisibleads used to temporarily store the
list of visible ads while the document is not visible (for example, if the user has tabbed to another page). adobserver will hold our intersectionobserver used to track the intersection between the ads and the <main> element's bounds. refreshintervalid used to store the interval id returned by setinterval(). this interval will be used to trigger our periodic refreshes of the ads' content. settin...
...And 9 more matches
PannerNode - Web APIs
t value, defined by the coneoutergain attribute. pannernode.coneoutergain a double value describing the amount of volume reduction outside the cone defined by the coneouterangle attribute. its default value is 0, meaning that no sound can be heard. pannernode.distancemodel an enumerated value determining which algorithm to use to reduce the volume of the audio source as it moves away from the
listener. possible values are "linear", "inverse" and "exponential". the default value is "inverse". pannernode.maxdistance a double value representing the maximum distance between the audio source and the
listener, after which the volume is not reduced any further. pannernode.orientationx represents the horizontal position of the audio source's vector in a right-hand cartesian coordinate system. ...
...z represents the longitudinal (back and forth) position of the audio in a right-hand cartesian coordinate system. the default is 0. while this audioparam cannot be directly changed, its value can be altered using its value property. the default is value is 0. pannernode.refdistance a double value representing the reference distance for reducing volume as the audio source moves further from the
listener. for distances greater than this the volume will be reduced based on rollofffactor and distancemodel. pannernode.rollofffactor a double value describing how quickly the volume is reduced as the source moves away from the
listener. this value is used by all distance models. methods inherits methods from its parent, audionode. pannernode.setposition() defines the position of the audio ...
...ater than this the volume will be reduced based on rollofffactor and distancemodel. pannernode.rollofffactor a double value describing how quickly the volume is reduced as the source moves away from the
listener. this value is used by all distance models. methods inherits methods from its parent, audionode. pannernode.setposition() defines the position of the audio source relative to the
listener (represented by an audio
listener object stored in the audiocontext.
listener attribute.) pannernode.setorientation() defines the direction the audio source is playing in. pannernode.setvelocity() defines the velocity vector of the audio source — how fast it is moving and in what direction. in a previous version of the specification, the pannernode had a velocity that could pitch ...
...And 9 more matches
Using Touch Events - Web APIs
s may subsequently touch the surface and optionally move across the touch surface. the interaction ends when the fingers are removed from the surface. during this interaction, an application receives touch events during the start, move, and end phases. the application may apply its own semantics to the touch inputs. interfaces touch events consist of three interfaces (touch, touchevent and touch
list) and the following event types: touchstart - fired when a touch point is placed on the touch surface. touchmove - fired when a touch point is moved along the touch surface. touchend - fired when a touch point is removed from the touch surface. touchcancel - fired when a touch point has been disrupted in an implementation-specific manner (for example, too many touch points are created). th...
...on a touch-sensitive device. the contact point is typically referred to as a touch point or just a touch. a touch is usually generated by a finger or stylus on a touchscreen, pen or trackpad. a touch point's properties include a unique identifier, the touch point's target element as well as the x and y coordinates of the touch point's position relative to the viewport, page, and screen. the touch
list interface represents a
list of contact points with a touch surface, one touch point per contact. thus, if the user activated the touch surface with one finger, the
list would contain one item, and if the user touched the surface with three fingers, the
list length would be three. the touchevent interface represents an event sent when the state of contacts with a touch-sensitive surface changes. ...
...rface represents an event sent when the state of contacts with a touch-sensitive surface changes. the state changes are starting contact with a touch surface, moving a touch point while maintaining contact with the surface, releasing a touch point and canceling a touch event. ...
...And 9 more matches
Box-shadow generator - CSS: Cascading Style Sheets
-pointer'; node.appendchild(pointer); this.pointer = pointer; setmousetracking(node, updateslider.bind(this)); sliders[topic] = this; setvalue(topic, this.value); } var setbuttoncomponent = function setbuttoncomponent(node) { var type = node.getattribute('data-type'); var topic = node.getattribute('data-topic'); if (type === "sub") { node.textcontent = '-'; node.addevent
listener("click", function() { decrement(topic); }); } if (type === "add") { node.textcontent = '+'; node.addevent
listener("click", function() { increment(topic); }); } } var setinputcomponent = function setinputcomponent(node) { var topic = node.getattribute('data-topic'); var unit_type = node.getattribute('data-unit'); var input = document.createelement('input');...
... } } var setinputcomponent = function setinputcomponent(node) { var topic = node.getattribute('data-topic'); var unit_type = node.getattribute('data-unit'); var input = document.createelement('input'); var unit = document.createelement('span'); unit.textcontent = unit_type; input.setattribute('type', 'text'); node.appendchild(input); node.appendchild(unit); input.addevent
listener('click', function(e) { this.select(); }); input.addevent
listener('change', function(e) { setvalue(topic, e.target.value | 0); }); subscribe(topic, function(value) { node.children[0].value = value; }); } var increment = function increment(topic) { var slider = sliders[topic]; if (slider === null || slider === undefined) return; if (slider.value + slider.step <...
...a = slider.max - slider.min; var width = slider.node.clientwidth; var offset = slider.pointer.clientwidth; var pos = (value - slider.min) * width / delta; slider.value = value; slider.pointer.style.left = pos - offset / 2 + "px"; slider.node.setattribute('data-value', value); notify.call(slider); } var setmousetracking = function setmousetracking(elem, callback) { elem.addevent
listener("mousedown", function(e) { callback(e); document.addevent
listener("mousemove", callback); }); document.addevent
listener("mouseup", function(e) { document.removeevent
listener("mousemove", callback); }); } var subscribe = function subscribe(topic, callback) { if (subscribers[topic] === undefined) subscribers[topic] = []; subscribers[topic].push(callback); } var unsu...
...And 9 more matches
Cross-browser audio basics - Developer guides
t to show progress, buffering and only activate the buttons when the media is ready to play? fortunately, there are a number of events we can use to let our player know exactly what is happening. first, let's take a look at the media loading process in order: loadstart the loadstart event tells us simply that load process has started and the browser is connecting to the media. ...
... and the browser is connecting to the media. myaudio.addevent
listener("loadstart", function() { //grabbing the file }); durationchange if you just want to know as soon as the duration of your media is established, this is the event for you. this can be useful because the initial value for duration is nan (not a number), which you probably don't want to display to your users. myaudio.addevent
listener("durationchange", function() { //you can display the duration now }); loadedmetadata metadata can consist of more than just duration — if you want to wait for all the metadata to download before doing something, you can detect the loadedmetadata event. ...
...value for duration is nan (not a number), which you probably don't want to display to your users. myaudio.addevent
listener("durationchange", function() { //you can display the duration now }); loadedmetadata metadata can consist of more than just duration — if you want to wait for all the metadata to download before doing something, you can detect the loadedmetadata event. myaudio.addevent
listener("loadedmetadata", function() { //you can display the duration now }); loadeddata the loadeddata event is fired when the first bit of media arrives. the playhead is in position but not quite ready to play. myaudio.addevent
listener("loadeddata", function() { //you could display the playhead now }); progress the progress event indicates that the download of media is still in progress. i...
...And 9 more matches
port - Archive of obsolete content
any value that is serializable to json. ...
...sagepayload); from the main add-on code to the content script: // main.js var mymessagepayload = "some data"; worker.port.emit("mymessage", mymessagepayload); on() the port.on() function registers a function as a
listener for a particular message sent from the other side using port.emit(). it takes two parameters: the name of the message and a function to handle it. ...
...nction as a
listener for a particular message sent from the other side using port.emit(). it takes two parameters: the name of the message and a function to handle it. in a content script, to
listen for "mymessage" sent from the main add-on code: // content-script.js self.port.on("mymessage", function handlemymessage(mymessagepayload) { // handle the message }); in the main add-on code, to
listen for "mymessage" sent from a a content script: // main.js worker.port.on("mymessage", function handlemymessage(mymessagepayload) { // handle the message }); once() often you'll want to receive a message just once, then stop
listening. the port object offers a shortcut to do this: the once() method. ...
...And 8 more matches
Porting the Library Detector - Archive of obsolete content
erything else. the bulk of the script is an array of test objects, one for each library. each test object contains a function called test(): if the function finds the library, it defines various additional properties for the test object, such as a version property containing the library version. each test also contains a chrome:// url pointing to the icon associated with its library. ...
...r the test object, such as a version property containing the library version. each test also contains a chrome:// url pointing to the icon associated with its library. the script
listens to gbrowser's domcontentloaded event. when this is triggered, the testlibraries() function builds an array of libraries by iterating through the tests and adding an entry for each library which passes. once the
list is built, the switchlibraries() function constructs a xul statusbarpanel element for each library it found, populates it with the icon at the corresponding chrome:// url, and adds it to the box. finally, it
listens to gbrowser's tabselect event, to update the contents of the box for that window. content script separation the test objects in the original script need access to the dom window obj...
... the un-proxied dom window, so they can see the objects added by libraries, so we’ll need to use the experimental unsafewindow. the main add-on script, main.js, will use a page-mod to inject the content script into every new page. the content script, which we'll call library-detector.js, will keep most of the logic of the test functions intact. ...
...And 8 more matches
ui/button/toggle - Archive of obsolete content
sed on the device screen resolution and the place the icon appears. for example, in the screenshots above, firefox uses the small icon when the button is in the toolbar and the large icon when the button is in the menu panel. read more about specifying icons in the reference documentation for the togglebutton constructor. ...
...fox uses the small icon when the button is in the toolbar and the large icon when the button is in the menu panel. read more about specifying icons in the reference documentation for the togglebutton constructor. responding to click events you can respond to click events by assigning a
listener to the button's click or change events. you can do this in the button's constructor, by assigning the
listener to the onclick or onchange option. ...
...when the button is in the menu panel. read more about specifying icons in the reference documentation for the togglebutton constructor. responding to click events you can respond to click events by assigning a
listener to the button's click or change events. you can do this in the button's constructor, by assigning the
listener to the onclick or onchange option. ...
...And 8 more matches
On page load - Archive of obsolete content
this article is for xul/javascript developers who want to have custom code executed each time a new page is loaded in browser/mail. if you need finer control over custom code execution—for example, as documents are loading or when tabs are switched—see progress
listeners. progress
listeners allow extensions to be notified of events associated with documents loading in the browser and with tab switching events. progress
listeners implement the nsiwebprogress
listener interface. creating an overlay first, you need to create an overlay to one (or more, depending on which applications you target) of the following xul documents: application uri to overlay firefox chrome://browser/content/browser.xul thunderbird chrome://messenger/content/messenger.xul ...
...get) of the following xul documents: application uri to overlay firefox chrome://browser/content/browser.xul thunderbird chrome://messenger/content/messenger.xul navigator from seamonkey chrome://navigator/content/navigator.xul attaching a script attach a script to your overlay (see "attaching a script to an overlay") that adds a load event
listener to appcontent element (browsers) or messagepane (mail): window.addevent
listener("load", function load(event){ window.removeevent
listener("load", load, false); //remove
listener, no longer needed myextension.init(); },false); var myextension = { init: function() { var appcontent = document.getelementbyid("appcontent"); // browser if(appcontent){ appcontent.addeventl...
... // doc.location is a location object (see below for a link). // you can use it to make your code executed on certain pages only. if(doc.locatio...
...And 8 more matches
Tabbed browser - Archive of obsolete content
these snippets assume they are run in the context of a browser window. if you need to work with tabs from a non-browser window, you need to obtain a reference to one first, see working with windows in chrome code for details. ...
...e global variable gbrowser. // gbrowser is only accessible from the scope of // the browser window (browser.xul) gbrowser.addtab(...); if gbrowser isn't defined your code is either not running in the scope of the browser window or running too early. you can access gbrowser only after the browser window is fully loaded. if you need to do something with gbrowser right after the window is opened,
listen for the load event and use gbrowser in the event
listener. if your code does not have access to the main window because it is run in a sidebar or dialog, you first need to get access to the browser window you need before you can use gbrowser. you can find more information on getting access to the browser window in working with windows in chrome code. from a sidebar basically, if your extensi...
...ewly opened tab, you'll need to wait until the content has finished loading. // wrong way (the page hasn't finished loading yet) var newtabbrowser = gbrowser.getbrowserfortab(gbrowser.addtab("http://www.google.com/")); alert(newtabbrowser.contentdocument.body.innerhtml); // better way var newtabbrowser = gbrowser.getbrowserfortab(gbrowser.addtab("http://www.google.com/")); newtabbrowser.addevent
listener("load", function () { newtabbrowser.contentdocument.body.innerhtml = "<div>hello world</div>"; }, true); (the event target in the onload handler will be a 'tab' xul element). see tabbrowser for getbrowserfortab(). note that the code above does not work inside of the electrolysis (e10s) enabled tabs. opening a url in the correct window/tab there are methods available in chrome://browser/...
...And 8 more matches
Migrate apps from Internet Explorer to Mozilla - Archive of obsolete content
s not support accessing an element through document.elementname or even through the element's name, which internet explorer does (also called global namespace polluting). mozilla also does not support the netscape 4 document.layers method and internet explorer's document.all. while document.getelementbyid lets you retrieve one element, you can also use document.layers and document.all to obtain a
list of all document elements with a certain tag name, such as all <div> elements. the w3c dom level 1 method gets references to all elements with the same tag name through getelementsbytagname(). the method returns an array in javascript, and can be called on the document element or other nodes to search only their subtree. to get an array of all elements in the dom tree, you can use getelementsbyta...
...ns created for internet explorer. the first tool is the built-in javascript console, shown in figure 1, where errors and warnings are logged. you can access it in mozilla by going to tools -> web development -> javascript console or in firefox (the standalone browser product from mozilla) at tools -> javascript console. figure 1. javascript console the javascript console can show the full log
list or just errors, warnings, and messages. the error message in figure 1 says that at aol.com, line 95 tries to access an undefined variable called is_ns70. clicking on the link will open mozilla's internal view source window with the offending line highlighted. the console also allows you to evaluate javascript. to evaluate the entered javascript syntax, type in 1+1 into the input field and press ...
...cy browsers, such as internet explorer 4, rendered with so-called quirks under certain conditions. while mozilla aims to be a standards-compliant browser, it has three modes that support older web pages created with these quirky behaviors. the page's content and delivery determine which mode mozilla will use. mozilla will indicate the rendering mode in view -> page info (or ctrl+i) ; firefox will
list the rendering mode in tools -> page info. the mode in which a page is located depends on its doctype. doctypes (short for document type declarations) look like this: <!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/tr/html4/loose.dtd"> the section in blue is called the public identifier, the green part is the system identifier, which is a uri. standards mode ...
...And 8 more matches
appendItem - Archive of obsolete content
« xul reference home appenditem( label, value ) return type: element creates a new item and adds it to the end of the existing
list of items. you may optionally set a value. the function returns the newly created element. ...
... « xul reference home appenditem( label, value ) return type: element creates a new item and adds it to the end of the existing
list of items. you may optionally set a value. the function returns the newly created element. ...
... « xul reference home appenditem( label, value ) return type: element creates a new item and adds it to the end of the existing
list of items. you may optionally set a value. the function returns the newly created element. ...
...And 8 more matches
Things I've tried to do with XUL - Archive of obsolete content
feel free to add your own xul experiences here. how do i use percentage-based height/width with xul? short answer: you can't easily, at least not yet. this means that creating any sort of visual display (not necessarily "ui"; my use case is for creating a calendar time display) that sizes sanely when the user resizes the window is unfortunately very difficult. ...
...indow xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:html="http://www.w3.org/1999/xhtml"> ... <html:body id="invisible_element" flex="1" > <svg xmlns="http://www.w3.org/2000/svg" version="1.1"><!-- ...or _visible_ xul content or whatever... --></svg> </html:body> ... var available_width = document.getelementbyid("invisible_element").clientwidth; ... xbl in
listboxes using xbl bindings in
listboxes is not easy because there is a big bug there: if you create from js an element you want to bind, and if it is hidden when the
listbox is first rendered, the
listbox does not create a frame for it, and the xbl doesn't get attached... a workaround for that is to create the element, insert it in the document and set its style attribute with a -moz-binding proper...
...use there is a big bug there: if you create from js an element you want to bind, and if it is hidden when the
listbox is first rendered, the
listbox does not create a frame for it, and the xbl doesn't get attached... a workaround for that is to create the element, insert it in the document and set its style attribute with a -moz-binding property, all of that from c++ instead of js. multi-column
listboxes when adding items to multi-column
listboxes, you can't use the appenditem api: // auto-create and attach 1st cell var row = my
listbox.appenditem( label, value ); // create and attach 2nd cell var cell = document.createelement('
listcell'); cell.setattribute('label', label2 ); cell.setattribute('value', value2 ); row.appendchild( cell ); // etc // ... while this works at first, after a numb...
...And 8 more matches
Advanced Rules - Archive of obsolete content
the question mark indicates that the text following it is a variable. you can then use the variable 'var' within the remainder of the conditions. of course, you can name the variable whatever you want. member element the next element is the member element, which is used to iterate through a set of child resources. in rdf terms, that means a container such a seq, bag or alt. ...
...n about="http://www.xulplanet.com/rdf/weather/city/paris"> <cityset:name>paris</cityset:name> </rdf:description> . . . you want to display a row in a tree for each city. to do this, use the member element as in the following: <tree id="citiestree" datasources="weather.rdf" ref="http://www.xulplanet.com/rdf/weather/cities"> <template> <rule> <conditions> <content uri="?
list"/> <member container="?
list" child="?city"/> </conditions> <rule> <template> </tree> the template builder starts by grabbing the value of the ref attribute, which in this case is http://www.xulplanet.com/rdf/weather/cities. this resource will be placed in the '
list' variable as specified by the content tag. we can then get related resources to the root resource by using the '...
..."/> <member container="?
list" child="?city"/> </conditions> <rule> <template> </tree> the template builder starts by grabbing the value of the ref attribute, which in this case is http://www.xulplanet.com/rdf/weather/cities. this resource will be placed in the '
list' variable as specified by the content tag. we can then get related resources to the root resource by using the '
list' variable. the template builder then sees the member element. it causes the builder to iterate over the children of an element. the parent is specified by the container attribute and the children are specified by the child attribute. in the example above, the value of the container attribute is the variable '
list'. ...
...And 8 more matches
Commands - Archive of obsolete content
the command. you can think of the command element as a type of controller for the command. the command dispatcher locates a controller by looking at the currently focused element to see if it has a controller which can handle the command. xul elements have a controllers property which is used to check. you can use the controllers property to add your own controllers. you might use this to have a
listbox respond to cut, copy and paste operations, for instance. an example of this will be provided later. by default, only textboxes have a controller that does anything. the textbox controller handles clipboard operations, selection, undo and redo as well as some editing operations. note that an element may have multiple controllers, which will all be checked. if the currently focused element does...
...rea. note that html also has a commands and controller system although you can't use it on unprivileged web pages, but you may use it from, for example, a browser extension. if the window doesn't provide a controller capable of handling the command, nothing will happen. you can get the command dispatcher using the document's commanddispatcher property, or you can retrieve it from the controllers
list on an element or a window. the command dispatcher contains methods for retrieving controllers for commands and for retrieving and modifying the focus. adding controllers you can implement your own controllers to respond to commands. you could even override the default handling of a command with careful placement of the controller. a controller is expected to implement four methods, which are li...
... iscommandenabled (command) this method should return true if the command is enabled, or false if it is disabled. corresponding buttons will be disabled automatically. docommand (command) execute the command. this is where you would put the code to handle the command. onevent (event) this method handles an event. example: controller implementation let's assume that we want to implement a
listbox that handles the delete command. when the user selects delete from the menu, the
listbox deletes the selected row. in this case, you just need to attach a controller to a
listbox which will perform the action in its docommand method. try opening the example below (source view) in a browser window and selecting items from the
list. you'll notice that the delete command on the browser's edit me...
...And 8 more matches
tree - Archive of obsolete content
any number of columns. each row of the tree may contain child rows which are displayed indented from the parent. unlike other elements, the data to display inside the tree is not specified using tags, but is determined from a view object. the view object implements the nsitreeview interface. the view is queried for the data to appear in the tree. there are several ways in which trees are used, as
listed below. the second column
lists the interfaces available via the tree's view property. the third column indicates whether treeitem element are used. if you would like to allow the tree to be horizontally scrolled, simply set the width attributes for each column to make the tree wider than its containing object. tree type view interfaces has dom nodes? description con...
...rementally, so typing more letters with select more specific items. this feature may be disabled by setting this attribute to true. editable type: boolean indicates that the cells of the tree may be edited. enablecolumndrag type: boolean when set to true, the user may drag the column headers around to change the order in which they are displayed. flags type: space-separated
list of the values below a set of flags used for miscellaneous purposes. two flags are defined, which may be the value of this attribute. dont-test-empty: for template generated content, the builder will not check that a container is empty. dont-build-content: this flag may be used on a tree to indicate that content elements should not be generated. this results in a performance enhancement, bu...
...isplay in the element. if the element contains more than this number of rows, a scrollbar will appear which the user can use to scroll to the other rows. to get the actual number of rows in the element, use the getrowcount method. seltype type: one of the values below used to indicate whether multiple selection is allowed. single only one row may be selected at a time. (default in
listbox and rich
listbox.) multiple multiple rows may be selected at once. (default in tree.) for trees, you can also use the following values: cell individual cells can be selected text rows are selected; however, the selection highlight appears only over the text of the primary column. for rich
listbox, this is new in firefox 3.5. statedatasource type: uri chrome x...
...And 8 more matches
Index - MDN Web Docs Glossary: Definitions of Web-related terms
this glossary provides definitions of words and abbreviations you need to know to successfully understand and build for the web. ...
... entirely encloses it and its descendants. 40 breadcrumb accessibility, glossary, navigation, search, site map, breadcrumb a breadcrumb, or breadcrumb trail, is a navigational aid that is typically placed between a site's header and the main content, displaying either a hierarchy of the current page in relation to the the site's structure, from top level to current page, or a
list of the links the user followed to get to the current page, in the order visited. 41 brotli brotli, glossary, reference, web performance, compression brotli is a general-purpose lossless compression algorithm. 42 browser glossary, navigation a web browser or browser is a program that retrieves and displays pages from the web, and lets users access further...
...ove various kinds of content, not only text but also embedded images, video, audio, and interactive code. 48 cors glossary, infrastructure, security cors (cross-origin resource sharing) is a system, consisting of transmitting http headers, that determines whether browsers block frontend javascript code from accessing responses for cross-origin requests. ...
...And 8 more matches
Example 5 - Learn web development
this is the last example that explain how to build custom form widgets. ...
...is is the last example that explain how to build custom form widgets. ...
...pple</li> </ul> </div> </form> css content .widget select, .no-widget .select { position : absolute; left : -5000em; height : 0; overflow : hidden; } /* --------------- */ /* required styles */ /* --------------- */ .select { position: relative; display : inline-block; } .select.active, .select:focus { box-shadow: 0 0 3px 1px #227755; outline: none; } .select .opt
list { position: absolute; top : 100%; left : 0; } .select .opt
list.hidden { max-height: 0; visibility: hidden; } /* ------------ */ /* fancy styles */ /* ------------ */ .select { font-size : 0.625em; /* 10px */ font-family : verdana, arial, sans-serif; -moz-box-sizing : border-box; box-sizing : border-box; padding : 0.1em 2.5em 0.2em 0.5em; /* 1px 25px 2px 5px */ ...
...And 8 more matches
Getting started with HTML - Learn web development
width: 98%; } body { margin: 10px; background: #f5f9fa; } var textarea = document.getelementbyid('code'); var reset = document.getelementbyid('reset'); var solution = document.getelementbyid('solution'); var output = document.queryselector('.output'); var code = textarea.value; var userentry = textarea.value; function updatecode() { output.innerhtml = textarea.value; } reset.addevent
listener('click', function() { textarea.value = code; userentry = textarea.value; solutionentry = htmlsolution; solution.value = 'show solution'; updatecode(); }); solution.addevent
listener('click', function() { if(solution.value === 'show solution') { textarea.value = solutionentry; solution.value = 'hide solution'; } else { textarea.value = userentry; solution.value = ...
...ution'; updatecode(); }); solution.addevent
listener('click', function() { if(solution.value === 'show solution') { textarea.value = solutionentry; solution.value = 'hide solution'; } else { textarea.value = userentry; solution.value = 'show solution'; } updatecode(); }); var htmlsolution = '<em>this is my text.</em>'; var solutionentry = htmlsolution; textarea.addevent
listener('input', updatecode); window.addevent
listener('load', updatecode); // stop tab key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { var scrollpos = textarea.scr...
...ml: block-level elements and inline elements. block-level elements form a visible block on a page. a block-level element appears on a new line following the content that precedes it. any content that follows a block-level element also appears on a new line. block-level elements are usually structural elements on the page. for example, a block-level element might represent headings, paragraphs,
lists, navigation menus, or footers. a block-level element wouldn't be nested inside an inline element, but it might be nested inside another block-level element. inline elements are contained within block-level elements, and surround only small parts of the document’s content. (not entire paragraphs or groupings of content) an inline element will not cause a new line to appear in the document. it ...
...And 8 more matches
React interactivity: Editing, filtering, conditional rendering - Learn web development
previous overview: client-side javascript frameworks next as we near the end of our react journey (for now at least), we'll add the finishing touches to the main areas of functionality in our todo
list app. this includes allowing you to edit existing tasks, and filtering the
list of tasks between all, completed, and incomplete tasks. we'll look at conditional ui rendering along the way. prerequisites: familiarity with the core html, css, and javascript languages, knowledge of the terminal/command line. objective: to learn about conditional rendering in react, and implementing
list filtering and an editing ui in our app. editing the name of a task we don’t have a user interface for editing the name of a task yet. we'll get to that in a momen...
... it'll also take a newname property containing the name to update the task to. we'll use array.prototype.map() instead of array.prototype.filter() because we want to return a new array with some changes, instead of deleting something from the array. ...
... instead of deleting something from the array. add the edittask() function inside your app component, in the same place as the other functions: function edittask(id, newname) { const editedtask
list = 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(editedtask
list); } pass edittask into our <todo /> components as a prop in the same way we did with deletetask: const task
list = tasks.map(task => ( <todo id={task.id} name={task.name} completed={task.completed} key={task.id} toggletaskcompleted={toggletaskcompleted} deletetask={deletetask} edittask={edittask} /> )); now open todo.js. we’re going to do some refactoring. a u...
...And 8 more matches
Creating our first Vue component - Learn web development
along the way, we'll learn about a few important concepts such as calling components inside other components, passing data to them via props, and saving data state. note: if you need to check your code against our version, you can find a finished version of the sample vue app code in our todo-vue repository. ...
...f vue (like single file components or render functions), you'll need a terminal with node + npm installed. objective: to learn how to create a vue component, render it inside another component, pass data into it using props, and save its state. creating a todoitem component let's create our first component, which will display a single todo item. we'll use this to build our
list of todos. in your moz-todo-vue/src/components directory, create a new file named todoitem.vue. open the file in your code editor. create the component's template section by adding <template></template> to the top of the file. create a <script></script> section below your template section. inside the <script> tags, add a default exported object export default {}, which is your component objec...
... 'app', components: { todoitem } }; this is the same way that the helloworld component was registered by the vue cli earlier. to actually render the todoitem component in the app, you need to go up into your <template> element and call it as a <to-do-item></to-do-item> element. note that the component file name and its representation in javascript is always in upper camel case (e.g. ...
...And 8 more matches
Focus management with Vue refs - Learn web development
a lifecycle. this lifecycle spans from all the way before elements are created and added to the vdom (mounted), until they are removed from the vdom (destroyed). vue lets you run methods at various stages of this lifecycle using lifecycle methods. this can be useful for things like data fetching, where you may need to get your data before your component renders, or after a property changes. the
list of lifecycle methods are below, in the order that they fire. beforecreate() — runs before the instance of your component is created. data and events are not yet available. created() — runs after your component is initialized but before the component is added to the vdom. this is often where data fetching occurs. beforemount() — runs after your template is compiled, but before your comp...
...focus to the edit name text box, and back to the "edit" button when canceling or saving from the edit screen. however, unlike with the edit form, we don’t have a clear location for focus to move to when an element is deleted. we also need a way to provide assistive technology users with information that confirms that an element was deleted. we're already tracking the number of elements in our
list heading — the <h2> in app.vue — and it's associated with our
list of to-do items. this makes it a reasonable place to move focus to when we delete a node. first, we need to add a ref to our
list heading. we also need to add a tabindex="-1" to it — this makes the element programmatically focusable (i.e. it can be focused via javascript), when by default it is not. inside app.vue, update yo...
...however, it should be used with caution. over-using tabindex="-1" can cause problems for all sorts of users, so only use it exactly where you need to. ...
...And 8 more matches
Creating JavaScript callbacks in components
callback patterns in idl xpcom components use idl to create interfaces. these interfaces are used to manipulate the component in c++ and javascript. a common pattern used with interfaces to create a bi-directional communication between two groups of code is the observer (or
listener) pattern. basically, the component defines an observer (or
listener) interface which is implemented by some external code and this implementation is passed to the component. the component can then call methods on the observer interface to signal the external code when predefined events occur. here is a very simple example of the observer pattern: [scriptable, uuid(...)] interface stringparserobserver { void onword(string word); }; [scriptable, uuid(...)] interface stringparser { void parse(string data)...
... reference to the parser somehow */ stringparser.addobserver(wordhandler); stringparser.parse("pay no attention to the man behind the curtain"); you can find examples of this pattern all over the mozilla codebase. in fact, there is even a specific interface for this form of push callbacks, nsiobserverservice. ...
...er somehow */ stringparser.addobserver(wordhandler); stringparser.parse("pay no attention to the man behind the curtain"); you can find examples of this pattern all over the mozilla codebase. in fact, there is even a specific interface for this form of push callbacks, nsiobserverservice. javascript functions as callbacks another common use of the pattern is found in addevent
listener / removeevent
listener. ...
...And 8 more matches
TPS Tests
ute: python create_venv.py --keep-config %path% activate the environment source %path%/bin/activate run some tests note that the testfile is not a path, it should only be the filename from services/sync/tests/tps/ runtps --debug --testfile %test_file_name% --binary %firefox_binary_path% additionally, omitting a --testfile parameter will cause it to run all tps tests
listed in services/sync/tests/tps/all_tests.json an example on osx, for running just the test_sync.js testfile against a locally built firefox (where the mozconfig set the objdir to obj-ff-artifact): runtps --debug --testfile test_sync.js --binary obj-ff-artifact/dist/nightly.app/contents/macos/firefox running tps against stage, or dev fxa tps can be configured using the $tps_venv_p...
...t certainly see cleanup-profile1 or similar in the logs. that's what that phase is doing, it does any necessary cleanup for the phase, primarially unregistering the device associated with that profile. tps tests tend to be broken down into three sections, in the following order (we'll cover these out of order, for the sake of simplicity) phase declarations (mandatory). data definitions/asset
list (optional, but all current tests have them). phase implementation (mandatory) it's worth noting that some parts of tps assume that it can read the number off the end of the phase or profile to get to the next one, so try to stick to the convention established in the other tests. yes, this is cludgey, but it's effective enough and nobody has changed it. phase declarations these map the pha...
...c. the python testrunner will be parsing it with an unforgiving call to json.loads, so anything other than strict json will fail. you can use as many profiles or phases as you need, but every phase you define later must be declared here, or it will not be run by the python test runner. any phases declared here but not implemented later will cause the test to fail when it hits that phase. asset
lists a test file will contain one or more asset
lists, which are
lists of bookmarks, passwords, or other types of browser data that are relevant to sync. the format of these asset
lists vary somwhat depending on asset type. bookmarks passwords history tabs form data prefs test phases the phase blocks are where the action happens! they tell tps what to do. each phase block contains the nam...
...And 8 more matches
Handling Mozilla Security Bugs
urity vulnerabilities. representatives of the various companies and groups actively distributing mozilla-based products. super-reviewers and drivers. the bugzilla administrators will technically be in the mozilla security bug group as well, mainly because they already have visibility into all bugzilla data hosted through mozilla.org. the mozilla security bug group will have a private mailing
list, security-group@mozilla.org, to which everyone in the security bug group will be subscribed. this
list will act as a forum for discussing group policy and the addition of new members, as described below. in addition, mozilla.org will maintain a second well-known address, security@mozilla.org, through which people not in the security group can submit reports of security bugs. mail sent to this add...
... thus someone reporting a security bug essentially becomes a member of the overall group of people working to investigate and fix that particular vulnerability, and anyone else may be easily invited to assist as well, if and when it makes sense. expanding the mozilla security bug group as previously described, the mozilla security module owner can select one or more peers to shar...
...ers can be added to the mozilla security bug group as follows: new people can apply to join the security bug group, or may be recruited by existing members. applicants for membership must have someone currently in the security bug group who is willing to vouch for them and nominate them for membership. nomination is done by the "voucher" sending e-mail to the security bug group private mailing
list. the applicant's nomination for membership will then be considered for a period of a few days, during which members of the security bug group can speak out in favor of or against the applicant. at the end of this period, the security module owner will decide to accept the applicant or not, based on feedback and objections from the security bug group in general, and from the module owner's peers...
...And 8 more matches
nsIWebProgress
the nsiwebprogress interface is used to add or remove nsiwebprogress
listener instances to observe the loading of asynchronous requests (usually in the context of a dom window). nsiwebprogress instances may be arranged in a parent-child configuration, corresponding to the parent-child configuration of their respective dom windows. however, in some cases a nsiwebprogress instance may not have an associated dom window. the parent-child relationship of nsiwebprogress instances is not made explicit by this interface, but the relationship may exist in some implementations. ...
...s instances may be arranged in a parent-child configuration, corresponding to the parent-child configuration of their respective dom windows. however, in some cases a nsiwebprogress instance may not have an associated dom window. the parent-child relationship of nsiwebprogress instances is not made explicit by this interface, but the relationship may exist in some implementations. a nsiwebprogress
listener instance receives notifications for the nsiwebprogress instance to which it added itself, and it may also receive notifications from any nsiwebprogress instances that are children of that nsiwebprogress instance. uriloader/base/nsiwebprogress.idlscriptable please add a summary to this article. last changed in gecko 1.8.0 inherits from: nsisupports method overview void addprogress...
...ener instance receives notifications for the nsiwebprogress instance to which it added itself, and it may also receive notifications from any nsiwebprogress instances that are children of that nsiwebprogress instance. uriloader/base/nsiwebprogress.idlscriptable please add a summary to this article. last changed in gecko 1.8.0 inherits from: nsisupports method overview void addprogress
listener(in nsiwebprogress
listener a
listener, in unsigned long anotifymask); void removeprogress
listener(in nsiwebprogress
listener a
listener); attributes attribute type description domwindow nsidomwindow the dom window associated with this nsiwebprogress instance. read only. exceptions thrown ns_error_failure indicates that there is no associated dom window. isloadingdocument prbool ind...
...And 8 more matches
Mozilla
s are filed pointing out situations where perfectly legitimate words are missing from the english spell check dictionary in firefox. this article describes the process for adding a word to the dictionary. adding phishing protection data providers phishing protection technology lets firefox help protect users by comparing the urls the user visits to a
list of known scam sites, and presenting a warning to the user when they visit a site on the
list. an introduction to hacking mozilla this guide introduces the mozilla project and provides an overview for developers interested in contributing to or exploring the various parts of the codebase. android-specific test suites there are several android...
...ign recommendations and testing guidelines. bugzilla bugzilla.mozilla.org (often abbreviated b.m.o) is mozilla.org's bug-tracking system, a database for recording bugs and enhancement requests for firefox, thunderbird, seamonkey, camino, and other mozilla.org projects. building mozilla in this article, we
list documents that will guide you in building firefox or other projects based upon mozilla code. building spidermonkey with ubsan 1. compile a recent version of llvm & clang. c++ portability guide this document has migrated to using c++ in mozilla code. choosing the right memory allocator there are a lot of different memory allocators ...
...ers: the social api and an extension. you can choose either depending on your needs and resources. creating a language pack to create a language pack, or a localization repack, you first need to go through the initial setup process. creating a localized windows installer of seamonkey preamble: not all of the programs
listed below are necessary. some of them are simply the ones i use because i like them, while others are scripts that i've created to speed up the work. you can in every case choose the program you prefer to do some operations, and you can also decide not to use any of my scripts and manually enter all of the commands by hand. it's your choice! creating a login manag...
...And 8 more matches
Document.querySelectorAll() - Web APIs
this string must be a valid css selector string; if it's not, a syntaxerror exception is thrown. see locating dom elements using selectors for more information about using selectors to identify elements. multiple selectors may be specified by separating them using commas. ...
...this string must be a valid css selector string; if it's not, a syntaxerror exception is thrown. see locating dom elements using selectors for more information about using selectors to identify elements. multiple selectors may be specified by separating them using commas. ...
...y elements. multiple selectors may be specified by separating them using commas. note: characters which are not part of standard css syntax must be escaped using a backslash character. since javascript also uses backslash escaping, special care must be taken when writing string literals using these characters. see escaping special characters for more information. ...
...And 8 more matches
Element - Web APIs
095dd; pointer-events: all;} properties inherits properties from its parent interface, node, and by extension that interface's parent, eventtarget. it implements the properties of parentnode, childnode, nondocumenttypechildnode, and animatable. element.attributes read only returns a namednodemap object containing the assigned attributes of the corresponding html element. element.class
list read only returns a domtoken
list containing the
list of class attributes. element.classname is a domstring representing the class of the element. element.clientheight read only returns a number representing the inner height of the element. element.clientleft read only returns a number representing the width of the left border of the element. element.clienttop read only returns a numb...
...e element immediately following the given one in the tree, or null if there's no sibling node. element.outerhtml is a domstring representing the markup of the element including its content. when used as a setter, replaces the element with nodes parsed from the given string. element.part represents the part identifier(s) of the element (i.e. set using the part attribute), returned as a domtoken
list. element.prefix read only a domstring representing the namespace prefix of the element, or null if no prefix is specified. nondocumenttypechildnode.previouselementsibling read only is a element, the element immediately preceding the given one in the tree, or null if there is no sibling element. element.scrollheight read only returns a number representing the scroll view height of an elem...
...hen your app is running in the background. element.onfullscreenerror an event handler for the fullscreenerror event, which is sent when an error occurs while attempting to change into full-screen mode. methods inherits methods from its parents node, and its own parent, eventtarget, and implements those of parentnode, childnode, nondocumenttypechildnode, and animatable. eventtarget.addevent
listener() registers an event handler to a specific event type on the element. element.attachshadow() attaches a shadow dom tree to the specified element and returns a reference to its shadowroot. element.animate() a shortcut method to create and run an animation on an element. returns the created animation object instance. element.closest() returns the element which is the closest ancestor...
...And 8 more matches
HTML elements reference - HTML: Hypertext Markup Language
for more information about the basics of html elements and attributes, see the section on elements in the introduction to html article. main root element description <html> the html <html> element represents the root (top-level element) of an html document, so it is also referred to as the root element. all other elements must be descendants of this element. document metadata metadata contains information about the page. ...
...an extended quotation. usually, this is rendered visually by indentation (see notes for how to change it). a url for the source of the quotation may be given using the cite attribute, while a text representation of the source can be given using the <cite> element. <dd> the html <dd> element provides the description, definition, or value for the preceding term (<dt>) in a description
list (<dl>). <div> the html content division element (<div>) is the generic container for flow content. it has no effect on the content or layout until styled using css. <dl> the html <dl> element represents a description
list. the element encloses a
list of groups of terms (specified using the <dt> element) and descriptions (provided by <dd> elements). common uses for this...
...(<div>) is the generic container for flow content. it has no effect on the content or layout until styled using css. <dl> the html <dl> element represents a description
list. the element encloses a
list of groups of terms (specified using the <dt> element) and descriptions (provided by <dd> elements). common uses for this element are to implement a glossary or to display metadata (a
list of key-value pairs). <dt> the html <dt> element specifies a term in a description or definition
list, and as such must be used inside a <dl> element. <figcaption> the html <figcaption> or figure caption element represents a caption or legend describing the rest of the contents of its parent <figure> element. <figure> the html <figure> (figure with optiona...
...And 8 more matches
Browser detection using the user agent - HTTP
what you want to do for screen size is not slash off information on smaller screens. that will only annoy people because it will force them to use the desktop version. rather, try to have fewer columns of information in a longer page on smaller screens while having more columns with a shorter page on larger screen sizes. this ...
...hile the webpage looks smooth, fluid, and dynamically resized. the simplest way to do this is to separate all the code that moves content around based on screen size to a single function that is called when the page is loaded and at each resize event thereafter. if there is a lot calculated by this layout function before it determines the new layout of the page, then consider debouncing the event
listener such that it is not called as often. also note that there is a huge difference between the media queries (max-width: 25em), not all and (min-width: 25em), and (max-width: 24.99em): (max-width: 25em) excludes (max-width: 25em), whereas not all and (min-width: 25em) includes (max-width: 25em). (max-width: 24.99em) is simply a poor man's version of not all and (min-width: 25em): do not use (max...
...rs on ios to use webkit internally, thus the user has no way to get a better more updated browser on older devices. most bugs can be detected, but some bugs take more effort to detect than others. in such cases, it might be beneficial to use user agent sniffing to save on performance. ...
...And 8 more matches
Content Scripts - Archive of obsolete content
t won't clash with the page script's version. interacting with page scripts usually the insulation between content scripts and page scripts is what you want. but sometimes you might want to interact with page scripts: you might want to share objects between content scripts and page scripts or to send messages between them. if you need to do this, read about interacting with page scripts. event
listeners you can
listen for dom events in a content script just as you can in a normal page script, but there are two important differences: first, if you define an event
listener by passing it as a string into setattribute(), then the
listener is evaluated in the page's context, so it will not have access to any variables defined in the content script. for example, this content script will fail w...
...y passing it as a string into setattribute(), then the
listener is evaluated in the page's context, so it will not have access to any variables defined in the content script. for example, this content script will fail with the error "themessage is not defined": var themessage = "hello from content script!"; anelement.setattribute("onclick", "alert(themessage);"); second, if you define an event
listener by direct assignment to a global event handler like onclick, then the assignment might be overridden by the page. for example, here's an add-on that tries to add a click handler by assignment to window.onclick: var myscript = "window.onclick = function() {" + " console.log('unsafewindow.onclick: ' + window.document.title);" + "}"; require("sdk/page-mod").pagem...
...("sdk/page-mod").pagemod({ include: "*", contentscript: myscript, contentscriptwhen: "start" }); this will work fine on most pages, but will fail on pages which also assign to onclick: <html> <head> </head> <body> <script> window.onclick = function() { window.alert("it's my click now!"); } </script> </body> </html> for these reasons, it's better to add event
listeners using addevent
listener(), defining the
listener as a function: var themessage = "hello from content script!"; anelement.onclick = function() { alert(themessage); }; anotherelement.addevent
listener("click", function() { alert(themessage); }); communicating with the add-on to enable add-on scripts and content scripts to communicate with each other, each end of the conversation has acc...
...And 7 more matches
dev/panel - Archive of obsolete content
"my new devtool's panel", icon: "./my-icon.png", url: "./my-panel.html", onready: function() { this.postmessage("message from the add-on"); } }); // export the constructor exports.mypanel = mypanel; // create a new tool, initialized // with the new constructor const mytool = new tool({ panels: { mypanel: mypanel } }); in the panel document script: // my-panel.js window.addevent
listener("message", function(event) { var content = document.getelementbyid("content"); content.textcontent = event.data; }); note that at the moment you have to pass an array of ports into postmessage, even if you don't need to use them: // main.js // require the sdk modules const { panel } = require("dev/panel"); const { tool } = require("dev/toolbox"); const { class } = require("sdk/core/he...
...document this.postmessage("message from the add-on", [panelside]); } }); // export the constructor exports.mypanel = mypanel; // create a new tool, initialized // with the new constructor const mytool = new tool({ panels: { mypanel: mypanel } }); in the panel document: retrieve the messageport from the event, and use it to send messages to the add-on // my-panel.js window.addevent
listener("message", function(event) { // retrieve the port var toaddon = event.ports[0]; toaddon.start(); toaddon.postmessage("message from the panel document"); console.log(toaddon); }); communicating with the debugger server the firefox developer tools use a client/server protocol: a tool, such as a javascript debugger or style editor, is the client, and the program being debugged, such...
... state of the program being debugged. the remote debugging protocol page describes the protocol in detail. when the user opens a panel and the panel is created, the framework calls the panel's setup method. the setup method will be passed a debuggee object, which is a messageport that the add-on can use to exchange messages with the debugger server. ...
...And 7 more matches
event/core - Archive of obsolete content
the event/core module allows the creation of apis to broadcast and subscribe to events. usage many modules in the sdk can broadcast events. for example, the tabs module emits an open event when a new tab is opened. also see the tutorial on implementing event targets to get started with this api. ...
...odules in the sdk can broadcast events. for example, the tabs module emits an open event when a new tab is opened. also see the tutorial on implementing event targets to get started with this api. an event
listener may be registered to any event target using the on function: var { on, once, off, emit } = require('sdk/event/core'); var target = { name: 'target' }; on(target, 'message', function
listener(event) { console.log('hello ' + event); }); on(target, 'data', console.log); an event of a specific type may be emitted on any event target object using the emit function. this will call all registered
listeners for the given type on the given event target in the same order they were registered. emit(target, 'message', 'event'); // info: 'hello event' emit(target, 'data', { type: 'data' }...
...ole.log); an event of a specific type may be emitted on any event target object using the emit function. this will call all registered
listeners for the given type on the given event target in the same order they were registered. emit(target, 'message', 'event'); // info: 'hello event' emit(target, 'data', { type: 'data' }, 'second arg'); // info: [object object] 'second arg' registered event
listeners may be removed using off function: off(target, 'message'); emit(target, 'message', 'bye'); // info: 'hello bye' sometimes
listener only cares about first event of specific type. ...
...And 7 more matches
XUL Event Propagation - Archive of obsolete content
collectively, this process is referred to as the event model. ...
... the "click" event, but a variety of events can be raised by the button element. when the mouse moves over the button, for example, the "hover" event is raised. and sometimes elements raise different events for the pressing down of the click and the release. the events raised by a particular element are pre-determined. the click event is just a message. it's passive in that it doesn't look for a
listener; it propagates or "bubbles up" the hierarchy of nodes within the interface until it is either handled in some way or passes out of the interface unhandled. any element that is interested in the event -- any part of the interface, in other words, that needs to know about and respond to the user's click action on the button -- "handles" the event with an event handler, or chunk of code to be ex...
...the interface until it is either handled in some way or passes out of the interface unhandled. any element that is interested in the event -- any part of the interface, in other words, that needs to know about and respond to the user's click action on the button -- "handles" the event with an event handler, or chunk of code to be executed when the given event is "heard". the availability of event
listeners is also somewhat pre-determined, though xul provide generalized event
listeners (i.e., oncommand event
listeners) for most of the elements in the widget hierarchy. event handlers are written by you, the developer of the interface. very often, the event raised by the element is heard by the element itself and handled right there before it bubbles up any higher. this is the case in the exampl...
...And 7 more matches
menu - Archive of obsolete content
eave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. label type: string the label that will appear on the element. if this is left out, no text appears. for an editable menuitem element the value of this attribute is copied to the menu
list.value property upon user selection of the menuitem. menuactive type: boolean this attribute is set on an item in a menu when it is being hovered over. typcially, the theme will use this to highlight the item. a dommenuitemactive event will be sent to the item when the item is hovered over, and a dommenuiteminactive event will be sent to the item when the selection moves away. open...
...e maximum width of the menu itself. otherwise, the menu will size itself to at least the size of the popup. if the menu has a maximum width, the popup will also be this width. none the width of the popup will not be constrained to the size of the menu. pref the preferred width of the menu label or button will be the size needed for the popup contents. this is the default value for menu
lists. always both the preferred and minimum width of the menu label or button will be the same as that necessary for the menupopup. value type: string the string attribute allows you to associate a data value with an element. it is not used for any specific purpose, but you can access it with a script for your own use. be aware, however, that some elements, such as textbox will displa...
...in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not require validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable). for user editable menu
list elements, the contents, as visible to the user, are read and set using the menu
list.value syntax. for those elements, setattribute("value", myvalue) and getattribute("value") do not access or affect the contents displayed to the user. properties accessibletype type: integer a value indicating the type of accessibility object for the element. control type: menu...
...And 7 more matches
Processing XML with E4X - Archive of obsolete content
operator accesses direct children of the given node, the .. operator accesses all children no matter how deeply nested: alert(person..*.length()); // 11 the length() method here returns 11 because both elements and text nodes are included...
....language.length()); // 2 as with the dom, * can be used to access all child nodes: alert(person.likes.*.length()); // 4 while the . operator accesses direct children of the given node, the .. operator accesses all children no matter how deeply nested: alert(person..*.length()); // 11 the length() method here returns 11 because both elements and text nodes are included in the resulting xml
list. objects representing xml elements provide a number of useful methods, some of which are illustrated below: todo: add all of the methods to the javascript reference, link from here alert(person.name.text()) // bob smith var xml = person.name.toxmlstring(); // a string containing xml var personcopy = person.copy(); // a deep copy of the xml object var child = person.child(1); // the second ch...
...ul methods, some of which are illustrated below: todo: add all of the methods to the javascript reference, link from here alert(person.name.text()) // bob smith var xml = person.name.toxmlstring(); // a string containing xml var personcopy = person.copy(); // a deep copy of the xml object var child = person.child(1); // the second child node; in this case the <likes> element working with xml
lists in addition to the xml object, e4x introduces an xml
list object. xml
list is used to represent an ordered collection of xml objects; for example, a
list of elements. continuing the above example, we can access an xml
list of the <lang> elements in the page as follows: var langs = languages.lang; xml
list provides a length() method which can be used to find the number of contained elements: a...
...And 7 more matches
WAI-ARIA basics - Learn web development
lly via javascript. an important point about wai-aria attributes is that they don't affect anything about the web page, except for the information exposed by the browser's accessibility apis (where screenreaders get their information from). wai-aria doesn't affect webpage structure, the dom, etc., although the attributes can be useful for selecting elements by css. note: you can find a useful
list of all the aria roles and their uses, with links to futher information, in the wai-aria spec — see definition of roles. the spec also contains a
list of all the properties and states, with links to further information — see definitions of states and properties (all aria-* attributes). where is wai-aria supported? this is not an easy question to answer. it is difficult to find a conclusive...
...ed about some of the problems that prompted wai-aria to be created earlier on, but essentially, there are four main areas that wai-aria is useful in: signposts/landmarks: aria's role attribute values can act as landmarks that either replicate the semantics of html5 elements (e.g. <nav>), or go beyond html5 semantics to provide signposts to different functional areas, e.g search, tabgroup, tab,
listbox, etc. dynamic content updates: screenreaders tend to have difficulty with reporting constantly changing content; with aria we can use aria-live to inform screenreader users when an area of content is updated, e.g. via xmlhttprequest, or dom apis. enhancing keyboard accessibility: there are built-in html elements that have native keyboard accessibility; when other elements are used along with...
...ies of nested <div>s along with css/javascript is used to create a complex ui-feature, or a native control is greatly enhanced/changed via javascript, accessibility can suffer — screenreader users will find it difficult to work out what the feature does if there are no semantics or other clues. in these situations, aria can help to provide what's missing with a combination of roles like button,
listbox, or tabgroup, and properties like aria-required or aria-posinset to provide further clues as to functionality. one thing to remember though — you should only use wai-aria when you need to! ideally, you should always use native html features to provide the semantics required by screenreaders to tell their users what is going on. sometimes this isn't possible, either because you have limited...
...And 7 more matches
Styling links - Learn web development
htmlinput.value; var csscode = cssinput.value; var output = document.queryselector(".output"); var solution = document.getelementbyid("solution"); var styleelem = document.createelement('style'); var headelem = document.queryselector('head'); headelem.appendchild(styleelem); function drawoutput() { output.innerhtml = htmlinput.value; styleelem.textcontent = cssinput.value; } reset.addevent
listener("click", function() { htmlinput.value = htmlcode; cssinput.value = csscode; drawoutput(); }); solution.addevent
listener("click", function() { htmlinput.value = htmlcode; cssinput.value = 'p {\n font-size: 1.2rem;\n font-family: sans-serif;\n line-height: 1.4;\n}\n\na {\n outline: none;\n text-decoration: none;\n padding: 2px 1px 0;\n}\n\na:link {\n color: #265301;\n}\n\na:vi...
...let's look at a really simple example that adds an icon to external links (links that lead to other sites.) such an icon us...
...let's look at a really simple example that adds an icon to external links (links that lead to other sites.) such an icon usually looks like a little arrow pointing out of ...
...And 7 more matches
Example 4 - Learn web development
this is the fourth example that explain how to build custom form widgets. ...
...pple</li> </ul> </div> </form> css content .widget select, .no-widget .select { position : absolute; left : -5000em; height : 0; overflow : hidden; } /* --------------- */ /* required styles */ /* --------------- */ .select { position: relative; display : inline-block; } .select.active, .select:focus { box-shadow: 0 0 3px 1px #227755; outline: none; } .select .opt
list { position: absolute; top : 100%; left : 0; } .select .opt
list.hidden { max-height: 0; visibility: hidden; } /* ------------ */ /* fancy styles */ /* ------------ */ .select { font-size : 0.625em; /* 10px */ font-family : verdana, arial, sans-serif; -moz-box-sizing : border-box; box-sizing : border-box; padding : 0.1em 2.5em 0.2em 0.5em; /* 1px 25px 2px 5px */ ...
...cal-align: top; } .select:after { content : "ā¼"; position: absolute; z-index : 1; height : 100%; width : 2em; /* 20px */ top : 0; right : 0; padding-top : .1em; -moz-box-sizing : border-box; box-sizing : border-box; text-align : center; border-left : .2em solid #000; border-radius: 0 .1em .1em 0; background-color : #000; color : #fff; } .select .opt
list { z-index : 2;
list-style: none; margin : 0; padding: 0; background: #f0f0f0; border: .2em solid #000; border-top-width : .1em; border-radius: 0 0 .4em .4em; box-shadow: 0 .2em .4em rgba(0,0,0,.4); -moz-box-sizing : border-box; box-sizing : border-box; min-width : 100%; max-height: 10em; /* 100px */ overflow-y: auto; overflow-x: hidden; } .select .option { pa...
...And 7 more matches
What is JavaScript? - Learn web development
so what can it r...
...e are advanced techniques that we won't cover in this course. javascript running order when the browser encounters a block of javascript, it generally runs it in order, from top to bottom. this means that you need to be careful what order you put things in. for example, let's return to the block of javascript we saw in our first example: const para = document.queryselector('p'); para.addevent
listener('click', updatename); function updatename() { let name = prompt('enter a new name'); para.textcontent = 'player 1: ' + name; } here we are selecting a text paragraph (line 1), then attaching an event
listener to it (line 3) so that when the paragraph is clicked, the updatename() code block (lines 5–8) is run. the updatename() code block (these types of reusable code blocks are called ...
...de blocks are called "functions") asks the user for a new name, and then inserts that name into the paragraph to update the display. if you swapped the order of the first two lines of code, it would no longer work — instead, you'd get an error returned in the browser developer console — typeerror: para is undefined. this means that the para object does not exist yet, so we can't add an event
listener to it. note: this is a very common error — you need to be careful that the objects referenced in your code exist before you try to do stuff to them. interpreted versus compiled code you might hear the terms interpreted and compiled in the context of programming. in interpreted languages, the code is run from top to bottom and the result of running the code is immediately returned. you ...
...And 7 more matches
Ember app structure and componentization - Learn web development
is is useful in such cases where we have an <input> being used with no corresponding html text that could be turned into a label. when you save application.hbs, the development server you started earlier will automatically rebuild the app and refresh the browser. the rendered output should now look like this: it doesn't take too much effort to get our html looking like a fully-featured to-do
list app. update the application.hbs file again so its content looks like this: <section class="todoapp"> <h1>todos</h1> <input class="new-todo" aria-label="what needs to be done?" placeholder="what needs to be done?" autofocus > <section class="main"> <input id="mark-all-complete" class="toggle-all" type="checkbox"> <label for="mark-all-complete">mark all as complete...
...bs file again so its content looks like this: <section class="todoapp"> <h1>todos</h1> <input class="new-todo" aria-label="what needs to be done?" placeholder="what needs to be done?" autofocus > <section class="main"> <input id="mark-all-complete" class="toggle-all" type="checkbox"> <label for="mark-all-complete">mark all as complete</label> <ul class="todo-
list"> <li> <div class="view"> <input aria-label="toggle the completion of this todo" class="toggle" type="checkbox" > <label>buy movie tickets</label> <button type="button" class="destroy" title="remove this todo" ></button> </div> <input autofocus c...
...ml code into dynamic components; later we'll turn it into a fully interactive app. ...
...And 7 more matches
Handling common accessibility problems - Learn web development
one the attribute tabindex="0" (see webaim's tabindex article for more really useful details). this allows us to tab to the buttons, but not to activate them via the enter/return key. to do that, we had to add the following bit of javascript trickery: document.onkeydown = function(e) { if(e.keycode === 13) { // the enter/return key document.activeelement.onclick(e); } }; here we add a
listener to the document object to detect when a button has been pressed on the keyboard. we check what button was pressed via the event object's keycode property; if it is the keycode that matches return/enter, we run the function stored in the button's onclick handler using document.activeelement.onclick(). activeelement gives us the element that is currently focused on the page. note: this techn...
...essed via the event object's keycode property; if it is the keycode that matches return/enter, we run the function stored in the button's onclick handler using document.activeelement.onclick(). activeelement gives us the element that is currently focused on the page. note: this technique will only work if you set your original event handlers via event handler properties (e.g. onclick). addevent
listener won't work. this is a lot of extra hassle to build the functionality back in. and there's bound to be other problems with it. better to just use the right element for the right job in the first place. text alternatives text alternatives are very important for accessibility — if a person has a visual or hearing impairment that stops them being able to see or hear some content, then this i...
...might be a good idea. element relationships and context there are certain features and best practices in html designed to provide context and relationships between elements where none otherwise exists. the three most common examples are links, form labels, and data tables. the key to accessible link text is that people using screen readers will often use a common feature whereby they pull up a
list of all the links on the page. in this case, the link text needs to make sense out of context. for example, a
list of links labeled "click here", "click here", etc. is really bad for accessibility. it is better for link text to make sense in context and out of context. next on our
list, the form <label> element is one of the central features that allows us to make forms accessible. the trouble wi...
...And 7 more matches
Adding a new CSS property
ain only properties set/reset by a particular common shorthand property; this improves the effectiveness of some of the performance and memory optimizations done with the rule tree, and thus we should avoid adding a property not reset by that shorthand to such a struct. once you know which struct you're going to use (or that the property is a shorthand), you can add appropriate entry to nscssprop
list.h. again, see the documentation at the top of the file and the other entries for examples, and also see the next section for details about parsing. parsing to start implementing the parsing, first read the syntax line in the property's specification (whose syntax is in turn defined in the css values and units specification) and any prose in the specification that adds additional restrictions t...
...p of the file and the other entries for examples, and also see the next section for details about parsing. parsing to start implementing the parsing, first read the syntax line in the property's specification (whose syntax is in turn defined in the css values and units specification) and any prose in the specification that adds additional restrictions to that syntax. ...
...d any prose in the specification that adds additional restrictions to that syntax. every property in nscssprop
list.h must have in its flags field exactly one of the four css_property_parse_* flags defined in nscssprops.h. given the syntax for the property, you can determine which one to use. if the property's values can be expressed as a single value, or as a space-separated or comma-separated
list of values that can be described by the variant_* flags (also in nscssprops.h), you should use css_property_parse_value or css_property_parse_value_
list, and set the appropriate variant_* flags in the entry in nscssprop
list.h (and maybe also css_property_value_
list_uses_commas). otherwise, set the variant entry in the nscssprop
list entry to 0. if you need custom parsing code, this can be inserte...
...And 7 more matches
Creating Sandboxed HTTP Connections
omponents.interfaces.nsiioservice); // create an nsiuri var uri = ioservice.newuri(myurlstring, null, null); once the nsiuri has been created, a nsichannel can be generated from it using nsiioservice's newchannelfromuri method: // get a channel for that nsiuri var channel = ioservice.newchannelfromuri(uri); to initiate the connection, the asyncopen method is called. it takes two arguments: a
listener and a context that is passed to the
listener's methods. channel.asyncopen(
listener, null); http notifications the above mentioned
listener is a nsistream
listener, which gets notified about events such as http redirects and data availability. onstartrequest - gets called when a new request is initiated. ondataavailable - new data is available. since this is a stream, it could be call...
...n a new request is initiated. ondataavailable - new data is available. since this is a stream, it could be called multiple times (depending on the size of the returned data, networking conditions, etc). onstoprequest - the request has finished. onchannelredirect - when a redirect happens, a new nsichannel is created, and both the old and new ones are passed in as arguments. since nsistream
listener does not cover cookies, the current channel being used will need to be stored as a global, since another
listener will be used for cookie notifications (covered in the next section). it is usually best to use a javascript wrapper that implements all the required methods and calls the specified callback function when the connection has completed. below is an example: // global channel var gch...
... is an example: // global channel var gchannel; // init the channel // the io service var ioservice = components.classes["@mozilla.org/network/io-service;1"] .getservice(components.interfaces.nsiioservice); // create an nsiuri var uri = ioservice.newuri(myurlstring, null, null); // get a channel for that nsiuri gchannel = ioservice.newchannelfromuri(uri); // get an
listener var
listener = new stream
listener(callbackfunc); gchannel.notificationcallbacks =
listener; gchannel.asyncopen(
listener, null); function stream
listener(acallbackfunc) { this.mcallbackfunc = acallbackfunc; } stream
listener.prototype = { mdata: "", // nsistream
listener onstartrequest: function (arequest, acontext) { this.mdata = ""; }, ondataavailable: function (arequest, a...
...And 7 more matches
Makefile - variables
note: non-functional links can be fixed by inserting en/. variable name description add_to_def_file cpp_sources cpp_unit_tests a
list of source files to compile as unit tests. csrcs a
list of c source files to compile. defines additional preprocessor defines for c++ expand_mozlibname exports a
list of exported header files and sources to install for external use. exports_namespaces exported package include directory: dist/include/${namespace} exports_${namespace} a
list of exports/headers that should be copied into the exported namespace directory. ...
...o the exported namespace directory. extra_components nsdefaultclh.manifest, javascript xpcomm files extra_dso_libs extra_dso_ldopts extra_js_modules extra_pp_components xpcomm files to pre-process before installation. garbage a "clean target" macro containing a
list of files to remove. garbage_dirs a "clean target" macro containing a
list of directories to remove. global_deps a
list of common dependencies (makefile.in, autoconf.mk) that will force rebuilding. libobjs have_dtrace sun microsystem's dynamic tracing environment is available. local_includes ...
... suppress_default_rules inhibit processing of makefile tier targets/directory processing will be unordered. tier build order dependencies - subdirectories for make to traverse prior to building current. xpidl_module module name to use when generating .xpt files, default to module. xpidlsrcs internal: a
list of .idl files to generate exported headers from. xpidl_name name of extension to build see also configure.sh variables description build_project_arg command line/environment override configure_env_args command line/environment override directory variable ...
...And 7 more matches
Overview of Mozilla embedding APIs
s of the various xpcom services. each service is represented by a singleton object which is instantiated the first time it is requested and remains alive until the service manager is shut down, or the service is explicitly unloaded. through the service manager, individual services can be loaded, unloaded and accessed. implemented interfaces: nsiservicemanager related interfaces: nsishutdown
listener nsmemory the nsmemory service provides the global memory manager implementation for xpcom. in addition to memory allocation and release, this service provides low memory notifications, called a memory pressure observers, which are notified when memory is low - thus allowing cached resources to be freed. all heap access should be done via the nsmemory service. to facilitate this, a set of glo...
...s: nsifactory nsuriloader the nsuriloader service is responsible for targeting a uri at an appropriate content handler. a content handler may be an existing or new window, a helper application or the unknown content handler - if no other handler can be found for the content-type. contract-id: ns_uri_loader_contractid implemented interfaces: nsiuriloader related interfaces: nsiuricontent
listener nsunknowncontenttypehandler the unknowncontenttypehandler service is the last resort of the uriloader when no other content handler can be located. if no registered content handlers are available, the unknowncontenttypehandler is notified. the default implementation of this service displays a dialog box asking the user if the content should be saved to disk... contract-id: ns_iunknowncontent...
...nknowncontenttypehandler helperapp launch dialog contract-id: ns_externalhelperappservice_contractid implemented interfaces: nsiexternalhelperappservice preferences service the preferences service provides access to persistent data stored within a user's profile directory. ...
...And 7 more matches
L20n Javascript API
l20n javascript api var ctx = l20n.getcontext(); ctx.linkresource('./locales/strings.l20n'); ctx.requestlocales(); when you freeze the context by calling requestlocales, the resource files will be retrieved, parsed and compiled. you can
listen to the ready event (emitted by the context instance when all the resources have been compiled) and use ctx.getsync and ctx.getentitysync to get translations synchronously. ...
...ctx.getsync and ctx.getentitysync to get translations synchronously. alternatively, you can register callbacks to execute when the context is ready (or when globals change and translations need to be updated) with ctx.localize. ctx.localize(['hello', 'new'], function(l10n) { var node = document.queryselector('[data-l10n-id=hello]'); node.textcontent = l10n.entities.hello.value; node.class
list.remove('hidden'); }); ctx.registerlocales(defaultlocale: string?, availablelocales: array<string>?) register the default locale of the context instance, as well as all other locales available to the context instance before the language negotiation. locales are referenced by their bcp 47 language codes. ctx.registerlocales('en-us', ['ar', 'es-ar', 'es-es', 'en-us', 'fr', 'pl']); defaultlo...
...ecify the user's preferred locales for the context instance to negotiate against and freeze the context instance. when a context instance is frozen, no more resources can be added or linked. all io related to fetching the resource files takes place when a context instance freezes. when all resources have been fetched, parsed and compiled, the context instance will emit a ready event. the final
list of locales supported by the context instance will be negotiated asynchronously by the negotiator registered by registerlocalenegotiator. ctx.requestlocales('pl'); ctx.requestlocales('fr-ca', 'fr'); if requestedlocales argument
list is empty or undefined, the default locale from registerlocales will be used. ctx.requestlocales('pl'); if registerlocales hasn't been called, the special...
...And 7 more matches
NSS tools : crlutil
name crlutil —
list, generate, modify, or delete crls within the nss security database file(s) and
list, create, modify or delete certificates entries in a particular crl. synopsis crlutil [options] [[arguments]] status this documentation is still work in progress. please contribute to the initial review in mozilla nss bug 836477[1] description the certificate revocation
list (crl) management tool, crlutil, is a command-line utility that can
list, generate, modify, or delete crls within the nss security database file(s) and
list, create, modify or delete certificates entries in a particular crl. the key and certificate management process generally begins with creating keys in the key database, then generating and managing certificates in the certificate database(see ce...
...urity database file(s) and
list, create, modify or delete certificates entries in a particular crl. the key and certificate management process generally begins with creating keys in the key database, then generating and managing certificates in the certificate database(see certutil tool) and continues with certificates expiration or revocation. this document discusses certificate revocation
list management. for information on security module database management, see using the security module database tool. for information on certificate and key database management, see using the certificate database tool. ...
...each command takes one option. each option may take zero or more arguments. ...
...And 7 more matches
Hacking Tips
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". ...
...dealing with the javascript shell obtained at the end of the build documentation of spidermonkey. it is separated in 2 parts, one section related to debugging and another section related to drafting optimizations. many of these tips only apply to debug builds of the js shell; they will not function in a release build. 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". getting the bytecode of a function (from js shell) the shell has a small function named dis to dump the bytecode of a function with its source notes. without arguments, it will dump the bytecode...
..., will call iongraph, graphviz and your prefered png viewer to display the mir graph at the precise time of the execution. to find mirgenetator* instances, is best is to look up into the stack for optimizemir, or codegenerator::generatebody. optimizemir function has a mir argument, and the codegenerator::generatebody function has a member this->gen. ...
...And 7 more matches
Building the WebLock UI
ce, but it also interacts with particular parts of the mozilla user interface, where it must install itself as an extension to the ui. specifically, the user interface we create in this chapter will be overlaid into the statusbar of the browser component, where it will provide a small icon the user can click to access the web lock interface. weblock indicator in browser user interface package
list the user interface described in this section is comprised of four files: weblockoverlay.xul is the file that defines the little status icon in the browser. weblock.xul defines the web lock manager dialog. weblock.css provides style rules for both of the xul files. weblock.js provides javascript functions for both of the xul files. each of these files is described briefly in the sections ...
..., 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 is a bit more complicated, because it requires that you work with the currently loaded page or provide other ui (e.g., a textfield where you can enter an arbitrary url) for specifying urls. in the xul section we'll go into how the user interface is defined. this section describes the functions that are called from the interface and how they interact with the weblock component. the url that...
...t with the weblock component. the url that the addsite method expects is a string, so we can pass a string directly in from the user interface, or we can do a check on the string and verify that it's a valid url. in this tutorial, focusing as it is on the weblock functionality (rather than the ui), we'll assume the strings we get from the ui itself are urls we actually want to write to the white
list: function addthissite() { var tf = document.getelementbyid("dialog.input"); // weblock is global and declared above weblock.addsite(tf.value); } this javascript function can be called directly from the xul widget, where the input string is retrieved as the value property of the textbox element. you also need to create the function that displays the weblock window itself when the user cl...
...And 7 more matches
nsIDownloadManager
es["@mozilla.org/download-manager;1"] .getservice(components.interfaces.nsidownloadmanager); method overview nsidownload adddownload(in short adownloadtype, in nsiuri asource, in nsiuri atarget, in astring adisplayname, in nsimimeinfo amimeinfo, in prtime astarttime, in nsilocalfile atempfile, in nsicancelable acancelable, in boolean aisprivate); void add
listener(in nsidownloadprogress
listener a
listener); void canceldownload(in unsigned long aid); void cleanup(); void endbatchupdate(); obsolete since gecko 1.9.1 void flush(); obsolete since gecko 1.8 nsidownload getdownload(in unsigned long aid); void onclose(); obsolete since gecko 1.9.1 void open(in nsidomwindow aparent, in nsidownload...
...nload); obsolete since gecko 1.9.1 void openprogressdialogfor(in nsidownload adownload, in nsidomwindow aparent, in boolean acanceldownloadonclose); obsolete since gecko 1.9.1 void pausedownload(in unsigned long aid); void removedownload(in unsigned long aid); void removedownloadsbytimeframe(in long long abegintime, in long long aendtime); void remove
listener(in nsidownloadprogress
listener a
listener); void resumedownload(in unsigned long aid); void retrydownload(in unsigned long aid); void savestate(); obsolete since gecko 1.8 void startbatchupdate(); obsolete since gecko 1.9.1 attributes attribute type description activedownloadcount long the number of files currently bei...
...at is downloads that have completed, have failed or have been canceled. read only. datasource nsirdfdatasource read only. obsolete since gecko 1.8 dbconnection mozistorageconnection the database connection to the downloads database. read only. defaultdownloadsdirectory nsilocalfile returns the platform default downloads directory. read only. ...
...And 7 more matches
nsIFrameMessageManager
content/base/public/nsimessagemanager.idlscriptable provides methods for managing message
listeners on local frames. this provides a way for local frames to receive messages from remote frames. 1.0 66 introduced gecko 2.0 obsolete gecko 17.0 inherits from: nsisupports last changed in gecko 17.0 (firefox 17.0 / thunderbird 17.0 / seamonkey 2.14) this interface is obsolete and was removed in firefox 17. you should use nsimessage
listenermanager or nsimessagesender instead. ...
...ive messages from remote frames. 1.0 66 introduced gecko 2.0 obsolete gecko 17.0 inherits from: nsisupports last changed in gecko 17.0 (firefox 17.0 / thunderbird 17.0 / seamonkey 2.14) this interface is obsolete and was removed in firefox 17. you should use nsimessage
listenermanager or nsimessagesender instead. ...
...66 introduced gecko 2.0 obsolete gecko 17.0 inherits from: nsisupports last changed in gecko 17.0 (firefox 17.0 / thunderbird 17.0 / seamonkey 2.14) this interface is obsolete and was removed in firefox 17. you should use nsimessage
listenermanager or nsimessagesender instead. ...
...And 7 more matches
nsISelectionPrivate
rivate.idlscriptable internal support for content selection handling. inherits from: nsisupports last changed in gecko 35 (firefox 35 / thunderbird 35 / seamonkey 2.32) warning: the content of this article may be out of date. this page wasn't updated since the initial import in 2011. see the idl file linked above for up-to-date information. ...
...nternal support for content selection handling. inherits from: nsisupports last changed in gecko 35 (firefox 35 / thunderbird 35 / seamonkey 2.32) warning: the content of this article may be out of date. this page wasn't updated since the initial import in 2011. see the idl file linked above for up-to-date information. ...
...ort for content selection handling. inherits from: nsisupports last changed in gecko 35 (firefox 35 / thunderbird 35 / seamonkey 2.32) warning: the content of this article may be out of date. this page wasn't updated since the initial import in 2011. see the idl file linked above for up-to-date information. ...
...And 7 more matches
nsIServerSocket
var serversocket = components.classes["@mozilla.org/network/server-socket;1"] .createinstance(components.interfaces.nsiserversocket); method overview void init(in long aport, in boolean aloopbackonly, in long abacklog); void initwithaddress([const] in prnetaddrptr aaddr, in long abacklog);native code only! ...
...ents.classes["@mozilla.org/network/server-socket;1"] .createinstance(components.interfaces.nsiserversocket); method overview void init(in long aport, in boolean aloopbackonly, in long abacklog); void initwithaddress([const] in prnetaddrptr aaddr, in long abacklog);native code only! ...
...es["@mozilla.org/network/server-socket;1"] .createinstance(components.interfaces.nsiserversocket); method overview void init(in long aport, in boolean aloopbackonly, in long abacklog); void initwithaddress([const] in prnetaddrptr aaddr, in long abacklog);native code only! ...
...And 7 more matches
Creating a gloda message query
ore constraints can be found in the three js files given further below. from https://developer.mozilla.org/docs/mozilla/thunderbird/thunderbird_extensions/demo_addon, demo3, it seems that the attributename given in these files is the constraintname to be used (e.g. query.subjectmatches(searchstring) for message subject (compare fundattr.js line 145 ). ...
...tributename given in these files is the constraintname to be used (e.g. query.subjectmatches(searchstring) for message subject (compare fundattr.js line 145 ). create a collection from the query your
listener is notified as messages are added to the collection as the database query completes. you may also see new messages show up if new messages are indexed that meet the constraints. ...
...ct (compare fundattr.js line 145 ). create a collection from the query your
listener is notified as messages are added to the collection as the database query completes. you may also see new messages show up if new messages are indexed that meet the constraints. ...
...And 7 more matches
Migrating from Firebug - Firefox Developer Tools
for the latest developer tools and features, try firefox developer edition. download firefox developer edition general activation firebug's activation is url based respecting the same origin policy. that means that when you open a page on the same origin in a different tab, firebug gets opened automatically. ...
...fferent parts of the box model within the page when hovering them in the box model view. also, both tools allow you to edit the different values inline via a click on them. inspect computed styles the computed values of css properties are displayed within the devtools' computed side panel like within firebug's computed side panel. the difference is that in the devtools the properties are always
listed alphabetically and not grouped (see bug 977128) and there is no option to hide the mozilla specific styles, therefore there is an input field allowing to filter the properties. inspect events events assigned to an element are displayed in the events side panel in firebug. in the devtools they are shown when clicking the small 'ev' icon besides an element within the node view. both tools allow...
...grouped (see bug 977128) and there is no option to hide the mozilla specific styles, therefore there is an input field allowing to filter the properties. inspect events events assigned to an element are displayed in the events side panel in firebug. in the devtools they are shown when clicking the small 'ev' icon besides an element within the node view. both tools allow to display wrapped event
listeners (e.g.
listeners wrapped in jquery functions). to improve the ui of the devtools, there is also a request to add an events side panel to them like the one in firebug (see bug 1226640). stop script execution on dom mutation in firebug you can break on dom mutations, that means that when an element is changed, the script execution is stopped at the related line within the javascript file, whi...
...And 7 more matches
BaseAudioContext.createPanner() - Web APIs
the createpanner() method of the baseaudiocontext interface is used to create a new pannernode, which is used to spatialize an incoming audio stream in 3d space. the panner node is spatialized in relation to the audiocontext's audio
listener (defined by the audiocontext.
listener attribute), which represents the position and orientation of the person
listening to the audio. syntax baseaudioctx.createpanner(); returns a pannernode. ...
...udio stream in 3d space. the panner node is spatialized in relation to the audiocontext's audio
listener (defined by the audiocontext.
listener attribute), which represents the position and orientation of the person
listening to the audio. syntax baseaudioctx.createpanner(); returns a pannernode. example in the following example, you can see an example of how the createpanner() method, audio
listener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio
listener and panner (source) occupy initially, and then update the position of one or both of these as the application is used. ...
...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. ...
...And 7 more matches
Using the CSS Typed Object Model - Web APIs
. this article provides an introduction to all of its main features. computedstylemap() with the css typed om api, we can access all the css properties and values — including custom properties — that are impacting an element. let's see how this works by creating our first example, which explores computedstylemap(). we start with some html: a paragraph with a link, as well as a definition
list to which we will add all the css property / value pairs. <p> <a href="https://example.com">link</a> </p> <dl id="regurgitation"></dl> we add javascript to grab our unstyled link and return back a definition
list of all the default css property values impacting the link using computedstylemap(). // get the element const myelement = document.queryselector('a'); // get the <dl> we'll be popul...
...add all the css property / value pairs. <p> <a href="https://example.com">link</a> </p> <dl id="regurgitation"></dl> we add javascript to grab our unstyled link and return back a definition
list of all the default css property values impacting the link using computedstylemap(). ...
...we iterate through the style map, creating a <dt> and <dd> for each...
...And 7 more matches
EventTarget - Web APIs
element, document, and window are the most common event targets, but other objects can be event targets, too. for example xmlhttprequest, audionode, audiocontext, and others. many event targets (including elements, documents, and windows) also support setting event handlers via onevent properties and attributes. ...
...7f8" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constructor eventtarget() creates a new eventtarget object instance. methods eventtarget.addevent
listener() registers an event handler of a specific event type on the eventtarget. eventtarget.removeevent
listener() removes an event
listener from the eventtarget. eventtarget.dispatchevent() dispatches an event to this eventtarget. additional methods in mozilla chrome codebase mozilla includes a couple of extensions for use by js-implemented event targets to implement onevent properties. se...
...venttarget. additional methods in mozilla chrome codebase mozilla includes a couple of extensions for use by js-implemented event targets to implement onevent properties. see also webidl bindings. ...
...And 7 more matches
Recommended Drag Types - Web APIs
hat do not support other types, unless there is no logical text alternative. always add this text/plain type last, as it is the least specific and shouldn’t be preferred. note: in older code, you may find text/unicode or the text types. these are equivalent to text/plain, and will store and retrieve plain text data. dragging links dragged hyperlinks should include data of two types: text/uri-
list, and text/plain. both types should use the link’s url for their data. for example: var dt = event.datatransfer; dt.setdata("text/uri-
list", "https://www.mozilla.org"); dt.setdata("text/plain", "https://www.mozilla.org"); as usual, set the text/plain type last, as a fallback for the text/uri-
list type. note: the url type is uri-
list with an i, not an l. to drag multiple links, separate each...
...es should use the link’s url for their data. for example: var dt = event.datatransfer; dt.setdata("text/uri-
list", "https://www.mozilla.org"); dt.setdata("text/plain", "https://www.mozilla.org"); as usual, set the text/plain type last, as a fallback for the text/uri-
list type. note: the url type is uri-
list with an i, not an l. to drag multiple links, separate each link inside the text/uri-
list data with a crlf linebreak. lines that begin with a number sign (#) are comments, and should not be considered urls. you can use comments to indicate the purpose of a url, the title associated with a url, or other data. ...
...tiple links, separate each link inside the text/uri-
list data with a crlf linebreak. lines that begin with a number sign (#) are comments, and should not be considered urls. you can use comments to indicate the purpose of a url, the title associated with a url, or other data. the text/plain fallback for multiple links should include all urls, but no comments. for example, this sample text/uri-
list data contains two links and a comment: http://www.mozilla.org #a second link http://www.example.com when retrieving a dropped link, ensure you handle when multiple links are dragged, including any comments. for convenience, the special type url may be used to refer to the first valid link within data for the text/uri-
list type. do not add data with the url type — attempting to do so will s...
...And 7 more matches
HTML Drag and Drop API - Web APIs
tart …the user starts dragging an item. (see starting a drag operation.) drop ondrop …an item is dropped on a valid drop target. (see performing a drop.) note: neither dragstart nor dragend events are fired when dragging a file into the browser from the os. interfaces the html drag and drop interfaces are dragevent, datatransfer, datatransferitem and datatransferitem
list. the dragevent interface has a constructor and one datatransfer property, which is a datatransfer object. datatransfer objects include the drag event's state, such as the type of drag being done (like copy or move), the drag's data (one or more items), and the mime type of each drag item. datatransfer objects also have methods to add or remove items to the drag's data. the dragevent and datatr...
...ransfer objects also have methods to add or remove items to the drag's data. the dragevent and datatransfer interfaces should be the only ones needed to add html drag and drop capabilities to an application. ...
...ut those extensions will only work on firefox.) each datatransfer object contains an items property, which is a
list of datatransferitem objects. a datatransferitem object represents a single drag item, each with a kind property (either string or file) and a type property for the data item's mime type. the datatransferitem object also has methods to get the drag item's data. the datatransferitem
list object is a
list of datatransferitem objects. the
list object has methods to add a drag item to the
list, remove a drag item from the
list, and clear the
list of all drag items. a key difference between the datatransfer and datatransferitem interfaces is that the former uses the synchronous getdata() method to access a drag item's data, but the latter instead uses the asynchronous getasstring() ...
...And 7 more matches
PannerNode.distanceModel - Web APIs
the distancemodel property of the pannernode interface is an enumerated value determining which algorithm to use to reduce the volume of the audio source as it moves away from the
listener. the possible values are: linear: a linear distance model calculating the gain induced by the distance according to: 1 - rollofffactor * (distance - refdistance) / (maxdistance - refdistance) inverse: an inverse distance model calculating the gain induced by the distance according to: refdistance / (refdistance + rollofffactor * (math.max(distance, refdistance) - refdistance)) exponential: an exponential distance model calculating the gain induced by the distance according to: pow((math.max(distance, refdistance) / refdistance, -rollofffactor). inverse is the default value of distancemodel. ...
...distance according to: pow((math.max(distance, refdistance) / refdistance, -rollofffactor). inverse is the default value of distancemodel. syntax var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.distancemodel = 'inverse'; value a enum — see distancemodeltype. ...
...el. syntax var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.distancemodel = 'inverse'; value a enum — see distancemodeltype. example in the following example, you can see an example of how the createpanner() method, audio
listener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio
listener and panner (source) occupy initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change rea
listically as your character moves closer to or further away from a music player such as a stereo. in the example you can see this being controlled by the functi...
...And 7 more matches
PannerNode.setOrientation() - Web APIs
the setorientation() method of the pannernode interface defines the direction the audio source is playing in. this can have a big effect if the sound is very directional — controlled by the three cone-related attributes pannernode.coneinnerangle, pannernode.coneouterangle, and pannernode.coneoutergain. in such a case, a sound pointing away from the
listener can be very quiet or even silent. the three parameters x, y and z are unitless and describe a direction vector in 3d space using the right-hand cartesian coordinate system. the default value of the direction vector is (1, 0, 0). syntax var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.setorientation(1,0,0); returns void. example in the following example, you can see an example of how the createpann...
..., y and z are unitless and describe a direction vector in 3d space using the right-hand cartesian coordinate system. the default value of the direction vector is (1, 0, 0). syntax var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.setorientation(1,0,0); returns void. ...
...he direction vector is (1, 0, 0). syntax var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.setorientation(1,0,0); returns void. example in the following example, you can see an example of how the createpanner() method, audio
listener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio
listener and panner (source) occupy initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change rea
listically as your character moves closer to or further away from a music player such as a stereo. in the example you can see this being controlled by the functi...
...And 7 more matches
PannerNode.setPosition() - Web APIs
the setposition() method of the pannernode interface defines the position of the audio source relative to the
listener (represented by an audio
listener object stored in the audiocontext.
listener attribute.) the three parameters x, y and z are unitless and describe the source's position in 3d space using the right-hand cartesian coordinate system. the setposition() method's default value of the position is (0, 0, 0). syntax var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.setposition(0,0,0); returns void. ...
...itless and describe the source's position in 3d space using the right-hand cartesian coordinate system. the setposition() method's default value of the position is (0, 0, 0). syntax var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.setposition(0,0,0); returns void. ...
... value of the position is (0, 0, 0). syntax var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.setposition(0,0,0); returns void. example in the following example, you can see an example of how the createpanner() method, audio
listener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio
listener and panner (source) occupy initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change rea
listically as your character moves closer to or further away from a music player such as a stereo. in the example you can see this being controlled by the functi...
...And 7 more matches
PannerNode.setVelocity() - Web APIs
the setvelocity() method of the pannernode interface defines the velocity vector of the audio source — how fast it is moving and in what direction. this method was removed from the specification because of gaps in its design and implementation problems. the velocity relative to the
listener is used to control the pitch change needed to conform with the doppler effect due to the relative speed. as the vector controls both the direction of travel and its velocity, the three parameters x, y and z are expressed in meters per second. the default value of the velocity vector is (0, 0, 0). syntax var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.setvelocity(0,0,17); returns void. example in the following example, you can see an example of how the createpann...
...trols both the direction of travel and its velocity, the three parameters x, y and z are expressed in meters per second. the default value of the velocity vector is (0, 0, 0). syntax var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.setvelocity(0,0,17); returns void. ...
...of the velocity vector is (0, 0, 0). syntax var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.setvelocity(0,0,17); returns void. example in the following example, you can see an example of how the createpanner() method, audio
listener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio
listener and panner (source) occupy initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change rea
listically as your character moves closer to or further away from a music player such as a stereo. in the example you can see this being controlled by the functi...
...And 7 more matches
Range.extractContents() - Web APIs
html attribute events are retained or duplicated as they are for the node.clonenode() method. html id attributes are also cloned, which can lead to an invalid document if a partially-selected node is extracted and appended to the document. partially selected nodes are cloned to include the parent tags necessary to make the document fragment valid. ...
...asic example var range = document.createrange(); range.selectnode(document.getelementsbytagname("div").item(0)); var documentfragment = range.extractcontents(); document.body.appendchild(documentfragment); moving items between containers this example lets you move items between two containers. select one or more item, and then click "swap" to move them to the opposite container. ...
...t.getelementsbytagname("div").item(0)); var documentfragment = range.extractcontents(); document.body.appendchild(documentfragment); moving items between containers this example lets you move items between two containers. select one or more item, and then click "swap" to move them to the opposite container. ...
...And 7 more matches
Adding captions and subtitles to HTML5 video - Developer guides
itlesmenu.appendchild(createmenuitem('subtitles-off', '', 'off')); for (var i = 0; i < video.texttracks.length; i++) { subtitlesmenu.appendchild(createmenuitem('subtitles-' + video.texttracks[i].language, video.texttracks[i].language, video.texttracks[i].label)); } videocontainer.appendchild(subtitlesmenu); } this code creates a documentfragment, which is used to hold an unordered
list containing our subtitles menu. first of all an option is added to allow the user to switch all subtitles off, and then buttons are added for each text track, reading the language and label from each one. the creation of each
list item and button is done by the createmenuitem() function, which is defined as follows: var subtitlemenubuttons = []; var createmenuitem = function(id, lang, label) { ...
...ining our subtitles menu. first of all an option is added to allow the user to switch all subtitles off, and then buttons are added for each text track, reading the language and label from each one. ...
... to allow the user to switch all subtitles off, and then buttons are added for each text track, reading the language and label from each one. ...
...And 7 more matches
Setting up adaptive streaming media sources - Developer guides
qualities and time points there are, the more 'adaptive' your stream will be, but we will usually want to find a pragmatic balance between size, time to encode and adaptiveness. the good news is that once we have encoded our media in the appropriate format we are pretty good to go. for adaptive streaming over http, no special server-side components are required. both mpeg-dash and hls use a play
list format to structure the component piece of media that make the possible streams. various bitrate streams are broken into segments and placed in appropriate server folders — we have to provide our media players with a link to lookup files or play
lists specifying the name and location of these stream folders. mpeg-dash encoding mpeg-dash is an adaptive bitrate streaming technique that enables s...
...files and installing dependencies to get this software up and running. note: since mpeg-dash decoding is done partially using javascript and mse files are often grabbed using xhr, keep same origin rules in mind. note: if you use webm you can use the methods shown in this tutorial dash adaptive streaming for html 5 video. once encoded your file structure may look something like this: play
list -> /segments/news.mp4.mpd main segment folder -> /segments/main/ 100 kbps segment folder -> /segments/main/news100 contains (1.m4s, 2.m4s, 3.m4s ... ) 200 kbps segment folder -> /segments/main/news200 contains (1.m4s, 2.m4s, 3.m4s ... ) 300 kbps segment folder -> /segments/main/news300 contains (1.m4s, 2.m4s, 3.m4s ... ) 400 kbps segment folder -> /segments/main/news4...
...segment folder -> /segments/main/ 100 kbps segment folder -> /segments/main/news100 contains (1.m4s, 2.m4s, 3.m4s ... ) 200 kbps segment folder -> /segments/main/news200 contains (1.m4s, 2.m4s, 3.m4s ... ) 300 kbps segment folder -> /segments/main/news300 contains (1.m4s, 2.m4s, 3.m4s ... ) 400 kbps segment folder -> /segments/main/news400 contains (1.m4s, 2.m4s, 3.m4s ... ) the play
list or .mpd file contains xml that explicitly
lists where all the various bitrate files reside. <?xml version="1.0"?> <mpd xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns="urn:mpeg:dash:schema:mpd:2011" xsi:schemalocation="urn:mpeg:dash:schema:mpd:2011" profiles="urn:mpeg:dash:profile:isoff-main:2011" type="static" mediapresentationduration="pt0h9m56.46s"> <baseurl> http://e...
...And 7 more matches
MIME types (IANA media types) - HTTP
a media type (also known as a multipurpose internet mail extensions or mime type) is a standard that indicates the nature and format of a document, file, or assortment of bytes. it is defined and standardized in ietf's rfc 6838. the internet assigned numbers authority (iana) is responsible for all official mime types, and you can find the most up-to-date and complete
list at their media types page. important: browsers use the mime type, not the file extension, to determine how to process a url, so it's important that web servers send the correct mime type in the response's content-type header. if this is not correctly configured, browsers are likely to misinterpret the contents of files and sites will not work correctly, and downloaded files may be mishandled. structure of a mime type t...
... one which represents a document that's comprised of multiple component parts, each of which may have its own individual mime type; or, a multipart type may encapsulate multiple files being sent together in one transaction. for example, multipart mime types are used when attaching multiple files to an email. discrete types the discrete types currently registered with the iana are: application
list at iana any kind of binary data that doesn't fall explicitly into one of the other types; either data that will be executed or interpreted in some way or binary data that requires a specific application or category of application to use. generic binary data (or binary data whose true type is unknown) is application/octet-stream. other common examples include application/pdf, application/pkcs8, a...
...y data that doesn't fall explicitly into one of the other types; either data that will be executed or interpreted in some way or binary data that requires a specific application or category of application to use. generic binary data (or binary data whose true type is unknown) is application/octet-stream. other common examples include application/pdf, application/pkcs8, and application/zip. audio
list at iana audio or music data. examples include audio/mpeg, audio/vorbis. example reserved for use as a placeholder in examples showing how to use mime types. these should never be used outside of sample code
listings and documentation. example can also be used as a subtype; for instance, in an example related to working with audio on the web, the mime type audio/example can be used to indicate ...
...And 7 more matches
remote/parent - Archive of obsolete content
.log("remote says: " + message); }); child process privileges a module loaded into a child process can't do everything that the same module loaded into the parent process can. multiprocess firefox restricts the things that code running in child processes is allowed to do. for example, when the child process is sandboxed, modules won't be able to access the file system. we don't yet have a full
list of all the modules that a module in the child process can't load, but the sorts of things
listed in limitations of frame scripts broadly apply. examples property retrieval this first example shows fetching a simple property from every existing and future process. remote.js runs in all child processes. // remote.js const { process } = require("sdk/remote/child"); const { processid } = require(...
...t argument is always the process, then the message payload process.port.once("id", (process, id) => { console.log("child process is remote:" + process.isremote); console.log("child process id:" + id); }); }); content frame manipulation this demonstrates telling every current frame to link to a specific anchor element: // remote.js const { frames } = require("sdk/remote/child"); //
listeners receive the frame the event was for as the first argument frames.port.on("changelocation", (frame, ref) => { frame.content.location += "#" + ref; }); // main.js const { frames, remoterequire } = require("sdk/remote/parent"); remoterequire("./remote.js", module); frames.port.emit("changelocation", "foo"); tab information this shows sending a message when a tab loads; this is similar t...
...e.content.location += "#" + ref; }); // main.js const { frames, remoterequire } = require("sdk/remote/parent"); remoterequire("./remote.js", module); frames.port.emit("changelocation", "foo"); tab information this shows sending a message when a tab loads; this is similar to how the sdk/tabs module currently works. ...
...And 6 more matches
How to convert an overlay extension to restartless - Archive of obsolete content
s updated without a restart. the big culprits are jsm files and locale files (namely property files), though in some situations this is true for dynamically loaded image files too. you're still going to have to manually clear the chrome cache on add-on shutdown to work around this, but that doesn't seem to be enough with an internal jar. so, time to switch to extractionless, too. see here for the
list of stuff you can't have in addition to no resource:// uris or file:// uris to files inside your xpi. if you actually can't find a way to go fully extractionless, you could hack together some combination of internal jar(s) and extracted files. it can be done. however, you really should go extractionless. firefox profiles aren't the pristine environment they're supposed to be. software that preten...
...lements are also nodes). you'll need to write two functions. one to take a xul window object and then create and add your elements, and then another to find your elements and remove them from the window object. the former will need to be run on add-on startup and the later on add-on shutdown. until you get your bootstrap.js running you should use a basic overlay onto the xul window with an event
listener for "load" to catch overlay load and then run your manual ui construction function. step 6a. details on adding elements dynamically to chrome xul window there is a way that makes constructing of ui a lot similar to the way it was made with xul overlay. it involves using firebug.sdk. the next is example of the code: var overlay = toolbarbutton(toolbarbuttonattrs, panel({'id': 'thepane...
...f it as main.c, but for javascript based firefox restartless add-ons. ...
...And 6 more matches
Editor Embedding Guide - Archive of obsolete content
nsieditingsession from it. from there you call editingsession->makewindoweditable(domwindow, editortype, pr_true). the first parameter is the nsidomwindow you just retrieved, the second is the editor type you want to create, and the third is whether you want the window editable immediately or when the document is done loading. ...
...elow is the sequence of steps that need to be followed for the same: 1. get the nsicommandmanager from the nsiwebbrowser using do_getinterface: nscomptr<nsicommandmanager> commandmanager; nsiwebbrowser->do_getinterface(getter_addrefs(commandmgr)); 2. call a command -- docommand: commandmanager->docommand(acommand, acommandparams); acommand is a const char * to a supported command name (see
list below). acommandparams could possibly be a null pointer or a pointer to a valid structure filled with relative parameters to acommand (see
list below for legal params). 3. verify if a command is enabled -- iscommandenabled: commandmanager->iscommanddisabled(acommand, retval) 4. get the current command state of a given command -- getcommandstate: commandmanager->getcommandstate(acommand,acom...
...ate "state_all"(boolean), "state_begin"(boolean), "state_end"(boolean), "state_mixed"(boolean), "state_enabled" (boolean) docommand no parameters note this is logical style. typically it is displayed with monospace font. cmd_removelinks removes the existing link from the selection (if any). getcommandstate "state_enabled"(boolean), ??? docommand no parameters cmd_ol makes ordered
list from selection or inserts new
list if there is no selection. getcommandstate "state_enabled"(boolean) docommand no parameters note see also cmd_remove
list cmd_ul makes unordered
list from selection or inserts new
list if there is no selection. getcommandstate "state_enabled"(boolean) docommand no parameters note see also cmd_remove
list cmd_dt inserts
list item (dt element). ...
...And 6 more matches
Supporting private browsing mode - Archive of obsolete content
browsing notifications there are notifications available that allow you to easily watch for changes to the status of the private browsing mode, including detecting when it turns on and off. in addition, there is a browser:purge-session-history notification that is sent when the browser purges private data that extensions can watch in order to know when it's time to do the same. ...
...able that allow you to easily watch for changes to the status of the private browsing mode, including detecting when it turns on and off. in addition, there is a browser:purge-session-history notification that is sent when the browser purges private data that extensions can watch in order to know when it's time to do the same. a private browser
listener helper object this helper object registers
listeners for private browsing mode changes. ...
... there is a browser:purge-session-history notification that is sent when the browser purges private data that extensions can watch in order to know when it's time to do the same. a private browser
listener helper object this helper object registers
listeners for private browsing mode changes. this handles interacting with the private browsing service so you don't have to. ...
...And 6 more matches
Venkman Introduction - Archive of obsolete content
by inserting line breaks and whitespace in appropriate places. when pretty print is enabled you will see a green check mark on the toolbar button, and the menu item will be checked as well. the loaded scripts view the loaded scripts view is in the top left portion of the window. when a file is loaded by the browser it will appear in this view, and when unloaded it will be removed. files are
listed in alphabetical order, grouped by file type. file names are displayed after a color coded, single letter icon representing the file extension. figure 6 shows the table of icon and file types. at the time if this writing, the order and grouping of file names cannot be changed. icon file type .js .html, .htm .xul .xml ...
...olds all arguments and local variables, and the this object holds the value of the this keyword. e enumerable property r read only property p permanent (cannot be deleted) a alias to another property a argument to a function v declared with var figure 8. property flags properties of both scope and this objects are
listed alphabetically, grouped by data type. figure 9 shows which icons represent which data types. properties which are of the type object are displayed with the name of their constructor function in curly braces as their value. you can locate the source code of the constructor by selecting "find constructor" from the property's context menu. you can find the place where the object was instantiated ...
...void (undefined) value null value boolean value string value integer value double value object value function value figure 9. type icons the column picker for this view (the box on the top right) can be used to display type and flags columns. the type column contains a textual description of the type of the object. flags
lists one or more applicable flags for this object. flags are shown enumerated in figure 8. if an item visible in the local variables view is modified via the interactive session view the modification will be immediately reflected in the local variable view. at the time of this writing, the local variables view's default sort order and grouping are not adjustable. the call stack view the call st...
...And 6 more matches
removeItemAt - Archive of obsolete content
« xul reference home removeitemat( index ) return type: element removes the child item in the element at the specified index. the method returns the removed item. ...
... « xul reference home removeitemat( index ) return type: element removes the child item in the element at the specified index. the method returns the removed item. ...
... « xul reference home removeitemat( index ) return type: element removes the child item in the element at the specified index. the method returns the removed item. ...
...And 6 more matches
Filtering - Archive of obsolete content
this can be done by modifying the dom nodes inside the query and rebuilding the template. for instance, to apply a filter, you might add a new <triple> element. to remove the filter, the <triple> should be removed again. let's assume that we've given an id of 'cond' to the query tag. ...
...if this is set, we add a filter, otherwise we remove it. the code is fairly straightforward. a new <triple> element is created and the object attribute is set to the value to filter by. for example, the resulting triple for the netherlands might be: <triple subject="?photo" predicate=...
... the template must be rebuilt by calling the rebuild method. this method will remove all of the existing generated content, delete all of the internal information pertaining to the results, and start again as if the template were just being examined for the first time. the template will be parsed again and the data examined for new results. you can view a complete example of this in action. ...
...And 6 more matches
XPCOM Examples - Archive of obsolete content
« previousnext » this section provides some examples of using xpcom along with some additional interfaces. window management this example contains rdf datasource that will be seen in the later section. you might skip this example for the time being, except when you have already had that knowledge. creating a window menu the
list of currently open mozilla windows can be used as an rdf datasource. ...
...es of using xpcom along with some additional interfaces. window management this example contains rdf datasource that will be seen in the later section. you might skip this example for the time being, except when you have already had that knowledge. creating a window menu the
list of currently open mozilla windows can be used as an rdf datasource. this allows you to create a window menu with a
list of the currently open windows in the application. the datasource for this is rdf:window-mediator. ...
...eing, except when you have already had that knowledge. creating a window menu the
list of currently open mozilla windows can be used as an rdf datasource. this allows you to create a window menu with a
list of the currently open windows in the application. the datasource for this is rdf:window-mediator. we can use this as in the following example: example 1 : source <toolbox> <menubar id="window
list-menubar"> <menu label="window"> <menupopup id="window-menu" datasources="rdf:window-mediator" ref="nc:windowmediatorroot"> <template> <rule> <menuitem uri="rdf:*" label="rdf:http://home.netscape.com/nc-rdf#name"/> </rule> </template> </menupopup> </menu> </menubar> </toolbox> a window menu will be created with a
list of all the open windows. try this example by...
...And 6 more matches
radiogroup - Archive of obsolete content
in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not require validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable). for user editable menu
list elements, the contents, as visible to the user, are read and set using the menu
list.value syntax. for those elements, setattribute("value", myvalue) and getattribute("value") do not access or affect the contents displayed to the user. properties accessibletype type: integer a value indicating the type of accessibility object for the element. disabled ...
... by assigning its index to this property. by assigning -1 to this property, all items will be deselected. returns -1 if no items are selected selecteditem type: element holds the currently selected item. if no item is currently selected, this value will be null. you can select an item by setting this value. a select event will be sent to the controlling container (i.e. ...
... its index to this property. by assigning -1 to this property, all items will be deselected. returns -1 if no items are selected selecteditem type: element holds the currently selected item. if no item is currently selected, this value will be null. you can select an item by setting this value. a select event will be sent to the controlling container (i.e. ...
...And 6 more matches
Deploying XULRunner - Archive of obsolete content
xulrunner must be registered on the system and the app must be deployed per the instructions at xul application packaging. if your installer is capable of determining whether or not xulrunner has been registered on the system you could perform the check and register the appropriate version if necessary. after that, the app could be installed to the registered xulrunner and appear in start menus,
lists of installed programs, etc. (bonus points for checking the operating system and downloading the right xulrunner on the fly, or bundling them into your installer). registration and app installation are performed with command line switches as outlined in the xulrunner section of article command line options. it may turn out to be easier to create a self contained portable application, as describe...
...teract with the design of xulrunner (see bug 1105044 for the inside scoop), starting with xulrunner 39 the xulrunner library files are no longer able to reside in a xulrunner framework directory. instead, the library files are placed directly into the macos directory alongside the main executable file. here's how the entire application bundle looks: myapp.app/ contents/ info.p
list pkginfo resources/ application.ini app_icon.icns components/ ... components which are part of the application chrome/ ... chrome which is part of the application ... additional application files such as icons, etc macos/ xulrunner (this is the "...
... error: "unable to load xpcom." xulrunner was fixed in gecko 39. see this blog post for additional background about this change. xulrunner 38 and earlier in xulrunner 38 and earlier, xulrunner is provided in a mac os x framework bundle, which is placed in your application bundle's frameworks directory. the complete bundle structure is as follows: myapp.app/ contents/ info.p
list pkginfo frameworks/ xul.framework/ files copied from /library/frameworks/xul.framework/versions/1.8/... make sure you copy all symlinks correctly (use rsync -rl /library/frameworks/xul.framework ...). resources/ application.ini app_icon.icns components/ ... components which a...
...And 6 more matches
CSS and JavaScript accessibility best practices - Learn web development
the same token, a heading loses its visual purpose if you style it so it doesn't look like a heading. the rule of thumb is that you can update the styling of a page feature to fit in your design, but don't change it so much that it no longer looks or behaves as expected. the following sections summarize the main html features to consider. "standard" text content structure headings, paragraphs,
lists — the core text content of your page: <h1>heading</h1> <p>paragraph</p> <ul> <li>my
list</li> <li>has two items.</li> </ul> some typical css might look like this: h1 { font-size: 5rem; } p, li { line-height: 1.5; font-size: 1.6rem; } you should: select sensible font sizes, line heights, letter spacing, etc. to make your text logical, legible, and comfortable to read. make ...
... <li>has two items.</li> </ul> some typical css might look like this: h1 { font-size: 5rem; } p, li { line-height: 1.5; font-size: 1.6rem; } you should: select sensible font sizes, line heights, letter spacing, etc. to make your text logical, legible, and comfortable to read. make sure your headings stand out from your body text, typically big and bold like the default styling. your
lists should look like
lists. your text color should contrast well with your background color. see html text fundamentals and styling text for more information. emphasised text inline markup that confers specific emphasis to the text that it wraps: <p>the water is <em>very hot</em>.</p> <p>water droplets collecting on surfaces is called <strong>condensation</strong>.</p> you might want to add ...
...ambiguously linked to their inputs, so screen readers can read them out alongside: <label for="name">enter your name:</label> <input type="text" name="name" id="name"> we only do the validation when the form is submitted — this is so that we don't update the ui too often and potentially confuse screen reader (and possibly other) users: form.onsubmit = validate; function validate(e) { error
list.innerhtml = ''; for(let i = 0; i < formitems.length; i++) { const testitem = formitems[i]; if(testitem.input.value === '') { errorfield.style.left = '360px'; createlink(testitem); } } if(error
list.innerhtml !== '') { e.preventdefault(); } } note: in this example, we are hiding and showing the error message box using absolute positioning rather than another m...
...And 6 more matches
Example 1 - Learn web development
this is the first example of code that explains how to build a custom form widget. ...
...erry</li> <li class="option">lemon</li> <li class="option">banana</li> <li class="option">strawberry</li> <li class="option">apple</li> </ul> </div> css /* --------------- */ /* required styles */ /* --------------- */ .select { position: relative; display : inline-block; } .select.active, .select:focus { box-shadow: 0 0 3px 1px #227755; outline: none; } .select .opt
list { position: absolute; top : 100%; left : 0; } .select .opt
list.hidden { max-height: 0; visibility: hidden; } /* ------------ */ /* fancy styles */ /* ------------ */ .select { font-size : 0.625em; /* 10px */ font-family : verdana, arial, sans-serif; -moz-box-sizing : border-box; box-sizing : border-box; padding : 0.1em 2.5em 0.2em 0.5em; /* 1px 25px 2px 5px */ ...
...cal-align: top; } .select:after { content : "ā¼"; position: absolute; z-index : 1; height : 100%; width : 2em; /* 20px */ top : 0; right : 0; padding-top : .1em; -moz-box-sizing : border-box; box-sizing : border-box; text-align : center; border-left : .2em solid #000; border-radius: 0 .1em .1em 0; background-color : #000; color : #fff; } .select .opt
list { z-index : 2;
list-style: none; margin : 0; padding: 0; background: #f0f0f0; border: .2em solid #000; border-top-width : .1em; border-radius: 0 0 .4em .4em; box-shadow: 0 .2em .4em rgba(0,0,0,.4); box-sizing : border-box; min-width : 100%; max-height: 10em; /* 100px */ overflow-y: auto; overflow-x: hidden; } .select .option { padding: .2em .3em; } .select .hi...
...And 6 more matches
TypeScript support in Svelte - Learn web development
download the setuptypescript.js file to a scripts folder inside your project's root folder, and then run node scripts/setuptypescript.js. you can even use degit to download the script. that's what we will do to start porting our application to typescript. note: remember that you can run npx degit opensas/mdn-svelte-tutorial/07-typescript-support svelte-todo-typescript to get the complete to-do
list application in javascript before you start porting it to typescript. go to the root directory of the project and enter these commands: npx degit sveltejs/template/scripts scripts # download script file to a scripts folder node scripts/setuptypescript.js # run it converted to typescript. you will need to re-run your dependency manager to get started. npm install ...
...ipt when building svelte projects. now we will undo these changes in order to start porting our application to typescript, so we won't be bothered with all the validate warnings. remove the flawed todo and the lang='ts' attribute from the todos.svelte file. also remove the import of todotype and the lang='ts' from todo.svelte. we'll take care of them propertly, later on. porting our to-do
list app to typescript now we are ready to start porting our to-
list application to take advantage of all the features that typescript offers to us. let's start by running the validate script in watch mode inside your project root: npm run validate -- --watch this should output something like the following: svelte-check "--watch" loading svelte-check in workspace: ./svelte-todo-typescript gettin...
...ing tag, as an htmlelement. update the let headingel line with the following: let headingel: htmlelement finally, you'll notice the following error reported, related to where we set the tabindex attribute. that's because typescript is type-checking the <h2> element and expects tabindex to be of type number. to fix it, replace tabindex="-1" with tabindex={-1}, like this: <h2 id="
list-heading" bind:this={headingel} tabindex={-1}>{completedtodos} out of {totaltodos} items completed</h2> this way typescript can prevent us from incorrectly assigning it to a string variable. newtodo.svelte next we will take care of newtodo.svelte. as usual, add the lang='ts' attribute. the warning will indicate that we have to specify a type for the nameel variable. set its typ...
...And 6 more matches
Using Vue computed properties - Learn web development
html-based template syntax that maps to the underlying dom structure. 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. objective: to learn how to use vue computed properties. using computed properties the aim here is to add a summary count of our to-do
list. this can be useful for users, while also serving to label the
list for assistive technology. if we have 2 of 5 items completed in our to-do
list, our summary could read "3 items completed out of 5". while it might be tempting to do something like this: <h2>{{todoitems.filter(item => item.done).length}} out of {{todoitems.length}} items completed</h2> it would be recalculated on every render. ...
...rly to methods, but only re-run when one of their dependencies changes. in our case, this would only re-run when the todoitems array changes. to create a computed property, we need to add a computed property to our component object, much like the methods property we've used previously. adding a summary counter add the following code to your app component object, below the methods property. ...
...he todoitems array changes. to create a computed property, we need to add a computed property to our component object, much like the methods property we've used previously. adding a summary counter add the following code to your app component object, below the methods property. the
list summary method will get the number of finished todoitems, and return a string reporting this. computed: {
listsummary() { const numberfinisheditems = this.todoitems.filter(item =>item.done).length return `${numberfinisheditems} out of ${this.todoitems.length} items completed` } } now we can add {{
listsummary}} directly to our template; we'll add this inside an <h2> element, just above our <ul>. we'll also add an id and an aria-labelledby attribute to assign the <h2> contents to be a label for t...
...And 6 more matches
Command line crash course - Learn web development
(e.g. the terminal, and the tools you can access through it). many tutorials and tools that exist on the web today support (and sadly assume) unix-based systems, but not to worry — they are available on most systems. in this section, we’ll look at how to get access to the terminal on your chosen system. linux/unix as hinted at above, linux/unix systems have a terminal available by default,
listed among your applications. macos macos has a system called darwin that sits underneath the graphical user interface. darwin is the unix-like system, which provides the terminal, and access to the low-level tools. macos darwin mostly has parity with unix, certainly good enough to not cause us any worries as we work through this article. the terminal is available on macos at applications/utiliti...
...our web browser. a leading slash means "at the root of the web site", whereas omitting the slash means "the url is relative to my current page". note: on windows you use backslashes instead of forward slashes, e.g. cd desktop\project\src — this may seem really odd, but if you are interested in why, watch this youtube clip featuring an explanation by one of microsoft’s principal engineers. ...
...as omitting the slash means "the url is relative to my current page". note: on windows you use backslashes instead of forward slashes, e.g. cd desktop\project\src — this may seem really odd, but if you are interested in why, watch this youtube clip featuring an explanation by one of microsoft’s principal engineers.
listing directory contents another built-in unix command is ls (short for
list), which
lists the contents of the directory you’re currently in. ...
...And 6 more matches
Performance
g stateless functions once per process bad: // addon.js services.mm.loadframescript("framescript.js", true) // framescript.js const precomputedconstants = // ... function helper(window, action) { // ... do some work on the window } function dosomething(message) { result = helper(content, message.data) sendasyncmessage("my-addon:response-from-child", {something: result}) } addmessage
listener("my-addon:request-from-parent", dosomething) why is this bad? because declared functions are also objects. and since frame scripts get evaluated for each tab this means new function objects get instantiated, new constants get computed, block scopes must be set up etc. while it may seem fairly innocencous in this toy example, real scripts often have a lot more functions and initialize som...
...rted_symbols = ['addframe']; const precomputedconstants = // ... function helper(window, action) { // ... do some work on the window } function dosomething(message) { frameglobal = message.target result = helper(frameglobal.content, message.data) frameglobal.sendasyncmessage("my-addon:response-from-child", {something: result}) } function addframe(frameglobal) { frameglobal.addmessage
listener("my-addon:request-from-parent", dosomething) } javascript modules are per-process singletons and thus all their objects are only initialized once, which makes them suitable for stateless callbacks. but care must be taken to not leak references to the frame script global when it is passed into a jsm. alternatively the frame's unload event or weak maps can be used to ensure that frames can...
...osed. store heavyweight state once per process bad: // addon.js var main = new myaddonservice(); main.onchange(statechange); function statechange() { services.mm.broadcastasyncmessage("my-addon:update-configuration", {newconfig: main.serialize()}) } // framescript.js var maincopy; function onupdate(message) { maincopy = myaddonservice.deserialize(message.data.newconfig); } addmessage
listener("my-addon:update-configuration", onupdate) // maincopy used by other functions the main issue here is that a separate object is kept for each tab. not only does that increase memory footprint but the deserialization also has to be executed seperately for each tab, thus requiring more cpu time. better: // addon.js var main = new myaddonservice(); main.onchange(statechange); function st...
...And 6 more matches
How to implement a custom autocomplete search component
there are actually two autocomplete mechanisms: an older mechanism that is part of the "xpfe" codebase and is used in older applications such as thunderbird and seamonkey. a newer and slightly simplified mechanism that is used in "toolkit" applications such as firefox and xulrunner. thunderbird 2.x and seamonkey 1.1.x support the toolkit interfaces, although they do not use the same autocomplete widget. ...
...tocomplete search components sometimes, you may want to build your own autocomplete source. to do so you need the following: create an xpcom component that implements the nsiautocompletesearch interface. make sure the contract id of your xpcom component follows the following form: "@mozilla.org/autocomplete/search;1?name=xxx", where "xxx" is the name of your autocomplete source. implement the
list of matched strings using the nsiautocompleteresult interface. the simplest way to make an xpcom component is to build an xpcom javascript component (this cannot be done with a javascript module). how to build an xpcom component in javascript will step you through the process. because creating an xpcom component in order to build a custom autocomplete source can be enough to discourage some devel...
...) { return this._results[index]; }, queryinterface: xpcomutils.generateqi([ ci.nsiautocompleteresult ]) }; /** * @constructor * * @implements {nsiautocompletesearch} */ function providerautocompletesearch() { } providerautocompletesearch.prototype = { classid: class_id, classdescription : class_name, contractid : contract_id, /** * searches for a given string and notifies a
listener (either synchronously * or asynchronously) of the result * * @param searchstring the string to search for * @param searchparam an extra parameter * @param previousresult a previous result to use for faster searchinig * @param
listener the
listener to notify when the search is complete */ startsearch: function(searchstring, searchparam, previousresult,
listener) { va...
...And 6 more matches
AddonInstall
cks download and installation process of an add-on. instances can be created using the getinstallforfile() or getinstallforurl() methods on the addonmanager. once you have an instance the install() method is used to start automatic download and installation. this can be canceled at any time with the cancel() method. method overview void install() void cancel() void add
listener(in install
listener
listener) void remove
listener(in install
listener
listener) properties attribute type description name string the name of the add-on being installed. version string the version of the add-on being installed. iconurl string the icon of the add-on being installed. releasenotesuri nsiuri ...
...ting anything installed. this is guaranteed to be correct after downloading is complete but may be set earlier. addon addon the full addon that this install will install. only available after downloading is complete. methods install() starts or continues the install process. ...
...ilable after downloading is complete. methods install() starts or continues the install process. the process will continue in the background until it fails, completes, one of the registered install
listeners pauses it, or the process is canceled by a call to the cancel() method. void install( ) cancel() cancels the install process, it cannot be restarted after this. void cancel( ) add
listener() adds a new install
listener if the
listener is not already registered to monitor this specific addoninstall. ...
...And 6 more matches
Mozilla DOM Hacking Guide
ll handle the array behavior. indeed, it will forward the call history[1] to history.item(1), which is defined in the idl and easily coded. the relevant code is at nsdomclassinfo.cpp, around line 4520. these two examples demonstrate the power of the dom combined with xpconnect and the javascript engine. the possibilities are endless. "what do you want to code today?" ;-) all the dom classes are
listed in an enum defined in nsidomclassinfo.h, nsdomclassinfoid. there are classes for the dom0, core dom, html, xml, xul, xbl, range, css, events, etc... the array sclassinfodata, defined in nsdomclassinfo.cpp, maps each dom class to its helper class and to the interfaces that are exposed to javascript. it is an array of type nsdomclassinfodata, which is a structure defined in nsidomclassinfo.h. th...
...escribed in section 1.5. interface flattening one of the nicest -- and most important -- features of the xpconnect'ed dom is the interface flattening. "interface flattening is the ability to call methods on an object regardless of the interface it was defined on." for example, when we have the document object in javascript, we can call indistinctly document.getelementbyid(), or document.addevent
listener(), although they are defined on two different interfaces (domdocument and domeventtarget. needless to say this is critical for the use of the dom in real-world content. in mozilla interface flattening is obtained through the use of the nsiclassinfo interface. nsiclassinfo stores the interfaces available for an object and later on xpconnect uses those interfaces to lookup the right method to ...
...s obtained through the use of the nsiclassinfo interface. nsiclassinfo stores the interfaces available for an object and later on xpconnect uses those interfaces to lookup the right method to call. the great thing is that one can easily see the interfaces available from js through interface flattening by looking at the code. the interesting part is in nsdomclassinfo::init(). there we have a long
list of macros. there is one set of macros per dom class. there you can see, for each object, what interfaces are part of the "flattened" set. as an example, on the window object, we can call all the methods defined on the following interfaces: nsidomwindow, nsidomjswindow, nsidomeventreciever, nsidomeventtarget, nsidomviewcss, and nsidomabstractview. again, without caring on what interface the method...
...And 6 more matches
Finishing the Component
using frozen interfaces the core functionality of blocking sites is still missing, however. ...
... nsisupports xpcom frozen provides interface discovery, and object reference counting nsiobserver xpcom frozen allows messaging passing between objects nsicontentpolicy content not frozen interface for policy control mechanism iweblock web lock not frozen enables and disables weblock. also, provides access to the url that are white
listed. implementing the nsicontentpolicy interface to implement the new interface, you must #include the unfrozen nsicontentpolicy, and you must also make sure the build system can find the file you've brought over. the location of the file and the steps for adding that location to the build system vary depending on how you build this component. once you have made sure that your component bu...
... it into a gecko installation. when the component is loaded, gecko calls the nsicontentpolicy implementation in weblock on every page load, and this prevents pages from displaying by returning the proper value when the load method is called. the web locking policy that we are going to put into place is quite simple: for every load request that comes through, we will ensure that the uri is in the
list of "good" urls on the white
list. if you care to extend this implementation so that the
list of urls is held remotely on a server somewhere - as might be the case when the weblock component is used in a corporate intranet, for example - there are networking apis in gecko that will support this. or you could implement the web lock so that instead of blocking any site, the component would simply ...
...And 6 more matches
Using XPCOM Utilities to Make Things Easier
p somewhat (e.g., high-level macros expand to other macros), they fall into the following general categories. generic xpcom module macros the work in the previous chapter was useful in setting up the generic component code. but there are only a few places in that code that are unique to the weblock component, and it was a lot of typing. to write a different component library, you could copy the
listing at the end of the chapter, change very little, and paste it into a new project. to avoid these kinds of redundancies, to regulate the way generic code is written, and to save typing, xpcom providesgeneric module macros that expand into the module code you've already seen. since these macros expand into "generic" implementations, they may not offer as much flexibility as you have when you are ...
...c module macros that expand into the module code you've already seen. since these macros expand into "generic" implementations, they may not offer as much flexibility as you have when you are writing your own implementation. but they have the advantage of allowing much more rapid development. to get an idea about how much can be handled with the macros described in this section, compare the code
listing in weblock2.cpp at the end of the chapter with weblock1.cpp in the previous chapter. the module macros include one set of macros that define the exported nsgetmodule entry point, the required nsimodule implementation code and another that creates a generic factory for your implementation class. used together, these macros can take care of a lot of the component implementation code and leave y...
...entation class. used together, these macros can take care of a lot of the component implementation code and leave you working on the actual logic for your component. note that all of the macros described in this section are similar but are used in slightly different situations. some differ only in whether or not a method is called when the module is created and/or destroyed. xpcom module macros
lists the macros discussed in this section. xpcom module macros macro description ns_impl_nsgetmodule(name, components) implements the nsimodule interface with the module name of name and the component
list in components. ns_impl_nsgetmodule_with_ctor(name, components, ctor) same as above but allows for a special function to be called when the module is created. ...
...And 6 more matches
nsIAlertsService
note: if you are calling this function...
...); methods showalertnotification() displays a notification window. note: if you are calling this function from javascript, you should wrap it in a try/catch because it can fail on mac os x prior to firefox 22. void showalertnotification( in astring imageurl, in astring title, in astring text, in boolean textclickable, optional in astring cookie, optional in nsiobserver alert
listener, optional in astring name, optional in astring dir, optional in astring lang, optional in astring data, optional in nsiprincipal principal, optional in boolean inprivatebrowsing, optional ); parameters imageurl a url identifying the image to display in the notification alert. title the title for the alert. text the text to display in the alert, explaining the alert condi...
...he notification alert. title the title for the alert. text the text to display in the alert, explaining the alert condition. the text must not be too long, otherwise it might be truncated to a platform-specific length. if the text is too long, try to use line returns in the text to have it split and displayed over multiple lines. textclickable optional if true, if the user clicks on it, the
listener is notified; when hovered the notification background becomes lighter and the cursor turns to a pointer. prior to gecko 32 the text was made to look like a link. cookie optional a blind cookie the alert passes back to the consumer during alert
listener callbacks. alert
listener optional an object to receive callbacks from the alert; may be null if you don't care about callbacks. it must i...
...And 6 more matches
nsICacheSession
handles open synchronous and asynchronous cache entry operations along with evicting cache entries and checking for cache devices instantiation according to the session storage policies. ...
...pen synchronous and asynchronous cache entry operations along with evicting cache entries and checking for cache devices instantiation according to the session storage policies. ...
...4 / seamonkey 2.11) method overview void asyncopencacheentry(in acstring key, in nscacheaccessmode accessrequested, in nsicache
listener
listener, [optional] in boolean nowait); void evictentries(); prbool isstorageenabled(); nsicacheentrydescriptor opencacheentry(in acstring key, in nscacheaccessmode accessrequested, in boolean blockingmode); void doomentry(in acstring key, in nsicache
listener
listener); attributes attribute type description doomentriesifexpired prbool expired entries will be doomed or evicted if this attribute is set to true. if false, expired entries will be returned (useful for offline mode and clients, such as http, that can update the valid lifetime of cached content). this attribute defaults to true. methods asyncopencacheentry() this method gives...
...And 6 more matches
nsIConsoleService
obsolete since gecko 19 (firefox 19 / thunderbird 19 / seamonkey 2.16)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed a...
... obsolete since gecko 19 (firefox 19 / thunderbird 19 / seamonkey 2.16)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avo...
... obsolete since gecko 19 (firefox 19 / thunderbird 19 / seamonkey 2.16)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using ...
...And 6 more matches
nsISessionStore
a json string representing the current state of all windows in the web browser. getclosedtabcount() returns the number of restorable tabs for a given window. unsigned long getclosedtabcount( in nsidomwindow awindow ); parameters awindow the window whose restorable tab count should be returned. return value the number of restorable tabs in the window. ...
... unsigned long getclosedtabcount( in nsidomwindow awindow ); parameters awindow the window whose restorable tab count should be returned. return value the number of restorable tabs in the window. getclosedtabdata() returns a
list of closed tabs for a specified window. astring getclosedtabdata( in nsidomwindow awindow ); parameters awindow the browser window whose closed tab
list is to be retrieved. return value a json string representing the
list of closed tabs for the window specified by awindow. the
list is in last in/first out (lifo) order, so that the first item in the
list is the last tab that was closed. getclosedwindowcount() returns the number of restorable windows. unsigned long getclosedwindowcount(); parameters none. return value the number of resto...
... gettabstate() returns the state of the specified tab. ...
...And 6 more matches
CSSStyleSheet - Web APIs
for example, one rule might be a cssstylerule object containing a style such as: h1, h2 { font-size: 16pt; } another rule might be an at-rule such as @import or @media, and so forth. see the notes section for the various ways a cssstylesheet object can be obtained. ...
... for example, one rule might be a cssstylerule object containing a style such as: h1, h2 { font-size: 16pt; } another rule might be an at-rule such as @import or @media, and so forth. see the notes section for the various ways a cssstylesheet object can be obtained. ...
...srules property. for example, one rule might be a cssstylerule object containing a style such as: h1, h2 { font-size: 16pt; } another rule might be an at-rule such as @import or @media, and so forth. see the notes section for the various ways a cssstylesheet object can be obtained. properties inherits properties from its parent, stylesheet. cssrules read only returns a live cssrule
list which maintains an up-to-date
list of the cssrule objects that comprise the stylesheet. this is normally used to access individual rules like this: stylesheet.cssrules[i] // where i = 0..cssrules.length-1 to add or remove items in cssrules, use the cssstylesheet's insertrule() and deleterule() methods. ownerrule read only if this stylesheet is imported into the document using an @impor...
...And 6 more matches
How whitespace is handled by HTML, CSS, and in the DOM - Web APIs
ndled as follows (the may be some slight differences in exact behavior between browsers, but this basically works): because we’re inside a block formatting context, everything must be a block, so our 3 text nodes also become blocks, just like the 2 <div>s. ...
...for example navigation menu items. because they are blocks, many people expect that they will behave as such, but really they don’t. if there is formatting whitespace between adjacent inline elements, this will result in space in the layout, just like the spaces between words in text. ...
...le navigation menu items. because they are blocks, many people expect that they will behave as such, but really they don’t. if there is formatting whitespace between adjacent inline elements, this will result in space in the layout, just like the spaces between words in text. ...
...And 6 more matches
Document Object Model (DOM) - Web APIs
ached to them. once an event is triggered, the event handlers get executed. to learn more about what the dom is and how it represents documents, see our article introduction to the dom. ...
... once an event is triggered, the event handlers get executed. to learn more about what the dom is and how it represents documents, see our article introduction to the dom. dom interfaces attr cdatasection characterdata childnode comment customevent document documentfragment documenttype domerror domexception domimplementation domstring domtimestamp domstring
list domtoken
list element event eventtarget htmlcollection mutationobserver mutationrecord namednodemap node nodefilter nodeiterator node
list nondocumenttypechildnode parentnode processinginstruction selection range text textdecoder textencoder timeranges treewalker url window worker xmldocument obsolete dom interfaces the document object model has been highly simplified. to ac...
...ument object model has been highly simplified. to achieve this, the following interfaces present in the different dom level 3 or earlier specifications have been removed. it is uncertain whether some may be reintroduced in the future or not, but for the time being they should be considered obsolete and should be avoided: documenttouch domconfiguration domerrorhandler domimplementation
list domimplementationregistry domimplementationsource domlocator domobject domsettabletoken
list domuserdata elementtraversal entity entityreference name
list notation typeinfo userdatahandler html dom a document containing html is described using the document interface, which is extended by the html specification to include various html-specific features. i...
...And 6 more matches
Using the Gamepad API - Web APIs
lopers and designers to access and use gamepads and other game controllers. the gamepad api introduces new events on the window object for reading gamepad and controller (hereby referred to as gamepad) state. in addition to these events, the api also adds a gamepad object, which you can use to query the state of a connected gamepad, and a navigator.getgamepads() method which you can use to get a
list of gamepads known to the page. connecting to a gamepad when a new gamepad is connected to the computer, the focused page first receives a gamepadconnected event. if a gamepad is already connected when the page loaded, the gamepadconnected event is dispatched to the focused page when the user presses a button or moves an axis. in firefox, gamepads are only exposed to a page when the user inter...
...cused page when the user presses a button or moves an axis. in firefox, gamepads are only exposed to a page when the user interacts with one with the page visible. this helps prevent gamepads being used for fingerprinting the user. once one gamepad has been interacted with, other gamepads that are connected will automatically be visible. you can use gamepadconnected like this: window.addevent
listener("gamepadconnected", function(e) { console.log("gamepad connected at index %d: %s. %d buttons, %d axes.", e.gamepad.index, e.gamepad.id, e.gamepad.buttons.length, e.gamepad.axes.length); }); each gamepad has a unique id associated with it, which is available on the event's gamepad property. disconnecting a gamepad when a gamepad is disconnected, and if a page has previously recei...
...ad.id, e.gamepad.buttons.length, e.gamepad.axes.length); }); each gamepad has a unique id associated with it, which is available on the event's gamepad property. disconnecting a gamepad when a gamepad is disconnected, and if a page has previously received data for that gamepad (e.g. gamepadconnected), a second event is dispatched to the focused window, gamepaddisconnected: window.addevent
listener("gamepaddisconnected", function(e) { console.log("gamepad disconnected from index %d: %s", e.gamepad.index, e.gamepad.id); }); the gamepad's index property will be unique per-device connected to the system, even if multiple controllers of the same type are used. the index property also functions as the index into the array returned by navigator.getgamepads(). var gamepads = {}; funct...
...And 6 more matches
HTMLInputElement - Web APIs
not a candidate for constraint validation (willvalidate is false), or it satisfies its constraints. this value can be set by the setcustomvalidity method. willvalidate read only boolean: returns whether the element is a candidate for constraint validation. it is false if any conditions bar it from constraint validation, including: its type is hidden, reset, or button; it has a <data
list> ancestor; its disabled property is true. properties that apply only to elements of type checkbox or radio checked boolean: returns / sets the current state of the element when type is checkbox or radio. defaultchecked boolean: returns / sets the default state of a radio button or checkbox as originally specified in html that created this object. indetermi...
... submit button, if the value of type is image; otherwise it is ignored. width string: returns / sets the document's width attribute, which defines the width of the image displayed for the button, if the value of type is image. ...
...is image. properties that apply only to elements of type file accept string: returns / sets the element's accept attribute, containing comma-separated
list of file types accepted by the server when type is file. allowdirs boolean: part of the non-standard directory upload api; indicates whether or not to allow directories and files both to be selected in the file
list. implemented only in firefox and is hidden behind a preference. files returns/accepts a file
list object, which contains a
list of file objects representing the files selected for upload. webkitdirectory boolean: returns the webkitdirectory attribute; if true, the file system picker interface only accepts directories instead of files. webkitentries array of ...
...And 6 more matches
Dragging and Dropping Multiple Items - Web APIs
andard methods. these are methods that mirror the types property as well as the getdata(), setdata() and cleardata() methods, however, they take an additional argument that specifies the index of the item to retrieve, modify or remove. the drag processing described in this document use the datatransfer interface. this processing does not use the datatransferitem interface nor the datatransferitem
list interface. setting and getting with indices the mozsetdataat() method allows you to add multiple items during a dragstart event. this function similarly to setdata() var dt = event.datatransfer; dt.mozsetdataat("text/plain", "data to drag", 0); dt.mozsetdataat("text/plain", "second data to drag", 1); this example adds two items to be dragged. the last argument specifies the index of the item...
...the index is equivalent to calling setdata(). you can clear an item using the mozcleardataat() method. event.datatransfer.mozcleardataat("text/plain", 1); caution: removing the last format for a particular index will remove that item entirely, shifting the remaining items down, so the later items will have different indices. ...
...aat() method. event.datatransfer.mozcleardataat("text/plain", 1); caution: removing the last format for a particular index will remove that item entirely, shifting the remaining items down, so the later items will have different indices. ...
...And 6 more matches
Checking when a deadline is due - Web APIs
in this article we look at a complex example involving checking the current time and date against a deadline stored via indexeddb. the main complication here is checking the stored deadline info (month, hour, day, etc.) against the current time and date taken from a date object. the main example application we will be referring to in this article is to-do
list notifications, a simple to-do
list application that stores task titles and deadline times and dates via indexeddb, and then provides users with notifications when deadline dates are reached, via the notification, and vibration apis. you can download the to-do
list notifications app from github and play around with the source code, or view the app running live. the basic problem in the to-do app, we wanted to first record t...
...ourse humans don't want to enter deadline information in the same format javascript understands. human-readable dates are quite different, with a number of different representations. recording the date information to provide a reasonable user experience on mobile devices, and to cut down on ambiguities, i decided to create an html form with: a text input for entering a title for your to-do
list. this is the least avoidable bit of user typing. number inputs for the hour and minute parts of the deadline. on browsers that support type="number", you get a nice little up and down arrow number picker. on mobile platforms you tend to get a numeric keypad for entering data, which is helpful. on others you just get a standard text input, which is okay. <select> elements for inputting the day, ...
...duplicate items not allowed.</li>'; }; // create an object store on the trans...
...And 6 more matches
PannerNode.maxDistance - Web APIs
the maxdistance property of the pannernode interface is a double value representing the maximum distance between the audio source and the
listener, after which the volume is not reduced any further. this value is used only by the linear distance model. the maxdistance property's default value is 10000. syntax var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.maxdistance = 10000; value a double. the default is 10000, and non-positive values are not allowed. exceptions rangeerror the property has been given a value that is outside the accepted range. example in the following example, you can see an example of how the createpanner() method, audio
listener and pannernode would be used to control audio spatialisation. generally you will define the posit...
...the default is 10000, and non-positive values are not allowed. exceptions rangeerror the property has been given a value that is outside the accepted range. example in the following example, you can see an example of how the createpanner() method, audio
listener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio
listener and panner (source) occupy initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change rea
listically as your character moves closer to or further away from a music player such as a stereo. in the example you can see this being controlled by the functi...
...via the positionpanner() function. ...
...And 6 more matches
PannerNode.panningModel - Web APIs
e. hrtf: renders a stereo output of higher quality than equalpower — it uses a convolution with measured impulse responses from human subjects. syntax var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; value a enum — see panningmodeltype. ...
...bjects. syntax var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; value a enum — see panningmodeltype. example in the following example, you can see an example of how the createpanner() method, audio
listener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio
listener and panner (source) occupy initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change rea
listically as your character moves closer to or further away from a music player such as a stereo. in the example you can see this being controlled by the functi...
...via the positionpanner() function. ...
...And 6 more matches
ParentNode.querySelectorAll() - Web APIs
this string must be a valid css selector string; if it's not, a syntaxerror exception is thrown. ...
...this string must be a valid css selector string; if it's not, a syntaxerror exception is thrown. ...
...this string must be a valid css selector string; if it's not, a syntaxerror exception is thrown. see locating dom elements using selectors for more information about using selectors to identify elements. ...
...And 6 more matches
Using Performance Timeline - Web APIs
+ " = not supported"); } } } } this interface also includes a tojson() method that returns the serialization of the performanceentry object. the following examples show the use of this method. ...
...this interface also includes a tojson() method that returns the serialization of the performanceentry object. the following examples show the use of this method. ...
...rformance observer interfaces allow an application to register an observer for specific performance event types, and when one of those event types is recorded, the application is notified of the event via the observer's callback function that was specified at the time, the observer was created. when the observer (callback) is invoked the callback's parameters include a performance observer entry
list that only contains observed performance entries. that is, the
list only contains entries for the event types that were specified when the observer's observe() method was invoked. the following example shows how to register two observers: the first one registers for several event types and the second observer only registers for one event type. function performanceobservers() { // create observ...
...And 6 more matches
SpeechRecognition - Web APIs
fault value is 1. speechrecognition.serviceuri specifies the location of the speech recognition service used by the current speechrecognition to handle the actual recognition. the default is the user agent's default speech service. methods speechrecognition also inherits methods from its parent interface, eventtarget. ...
...e the actual recognition. the default is the user agent's default speech service. methods speechrecognition also inherits methods from its parent interface, eventtarget. speechrecognition.abort() stops the speech recognition service from
listening to incoming audio, and doesn't attempt to return a speechrecognitionresult. speechrecognition.start() starts the speech recognition service
listening to incoming audio with intent to recognize grammars associated with the current speechrecognition. ...
... audiostart fired when the user agent has started to capture audio. ...
...And 6 more matches
Writing a WebSocket server in C# - Web APIs
e i will show you how to write one in c#. you can do it in any server-side language, but to keep things simple and more understandable, i chose microsoft's language. this server conforms to rfc 6455 so it will only handle connections from chrome version 16, firefox 11, ie 10 and over. first steps websockets communicate over a tcp (transmission control protocol) connection. ...
... to create an ipaddress object from a string, use the parse static method of ipaddress. ...
... to create an ipaddress object from a string, use the parse static method of ipaddress. ...
...And 6 more matches
Advanced techniques: Creating and sequencing audio - Web APIs
uffersourcenode, biquadfilternode "dial up" loading a sound sample to play audiocontext.decodeaudiodata(), audiobuffersourcenode note: this instrument was not created to sound good, it was created to provide demonstration code and represents a very simplified version of such an instrument. the sounds are based on a dial-up modem. if you are unaware of how one sounds you can
listen to one here. creating an audio context as you should be used to by now, each web audio api app starts with an audio context: // for cross browser compatibility const audiocontext = window.audiocontext || window.webkitaudiocontext; const audioctx = new audiocontext(); the "sweep" — oscillators, periodic waves, and envelopes for what we will call the "sweep" sound, that first noise you he...
...we need to add a gainnode and connect that through our audio g...
... /> now we can create some variables over in javascript and have them change when the input values are updated: let attacktime = 0.2; const attackcontrol = document.queryselector('#attack'); attackcontrol.addevent
listener('input', function() { attacktime = number(this.value); }, false); let releasetime = 0.5; const releasecontrol = document.queryselector('#release'); releasecontrol.addevent
listener('input', function() { releasetime = number(this.value); }, false); the final playsweep() function now we can expand our playsweep() function. we need to add a gainnode and connect that through our audio graph to actually apply amplitude variations to our sound. the gain node has one property: gain, which is of type audioparam. this is really useful — now we can start to harness the p...
...And 6 more matches
Using CSS transitions - CSS: Cascading Style Sheets
is instantaneous. with css transitions enabled, changes occur at time intervals that follow an acceleration curve, all of which can be customized. animations that involve transitioning between two states are often called implicit transitions as the states in between the start and final states are implicitly defined by the browser. css transitions let you decide which properties to animate (by
listing them explicitly), when the animation will start (by setting a delay), how long the transition will last (by setting a duration), and how the transition will run (by defining a timing function, e.g. linearly or quick at the beginning, slow at the end). which css properties can be transitioned? the web author can define which property has to be animated and in which way. this allows the creati...
...he transition will last (by setting a duration), and how the transition will run (by defining a timing function, e.g. linearly or quick at the beginning, slow at the end). which css properties can be transitioned? the web author can define which property has to be animated and in which way. this allows the creation of complex transitions. as it doesn't make sense to animate some properties, the
list of animatable properties is limited to a finite set. note: the set of properties that can be animated is changing as the specification develops. the auto value is often a very complex case. the specification recommends not animating from and to auto. some user agents, like those based on gecko, implement this requirement and others, like those based on webkit, are less strict. using animations ...
...on with the following sub-properties: (note that these transitions loop infinitely only for the purpose of our examples; css transitions only visualize a property change from start to finish. if you need visualizations that loop, look into the css animation property.) transition-property specifies the name or names of the css properties to which transitions should be applied. only properties
listed here are animated during transitions; changes to all other properties occur instantaneously as usual. transition-duration specifies the duration over which transitions should occur. you can specify a single duration that applies to all properties during the transition, or multiple values to allow each property to transition over a different period of time. transition-duration: 0.5s ...
...And 6 more matches
display - CSS: Cascading Style Sheets
the detail of what happens when display: flex is declared is defined in the css flexible box model specification. see the table at the end of this document for all of the individual specifications. syntax the css display property is specified using keyword values. keyword values are grouped into six value categories: .container { display: [ <display-outside> || <display-inside> ] | <display-
listitem> | <display-internal> | <display-box> | <display-legacy> ; } outside <display-outside> these keywords specify the element’s outer display type, which is essentially its role in flow layout. valid <display-outside> values: block the element generates a block element box, generating line breaks both before and after the element when in the normal flow. inline the element generat...
...sponding html <ruby> elements. note: browsers that support the two value syntax, on finding the inner value only, such as when display: flex or display: grid is specified, will set their outer value to block. this will result in expected behavior; for example if you specify an element to be display: grid, you would expect that the box created on the grid container would be a block level box.
list item <display-
listitem> the element generates a block box for the content and a separate
list-item inline box. a single value of
list-item will cause the element to behave like a
list item. this can be used together with
list-style-type and
list-style-position.
list-item can also be combined with any <display-outside> keyword and the flow or flow-root <display-inside> keywords. note: in ...
...success criterion 1.3.1 | w3c understanding wcag 2.0 formal definition initial valueinlineapplies toall elementsinheritednocomputed valueas the specified value, except for positioned and floating elements and the root element. ...
...And 6 more matches
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. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...nd send us a pull request. ...
... values none is a keyword meaning that there is no explicit grid. any rows will be implicitly generated and their size will be determined by the grid-auto-rows property. <length> is a non-negative length. <percentage> is a non-negative <percentage> value, relative to the block size of the grid container. if the size of the grid container depends on ...
...And 6 more matches
Audio and video manipulation - Developer guides
o.ended) { return; } this.computeframe(); var self = this; settimeout(function () { self.timercallback(); }, 16); // roughly 60 frames per second }, doload: function() { this.video = document.getelementbyid("my-video"); this.c1 = document.getelementbyid("my-canvas"); this.ctx1 = this.c1.getcontext("2d"); var self = this; this.video.addevent
listener("play", function() { self.width = self.video.width; self.height = self.video.height; self.timercallback(); }, false); }, computeframe: function() { this.ctx1.drawimage(this.video, 0, 0, this.width, this.height); var frame = this.ctx1.getimagedata(0, 0, this.width, this.height); var l = frame.data.length / 4; for (var i = 0; i < l; i++) { var g...
... audio manipulation playbackrate aside, to manipulate audio you'll typically use the web audio api. s...
... audio manipulation playbackrate aside, to manipulate audio you'll typically use the web audio api. selecting an audio source the web audio api can receive audio from a variety of sources, then p...
...And 6 more matches
HTML attribute: multiple - HTML: Hypertext Markup Language
values depends on the form control. depending on the type, the form control may have a different appearance if the multiple attribute is set. for the file input type, the native messaging the browser provides differs. in firefox, the file input reads "no files selected" when the attribute is present and "no file selected" when not, when no files are selected. most browsers displaying a scrolling
list box for a <select> control with the multiple attribute set versus a single line dropdown when the attribute is ommitted. the email input displays the same, but will match the :invalid pseudo-class if more than one comma-separated email address is included if the attribute is not present. when multiple is set on the email input type, the user can inlclude zero (if not also required), one or more...
...ill match the :invalid pseudo-class if more than one comma-separated email address is included if the attribute is not present. when multiple is set on the email input type, the user can inlclude zero (if not also required), one or more comma-separated email addresses. <input type="email" multiple name="emails" id="emails"> if and only if the multiple attribute is specified, the value can be a
list of properly-formed comma-separated e-mail addresses. any trailing and leading whitespace is removed from each address in the
list. when multiple is set on the file input type, the user can select one or more files. the user can choose multiple files from the file picker in any way that their chosen platform allows (e.g. by holding down shift or control, and then clicking). <input type="file" mu...
...ose multiple files from the file picker in any way that their chosen platform allows (e.g. by holding down shift or control, and then clicking). <input type="file" multiple name="uploads" id="uploads"> when the attribute is omitted, the user can only select a single file per <input>. the multiple attribute on the <select> element represents a control for selecting zero or more options from the
list of options. otherwise, the <select> element represents a control for selecting a single <option> from the
list of options. <select multiple name="drawfs" id="drawfs"> <option>grumpy</option> <option>happy</option> <option>sleepy</option> <option>bashful</option> <option>sneezy</option> <option>dopey</option> <option>doc</option> </select> when multiple is specified, most browsers ...
...And 6 more matches
<input type="number"> - HTML: Hypertext Markup Language
ository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. on browsers that don't support inputs of type number, a number input falls back to type text. value any floating-point number, or empty. events change and input supported common attributes autocomplete,
list, placeholder, readonly idl attributes
list, value, valueasnumber methods select(), stepup(), stepdown() value any floating-point number, or empty. you can set a default value for the input by including a number inside the value attribute, like so: <input id="number" type="number" value="42"> additional attributes in addition to the attributes commonly supporte...
...epdown() value any floating-point number, or empty. ...
...floating-point number, or empty. ...
...And 6 more matches
<input type="tel"> - HTML: Hypertext Markup Language
phone numbers. using a specific input type for telephone numbers also makes adding custom validation and handling of phone numbers more convenient. note: browsers that don't support type tel fall back to being a standard text input. value a domstring representing a telephone number, or empty events change and input supported common attributes autocomplete,
list, maxlength, minlength, pattern, placeholder, readonly, and size idl attributes
list, selectionstart, selectionend, selectiondirection, and value methods select(), setrangetext(), setselectionrange() value the <input> element's value attribute contains a domstring that either represents a telephone number or is an empty string (""). additional attributes in additi...
...trangetext(), setselectionrange() value the <input> element's value attribute contains a domstring that either represents a telephone number or is an empty string (""). ...
...ange() value the <input> element's value attribute contains a domstring that either represents a telephone number or is an empty string (""). ...
...And 6 more matches
The "codecs" parameter in common media types - Web media technologies
ing avc (h.264) video, main profile, level 4.2. as is the case with any mime type parameter, codecs must be changed to codecs* (note the asterisk character, *) if any of the properties of the codec use special characters which must be percent-encoded per rfc 2231, section 4: mime parameter value and encoded word extensions. ...
...e parameter, codecs must be changed to codecs* (note the asterisk character, *) if any of the properties of the codec use special characters which must be percent-encoded per rfc 2231, section 4: mime parameter value and encoded word extensions. you can use the javascript encodeuri() function to encode the parameter
list; similarly, you can use decodeuri() to decode a previously encoded parameter
list. ...
...asterisk character, *) if any of the properties of the codec use special characters which must be percent-encoded per rfc 2231, section 4: mime parameter value and encoded word extensions. you can use the javascript encodeuri() function to encode the parameter
list; similarly, you can use decodeuri() to decode a previously encoded parameter
list. when the codecs parameter is used, the specified
list of codecs must include every codec used for the contents of the file. ...
...And 6 more matches
Content type - SVG: Scalable Vector Graphics
angle <angle> angles are specified in one of two ways. when used in the value of a property in a stylesheet, an <angle> is defined as follows: angle ::= number (~"deg" | ~"grad" | ~"rad")? where deg indicates degrees, grad indicates grads and rad indicates radians. for properties defined in css2, an angle unit identifier must be provided. for angle values in svg-specific properties and their corresponding presentation attributes, the angle unit identifier is optional. if not provided, the angle value is assumed to be in degrees. ...
...gb notation (#rgb) is converted into six-digit form (#rrggbb) by replicating digits, not by adding zeros. for example, #fb0 expands to #ffbb00. this ensures that white (#ffffff) can be specified with the short notation (#fff) and removes any dependencies on the color depth of the display. the format of an rgb value in the functional notation is an rgb start-function, followed by a comma-separated
list of three numerical values (either three integer values or three percentage values) followed by ")". an rgb start-function is the case-insensitive string "rgb(", for example "rgb(" or "rgb(". for compatibility, the all-lowercase form "rgb(" is preferred. the integer value 255 corresponds to 100%, and to f or ff in the hexadecimal notation: rgb(255,255,255) = rgb(100%,100%,100%) = #fff. white space...
...surable definition of the color, which can be related to international standards. color ::= "#" hexdigit hexdigit hexdigit (hexdigit hexdigit hexdigit)? | "rgb("integer, integer, integer")" | "rgb("integer "%", integer "%", integer "%)" | color-keyword hexdigit ::= [0-9a-fa-f] where color-keyword matches (case insensitively) one of the color keywords
listed in css color module level 3, or one of the system color keywords
listed in user preferences for colors (css2, section 18.2). the corresponding svg dom interface definitions for <color> are defined the one defined by css. svg's extension to color, including the ability to specify icc-based colors, are represented using dom interface svgcolor. coordinate <coordinate> a <coordinate> is...
...And 6 more matches
For Further Reading - XSLT: Extensible Stylesheet Language Transformations
s a very big book, well laid out, and exhaustive, if sometimes exhausting, in detail, covering every possible base in the xslt story. http://www.amazon.com/xslt-programme.../dp/0764543814 xslt author: doug tidwell length: 473 pages publisher: o'reilly media; 1 edition (august 15, 2001) isbn: 0596000537 doug tidwell is a senior developer at ibm and a prominent evange
list for xml technologies generally. he is the author of several articles and tutorials on various aspects of xml at ibm's extensive xml developer site. this book is somewhat less comprehensive than michael kay's, but it covers the basics well, and offers some intriguing examples. http://www.amazon.com/xslt-doug-tidwell/dp/0596000537 learning xml, second edition author: erik t. ray...
... an overview of xml generally. chapter 6 is devoted specifically to xslt. http://www.amazon.com/gp/product/0596004206 digital websites world wide web consortium the w3c homepage: http://www.w3.org/ the main xsl page: http://www.w3.org/style/xsl/ the version 1.0 recommendation for xslt: http://www.w3.org/tr/xslt archive of public style (css and xslt) discussions: http://
lists.w3.org/archives/public/www-style/ the version 1.0 recommendation for xpath: http://www.w3.org/tr/xpath the world wide web consortium is the body that publishes recommendations for a number of web-based technologies, many of which become the de-facto standard. articles hands-on xsl author: don r. day location: http://www-106.ibm.com/developerwork...-hands-on-xsl/ ...
... ...
...And 6 more matches
simple-prefs - Archive of obsolete content
d stores the full path and name of the file selected. { "type": "file", "name": "myfile", "title": "select a file" } directory displayed as a "browse" button that opens a directory picker and stores the full path and name of the directory selected. { "type": "directory", "name": "mydirectory", "title": "select a directory" } menu
list displayed as a drop-down
list. the type of the stored value depends on the default value. the options are specified by a mandatory "options" attribute, that is an array of objects with mandatory attributes "label" and "value" the values of the "value" attributes must be supplied as strings. the values of the "label" attributes prefixed with "{name}_options.", where {name}...
..."label" and "value" the values of the "value" attributes must be supplied as strings. the values of the "label" attributes prefixed with "{name}_options.", where {name} is the name of the preference, are used as localization keys. if no matching entries are found, the value of the "label" attributes is used verbatim as labels. { "name": "typeofbreath", "type": "menu
list", "title": "type of breath", "value": 0, "options": [ { "value": "0", "label": "fire" }, { "value": "1", "label": "cold" }, { "value": "2", "label": "disintegration" } ] } radio displayed as radio buttons. the type of the stored value depends...
... "title": "alignment", "value": "n", "options": [ { "value": "l", "label": "lawful" }, { "value": "n", "label": "neutral" }, { "value": "c", "label": "chaotic" } ] } control displays a button. when the user clicks the button, the function
listening to the on() function for this preference is called. this type requires a mandatory attribute called "label" which is provided as a string. it is used to label the button. in "package.json": { "type": "control", "label": "click me!", "name": "sayhello", "title": "say hello" } in "main.js": var sp = require("sdk/simple-prefs"); sp.on("sayhello", ...
...And 5 more matches
Downloading Files - Archive of obsolete content
cy = privatebrowsingutils.privacycontextfromwindow(urlsourcewindow); persist.persistflags = persist.persist_flags_from_cache | persist.persist_flags_replace_existing_files; persist.saveuri(uritosave, null, null, null, "", targetfile, privacy); if you don't need detailed progress information, you might be happier with nsidownloader. ...
...rcewindow); persist.persistflags = persist.persist_flags_from_cache | persist.persist_flags_replace_existing_files; persist.saveuri(uritosave, null, null, null, "", targetfile, privacy); if you don't need detailed progress information, you might be happier with nsidownloader. ...
...i = services.io.newuri(aurltodownload, null, null); // obtain the privacy context of the browser window that the url // we are downloading comes from. if, and only if, the url is not // related to a window, null should be used instead. ...
...And 5 more matches
JavaScript Daemons Management - Archive of obsolete content
ck of all events started and then to stop them when appropriate through the cleartimeout() function. a possible approach to solve this problem is to nest all the information needed by each animation to start, stop, etc. in different objects (daemons) and then to create a constructor for such a class of objects (daemon) in order to standardize and simplify the instantiation of them. note: a minima
listic version of it (minidaemon) is published here. this more complex version of it is nothing but a big and scalable collection of methods for the daemon constructor. 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. so the minidaemon framework will remain the recommended way ...
...this module requires daemon.js to work. you can safely remove all or some of these methods, depending on your needs (modularity). when a method requires the presence of another method (it is relatively rare), there is a comment which explains why. if there are not comments to that method it depends only on the base system. /*\ |...
...a false value, the daemon will be paused. mydaemon.rate the time lapse (in number of milliseconds) between each invocation (read/write). mydaemon.length the total number of invocations. it can be a positive integer or infinity (read/write). mydaemon.reversals the number of times the daemon must be restarted (read/write). set it to infinity for a “loop mode”. mydaemon.onstart the start
listener (read/write). it will be called with three arguments: index (the iterative index of each invocation), length (the number of total invocations assigned to the daemon - finite or infinity), and backwards (a boolean expressing whether the process is going backwards or not). mydaemon.onstop the stop
listener (read/write). it will be called with three arguments: index (the iterative index of e...
...And 5 more matches
JavaScript Client API - Archive of obsolete content
erns the synchronizing of a specific set of information. e.g. there is an engine for bookmarks, tabs, history, preferences, etc. record piece of information that gets synchronized. records are transformed to wbo's, uploaded to a collection in a sync server and eventually downloaded by other sync clients. tracker entity that tracks changes to data. each engine has a corresponding tracker which
listens for changes to data or events it is interested in. when something of interest occurs, it interacts with the engine to let it know something has happened and it might want to take action store entity that serves as a data store/proxy for information in an engine. the name store is somewhat of a misnomer, as stores don't actually persistently store anything, but rather serve as short-lived dat...
...ponsibility to instantiate a record object, assign the given guid, and return it. itemexists(guid) should simply return true if an item with the given guid exists in the store, false otherwise. changeitemid(oldid, newid) must find the stored item currently associated with the guid oldid and change it to be associated with the guid newid. getallids() must return an iterable
list containing the guids of every item being stored on the local system. this can be a dictionary-type object where the keys are the guids and the values are whatever; or it can simply be a
list of guids. this is the method that the engine will call the first time it syncs, in order to get a complete inventory of what data there is that will need to be uploaded to the server. unless the items you're ...
... look up the data corresponding to this guid, by the mapping // you've defined. // set the data and the guid on the new record: record.bar = 17; // or whatever record.id = guid; // return the record return record; }, changeitemid: function(oldid, newid) { // find the item with guid = oldid and change its guid to newid. }, getallids: function() { // return a
list of the guids of all items. invent guids for any items // that don't have them already, and remember the mapping for later use. }, wipe: function() { // delete everything! }, create: function(record) { // create a new item based on the values in record }, update: function(record) { // look up the stored record with id = record.id, then set // its values to those of...
...And 5 more matches
XUL Events - Archive of obsolete content
« xul reference home the following tables and sections describe the event handler that are valid for most xul elements. the events
listeners can be attached using addevent
listener and removed using removeevent
listener. some of the events can be attached using attributes as well. when attaching event
listeners using attributes, be aware that only one
listener can be attached at a time. any previously attached
listeners are disconnected. the attribute name is the event name with an 'on' prefix. xul event reference subpages broadcastthe broadcast event is executed when the attributes of the element (such as a broadcaster) being
listened to are changed. the event handler should be placed on an observer.checkboxstatechangethe checkboxstatechange event is e...
...nt. you can use this event to provide feedback to the user. attribute: onmouseover mouseup this event is sent when the mouse is released on an element. attribute: onmouseup select this event is sent to a
listbox or tree when an item is selected. attribute: onselect unload this event is sent to a window when the window has closed. this is done after the close event. you should place this event handler on the window element. attribute: onunload mutat...
...otified of document changes. domnoderemoved this event is sent when a node is removed from an element. if you capture this event at the document level, you can be notified of document changes warning: it should be noted that the addition of any mutation event
listeners to a document degrades the performance of subsequent dom operations in that document, and that removing the
listeners later does not mitigate or reverse the effect. see mutation events for more details and mutation observers for a more efficient alternative. common xul events event description ...
...And 5 more matches
Introduction to XUL - Archive of obsolete content
s will respond to the mouse; toolbars will act as containers for buttons. the effect a widget will have on its application will be defined as a combination of predefined application behaviour and linkage between the widgets. this linkage can be accomplished by including javascript in the xul, or by application code which walks the content model after it has been built from xul, and hooks up event
listeners. generally a real application will use some combination of the two. applications, for instance, will have preconceived notions of what to do when they receive an "open file" command. an "open" button is simply a button. it will send its command to the application for processing, generally using some simple javascript for linkage. we are at first primarily concerned with the obvious ui comp...
... since xul is a language for describing window layout, there is some overlap in the topics covered by this document and a separate document describing ...
... since xul is a language for describing window layout, there is some overlap in the topics covered by this document and a separate document describing xul windows. ...
...And 5 more matches
PopupEvents - Archive of obsolete content
this event will be fired even for elements that don't have a context menu associated with them. for more information about how to use this event, see context menu events. popupshowing this event is fired on a menupopup, panel or tooltip just before it is made visible. this event is most commonly used to add or adjust items on the popup based on the context. ...
... popuphidden this event is fired on a menupopup, panel or tooltip once it has been hidden. the popupshowing event just before a popup is about to be displayed, a popupshowing event will fired on the popup. this will occur regardless of how the popup is opened, either from user interaction or from a script calling the openpopup or openpopupatscreen methods. the typical usage of a
listener of the popupshowing event is to adjust the content of the popup based on context. for instance, right clicking on an image might display items on a context menu pertaining to images, whereas clicking on a link would display only those items pertaining to links. within the
listener for the popupshowing event, you can append to or modify the menu as needed before it is displayed. for examples o...
...ple, a label within a panel is initialized with the current time. <panel id="time-panel" onpopupshowing="this.lastchild.value = (new date()).tolocaleformat('%t')"> <label value="time:"/> <label id="time"/> </panel> <toolbarbutton label="show time" popup="time-panel"/> you can prevent a menu or popup from appearing by calling the preventdefault method of the event from within a popupshowing
listener. the default operation of the popupshowing event is to continue showing the popup. the preventdefault method will stop this from happening and the popup will not be opened. <menu label="edit"> <menupopup onpopupshowing="if (gdisallowed) event.preventdefault();"> <menuitem label="undo"/> <menuitem label="redo"/> </menupopup> </menu> in this example, a global variable gdisallowed i...
...And 5 more matches
PopupKeys - Archive of obsolete content
on linux and the macintosh, disabled items within the menu are skipped over when navigating with the cursor keys. cursor left/right when a menu is selected, cursor right opens the menu, while a cursor left closes a menu. in a menubar, cursor left and right will cycle between top level menus. ...
...on linux and the macintosh, disabled items within the menu are skipped over when navigating with the cursor keys. cursor left/right when a menu is selected, cursor right opens the menu, while a cursor left closes a menu. in a menubar, cursor left and right will cycle between top level menus. ...
...n, only one level of menus is closed. tab/f10 closes all menus in a chain of submenus. when letter keys are pressed, the accesskeys within the menu are selected. if an access key is a pressed that does not correspond to an item within the menu, items that don't have access keys can be selected if the key pressed corresponds to the first letter of the label. other keys are ignored by the menu key
listener, however, the event does not propagate to the main window. this is because the key
listener is a capturing
listener attached to the document. for a panel, the only key that is handled by default is the escape key to close the panel. the other keys do not apply. focus in popups a menu does not take the keyboard focus. the menu key
listener described above captures key events on the document. ...
...And 5 more matches
Static Content - Archive of obsolete content
« previousnext » creating a menuitem in the filter
list to show all items is fairly easy. this item doesn't need to be generated from the datasource. instead it will be what is called static content in a template. the static content is any content that is a sibling of the template element. this content is displayed as is without affecting the generated content from the template. ...
... « previousnext » creating a menuitem in the filter
list to show all items is fairly easy. this item doesn't need to be generated from the datasource. instead it will be what is called static content in a template. the static content is any content that is a sibling of the template element. this content is displayed as is without affecting the generated content from the template. ...
...the template generates two results as before, one for each c...
...And 5 more matches
Adding Event Handlers - Archive of obsolete content
s generated, and sent first to the window, followed by the document, and then the box. that completes the capturing phase. next, the 'mousemove' event is sent to the button. finally, the bubbling phase causes the event to be sent to the box, document and window. the bubbling phase is essentially the reverse of the capturing phase. note that some events don't do the bubbling phase. you can attach
listeners to each element to
listen to the events during each step of event propagation. due to the way a single event is passed to all the ancestors, you may attach a
listener to a specific element or to an element higher in the hierarchy. naturally, an event attached to an element higher up will receive notification of all elements inside it, whereas an event attached to a button will only receive e...
...n a user activates an element, for example by pressing a button, changing a checkbox or selecting an item from a menu. the command event is a useful event since it automatically handles different ways of activating the element. for example, the command event will occur regardless of whether the user uses the mouse to click a button, or presses the enter key. there are two ways to attach an event
listener to an element. first, by using an attribute with a script as its value. second, by calling an element's addevent
listener method. the former may only handle bubbling events but tends to be simpler to write. the latter can handle events at any phase and may also be used to attach multiple
listeners for an event to an element. using the attribute form is more common for most events. attribute e...
...for example, the corresponding attribute for the 'command' event is 'oncommand'. ...
...And 5 more matches
Trees - Archive of obsolete content
« previousnext » xul provides a way to create tabular or hierarchical
lists using a tree. the tree one of the more complex elements in xul is the tree. a tree may be used to display rows of text in columns. it can be used with rows either in a flat
list or arranged into a hierarchy. a tree also allows the user to rearrange, resize and hide individual columns. some examples of trees include the
list of messages in a mail application, or the bookmarks window in mozilla. in some ways, a tree has some similarities with the
listbox. both can be used to create tables of data with multiple rows and columns, and both may contain column headers. ...
...(using advanced features, progress meters or checkboxes also can be added to the tree) a tree consists of two parts, the set of columns, and the tree body. ...
...(using advanced features, progress meters or checkboxes also can be added to the tree) a tree consists of two parts, the set of columns, and the tree body. ...
...And 5 more matches
menuitem - Archive of obsolete content
if this...
...sskey, command, control, crop, disabled, image, label, labelelement, parentcontainer, selected, tabindex, value style classes menuitem-iconic, menuitem-non-iconic examples <menu
list> <menupopup> <menuitem label="option 1" value="1"/> <menuitem label="option 2" value="2"/> <menuitem label="option 3" value="3"/> <menuitem label="option 4" value="4"/> </menupopup> </menu
list> attributes acceltext type: string text that appears beside the menu label to indicate the shortcut key (accelerator key) to use to invoke the command. if this value is set, it overrides an assigned key set in the key attribute. this attribute does not apply to menus directly on the menubar. accesskey type: character this should be set to a character that is u...
...nd orient attributes. note: the menuitem must have a class of menuitem-iconic for the image to appear. key type: id set to the id of a key element whose key shortcut is displayed in the menuitem. label type: string the label that will appear on the element. if this is left out, no text appears. for an editable menuitem element the value of this attribute is copied to the menu
list.value property upon user selection of the menuitem. name type: string name radio menuitems with the same name as put into a group. only one menuitem in each radio group can be checked at a time. selected type: boolean indicates whether the element is selected or not. this value is read-only. to change the selection, set either the selectedindex or selecteditem property of the ...
...And 5 more matches
prefwindow - Archive of obsolete content
atforms) setting it. for animatefadein to work properly, contents of prefpanes should be put into overlays. note for mac os x: a common way of opening modal windows on mac os x that are not attached as a sheet to the main window is to use nsiwindowwatcher.openwindow() with a null parentwindow. this does not work with prefwindows, breaking the general behavior of the window and in particular the
list of prefpanes. prefer the classical window.opendialog() with the following window features: "chrome,titlebar,toolbar,centerscreen,dialog=yes". attributes buttonalign, buttondir, buttonorient, buttonpack, buttons, defaultbutton, lastselected, onbeforeaccept, ondialogaccept, ondialogcancel, ondialogdisclosure, ondialoghelp, onload, onunload, title, type properties buttons, currentpane, defa...
...the align attribute for the box containing the buttons. buttondir type: string the value of the dir attribute for the box containing the buttons. buttonorient type: string the value of the orient attribute for the box containing the buttons. buttonpack type: string the value of the pack attribute for the box containing the buttons. buttons type: comma-separated
list of the values below a comma-separated
list of buttons to appear in the dialog box. the buttons will be placed in suitable locations for the user's platform and basic event handling will be performed automatically. the following values can be used in the
list: accept: the ok button, which will accept the changes when pressed. this button will also be the default button. cancel: the ca...
... title type: string the text to appear in the title bar of the window. type type: string set this attribute to child for preference dialogs that are child dialogs of a main preferences window. this ensures that the preferences are only saved when the main dialog is closed, if this is the appropriate behaviour for the platform. properties buttons type: comma-separated
list of the values below a comma-separated
list of buttons to appear on the dialog box. the buttons will be placed in suitable locations for the user's platform and basic event handling will be performed automatically. the following values can be used in the
list: accept: the ok button, which will accept the changes when pressed. this button will also be the default button. cancel: the ca...
...And 5 more matches
Archived Mozilla and build documentation - Archive of obsolete content
mozilla configurator ankh8 automatically handle failed asserts in debug builds as of 2004-12-8, it is now possible to automatically handle failed asserts in debug builds of mozilla for windows. blackconnect blackwood bonsai it is a tool that lets you perform queries on the contents of a cvs archive; you can: get a
list of checkins, see what checkins have been made by a given person, or on a given cvs branch, or in a particular time period. it also includes tools for looking at checkin logs (and comments); doing diffs between various versions of a file; and finding out which person is responsible for changing a particular line of code ("cvsblame"). bookmark keywords pr...
...owsers. creating a hybrid cd creating a microsummary a microsummary generator is a set of instructions for creating a microsummary from the content of a page. web pages can reference generators via <link rel="microsummary"> elements in their <head> elements. generators can also be independently downloaded and installed by users if they include a
list of pages to which they apply. creating a mozilla extension a mozilla extension is an installable enhancement to the mozilla browser that provides additional functionality (for example linky, which adds an item to the context menu for opening multiple links in a document or selection). this tutorial walks you through the process of building a mozilla ext...
... comments, ideas, questions and other discussion should be added on the devmo talk:1.0 launch roadmap page. further details on smaller tasks being done are available at user:dria:todo page. see also current events. download manager improvements in firefox 3 firefox 3 offers improvements to the download manager that allow multiple progress
listeners, use of the storage api for data management, download resuming, and more. in addition, you can augment or replace the download manager's user interface by implementing the new nsidownloadmanagerui interface. download manager preferences there are several preferences used by the download manager. this article provides a
list of them. drag and drop ...
...And 5 more matches
Theme changes in Firefox 2 - Archive of obsolete content
theme to work properly in firefox 2. note: we could use an article called updating themes for firefox 2 that would serve as a how-to guide for updating themes. if anyone with theming experience would like to write one, please do! browser changes requiring theme updates there are a number of changed and deleted files in the browser that may require you to make changes to your theme. the table
lists both the changed xul file and the theme's corresponding css file that you might need to update. filename css file details browser/base/searchdialog.xul browser/base/content/searchdialog.css removed from firefox 2. feeds/addfeedreader.xul feeds/addfeedreader.css new file that presents ui for adding a new feed reader. feeds/subscribe.xhtml ...
...sing/browser-protection.css new file containing the overlay that's drawn over the browser when you browse to a suspected phishing site. search/enginemanager.xul enginemanager.css new file containing the ui for the search engine manager window. toolkit/mozapps/preferences/fontscaling.xul - removed from firefox 2. changes to the default theme the table below
lists all the changes made in the default theme for firefox 2; you can use this information as a starting point for figuring out the changes you need to make. file description of change browser/bookmarks/addbookmark.css updated to include microsummary-related css changes. browser/bookmarks/bookmarksproperties.css new file; includes microsummary-related css. ...
...enabled in the add-ons manager. mozapps/extensions/notifybadges.png new file; contains the icons used ito badge the icons for add-ons in the add-on manager window to indicate their status. these look like this in the default theme: the first icon (green here) indicates that an add-on has an update available. the second icon (yellow here)appears to be used for block
listed items; trying to confirm. the third icon (red here) indicates that an add-on is disabled, either by the user or because it's incompatible with the application. the fourth icon (blue here)(not sure what this one means). mozapps/extensions/question.png new file; used in the add-ons manager when you check for updates. if no updates are found, this icon is displayed a...
...And 5 more matches
Reference - Archive of obsolete content
cated_header --nickolay 00:58, 26 aug 2005 (pdt) hmm, that was a bad question. what i meant to ask is: what markup should i use for bad examples (which aren't necessarily deprecated), i.e. examples that show what not to do? --maian 02:07, 26 aug 2005 (pdt) oh, i don't think so, but you can ask dria to create a css class for that. --nickolay 11:50, 26 aug 2005 (pdt) i'll add it to my todo
list for the new skins. i have to go through them again this weekend to fix up some stuff anyhow. good idea, maian. thanks :) -- dria 21:06, 26 aug 2005 (pdt) coding style should semicolons be added to all the examples? --maian 21:06, 25 aug 2005 (pdt) the original authors didn't use semicolons, but i'd add them. --nickolay 00:58, 26 aug 2005 (pdt) (more coding style questions) --maian 04:06,...
...ine, but a dom feature (probably non-standard). --nickolay 08:31, 22 september 2005 (pdt) what's funny is that this talk page shows up first in a google search for "btoa javascript". this is number 2. it's not in the ecma docs. if it's not in a standard, and that sun doc is corrent, then it should probably go in the window object methods. --jonnyq i've already added those methods in the methods
listing, but i haven't defined them yet. --maian 02:39, 21 october 2005 (pdt) delete? i don't see any mention in the operators section for the delete operator. did this operator get removed/deprecated, or is it missing from the documentation? brundlefly 13:15, 19 december 2005 (pst) neither: core javascript 1.5 reference:operators:special operators:delete operator --nickolay 14:48, 19 decembe...
...fortunately there is not an [easy] method to download content/packages of content off of devmo for 'local' browsing/viewing/printing, yet. it is in the "nice to have" category for us here, however i am unaware of anyone feverishly working on it. (there are some other priorities ahead of that, imho). if downloading the stuff is your priority you are free to field ideas/concept to the devmo mailing
list for discussion, and then actually code it (or find someone to do so). thanks for your thoughts --callek 15:05, 13 january 2006 (pst) notification when reorganization is finished leandro (localiser for the portuguese wiki) would like to be emailed when the js reference reorganization has been finished. his user page is here: http://developer.mozilla.org/pt/docs...%c3%aas_xavier -- dria 08:19, 2...
...And 5 more matches
Common causes of memory leaks in extensions - Extensions
instead be stored in an object which is specific to that document, and cleaned up when the document is unloaded, or stored as weak references. be careful with setinterval/settimeout using window.setinterval() or window.settimeout() can be problematic, too, when it comes to zombie compartments. consider the following example code that could be part of your browser.xul overlay: gbrowser.addevent
listener("domcontentloaded", function(evt) { var contentdoc = evt.originaltarget; var i = 0; // refresh the title once each second setinterval(function() { contentdoc.title = ++i; }, 1000); }, false); one would normally expect that the interval (or timer) would be destroyed as soon as the document unloads, in the same way that event
listeners are automatically destroyed. however, whil...
..., therefore leaking the content document and the associated window and compartment. if your add-on makes use of long-lived timeouts or uses window.setinterval(), you need to take special care to ensure your code won't accidentally leak content windows. therefore, your add-on should clean up such intervals and timeouts when the corresponding content document is unloaded, by adding an unload event
listener or by similar means. 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. problems in bootstrapped (restartless) add-ons bootstrapped extensions use a boot...
...rtment. a.someproperty = leakref; } function modifydocument2(document) { // the "body" dom node holding a reference to leakref will prevent // that function object from being garbage collected and hence // will leak the whole bootstrap compartment. document.body.someproperty = leakref; } see also kris maglione's guide to cleaning up bootstrapped extensions. ...
...And 5 more matches
Example 3 - Learn web development
that explain how to build custom form widgets. ...
...pple</li> </ul> </div> </form> css content .widget select, .no-widget .select { position : absolute; left : -5000em; height : 0; overflow : hidden; } /* --------------- */ /* required styles */ /* --------------- */ .select { position: relative; display : inline-block; } .select.active, .select:focus { box-shadow: 0 0 3px 1px #227755; outline: none; } .select .opt
list { position: absolute; top : 100%; left : 0; } .select .opt
list.hidden { max-height: 0; visibility: hidden; } /* ------------ */ /* fancy styles */ /* ------------ */ .select { font-size : 0.625em; /* 10px */ font-family : verdana, arial, sans-serif; -moz-box-sizing : border-box; box-sizing : border-box; padding : 0.1em 2.5em 0.2em 0.5em; /* 1px 25px 2px 5px */ ...
...cal-align: top; } .select:after { content : "ā¼"; position: absolute; z-index : 1; height : 100%; width : 2em; /* 20px */ top : 0; right : 0; padding-top : .1em; -moz-box-sizing : border-box; box-sizing : border-box; text-align : center; border-left : .2em solid #000; border-radius: 0 .1em .1em 0; background-color : #000; color : #fff; } .select .opt
list { z-index : 2;
list-style: none; margin : 0; padding: 0; background: #f0f0f0; border: .2em solid #000; border-top-width : .1em; border-radius: 0 0 .4em .4em; box-shadow: 0 .2em .4em rgba(0,0,0,.4); -moz-box-sizing : border-box; box-sizing : border-box; min-width : 100%; max-height: 10em; /* 100px */ overflow-y: auto; overflow-x: hidden; } .select .option { pa...
...And 5 more matches
Cooperative asynchronous JavaScript: Timeouts and intervals - Learn web development
a few lines of code. settimeout() returns an identifier value that can be used to refer to the timeout later, such as when you want to stop it. see clearing timeouts (below) to learn how to do that. passing parameters to a settimeout() function any parameters that you want to pass to the function being run inside the settimeout() must be passed to it as additional parameters at the end of the
list. for example, you could refactor the previous function so that it will say hi to whatever person's name is passed to it: function sayhi(who) { alert(`hello ${who}!`); } now, you can pass the name of the person into the settimeout() call as a third parameter: let mygreeting = settimeout(sayhi, 2000, 'mr. universe'); clearing timeouts finally, if a timeout has been created, you can cancel i...
...click ok on the first alert. settimeout(function() { alert('world'); }, 0); alert('hello'); this can be useful in cases where you want to set a block of code to run as soon as all of the main thread has finished running — put it on the async event loop, so it will run straight afterwards. clearing with cleartimeout() or clearinterval() cleartimeout() and clearinterval() both use the same
list of entries to clear from. interestingly enough, this means that you can use either method to clear a settimeout() or setinterval(). for consistency, you should use cleartimeout() to clear settimeout() entries and clearinterval() to clear setinterval() entries. this will help to avoid confusion. requestanimationframe() requestanimationframe() is a specialized looping function created for runnin...
... some hints: a click event handler can be added to most elements, including the document <body>. it makes more sense to put it on the <body> element if you want to maximize the clickable area — the event bubbles up to its child elements. you'll want to add a tracking variable to check whether the spinner is sp...
...And 5 more matches
Manipulating documents - Learn web development
ent because it allows you to select elements using css selectors. the above queryselector() call will match the first <a> element that appears in the document. if you wanted to match and do things to multiple elements, you could use document.queryselectorall(), which matches every element in the document that matches the selector, and stores references to them in an array-like object called a node
list. there are older methods available for grabbing element references, such as: document.getelementbyid(), which selects an element with a given id attribute value, e.g. <p id="myid">my paragraph</p>. the id is passed to the function as a parameter, i.e. const elementref = document.getelementbyid('myid'). document.getelementsbytagname(), which returns an array-like object containing all the ele...
...hildnode.remove(): linkpara.remove(); this method is not supported in older browsers. they have no method to tell a node to remove itself, so you'd have to do the following. linkpara.parentnode.removechild(linkpara); have a go at adding the above lines to your code. manipulating styles it is possible to manipulate css styles via javascript in a variety of ways. to start with, you can get a
list of all the stylesheets attached to a document using document.stylesheets, which returns an array-like object with cssstylesheet objects. you can then add/remove styles as wished. however, we're not going to expand on those features because they are a somewhat archaic and difficult way to manipulate style. there are much easier ways. the first way is to add inline styles directly onto elements yo...
...n our sizing code each time it changes. add the following to the bottom of your code: window.onresize = function() { winwidth = window.innerwidth; winheight = window.innerheight; div.style.width = winwidth + 'px'; div.style.height = winheight + 'px'; } note: if you get stuck, have a look at our finished window resize example (see it live also). active learning: a dynamic shopping
list to round off the article, we'd like to set you a little challenge — we want to make a simple shopping
list example that allows you to dynamically add items to the
list using a form input and button. when you add an item to the input and press the button: the item should appear in the
list. each item should be given a button that can be pressed to delete that item off the
list. the input s...
...And 5 more matches
Debugging on Mac OS X
ed on launch" field. add "-p profilename", where profilename is the name of a profile you created previously. repeat that to also add the argument "-no-remote". also in the "arguments" panel, you may want to add an environment variable moz_debug_child_process set to the value 1 to help with debugging e10s. select "build" from the left of the scheme editor window, and check that there is nothing
listed under targets (otherwise it may cause problems when you try to run the executable for debugging since you will get build errors). click "close" to close the scheme editor. at this point you can run the application from xcode, and when you pause or hit breakpoints it should show open the correct source file at the correct line. setting up lldb lldb is the debugger xcode provides/uses. one...
...since you will get build errors). click "close" to close the scheme editor. at this point you can run the application from xcode, and when you pause or hit breakpoints it should show open the correct source file at the correct line. setting up lldb lldb is the debugger xcode provides/uses. one important issue that the mozilla .lldbinit file fixes is that by default some breakpoints will be
listed as "pending", and xcode will not stop at them. if you don't include the mozilla's .lldbinit, you must at least put settings set target.inline-breakpoint-strategy always in your $home/.lldbinit as recommended on debugging mozilla with lldb. the .lldbinit file in the source tree imports many useful mozilla specific lldb settings, commands and formatters into lldb, but you may need to take one o...
...intdelete(bp_loc.getbreakpoint().getid()) # for completeness, find and delete the dummy breakpoint (the breakpoint # lldb creates when it can't initially find the method to set the # breakpoint on): # bug workaround! getid() on the *dummy* breakpoint appears to be returning # the breakpoint index instead of its id. ...
...And 5 more matches
Embedding Tips
nd embedders may wish to render them in a way more appropriate for their application and platform.. how do i load a page? get thensiwebnavigation interface on your webbrowser and call the loaduri method with the appropriate uri and flags. this interface also has methods for reloading, stopping a load and going back and forward in the history. ...
...oad a page? ...
...iate uri and flags. this interface also has methods for reloading, stopping a load and going back and forward in the history. how do i block a load? implement the nsiwebprogress
listener interface and register it with the appropriate web browser object via the nsiwebbrowser::addwebbrowser
listener() method. use the callbacks for after-the-fact cancellation. alternatively, implement a nsiuricontent
listener as described below. how do i watch/intercept a load before it happens? implement the nsiuricontent
listener interface, and register it with the appropriate web browser object via the nsiwebbrowser::parenturicontent
listener attribute. watch for changes in nsiuricontent
listener::onstarturiopen(). you can abort the uri load at this point if you don't want it to proceed. if necessary you may al...
...And 5 more matches
Certificate functions
the public functions
listed here are used to interact with certificate databases. if documentation is available for a function
listed below, the function name is linked to either its mdc wiki page or its entry in the old ssl reference. the mozilla cross reference (mxr) link for each function provides access to the function definition, prototype definition, and source code references. the nss version column indicates which versions of nss support the function. ...
...ame is linked to either its mdc wiki page or its entry in the old ssl reference. the mozilla cross reference (mxr) link for each function provides access to the function definition, prototype definition, and source code references. the nss version column indicates which versions of nss support the function. ...
...later cert_addocspacceptableresponses mxr 3.6 and later cert_addokdomainname mxr 3.4 and later cert_addrdn mxr 3.2.1 and later cert_asciitoname mxr 3.2 and later cert_cachecrl mxr 3.10 and later cert_clearocspcache mxr 3.11.7 and later cert_certchainfromcert mxr 3.2 and later cert_cert
listfromcert mxr 3.2 and later cert_certtimesvalid mxr 3.2 and later cert_changecerttrust mxr 3.2 and later cert_checkcertvalidtimes mxr 3.2 and later cert_checknamespace mxr 3.12 and later cert_checkcertusage mxr 3.3 and later cert_comparename mxr 3.2 and later cert_comparevaliditytimes mxr ...
...And 5 more matches
nsIApplicationUpdateService
siupdateservice.idlscriptable this interface describes a global application service that handles performing background update checks. it also provides utilities for selecting and downloading update patches. ...
... this interface describes a global application service that handles performing background update checks. it also provides utilities for selecting and downloading update patches. ...
...ities for selecting and downloading update patches. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void adddownload
listener(in nsirequestobserver
listener); astring downloadupdate(in nsiupdate update, in boolean background); void pausedownload(); void removedownload
listener(in nsirequestobserver
listener); nsiupdate selectupdate([array, size_is(updatecount)] in nsiupdate updates, in unsigned long updatecount); attributes attribute type description backgroundchecker nsiupdatechecker the update checker being used for background update checking. read only. canapplyupdates boolean true if the update service can download and install updates. indicates if ...
...And 5 more matches
nsIDOMWindowUtils
nsidomelement elementfrompoint(in float ax, in float ay, in boolean aignorerootscrollframe, in boolean aflushlayout); void entermodalstate(); nsidomelement findelementwithviewid(in nsviewid aid); void focus(in nsidomelement aelement); void forceupdatenativemenuat(in astring indexstring); void garbagecollect([optional] in nsicyclecollector
listener a
listener); short getcursortype(); astring getdocumentmetadata(in astring aname); nsidomwindow getouterwindowwithid(in unsigned long long aouterwindowid); long getpccountscriptcount(); astring getpccountscriptsummary(in long ascript); astring getpccountscriptcontents(in long ascript); void getscrollxy(in boolean aflush...
... long ascript); void getscrollxy(in boolean aflushlayout, out long ascrollx, out long ascrolly); astring getvisiteddependentcomputedstyle(in nsidomelement aelement, in astring apseudoelement, in astring apropertyname); boolean isinmodalstate(); void leavemodalstate(); void loadsheet(in nsiuri sheeturi, in unsigned long type); nsidomnode
list nodesfromrect(in float ax, in float ay, in float atopsize, in float arightsize, in float abottomsize, in float aleftsize, in boolean aignorerootscrollframe, in boolean aflushlayout); void processupdates(); obsolete since gecko 13.0 void purgepccounts(); unsigned long redraw([optional] in unsigned long acount); void renderdocument(in nsconstrect arect, in ...
...led without universalxpconnect privileges. void forceupdatenativemenuat( in astring indexstring ); parameters indexstring garbagecollect() force a garbage collection followed by a cycle collection. will throw a dom security error if called without universalxpconnect privileges in non-debug builds. available to all callers in debug builds. void garbagecollect( in nsicyclecollector
listener a
listener optional ); parameters a
listener optional
listener that receives information about the cc graph (see @mozilla.org/cycle-collector-logger;1 for a logger component) getcursortype() get current cursor type from this window. short getcursortype(); parameters none. return value the current value of nscursor. getdocumentmetadata() function to get metadata associated with...
...And 5 more matches
nsIMsgDBHdr
ments); void setprioritystring(in string priority); unsigned long orflags(in unsigned long flags); unsigned long andflags(in unsigned long flags); void setreferences(in string references); acstring getstringreference(in long refnum); void setrecipientsarray(in string names, in string addresses,in unsigned long numaddresses); void setcc
listarray(in string names, in string addresses,in unsigned long numaddresses); void setbcc
listarray(in string names, in string addresses,in unsigned long numaddresses);new in thunderbird 3.1 [noscript] void getauthorcollationkey(out octetptr key, out unsigned long len); [noscript] void getsubjectcollationkey(out octetptr key, out unsigned long len); [noscript] void ...
...in the ui. if you want to know whether the message is the root of an ignored subthread then you should check for the ignored flag. any children of the ignored message will be marked as read when added to the database. priority nsmsgpriorityvalue indicates the priority of this message. flags unsigned long indicates the flags of the message. see nsmsgmessageflags for a
list of what may or may not be set on this message. note that the elided flag should not be set on messages, as it is a flag strictly dealing with the database view. threadid nsmsgkey indicates the id of the thread to which this message belongs. this property does not change the state of any thread objects, so only internal database code should set this attribute. messagekey ...
...e. date prtime indicates the date of this message; the equivalent header is the date: header. dateinseconds unsigned long readonly: indicates the date of this message as a unix timestamp. messageid string indicates the message id of this message, without angle brackets. if setting this value, outer angle brackets will be stripped if present. cc
list string indicates the cc
list of this message; the equivalent header is the cc: header. bcc
list string [new in .31] indicates the bcc
list of this message; the equivalent header is the bcc: header. author string indicates the author of this message; the equivalent header is the from: header. the value here will effectively be the unparsed version of the header. ...
...And 5 more matches
nsINavBookmarksService
older. long long createdynamiccontainer( in long long aparentfolder, in autf8string aname, in astring acontractid, in long aindex ); parameters aparentfolder the id of the parent folder. aname the name of the new folder. acontractid the contract id of the service which is to manipulate this container. aindex the index to insert at, or default_index to append to the end of the
list. return value returns the id of the newly-inserted folder. createfolder() this method creates a new child folder and inserts it under the given parent. long long createfolder( in long long aparentfolder, in autf8string name, in long index ); parameters aparentfolder the id of the parent folder. name the name of the new folder. index the index to insert at, or default_index t...
...he id of the newly-inserted folder. createfolder() this method creates a new child folder and inserts it under the given parent. long long createfolder( in long long aparentfolder, in autf8string name, in long index ); parameters aparentfolder the id of the parent folder. name the name of the new folder. index the index to insert at, or default_index to append to the end of the
list. return value returns the id of the newly-inserted folder. endupdatebatch() obsolete since gecko 1.9 (firefox 3) causes observers to be notified of an endupdatebatch when a batch is done changing. should match beginupdatebatch() or bad things will happen. void endupdatebatch(); parameters none. exportbookmarkshtml() obsolete since gecko 1.9 (fi...
...urn value native code only!getbookmarkfolderstarray obsolete since gecko 1.9 (firefox 3)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. tarray version of getbookmarkfolders() for ease of use in c++ code. pass in a reference to a tarray; it will get cleared and filled with the resulting
list of folder ids. void getbookmarkfolderstarray( in nsiuri auri, in print64array aresult ); parameters auri aresult returns an nsiuri representing the uri whose bookmark is to be retrieved. if there is no bookmarked page found, it will return null. this method retrieves the
list of bookmark ids that contain the given uri. void getbookmarkidsforuri( in nsiuri auri, out unsign...
...And 5 more matches
nsIPromptService
all flags are defined as unsigned long constants and can be accessed as components.interfaces.nsipromptservice.flagname from javascript and as nsipromptservice::flagname from c++. button position flags on linux and mac, button 2 is on the left of the prompt, while but...
...e shown. acheckstate contains the initial checked state of the checkbox when this method is called and the final checked state after this method returns. if you call this method from javascript you need to wrap this argument in an object with its 'value' property set to a boolean (or use an empty object). return value true for ok, false for cancel select() shows a dialog box with a
list box of strings from which the user may make a single selection. see also the select_example. boolean select( in nsidomwindow aparent, in wstring adialogtitle, in wstring atext, in pruint32 acount, [array, size_is(acount)] in wstring aselect
list, out long aoutselection ); aparent the parent window for the dialog. if set to null the parent window wi...
...if you call this method from javascript, this argument is wrapped in an object with an attribute named 'value' which holds the selected index. ...
...And 5 more matches
XPIDL Syntax
hat includes within comments or raw code fragments are not processed by xpidl. unlike the c preprocessor, when a file is included multiple times, it acts as if the subsequent includes did not happen; this prevents the need for include guards. xpidl syntax (abnf) the root production here is idl_file. ...
...events the need for include guards. xpidl syntax (abnf) the root production here is idl_file. ...
... production here is idl_file. ...
...And 5 more matches
Demo Addon
make use of fixiterator(). it is a handy library that keeps your code cleaner and simpler. it lets you iterate over any collection and transforms your collection elements in the given objects, to use fixiterator, you have to import it with cu.import("resource:///modules/iteratorutils.jsm");. demo 1 - iterate over all the accounts this demo is implemented in demo1.html in the content folder. it
lists all your email accounts with their account type - either pop3 or imap - and the associated email addresses. let data = []; for each (let account in fixiterator(mailservices.accounts.accounts, ci.nsimsgaccount)) { let info = { server: null, type: null, emails: [], name: null, }; let server = account.incomingserver; if (server) { info.serve...
...ccess the incomingserver property of our account, which is a nsimsgincomingserver object. from this, we get its name and type. because an account can have multiple identities of type nsimsgidentity and therefore multiple associated email addresses, with use fixiterator() again to go over all identities and get every email address. demo 2 - find the inbox this demo shows various information: it
lists all folders of an account (in this case the first one) and marks the inbox folder with a *. furthermore, it shows some messages in the inbox and
lists a random attachment. we start with
listing all folders and marking the inbox: let server = accounts[0].incomingserver; let folder = server.rootfolder; // ... let inbox; let print = function (indent, folder) { let isinbox = folder.getflag(ci.
...mple, we get the incomingserver of the account in question. beginning with the rootfolder, with folder.getflag(ci.nsmsgfolderflags.inbox) we check whether the folder is the inbox. then we store the folder name in a string to display it later on the screen and mark it with an * if it is the inbox. afterwards, we check every folder for subfolders. we then go into each subfolder and start over. to
list some messages of the folder we use: for each (let msghdr in fixiterator(inbox.msgdatabase.enumeratemessages(), ci.nsimsgdbhdr)) { if (++i >= 10 && lastmsghdr != null) break; messages.push({ author: msghdr.mime2decodedauthor, subject: msghdr.mime2decodedsubject, date: new date(msghdr.date/1000), }); //... } to get a collection of messages in the in...
...And 5 more matches
about:debugging - Firefox Developer Tools
in firefox 76 and above, the message can look like the following: see connection for firefox for android 68 for more information. in the image above, there are three tabs open: network or cache recipe, nightly home, and about nightly. to debug the contents of one of these tabs, click the inspect button next to its title. when you do, the developer tools open in a new tab. above the usual
list of tools, you can see information about the device you are connected to, including the fact that you are connected (in this example) via usb, to firefox preview, on a pixel 2, as well as the title of the page that you are debugging, and the address of the page. starting in firefox 78, the url bar is editable, so that you can change the url used by the browser on the remote device, by typing in f...
...g 79), navigate backward or forward in the browsing history with the back and forward buttons. connecting over the network you can connect to a firefox debug server on your network, or on your debugging machine using the network location settings of the about:debugging page. enter the location and port on which the debugger server is running. ...
...e network location settings of the about:debugging page. enter the location and port on which the debugger server is running. when you do, it is added to the network locations
list along with the devices, as shown below: this firefox the this firefox tab combines the features of extensions, tabs, and workers into a single tab with the following sections: temporary extensions displays a
list of the extensions that you have loaded using the load temporary add-on button. extensions this section
lists information about the extensions that you have installed on your system. ...
...And 5 more matches
Background Tasks API - Web APIs
: darkgreen; } #progress { width: 100%; padding-top: 6px; } javascript content now that the document structure is defined, construct the javascript code that will do the work. 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. variable declarations let task
list = []; let totaltaskcount = 0; let currenttasknumber = 0; let taskhandle = null; these variables are used to manage the
list of tasks that are waiting to be performed, as well as status information about the task queue and its execution: task
list is an array of objects, each representing one task waiting to be run. totaltaskcount is a counter of the number of tasks that have been added to th...
...the task queue next, let's look at the way we manage the tasks that need to be performed. we're going to do this by creating a fifo queue of tasks, which we'll run as time allows during the idle callback period. enqueueing tasks first, we need a function that enqueues tasks for future execution. that function, enqueuetask(), looks like this: function enqueuetask(taskhandler, taskdata) { task
list.push({ handler: taskhandler, data: taskdata }); totaltaskcount++; if (!taskhandle) { taskhandle = requestidlecallback(runtaskqueue, { timeout: 1000 }); } schedulestatusrefresh(); } enqueuetask() accepts as input two parameters: taskhandler is a function which will be called to handle the task. taskdata is an object which is passed into the task handler as an input p...
...taskhandle = requestidlecallback(runtaskqueue, { timeout: 1000 }); } schedulestatusrefresh(); } enqueuetask() accepts as input two parameters: taskhandler is a function which will be called to handle the task. taskdata is an object which is passed into the task handler as an input parameter, to allow the task to receive custom data. to enqueue the task, we push an object onto the task
list array; the object contains the taskhandler and taskdata values under the names handler and data, respectively, then increment totaltaskcount, which reflects the total number of tasks which have ever been enqueued (we don't decrement it when tasks are removed from the queue). next, we check to see if we already have an idle callback created; if taskhandle is 0, we know there isn't an idle callbac...
...And 5 more matches
Advanced animations - Web APIs
we need to check if the x and y position of the ball is out of the canvas dimensions and invert the direction of the velo...
...we need to check if the x and y position of the ball is out of the canvas dimensions and invert the direction of the velocity vectors. to do so, we add the following checks to the draw method: if (ball.y + ball.vy > canv...
...); } }; function draw() { ctx.clearrect(0,0, canvas.width, canvas.height); ball.draw(); ball.x += ball.vx; ball.y += ball.vy; if (ball.y + ball.vy > canvas.height || ball.y + ball.vy < 0) { ball.vy = -ball.vy; } if (ball.x + ball.vx > canvas.width || ball.x + ball.vx < 0) { ball.vx = -ball.vx; } raf = window.requestanimationframe(draw); } canvas.addevent
listener('mouseover', function(e) { raf = window.requestanimationframe(draw); }); canvas.addevent
listener('mouseout', function(e) { window.cancelanimationframe(raf); }); ball.draw(); acceleration to make the motion more real, you can play with the velocity like this, for example: ball.vy *= .99; ball.vy += .25; this slows down the vertical velocity each frame, so that the ball will just b...
...And 5 more matches
Using channel messaging - Web APIs
er on to display confirmation messages that we will receive back from the <iframe>. ...
...receive back from the <iframe>. ...
... = document.getelementbyid('message-input'); var output = document.getelementbyid('message-output'); var button = document.queryselector('button'); var iframe = document.queryselector('iframe'); var channel = new messagechannel(); var port1 = channel.port1; // wait for the iframe to load iframe.addevent
listener("load", onload); function onload() { //
listen for button clicks button.addevent
listener('click', onclick); //
listen for messages on port1 port1.onmessage = onmessage; // transfer port2 to the iframe iframe.contentwindow.postmessage('init', '*', [channel.port2]); } // post a message on port1 when the button is clicked function onclick(e) { e.preventdefault(); port1.postmessage(input.value); } // handle messages received on port1 function onmessage(e) { output.i...
...And 5 more matches
ContentIndex.getAll() - Web APIs
the getall() method of the contentindex interface returns a promise that resolves with an iterable
list of content index entries. syntax var indexedcontent = contentindex.getall(); parameters this method receives no parameters. return value returns a promise that resolves with an array of contentdescription items. contentdescription each item returned is an object containing the following data: id: a unique string identifier. title: a string title for the item. used in user-visible
lists of content. title: a string title of the item. used in user-visible
lists of content. description: a string description of the item. used in user-visible
lists of content. url: a string containing the url of the corresponding html document. needs to be under the scope of the cu...
...f the source image. sizes: optional a string representation of the image size. type: optional the mime type of the image. exceptions no exceptions are thrown. if there are no items in the content index, an empty array is returned. ...
...esentation of the image size. type: optional the mime type of the image. exceptions no exceptions are thrown. if there are no items in the content index, an empty array is returned. examples the below example shows an asynchronous function that retrieves items within the content index and iterates over each entry, building a
list for the interface. ...
...And 5 more matches
Examples of web and XML development using the DOM - Web APIs
you can access these stylesheets and their rules individually using the stylesheet, style, and cssrule objects, as demonstrated in this example, which prints out all of the style rule selectors to the console. var ss = document.stylesheets; for(var i = 0; i < ss.length; i++) { for(var j = 0; j < ss[i].cssrules.length; j++) { dump(...
...n which the following three rules are defined: body { background-color: darkblue; } p { font-face: arial; font-size: 10pt; margin-left: .125in; } #lumpy { display: none; } this script outputs the following: body p #lumpy example 5: event propagation this example demonstrates how events fire and are handled in the dom in a very simple way. when the body of this html document loads, an event
listener is registered with the top row of the table. the event
listener handles the event by executing the function stopevent, which changes the value in the bottom cell of the table. however, stopevent also calls an event object method, event.stoppropagation, which keeps the event from bubbling any further up into the dom. note that the table itself has an onclick event handler that ought to displa...
...ropagation</title> <style> #t-daddy { border: 1px solid red } #c1 { background-color: pink; } </style> <script> function stopevent(ev) { c2 = document.getelementbyid("c2"); c2.innerhtml = "hello"; // this ought to keep t-daddy from getting the click. ...
...And 5 more matches
Introduction to the DOM - Web APIs
ied with a scripting language such as javascript. the w3c dom and whatwg dom standards are implemented in most modern browsers. many browsers extend the standard, so care must be exercised when using them on the web where documents may be accessed by various browsers with different doms. for example, the standard dom specifies that the getelementsbytagname method in the code below must return a
list of all the <p> elements in the document: const paragraphs = document.getelementsbytagname("p"); // paragraphs[0] is the first <p> element // paragraphs[1] is the second <p> element, etc. alert(paragraphs[0].nodename); all of the properties, methods, and events available for manipulating and creating web pages are organized into objects (for example, the document object that represents the docu...
... the structural representation of the document available from a single, consistent api. though we focus exclusively on javascript in this reference documentation, implementations of the dom can be built for any language, as this python example demonstrates: # python dom example import xml.dom.minidom as m doc = m.parse(r"c:\projects\py\chap1.xml") doc.nodename # dom property of document object p_
list = doc.getelementsbytagname("para") for more information on what technologies are involved in writing javascript on the web, see javascript technologies overview. accessing the dom you don't have to do anything special to begin using the dom. different browsers have different implementations of the dom, and these implementations exhibit varying degrees of conformance to the actual dom standard...
...he dom. element objects implement the dom element interface and also the more basic node interface, both of which are included together in this reference. in an html document, elements are further enhanced by the html dom api's htmlelement interface as well as other interfaces describing capabilities of specific kinds of elements (for instance, htmltableelement for <table> elements). node
list a node
list is an array of elements, like the kind that is returned by the method document.getelementsbytagname(). items in a node
list are accessed by index in either of two ways:
list.item(1)
list[1] these two are equivalent. in the first, item() is the single method on the node
list object. the latter uses the typical array syntax to fetch the second item in the
list. ...
...And 5 more matches
Traversing an HTML table with JavaScript and DOM Interfaces - Web APIs
> has two children. each <tbody>'s child (<tr>) has two children (<td>). finally, each <td> has one child: a text node. example: setting the background color of a paragraph getelementsbytagname(tagnamevalue) is a method available in any dom element or the root document element. when called, it returns an array with all of the element's descendants matching the tag name. ...
...y dom element or the root document element. when called, it returns an array with all of the element's descendants matching the tag name. the first element of the
list is located at position [0] in the array. ...
...hi</p> <p>hello</p> </body> javascript function set_background() { // get a
list of all the body elements (there will only be one), // and then select the zeroth (or first) such element mybody = document.getelementsbytagname("body")[0]; // now, get all the p elements that are descendants of the body mybodyelements = mybody.getelementsbytagname("p"); // get the second item of the
list of p elements myp = mybodyelements[1]; myp.style.background = "rgb(255,0,0)"; } in this example, we set the myp variable to the dom object for the second p element inside the body: first, we get a
list of all the body elements via mybody = document.getelementsbytagname("body")[0] since there is only one body element in any valid html document, this
list will have only one item, whic...
...And 5 more matches
Element: mouseenter event - Web APIs
are sent to the four elements of the hierarchy when the pointer reaches the text. a single mouseover event is sent to the deepest element of the dom tree, then it bubbles up the hierarchy until it is canceled by a handler or reaches the root. with deep hierarchies, the number of mouseenter events sent can be quite huge and cause significant performance problems. in such cases, it is better to
listen for mouseover events. combined with the corresponding mouseleave (which is fired at the element when the mouse exits its content area), the mouseenter event acts in a very similar way to the css :hover pseudo-class. examples the mouseover documentation has an example illustrating the difference between mouseover and mouseenter. mouseenter the following trivial example uses the mouseenter e...
...se exits its content area), the mouseenter event acts in a very similar way to the css :hover pseudo-class. examples the mouseover documentation has an example illustrating the difference between mouseover and mouseenter. mouseenter the following trivial example uses the mouseenter event to change the border on the div when the mouse enters the space alloted to it. it then adds an item to the
list with the number of the mouseenter or mouseleave event. html <div id='mousetarget'> <ul id="unordered
list"> <li>no events yet!</li> </ul> </div> css styling the div to make it more visible. #mousetarget { box-sizing: border-box; width:15rem; border:1px solid #333; } javascript var entereventcount = 0; var leaveeventcount = 0; const mousetarget = document.getelementbyid('mousetarge...
...the mouseenter or mouseleave event. html <div id='mousetarget'> <ul id="unordered
list"> <li>no events yet!</li> </ul> </div> css styling the div to make it more visible. ...
...And 5 more matches
MutationObserverInit.attributeFilter - Web APIs
erty is an array of strings specifying the names of the attributes whose values are to be monitored for changes. if this property is specified, there's no need to also set attributes to true, as it's implied. if the attributes permission is true but no attributefilter is included in the options object, all attributes' values are watched for changes. syntax var options = { attributefilter: [ "
list", "of", "attribute", "names" ] } value an array of domstring objects, each specifying the name of one attribute whose value is to be monitored for changes. there is no default value. if this property exists on the options object when the mutationobserver() constructor is used to create a new mutationobserver, attribute monitoring is enabled regardless of whether or not the attributes property...
...r not the attributes property is true. example in this example, a mutation observer is set up to watch for changes to the status and username attributes in any elements contained within a subtree that displays the names of users in a chat room. this lets the code, for example, reflect changes to users' nicknames, or to mark them as away from keyboard (afk) or offline. ...
...es property is true. example in this example, a mutation observer is set up to watch for changes to the status and username attributes in any elements contained within a subtree that displays the names of users in a chat room. this lets the code, for example, reflect changes to users' nicknames, or to mark them as away from keyboard (afk) or offline. ...
...And 5 more matches
Using the Notifications API - Web APIs
eral enough for compatibility with most system notification systems. examples one of the most obvious use cases for web notifications is a web-based mail or irc application that needs to notify the user when a new message is received, even if the user is doing something else with another application. many examples of this now exist, such as slack. we've written a real world example — a to-do
list app — to give more of an idea of how web notifications can be used. it stores data locally using indexeddb and notifies users when tasks are due using system notifications. download the to-do
list code, or view the app running live. requesting permission before an app can send a notification, the user must grant the application the right to do so. this is a common requirement when an api trie...
...esult) { console.log(result); }); this uses the promise-based version of the method. if you want to support older versions, you might have to use the older callback version, which looks like this: notification.requestpermission(); the callback version optionally accepts a callback function that is called once the user has responded to the request to display permissions. example in our todo
list demo, we include an "enable notifications" button that, when pressed, requests notification permissions for the app. <button id="enable">enable notifications</button> clicking this calls the asknotificationpermission() function: function asknotificationpermission() { // function to actually ask the permissions function handlepermission(permission) { // whatever the user answers, we mak...
...hod is available on requestpermission(). if so, we move on and return true. if it fails, we return false in the catch() {} block. creating a notification creating a notification is easy; just use the notification constructor. this constructor expects a title to display within the notification and some options to enhance the notification such as an icon or a text body. ...
...And 5 more matches
Pointer Lock API - Web APIs
terlock; // attempt to unlock document.exitpointerlock(); pointerlockchange event when the pointer lock state changes—for example, when calling requestpointerlock(), exitpointerlock(), the user pressing the esc key, etc.—the pointerlockchange event is dispatched to the document. this is a simple event and contains no extra data. ...
...or example, when calling requestpointerlock(), exitpointerlock(), the user pressing the esc key, etc.—the pointerlockchange event is dispatched to the document. this is a simple event and contains no extra data. ...
...ocked'); // do something useful in response } else { console.log('the pointer lock status is now unlocked'); // do something useful in response } } pointerlockerror event when there is an error caused by calling requestpointerlock() or exitpointerlock(), the pointerlockerror event is dispatched to the document. this is a simple event and contains no extra data. document.addevent
listener('pointerlockerror', lockerror, false); document.addevent
listener('mozpointerlockerror', lockerror, false); function lockerror(e) { alert("pointer lock failed"); } note: until firefox 50 the above events were prefixed with moz in firefox. extensions to mouse events the pointer lock api extends the normal mouseevent interface with movement attributes. two new attributes to mouse events—...
...And 5 more matches
Using readable streams - Web APIs
a function called readstream() is invoked to read the data back out of the stream again. we also close the stream, as we’ve stopped enqueuing chunks to it. ...
...ead the data back out of the stream again. we also close the stream, as we’ve stopped enqueuing chunks to it. ...
...gain. we also close the stream, as we’ve stopped enqueuing chunks to it. ...
...And 5 more matches
Using DTMF with WebRTC - Web APIs
not video. dialbutton and logelement these variables will be used to store references to the dial button and the <div> into which logging information will be written. they'll get set up when the page is first loaded. see initialization below. ...
... logelement these variables will be used to store references to the dial button and the <div> into which logging information will be written. they'll get set up when the page is first loaded. see initialization below. ...
... written. they'll get set up when the page is first loaded. see initialization below. initialization when the page loads, we do some basic setup: we fetch references to the dial button and the log output box elements, and we use addevent
listener() to add an event
listener to the dial button so that clicking it calls the connectanddial() function to begin the connection process. window.addevent
listener("load", function() { logelement = document.queryselector(".log"); dialbutton = document.queryselector("#dial"); dialbutton.addevent
listener("click", connectanddial, false); }); starting the connection process when the dial button is clicked, connectanddial() is called. this starts building the webrtc connection in preparation for sending the dtmf codes. function connectanddial() { ...
...And 5 more matches
Movement, orientation, and motion: A WebXR example - Web APIs
plied to convert them to simulate the viewer's current position and orientation. the fragment shader returns the color of each vertex, interpolating as needed from the values found in the texture and applying the lighting effects. starting up and shutting down webxr upon initially loading the script, we install a handler for the load event, so that we can perform initialization. ...
...or of each vertex, interpolating as needed from the values found in the texture and applying the lighting effects. starting up and shutting down webxr upon initially loading the script, we install a handler for the load event, so that we can perform initialization. ...
... event handlers, compiling and installing the glsl code for the vertex and fragment shaders, and attaching the webgl layer to the webxr session before kicking off the rendering loop. it gets called as the handler for the promise returned by issessionsupported(). ...
...And 5 more matches
Using the Web Animations API - Web APIs
from the other keys, we can specify an offset directly in the object, separated from the declaration with a comma. in the above example, to make sure that alice’s color changes at 30% (not 50%) for the color change, we are giving it offset: 0.3. currently, there should be at least two keyframes specified (representing the starting and ending states of the animation sequence). if your keyframe
list has only one entry, element.animate() may throw a notsupportederror exception in some browsers until they are updated. so to recap, the keys are equally spaced by default unless you specify an offset on a key. handy, no? representing timing properties we’ll also need to create an object of timing properties (an animationeffecttimingproperties object) corresponding to the values in alice’s ...
...illiseconds. the other thing you’ll notice is that it’s iterations, not iteration-count. there are a number of small differences between the terminology used in css animations and the terminology used in web animations. for instance, web animations doesn't use the string "infinite", but instead uses the javascript keyword infinity. and instead of timing-function we use easing. we aren’t
listing an easing value here because, unlike css animations where the default animation-timing-function is ease, in the web animations api the default easing is linear — which is what we want here. bring the pieces together now it’s time to bring them both together with the element.animate() method: document.getelementbyid("alice").animate( alicetumbling, alicetiming ) and boom: the anima...
..., so she gets bigger as the cupcake gets eaten. we can achieve this via the following function: var growalice = function() { // play alice's animation. alicechange.play(); // play the cake's animation. nommingcake.play(); } when a user holds their mouse down or presses their finger on the cake on a touch screen, we can now call growalice to make all the animations play: cake.addevent
listener("mousedown", growalice, false); cake.addevent
listener("touchstart", growalice, false); other useful methods in addition to pausing and playing, we can use the following animation methods: animation.finish() skips to the end of the animation. animation.cancel() aborts the animation and removes its effects. animation.reverse() sets the animation’s playback rate (animation.playbackrate)...
...And 5 more matches
Using XMLHttpRequest - Web APIs
tp requests in order to exchange data between the web site and a server. examples of both common and more obscure use cases for xmlhttprequest are included. to send an http request, create an xmlhttprequest object, open a url, and send the request. after the transaction completes, the object will contain useful information such as the response body and the http status of the result. function req
listener () { console.log(this.responsetext); } var oreq = new xmlhttprequest(); oreq.addevent
listener("load", req
listener); oreq.open("get", "http://www.example.org/example.txt"); oreq.send(); types of requests a request made via xmlhttprequest can fetch the data in one of two ways, asynchronously or synchronously. the type of request is dictated by the optional async argument (the third argumen...
...nt into a arraybuffer object, which stores the raw binary data. var oreq = new xmlhttprequest(); oreq.onload = function(e) { var arraybuffer = oreq.response; // not responsetext /* ... */ } oreq.open("get", url); oreq.responsetype = "arraybuffer"; oreq.send(); for more examples check out the sending and receiving binary data page monitoring progress xmlhttprequest provides the ability to
listen to various events that can occur while the request is being processed. this includes periodic progress notifications, error notifications, and so forth. support for dom progress event monitoring of xmlhttprequest transfers follows the specification for progress events: these events implement the progressevent interface. the actual events you can monitor to determine the state of an ongoing tra...
...ring of xmlhttprequest transfers follows the specification for progress events: these events implement the progressevent interface. the actual events you can monitor to determine the state of an ongoing transfer are: progress the amount of data that has been retrieved has changed. load the transfer is complete; all data is now in the response var oreq = new xmlhttprequest(); oreq.addevent
listener("progress", updateprogress); oreq.addevent
listener("load", transfercomplete); oreq.addevent
listener("error", transferfailed); oreq.addevent
listener("abort", transfercanceled); oreq.open(); // ... // progress on transfers from the server to the client (downloads) function updateprogress (oevent) { if (oevent.lengthcomputable) { var percentcomplete = oevent.loaded / oevent.total * 100;...
...And 5 more matches
ARIA live regions - Accessibility
while these changes are usually visually apparent to users who can see the page, they may not be obvious to users of assistive technologies. aria live regions fill this gap and provide a way to programmatically expose dynamic content changes in a way that can be announced by assistive technologies. ...
...="alert") on the element you want to announce changes to works as long as you add the attribute before the changes occur — either in the original markup, or dynamically using javascript. simple live regions dynamic content which updates without a page reload is generally either a region or a widget. simple content changes which are not interactive should be marked as live regions. ...
...regions are identified just like an id in a div, and multiple regions can be associated with a control using a space, e.g. aria-controls="myregionid1 myregionsid2". not known if the aria-controls aspect of live regions is implemented in current ats, or which. needs research. ...
...And 5 more matches
pad - CSS: Cascading Style Sheets
scription if a marker representation is smaller than the specified pad length, then the marker will be padded with the specified pad symbol. marker representations longer than the pad length are constructed as normal. pad descriptor takes the minimum marker length as an integer and a symbol to be used for padding as the second parameter. a common usage of the pad descriptor is when you need your
list to start numbering from 01 and go through 02, 03 and so on, instead of just 1, 2, 3... formal definition related at-rule@counter-styleinitial value0 ""computed valueas specified formal syntax <integer> && <symbol>where <symbol> = <string> | <image> | <custom-ident>where <image> = <url> | <image()> | <image-set()> | <element()> | <paint()> | <cross-fade()> | <gradient>where <image()> = image( ...
...ge-src> = <url> | <string><color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color><image-set-option> = [ <image> | <string> ] <resolution><id-selector> = <hash-token><cf-mixing-image> = <percentage>? && <image><cf-final-image> = <image> | <color><linear-gradient()> = linear-gradient( [ <angle> | to <side-or-corner> ]? ...
...color | <deprecated-system-color><image-set-option> = [ <image> | <string> ] <resolution><id-selector> = <hash-token><cf-mixing-image> = <percentage>? && <image><cf-final-image> = <image> | <color><linear-gradient()> = linear-gradient( [ <angle> | to <side-or-corner> ]? , <color-stop-
list> )<repeating-linear-gradient()> = repeating-linear-gradient( [ <angle> | to <side-or-corner> ]? , <color-stop-
list> )<radial-gradient()> = radial-gradient( [ <ending-shape> | <size> ]? [ at <position> ]? , <color-stop-
list> )<repeating-radial-gradient()> = repeating-radial-gradient( [ <ending-shape> | <size> ]? [ at <position> ]? , <color-stop-
list> )<conic-gradient()> = conic-gradient( [ from <angle> ]? [ at <position> ]?, <angular-color-stop-
list> )where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]? )...
...And 5 more matches
Using CSS animations - CSS: Cascading Style Sheets
each time. in the @keyframes, the width and margin-left are manipulated to make the element slide across the screen. ...
...d margin-left are manipulated to make the element slide across the screen. .slidein { animation-duration: 3s; animation-name: slidein; animation-iteration-count: 3; animation-direction: alternate; } @keyframes slidein { from { margin-left:100%; width:300% } to { margin-left:0%; width:100%; } } adding the animation event
listeners we’ll use javascript code to
listen for all three possible animation events. ...
...idein { animation-duration: 3s; animation-name: slidein; animation-iteration-count: 3; animation-direction: alternate; } @keyframes slidein { from { margin-left:100%; width:300% } to { margin-left:0%; width:100%; } } adding the animation event
listeners we’ll use javascript code to
listen for all three possible animation events. this code configures our event
listeners; we call it when the document is first loaded in order to set things up. ...
...And 5 more matches
Border-radius generator - CSS: Cascading Style Sheets
text; -ms-user-select: text; user-select: text; float: right; } javascript content 'use strict'; /** * ui-inputslidermanager */ var inputslidermanager = (function inputslidermanager() { var subscribers = {}; var sliders = []; var inputcomponent = function inputcomponent(obj) { var input = document.createelement('input'); input.setattribute('type', 'text'); input.addevent
listener('click', function(e) { this.select(); }); input.addevent
listener('change', function(e) { var value = parseint(e.target.value); if (isnan(value) === true) setvalue(obj.topic, obj.value); else setvalue(obj.topic, value); }); subscribe(obj.topic, function(value) { input.value = value + obj.unit; }); return input; } var slidercomponent = function sliderco...
...arget.value); if (isnan(value) === true) setvalue(obj.topic, obj.value); else setvalue(obj.topic, value); }); subscribe(obj.topic, function(value) { input.value = value + obj.unit; }); return input; } var slidercomponent = function slidercomponent(obj, sign) { var slider = document.createelement('div'); var startx = null; var start_value = 0; slider.addevent
listener("click", function(e) { setvalue(obj.topic, obj.value + obj.step * sign); }); slider.addevent
listener("mousedown", function(e) { startx = e.clientx; start_value = obj.value; document.body.style.cursor = "e-resize"; document.addevent
listener("mousemove", slidermotion); }); document.addevent
listener("mouseup", function(e) { document.removeevent
listener("mousemove", sl...
...checkbox.id = id; checkbox.setattribute('type', 'checkbox'); checkbox.checked = state; label.setattribute('for', id); if (name) { label.classname = 'text'; if (align) label.classname += ' ' + align; label.textcontent = name; } node.appendchild(checkbox); node.appendchild(label); this.node = node; this.topic = topic; this.checkbox = checkbox; checkbox.addevent
listener('change', function(e) { notify.call(this); }.bind(this)); buttons[topic] = this; } var getnode = function getnode(topic) { return buttons[topic].node; } var setvalue = function setvalue(topic, value) { try { buttons[topic].checkbox.checked = value; } catch(error) { console.log(error); } } var subscribe = function subscribe(topic, callback) { if (subscribers...
...And 5 more matches
animation - CSS: Cascading Style Sheets
lex: none; } .overlay { padding: .5em; } @keyframes slidein { from { transform: scalex(0); } to { transform: scalex(1); } } .a1 { animation: 3s ease-in 1s 2 reverse both paused slidein; } .a2 { animation: 3s linear 1s slidein; } .a3 { animation: 3s slidein; } .animation { background: #3f87a6; width: 100%; height: calc(100% - 1.5em); transform-origin: left center; } window.addevent
listener('load', function () { var animation = array.from(document.queryselectorall('.animation')); var button = array.from(document.queryselectorall('button')); function togglebutton (btn, type) { btn.class
list.remove('play', 'pause', 'restart'); btn.class
list.add(type); btn.title = type.touppercase(type); } function playpause (i) { var btn = button[i]; var anim = ...
...'play' : 'pause'); anim.style.ani...
... function togglebutton (btn, type) { btn.class
list.remove('play', 'pause', 'restart'); btn.class
list.add(type); btn.title = type.touppercase(type); } function playpause (i) { var btn = button[i]; var anim = animation[i]; if (btn.class
list.contains('play')) { anim.style.animationplaystate = 'running'; togglebutton(btn, 'pause'); } else if (btn.class
list.contains('pause')) { anim.style.animationplaystate = 'paused'; togglebutton(btn, 'play'); } else { anim.class
list.remove('a' + (i + 1)); settimeout(function () { togglebutton(btn, i === 0 ? ...
...And 5 more matches
box-shadow - CSS: Cascading Style Sheets
using: two, three, or four <length> values. if only two values are given, they are interpreted as <offset-x><offset-y> values. if a third value is given, it is interpreted as a <blur-radius>. if a fourth value is given, it is interpreted as a <spread-radius>. optionally, the inset keyword. optionally, a <color> value. to specify multiple shadows, provide a comma-separated
list of shadows. values inset if not specified (default), the shadow is assumed to be a drop shadow (as if the box were raised above the content). the presence of the inset keyword changes the shadow to one inside the frame (as if the content was depressed inside the box). inset shadows are drawn inside the border (even transparent ones), above the background, but below content. <offset-x> <off...
... <spread-radius> this is a fourth <length> value. positive values will cause the shadow to expand and grow bigger, negative values will cause the shadow to shrink. if not specified, it will be 0 (the shadow will be the same size as the element). <color> see <color> values for possible keywords and notations. if not specified, it defaults to currentcolor. ...
...rth <length> value. positive values will cause the shadow to expand and grow bigger, negative values will cause the shadow to shrink. if not specified, it will be 0 (the shadow will be the same size as the element). <color> see <color> values for possible keywords and notations. if not specified, it defaults to currentcolor. ...
...And 5 more matches
content - CSS: Cascading Style Sheets
l valuenormalapplies to::before and ::after pseudo-elementsinheritednocomputed valueon elements, always computes to normal. on ::before and ::after, if normal is specified, computes to none. ...
...nocomputed valueon elements, always computes to normal. on ::before and ::after, if normal is specified, computes to none. ...
...ge-src> = <url> | <string><color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color><image-set-option> = [ <image> | <string> ] <resolution><id-selector> = <hash-token><cf-mixing-image> = <percentage>? && <image><cf-final-image> = <image> | <color><linear-gradient()> = linear-gradient( [ <angle> | to <side-or-corner> ]? ...
...And 5 more matches
mask - CSS: Cascading Style Sheets
it is therefore recommended to use the mask shorthand rather than other shorthands or the individual properties to override any mask settings earlier in the cascade. this will ensure that mask-border has also been reset to allow the new styles to take effect. ...
...| <repeat-style> | <geometry-box> | [ <geometry-box> | no-clip ] | <compositing-operator> | <...
...| <repeat-style> | <geometry-box> | [ <geometry-box> | no-clip ] | <compositing-operator> | <masking-mode>wh...
...And 5 more matches
Event reference
otify code of interesting things that have taken place. 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. events can represent everything from basic user interactions to automated notifications of things happening in the rendering model. this article offers a
list of events that can be sent; some are standard events defined in official specifications, while others are events used internally by specific browsers; for example, mozilla-specific events are
listed so that add-ons can use them to interact with the browser. most common categories resource events event name fired when error a resource failed to load. abo...
...imary button only) has been pressed and released on an element. contextmenu the right button of the mouse is clicked (before the context menu is displayed). dblclick a pointing device button is clicked twice on an element. mousedown a pointing device button is pressed on an element. mouseenter a pointing device is moved onto the element that has the
listener attached. mouseleave a pointing device is moved off the element that has the
listener attached. mousemove a pointing device is moved over an element (fired continuously as the mouse moves). mouseover a pointing device is moved onto the element that has the
listener attached or onto one of its children. mouseout a pointing device is moved off the...
... mouseup a pointing device button is released over an element. pointerlockchange the pointer was locked or released. pointerlockerror it was impossible to lock the pointer for technical reasons or because the permission was denied. ...
...And 5 more matches
HTML attribute reference - HTML: Hypertext Markup Language
accesskey global attribute keyboard shortcut to activate or add focus to the element. action <form> the uri of a program that processes the information submitted via the form. ...
... accesskey global attribute keyboard shortcut to activate or add focus to the element. action <form> the uri of a program that processes the information submitted via the form. ...
... accesskey global attribute keyboard shortcut to activate or add focus to the element. action <form> the uri of a program that processes the information submitted via the form. ...
...And 5 more matches
Content negotiation - HTTP
owser (or any other kind of user-agent) sends several http headers along with the url. these headers describe the preferred choice of the user. the server uses them as hints and an internal algorithm chooses the best content to serve to the client. the algorithm is server-specific and not defined in the standard. see, for example, the apache negotiation algorithm. the http/1.1 standard defines
list of the standard headers that start server-driven negotiation (accept, accept-charset, accept-encoding, accept-language). though strictly speaking user-agent is not in this
list, it is sometimes also used to send a specific representation of the requested resource, though this is not considered as a good practice. the server uses the vary header to indicate which headers it actually used for conte...
...metimes also used to send a specific representation of the requested resource, though this is not considered as a good practice. the server uses the vary header to indicate which headers it actually used for content negotiation (or more precisely the associated response headers), so that caches can work optimally. in addition to these, there is an experimental proposal to add more headers to the
list of available headers, called client hints. client hints advertise what kind of device the user agent runs on (for example, if it is a desktop computer or a mobile device). even if server-driven content negotiation is the most common way to agree on a specific representation of a resource, it has several drawbacks: the server doesn't have total knowledge of the browser. even with the client hi...
...n where the client makes the choice, the server choice is always somewhat arbitrary. the information by the client is quite verbose (http/2 header compression mitigates this problem) and a privacy risk (http fingerprinting) as several representations of a given resource are sent, shared caches are less efficient and server implementations are more complex. the accept header the accept header
lists the mime types of media resources that the agent is willing to process. it is comma-separated
lists of mime types, each combined with a quality factor, a parameter indicating the relative degree of preference between the different mime types. the accept header is defined by the browser, or any other user-agent, and can vary according to the context, like fetching an html page or an image, a vid...
...And 5 more matches
Using Feature Policy - HTTP
feature policy allows you to control which origins can use which features, both in the top-level page and in embedded frames. essentially, you write a policy, which is an allowed
list of origins for each feature. for every feature controlled by feature policy, the feature is only enabled in the current document or frame if its origin matches the allowed
list of origins. for each policy-controlled feature, the browser maintains a
list of origins for which the feature is enabled, known as an allow
list. if you do not specify a policy for a feature, then a default allow
list will be used. the default allow
list is specific to each feature. the feature-policy header is still in an experimental state, and is subject to change at any time. be wary of this when implementing feature policy on your ...
...ist will be used. the default allow
list is specific to each feature. the feature-policy header is still in an experimental state, and is subject to change at any time. be wary of this when implementing feature policy on your website. writing a policy a policy is described using a set of individual policy directives. a policy directive is a combination of a defined feature name, and an allow
list of origins that can use the feature. features within a policy are separated by semicolons. allow
list an allow
list is a
list of origins that takes one or more of the following values, separated by spaces: *: the feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin. 'self': the feature will be allowed in this document, and in all nest...
...is disabled in top-level and nested browsing contexts. <origin(s)>: the feature is allowed for specific origins (for example, https://example.com). origins should be separated by a space. the values * (enable for all origins) or 'none' (disable for all origins) may only be used alone, while 'self' and 'src' may be used with one or more origins. features are each defined to have a default allow
list, which is one of: *: the feature is allowed by default in top-level browsing contexts and all nested browsing contexts (iframes). 'self': the feature is allowed by default in top-level browsing contexts and in nested browsing contexts (iframes) in the same origin. the feature is not allowed in cross-origin documents in nested browsing contexts. 'none': the feature is disabled in top-level an...
...And 5 more matches
Grammar and types - JavaScript
are added for clarity, not required. literals literals represent values in javascript. these are fixed values—not variables—that you literally provide in your script. this section describes the following types of literals: array literals boolean literals floating-point literals numeric literals object literals regexp literals string literals array literals an array literal is a
list of zero or more expressions, each of which represents an array element, enclosed in square brackets ([]). when you create an array using an array literal, it is initialized with the specified values as its elements, and its length is set to the number of arguments specified. the following example creates the coffees array with three elements and a length of three: let coffees = ['french roast',...
...ecify all elements in an array literal. if you put two commas in a row, the array fills in the value undefined for the unspecified elements. ...
...the unspecified elements. the following example creates the fish array: let fish = ['lion', , 'angel']; this array has two elements with values and one empty element: fish[0] is "lion" fish[1] is undefined fish[2] is "angel" if you include a trailing comma at the end of the
list of elements, the comma is ignored. in the following example, the length of the array is three. there is no my
list[3]. all other commas in the
list indicate a new element. ...
...And 5 more matches
Indexed collections - JavaScript
for example, consider an array called emp, which contains employees' names indexed by their numerical employee number. so emp[0] would be employee number zero, emp[1] employee number one, and so on. ...
...reversing, and sorting them. it has a property for determining the array length and other properties for use with regular expressions. creating an array the following statements create equivalent arrays: let arr = new array(element0, element1, ..., elementn) let arr = array(element0, element1, ..., elementn) let arr = [element0, element1, ..., elementn] element0, element1, ..., elementn is a
list of values for the array's elements. when these values are specified, the array is initialized with them as the array's elements. the array's length property is set to the number of arguments. the bracket syntax is called an "array literal" or "array initializer." it's shorter than other forms of array creation, and so is generally preferred. see array literals for details. to create an array wi...
...w 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. unassigned values are not iterated in a foreach loop. ...
...And 5 more matches
Making PWAs work offline with Service workers - Progressive web apps (PWAs)
xecuted after the registration is successful. it's the only piece of service worker code that sits inside the app.js file; everything else that is service worker-specific is written in the sw.js file itself. lifecycle of a service worker when registration is complete, the sw.js file is automatically downloaded, then installed, and finally activated. ...
...nside the app.js file; everything else that is service worker-specific is written in the sw.js file itself. lifecycle of a service worker when registration is complete, the sw.js file is automatically downloaded, then installed, and finally activated. installation the api allows us to add event
listeners for key events we are interested in — the first one is the install event: self.addevent
listener('install', (e) => { console.log('[service worker] install'); }); in the install
listener, we can initialize the cache and add files to it for offline use. our js13kpwa app does exactly that. first, a variable for storing the cache name is created, and the app shell files are
listed in one array. var cachename = 'js13kpwa-v1'; var appshellfiles = [ '/pwa-examples/js13kpwa/', '/pwa-e...
...ed along with the content from the data/games.js file are generated in the second array. after that, both arrays are merged using the array.prototype.concat() function. var gamesimages = []; for(var i=0; i<games.length; i++) { gamesimages.push('data/img/'+games[i].slug+'.jpg'); } var contenttocache = appshellfiles.concat(gamesimages); then we can manage the install event itself: self.addevent
listener('install', (e) => { console.log('[service worker] install'); e.waituntil( caches.open(cachename).then((cache) => { console.log('[service worker] caching all: app shell and content'); return cache.addall(contenttocache); }) ); }); there are two things that need an explanation here: what extendableevent.waituntil does, and what the caches object is. the service w...
...And 5 more matches
Structural overview of progressive web apps - Progressive web apps (PWAs)
.html js13kpwa.webmanifest style.css sw.js the html the html in the file index.html creates the structure of the app. the parts that are directly relevant to the app shell model are found outside the <section> with the id content within this page. ...
...you can <a href="https://github.com/mdn/pwa-examples/blob/master/js13kpwa"> fork js13kpwa on github</a> to check its source code.</p> <button id="notifications">request dummy notifications</button> <section id="c...
...l javascript code file. the <body> is split into the <header> (which displays an image) and the body of the app, which is found inside a <main> element. the app displays its title, a description, and then a place for the app content to be shown (a <section> element with the id content. below the content is a <footer>, which provides a copyright notice and assorted links. the app's only job is to
list all the a-frame entries from the js13kgames 2017 competition. as you can see it is a very ordinary, one page website. its only point is to have something simple we can use to examine the implementation of its actual pwa features. the css the css for this simple example is also as plain as possible: it uses @font-face to load and use a custom font, and it applies some simple styling of the html ...
...And 5 more matches
windows - Archive of obsolete content
private browser windows won't appear in the browserwindows property, you won't receive any window events, and you won't be able to open private windows. ...
...private browser windows won't appear in the browserwindows property, you won't receive any window events, and you won't be able to open private windows. ...
...longer protected by the compatibility guarantees made by the sdk's high-level apis. in particular, depending on what you do with these objects, your code might not work with multiprocess firefox. globals functions open(options) open a new window. var windows = require("sdk/windows").browserwindows; // open a new window. windows.open("http://www.example.com"); // open a new window and set a
listener for "open" event. windows.open({ url: "http://www.example.com", onopen: function(window) { // do stuff like
listen for content // loading. } }); returns the window that was opened: var windows = require("sdk/windows").browserwindows; var example = windows.open("http://www.example.com"); require("sdk/ui/button/action").actionbutton({ id: "read", label: "read", icon: "./r...
...And 4 more matches
Miscellaneous - Archive of obsolete content
s is the scrolling area. this is the scrolling area. this is the scrolling area. this is the scrolling area. this is the scrolling area. this is the scrolling area. this is the scrolling area. this is the scrolling area. this is the scrolling area. this is the scrolling area. </div> <script type="text/javascript"> var elm = document.getelementbyid("scrollarea"); elm.addevent
listener("dommousescroll", function scroll(event){ //event.detail is positive for a downward scroll, negative for an upward scroll alert("scrolling " + event.detail + " lines"); }, false); </script> if you do not receive a dommousescroll event while holding any of the modifier keys (ctrl,shift,alt,meta) you should check the mousewheel.withcontrolkey.action and related preferences. the mean...
...ction preference is shown in the following table mousewheel.withxxxkey.action result 0 scroll by lines. if set, you will receive dommousescroll events. 1 scroll by page. 2 move around in the history. if set, you will not receive dommousescroll events. 3 change text size. if set, you will not receive dommousescroll events. you can
listen to mouse wheel click events just like normal click events (via mousedown and mouseup events). when the mouse wheel is clicked, event.button will be equal to 1. simulating mouse and key events https://developer.mozilla.org/samples/domref/dispatchevent.html also, new in firefox 3 / gecko 1.9: var utils = window.queryinterface(components.interfaces.nsiinterfacerequestor) .get...
...vering which element in the loaded document has focus // focusedcontrol stores the focused field, or null if there is none. // this excludes textareas for simplicity, but onpageload() can easily be // modified to cycle through textareas as well. further enhancements would include // handling for fields dynamically added to the page (e.g., by page javascript). ...
...And 4 more matches
Extension Versioning, Update and Compatibility - Archive of obsolete content
maxversion of this entry must be a range that includes the version of the running application. if the application has a targetapplication entry but it is for an incompatible version then the application will retrieve updated compatibility information from the add-on's updateurl. if the install.rdf contains any targetplatform entries then the platform of the currently running application must be
listed or the installation will be rejected. firefox 3 note in applications based on gecko 1.9 you can also use a targetapplication entry with an id toolkit@mozilla.org and minversion and maxversion that match the toolkit version of the running application. this allows you to say that your add-on will install into any toolkit based application. overriding compatibility checking for testing p...
...ill use this value instead of that specified in the add-on's install.rdf. this can cause add-ons that are disabled for being incompatible to become enabled and add-ons that would normally not install to be installed. update rdf format if you host your add-on's updateurl yourself then you will need to return the add-on version information in an rdf format. below is an example update manifest. it
lists information about 2 different versions of the extension with id foobar@developer.mozilla.org. the versions included are 2.2 and 2.5, both of which specify compatibility with firefox versions 1.5 to 2.0.0.*. for version 2.2 an https update link is used while version 2.5 has a regular http link with a hash to verify the file retrieved. it is important to get the initial rdf:description's about at...
...e behavior depends on the version of the client application, of course. <?xml version="1.0" encoding="utf-8"?> <rdf:rdf xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"> <!-- this description resource includes all the update and compatibility information for a single add-on with the id foobar@developer.mozilla.org. you can
list multiple add-ons information in the same rdf file. --> <rdf:description about="urn:mozilla:extension:foobar@developer.mozilla.org"> <em:updates> <rdf:seq> <!-- each li is a different version of the same add-on --> <rdf:li> <rdf:description> <em:version>2.2</em:version> <!-- this is the version number of the add-on --> <!-- one...
...And 4 more matches
Chapter 2: Technologies used in developing extensions - Archive of obsolete content
anization that sets standards for web-related technologies. it has a number of useful qualities: it is generic, extensible, and easy to validate as well-formed. some examples of xml-based markup languages include xhtml, which is html redefined on an xml base; svg, for expressing vector images; and mathml, for expressing mathematical formulas. xul, which is used in firefox, is also based on xml.
listing 1: xml syntax <elementname someattribute="somevalue"> content </elementname> as shown in
listing 1, xml uses elements, which consist of an opening tag, a closing tag, and content. note: elements that take no content can be expressed in compact form as <elementname/>. an element can include other elements as well as text in its content, and all information is structured as a tree. as in a...
... name, these can be distinguished. the namespace uri for xhtml is "http://www.w3.org/1999/xhtml" ; for svg is it "http://www.w3.org/2000/svg". css: a style language to alter the display of xml documents like xml, cascading style sheets (css) is a technical specification established by the w3c; it is a style-description language defining the display of data marked up in xml and html. as shown in
listing 1, it has an extremely simple syntax. by separating the structure of the data, expressed through html or xml, and the display style, indicated by css, data can be reused better than it is when structural and sty
listic markup are both embedded in html. there are three css specifications (level 1 through level 3), with progressively powerful features. the gecko rendering engine handles nearly a...
... separating the structure of the data, expressed through html or xml, and the display style, indicated by css, data can be reused better than it is when structural and sty
listic markup are both embedded in html. there are three css specifications (level 1 through level 3), with progressively powerful features. the gecko rendering engine handles nearly all of css level 2 and some of css level 3.
listing 2: css code sample body { color: black; background-color: white; } p { margin-bottom: 1em; text-indent: 1em; } javascript: the world's most misunderstood language javascript is a scripting language first developed in the 1990s, at which time it was created as a way to add dynamic features to web pages. because it was often used at first to display pop-up windows, marching text in s...
...And 4 more matches
Handling Preferences - Archive of obsolete content
es window and other parts of its ui. in reality there are thousands of other preferences firefox handles that are not readily available to the user. these are hidden because they are too advanced or obscure for regular users to manage, and because the preferences window should be as easy to use as possible. to access all other preferences, enter "about:config" into the location bar. this xul page
lists all the preferences defined in the firefox installation, allowing you to change them as you please. as the warning message states, you should be very careful when changing preferences. incorrect values can make firefox behave oddly or break altogether. you can type on the "filter" textbox to search for specific preferences. if you type the word "homepage", it will filter all the preferences and...
... as the warning message states, you should be very careful when changing preferences. incorrect values can make firefox behave oddly or break altogether. you can type on the "filter" textbox to search for specific preferences. if you type the word "homepage", it will filter all the preferences and display only the ones which include the word "homepage" in its name or value. right-clicking on the
list reveals several options that allow you to modify preference values and add new ones. preferences with non-default values are highlighted in bold. all changes done in about:config are saved to the prefs.js file. the
list in about:config is not complete. some firefox preferences have no default value, so they are left out unless you add them manually. an extensive specification of firefox preferen...
...mdc articles and other guides are usually good at specifying the preferences you'll need to use. adding preferences to an extension extensions can read and write firefox preferences and, most importantly, create and manage their own. the preferences system provides a simple, unified storage facility for name / value mappings. ...
...And 4 more matches
XPCOM Objects - Archive of obsolete content
cc["@mozilla.org/observer-service;1"].getservice(ci.nsiobserverservice); the cc object (components.classes) is an index to static objects and class definitions available through xpcom. the string between the brackets is just an identifier, in this case corresponding to the observer service. you'll usually know what string to use by reading examples and documentation. there is no comprehensive
list of these (that we know of), and that's understandable since it would be a very long
list, and it can be extended by add-ons. if you want to see the
list in your current firefox installation, just run the following code in the error console: var str = ""; for (var i in components.classes) { str += i + "\n" }; str a run on firefox 3.6.2 with a few extensions installed yields 876 strings. that...
...her be getservice or createinstance, depending on what you're asking for. in most cases it is very clear which one to call, but in case of doubt, look for documentation on it. those two methods always receive the interface identifier as an argument. similarly to cc, ci (components.interfaces) is an index of available interfaces. a modified version of the last code snippet produces an even longer
list of available interfaces. just like in component identifiers, the nsi prefix is just a way of keeping things in order. the ns stands for netscape, mozilla's predecessor. the "i" stands for interface. our interfaces should begin with something like xsihello. an interface is just a definition of a set of attributes and methods that an object implementing it should have. xpcom components can impleme...
...ponents and interfaces, so we'll use that. another useful resource is this xpcom reference. this is generated from source, and it's kept relatively up to date. it shows the relationships between components and interfaces, but it's more of a source browser than a documentation reference. stepping into the time machine, we see the preferences service component page. right at the top you can see a
list of the interfaces it implements, with a link to a documentation page for each one of them. then you'll see a
list of all members of this object, with some documentation about it. it is particularly important to note that, for every member in the component, you'll see in what interface this member is defined. clicking on the link for the getbranch method takes you to the nsiprefservice documentati...
...And 4 more matches
Monitoring WiFi access points - Archive of obsolete content
code with universalxpconnect privileges can monitor the
list of available wifi access points to obtain information about them including their ssid, mac address, and signal strength. this capability was introduced primarily to allow wifi-based location services to be used by geolocation services. example this example simply displays a
list of the available access points. <html> <head> <title>wifi monitor example</title> <script> var count = 0; function test() { } test.prototype = { onchange: function (accesspoints) { netscape.security.privilegemanager.enableprivilege('universalxpconnect'); var d = document.getelementbyid("d"); d.innerhtml = ""; for (var i=0; i<accesspoints.length; i++) { var a = accesspoints[i]; d.innerhtml += "<p>" + a.mac + " " + a.ssid + ...
...erhtml += "<p>" + a.mac + " " + a.ssid + " " + a.signal + "</p>"; } var c = document.getelementbyid("c"); c.innerhtml = "<p>" + count++ + "</p>"; }, onerror: function (value) { alert("error: " +value); }, queryinterface: function(iid) { netscape.security.privilegemanager.enableprivilege('universalxpconnect'); if (iid.equals(components.interfaces.nsiwifi
listener) || iid.equals(components.interfaces.nsisupports)) return this; throw components.results.ns_error_no_interface; }, } netscape.security.privilegemanager.enableprivilege('universalxpconnect'); var
listener = new test(); var wifi_service = components.classes["@mozilla.org/wifi/monitor;1"].getservice(components.interfaces.nsiwifimonitor); wifi_service...
...this object is described in lines 11 through 40 in the code above. the onchange() method (lines 13 through 27) begins by ena...
...And 4 more matches
Creating a Help Content Pack - Archive of obsolete content
ents. the help documents are written in xhtml, and the rest are written in rdf. the content pack descriptor file outlines the framework of the contents of the pack by pointing to the files describing the table of contents, index, and glossary rdf files. the table of contents and index files are simple tree-based outlines written in rdf. the glossary file is written in rdf and consists of a simple
list of terms with corresponding urls to the term definition. creating a content pack the content pack descriptor file as mentioned earlier, the content pack descriptor file is written using rdf. if you don't know rdf, that's okay - for our purposes, you won't need to learn very much. if you understand the basics of html or (preferably) xml, you'll understand the very basics of the syntax - element...
...this attribute if you don't want it, but it's a useful shorthand to save typing. next, we need to describe where to find the glossary, index, and table of contents. (we're still not actually to the point where we're describing the actual data in each of these, so we'll just use some filler data for now.) add the following code inside the rdf:description element you just created: <nc:panel
list> <rdf:seq> </rdf:seq> </nc:panel
list> you'll create the relevant information descriptions within the rdf:seq element. the location of each of the glossary, index, and table of contents data sources is stored in one rdf:description element contained within one rdf:li element, like so: <rdf:seq> <rdf:li> <rdf:description nc:...
...s pretty simple. each panel is specified by one rdf:description element with the following attributes: nc:panelid specifies the name of the panel, which may be any one of glossary, search, toc, or index. the data source specified by toc will always be displayed, while the other data sources may only be available by searching through the loaded content pack. nc:datasources is a space-separated
list of rdf datasources used in construction of the structure of referenced topics. generally, each item in the
list will be a uri to an rdf file, but if you're more familiar with rdf you can also refer to a specific node within the rdf file using its rdf:id attribute. nc:platform (added in mozilla 1.8b2/firefox 1.1) when present specifies the platforms to which the information stored in the referenc...
...And 4 more matches
A XUL Bestiary - Archive of obsolete content
ses, the "load" event when it is loaded into a browser. the "click" event is fired by a button when it is clicked. if you don't do anything about these events, then you probably never know about them. documents will load, buttons will be clicked, and links will be hovered over, and events will be raised for all these actions behind closed doors. if, however, you write event handlers inside event
listeners, as we will describe shortly, you can use these events to set off other actions. this using of events to prompt other, more explicit actions is loosely what is meant by an event model. where, exactly, are these events fired? fired at whom? events that are fired by an object "bubble up" the hierarchical model that is the dom (or the aom) node by node. these events can be "handled" at any poi...
...up" the hierarchical model that is the dom (or the aom) node by node. these events can be "handled" at any point in that hierarchy -- including in the same node in which they were raised. if no one at a particular level in the hierarchy is interested in the event, then the event bubbles up to the next highest level on out to the top of the hierarchy. ...
...aom) node by node. these events can be "handled" at any point in that hierarchy -- including in the same node in which they were raised. if no one at a particular level in the hierarchy is interested in the event, then the event bubbles up to the next highest level on out to the top of the hierarchy. the term isn't used very often, but an "event
listener" is a special attribute of an object that
listens to its own events. ...
...And 4 more matches
Building accessible custom components in XUL - Archive of obsolete content
ing roles with dhtml accessibility download stage-2.zip install stage-2.xpi using the new dhtml accessibility techniques in firefox 1.5, we can declare the role of each element in our spreadsheet. the grid element is really a spreadsheet. each label element is really a cell within the spreadsheet. each description element is really a row or column header within the spreadsheet. you can find a
list of all the supported roles in firefox 1.5 on mozilla.org. role declarations are a little confusing at first glance, but they all follow the same pattern. the role attribute itself is in the xhtml 2 namespace. we will need to declare the namespace (xmlns:x2="http://www.w3.org/tr/xhtml2") so we can add an xhtml2:role attribute to each xul element. the role attribute value is also in a namespace. we...
...round the tab order and coming back into the spreadsheet), we need to programmatically reset the focus to the previously focused cell. this is handled in the spreadsheet_focus function, which is registered as a handler for the focus event. ...
...o programmatically reset the focus to the previously focused cell. this is handled in the spreadsheet_focus function, which is registered as a handler for the focus event. ...
...And 4 more matches
Menus - Archive of obsolete content
the user may select a command to invoke it, or may cancel the operation by pressing escape or clicking outside the menu. xul provides a number of tags for creating menus. these tags can be used to create menus which sit on a menubar or are attached to buttons. submenus may be created by nesting one menu inside of another. ...
...clicking the button will display the menu, allowing a command to be selected. this type of menu would be used when you want to have a set of commands yet don't want to use a menu bar, for example in a dialog box. see menu buttons for more information. toolbarbutton toolbar buttons can also support menus. this works just like it does for other buttons. see menu buttons for more information. menu
list a menu
list is used when you wish the user to select from a
list of items. for this type of menu, one of the items within it is selected. when another item is selected, the label of the item is set as the label of the menu
list. other user interfaces call this type of widget a combobox. you may also see a popup tag used in place of the menupopup tag. the popup tag is deprecated but is equivalent...
...nly need to be unique within that menu. when the item is clicked with the mouse or the access key is pressed while the menu is open, the command event is fired at the menuitem. this is the manner in which an action can be associated with the menuitem. for instance, the action associated with a open menuitem might be to open a file picker to select a file to open. ...
...And 4 more matches
Creating toolbar buttons (Customize Toolbar Window) - Archive of obsolete content
orking. another tutorial, which walks you through the entire process from the beginning, is also available. creating an overlay the first step is to create an overlay for the document containing the toolbar you wish to enhance. explaining overlays is beyond the scope of this tutorial -- you can read about them in the xul tutorial. to overlay a document, you need to know its uri. you can find a
list of uris for the most commonly overlaid documents at the bottom of this page. note: some people overlay chrome://messenger/content/mailwindowoverlay.xul. that should cause the button to appear on all windows that mailwindowoverlay.xul is applied to (i.e. main window and view message window). this needs to be looked into. adding the toolbar button toolkit applications have customizable toolbars;...
...tte"> <toolbarbutton id="myextension-button" class="toolbarbutton-1" label="&toolbarbutton.label;" tooltiptext="&toolbarbutton.tooltip;" oncommand="myextension.ontoolbarbuttoncommand(event);"/> </toolbarpalette> notes: the id of the palette (browsertoolbarpalette in the example) depends on the window (the parent window of the toolbar you wish to insert a button). see below for the
list of common palette ids. class="toolbarbutton-1" makes the toolbar button appear correctly in icons and text mode; it also adjusts padding. set the command to be executed when the button is clicked in the oncommand attribute. if you need to handle middle-click, add this line after the oncommand line. onclick="checkformiddleclick(this, event)" you can also handle middle-click and right-click...
...ent.getelementbyid('browsertoolbarpalette') will not work. this is the code to create and add it in. let button = doc.createelement("toolbarbutton"); button.setattribute("id", button_id); button.setattribute("label", "replace bookmark"); button.setattribute("class", "toolbarbutton-1 chromeclass-toolbar-additional"); button.setattribute("tooltiptext", "replace an existing bookmark"); button.style.
liststyleimage = "url(" + icon + ")"; button.addevent
listener("command", main.action, false); toolbox.palette.appendchild(button); this code is thanks to dgutov and is seen in full context at his repository here at github: dgutov / bmreplace / bootstrap.js. watch for a snippet that you can copy and paste into scratchpad, and then run on gists@github here: _ff-addon-snippet-addtoolbarbuttontopalette.
...And 4 more matches
More Event Handlers - Archive of obsolete content
« previousnext » in this section, the event object is examined and additional events are described. the event object every event handler is passed an event object. in the attribute form of the event handler, the event object is an implied argument to the script code which can be referred to using the name 'event'. in the addevent
listener form, the first argument passed to the
listener function will be the event object. other arguments can be passed to a
listener function, if required. the event object has a number of properties which can be examined during an event. for a full
list, see the reference. we already saw the event's target property in the last section. it holds a reference to the element where the event occurred. a similar property currenttarget holds the element...
...in the example below, currenttarget is always the vbox, whereas target would be the specific element, either the button or checkbox, that was activated. ...
...command="alert(event.currenttarget.tagname);"> <button label="ok"/> <checkbox label="show images"/> </vbox> stop event propagation once you handle an event, regardless of where in the propagation the event is, you will likely want to stop the event from being sent to further elements, essentially stopping the capturing or bubbling phases from continuing. depending on how you attach the event
listener to an element, there are different ways of doing this. recall that the capturing phase occurs before the bubbling phase, so any capturing
listeners will trigger before any bubbling
listeners. if a capturing event stops the event propagation, none of the later capturing
listeners, nor any of the bubbling
listeners will ever receive notification about the events. to manually stop event propagat...
...And 4 more matches
radio - Archive of obsolete content
only one radio button within the same radiogroup may be selected at a time. the user can switch which radio button is turned on by selecting it with the mouse or keyboard. other radio buttons in the same group are turned off. a label, specified with the label attribute may be added beside the radio button. more information is available in the xul tutorial. ...
... image type: uri the uri of the image to appear on the element. if this attribute is empty or left out, no image appears. the position of the image is determined by the dir and orient attributes. label type: string the label that will appear on the element. if this is left out, no text appears. for an editable menuitem element the value of this attribute is copied to the menu
list.value property upon user selection of the menuitem. selected type: boolean indicates whether the element is selected or not. this value is read-only. to change the selection, set either the selectedindex or selecteditem property of the containing element. tabindex type: integer the tab order of the element. the tab order is the order in which the focus is moved when the user...
...in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not require validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable). for user editable menu
list elements, the contents, as visible to the user, are read and set using the menu
list.value syntax. for those elements, setattribute("value", myvalue) and getattribute("value") do not access or affect the contents displayed to the user. properties accesskey type: character gets and sets the value of the accesskey attribute. accessibletype type: integ...
...And 4 more matches
calICalendarView - Archive of obsolete content
alicalendarview implementations are particularly well suited to xbl. there is, however, no practical obstacle to the interface being implemented by any javascript object associated with a group of dom nodes, even non-anonymous xul nodes. in the vast majority of cases, the dom corresponding to an implementation of calicalendarview will be rather complex. this explains the need for the fairly large
list off attributes and methods that must be implemented, so that outside code can be able to gain a decent picture of the current state of those nodes. it should be noted, however, that the methods and attributes implemented by a calicalendarview need not behave in any predictable fashion. for instance, when the showdate method of the the calendar-multiday-view (an implementation of this interface) w...
...as implemented here, it corresponds to th...
...as implemented here, it corresponds to the calendar containing all of the calievents and calitodos that shoud be shown in the view. in...
...And 4 more matches
Common Firefox theme issues and solutions - Archive of obsolete content
n/lion/: keyhole-circle.png toolbar.png toolbarbutton-dropmarker.png tabbrowser/alltabs-box-bkgnd-icon.png tabview/tabview.png places/toolbar.png linux linux select box fields are showing both drop arrow and spinner arrows on linux: the styling of drop down select box fields may show both a drop arrow and up/down spinner arrows. the problem is commonly caused by a -moz-appearance:menu
list style rule in chrome://global/skin/menu
list.css. once the offending rule is found, it should be deleted and manual styling used. app button not styled on linux, but is styled on windows on linux the firefox app button that is displayed when tabs are on top and menu bar is disabled is not styled properly compared to windows and is not changing colors when in private browsing mode. the cause of t...
... to your browser folder. you can modify/redesign these icons to match your theme provided appropriate padlock icons are used for secure sites but not on insecure sites. ...
...ed to the proper location in the browser.css file and modified as necessary: /* page proxy icon */ #page-proxy-favicon { width: 16px; height: 16px; margin: 1px 3px;
list-style-image: url(chrome://browser/skin/identity-icons-generic.png); -moz-image-region: rect(0, 16px, 16px, 0); } .verifieddomain > #identity-box-inner > #page-proxy-stack > #page-proxy-favicon {
list-style-image: url(chrome://browser/skin/identity-icons-https.png); } .verifiedidentity > #identity-box-inner > #page-proxy-stack > #page-proxy-favicon {
list-style-image: url(chrome://browser/skin/identity-icons-https-ev.png); } #identity-box:hover > #identity-box-inner > #page-proxy-stack > #page-proxy-favicon { -moz-image-region: rect(0, 32px, 16px, 16px); } #identity-box:...
...And 4 more matches
Accessing XML children - Archive of obsolete content
</foo> delete elem.bar; leaves just <foo> <baz/> </foo> the . ...
...lem1 = <foo> <bar/> </foo>; var elem2 = <red> <blue/> </red>; elem1.bar = elem2; replaces the <bar/> element with all of the content in elem2, giving: <foo> <red> <blue/> </red> <foo> xml
lists many times, however, a single element will have two or more children of the same type. in this case, accessing foo.bar will return an xml
list object, of all child elements of the type "bar". important it is your responsibility to determine whether you have an xml
list or a single element when using the . operator. e4x behaves no differently when returning these properties. the xml
list behaves much like an array. var element = <foo> <bar baz="1">red</bar> <bar baz="2">blue</bar> </foo>; var...
...object, of all child elements of the type "bar". important it is your responsibility to determine whether you have an xml
list or a single element when using the . operator. e4x behaves no differently when returning these properties. the xml
list behaves much like an array. var element = <foo> <bar baz="1">red</bar> <bar baz="2">blue</bar> </foo>; var
list = element.bar;
list.length(); // returns 2
list[0]; // the first bar element
list[1]; // the second bar element notice further that this
list is "live" in the sense that changes made to the
list are reflected back in the element that the
list originally came from. ...
...And 4 more matches
Cascade and inheritance - Learn web development
ont values directly to them. some properties do not inherit — for example if you set a width of 50% on an element, all of its descendants do not get a width of 50% of their parent's width. if this was the case, css would be very frustrating to use! note: on mdn css property reference pages you can find a technical information box, usually at the bottom of the specifications section, which
lists a number of data points about that property, including whether it is inherited or not. see the color property specifications section, for example. understanding how the concepts work together these three concepts together control which css applies to what element; in the below sections we'll see how they work together. it can sometimes seem a little bit complicated, but you will start to reme...
...mber them as you get more experienced with css, and you can always look up the details if you forget! even experienced developers don't remember all the details. the below video shows how you can use the firefox devtools to inspect a page's cascade, specificity, and more: understanding inheritance we'll start with inheritance. in the example below we have a <ul>, with two levels of unordered
lists nested inside it. we have given the outer <ul> a border, padding, and a font color. the color has applied to the direct children, but also the indirect children — the immediate child <li>s, and those inside the first nested
list. we have then added a class of special to the second nested
list and applied a different color to it. this then inherits down through its children. things like wi...
... controlling inheritance css provides four special universal property values for controlling inheritance. ...
...And 4 more matches
CSS values and units - Learn web development
the different types of values and units used in css properties. what is a css value? in css specifications and on the property pages here on mdn you will be able to spot values as they will be surrounded by angle brackets, such as <color> or <length>. when you see the value <color> as valid for a particular property, that means you can use any valid color as a value for that property, as
listed on the <color> reference page. note: you'll also see css values referred to as data types. the terms are basically interchangeable — when you see something in css referred to as a data type, it is really just a fancy way of saying value. note: yes, css values tend to be denoted using angle brackets, to differentiate them from css properties (e.g. the color property, versus the <color> da...
...lid you don't need to wonder which of the different types of color value can be used — keywords, hex values, rgb() functions, etc. you can use any available <color> values assuming they are supported by your browser. the page on mdn for each value will give you information about browser support. for example, if you look at the page for <color> you will see that the browser compatibility section
lists different types of color value and support for them. let's have a look at some of the types of value and unit you may frequently encounter, with examples so that you can try out different possible values. numbers, lengths, and percentages there are various numeric data types that you might find yourself using in css. the following are all classed as numeric: data type description...
...use is px (pixels). relative length units relative length units are relative to something else, perhaps the size of the parent element's font, or the size of the viewport. the benefit of using relative units is that with some careful planning you can make it so the size of text or other elements scale relative to everything else on the page. some of the most useful units for web development are
listed in the table below. unit relative to em font size of the parent, in the case of typographical properties like font-size, and font size of the element itself, in the case of other properties like width. ex x-height of the element's font. ch the advance measure (width) of the glyph "0" of the element's font. rem font size of the roo...
...And 4 more matches
Practical positioning examples - Learn web development
la facilisi.</p> </article> <article> <h2>the second tab</h2> <p>this tab hasn't got any lorem ipsum in it. but the content isn't very exciting all the same.</p> </article> <article> <h2>the third tab</h2> <p>lorem ipsum dolor sit amet, consectetur adipiscing elit. pellentesque turpis nibh, porttitor nec venenatis eu, pulvinar in augue. ...
...the div contains three <article> elements, which will make up the content panels that correspond to each tab. each panel contains some sample content. ...
...the div contains three <article> elements, which will make up the content panels that correspond to each tab. each panel contains some sample content. ...
...And 4 more matches
A first splash into JavaScript - Learn web development
{ lastresult.textcontent = 'wrong!'; lastresult.style.backgroundcolor = 'red'; if(userguess < randomnumber) { loworhi.textcontent = 'last guess was too low!' ; } else if(userguess > randomnumber) { loworhi.textcontent = 'last guess was too high!'; } } guesscount++; guessfield.value = ''; } guesssubmit.addevent
listener('click', checkguess); function setgameover() { guessfield.disabled = true; guesssubmit.disabled = true; resetbutton = document.createelement('button'); resetbutton.textcontent = 'start new game'; document.body.append(resetbutton); resetbutton.addevent
listener('click', resetgame); } function resetgame() { guesscount = 1; const reset...
...ave a nicely implemented checkguess() function, but it won't do anything because we haven't called it yet. ideally we want to call it when the "submit guess" button is pressed, and to do this we need to use an event. events are things that happen in the browser — a button being clicked, a page loading, a video playing, etc. — in response to which we can run blocks of code. the constructs that
listen out for the event happening are called event
listeners, and the blocks of code that run in response to the event firing are called event handlers. add the following line below your checkguess() function: guesssubmit.addevent
listener('click', checkguess); here we are adding an event
listener to the guesssubmit button. this is a method that takes two input values (called arguments) — the typ...
... try saving and refreshing your code now, and your example should work — to a point. ...
...And 4 more matches
Working with Svelte stores - Learn web development
tore let's start by creating a writable store. any component will be able to write to this store, and the alert component will subscribe to it and display a message whenever the store is modified. create a new file — stores.js — inside your src directory. give it the following content: import { writable } from 'svelte/store' export const alert = writable('welcome to the to-do
list app!') note: stores can be defined and used outside of svelte components, so you can organize them in any way you please. in the above code we import the writable() function from svelte/store and use it to create a new store called alert with an initial value of "welcome to the to-do
list app!". we then export the store. creating the actual component let's now create our alert component ...
...ptions, like nvda for windows, chromevox for chrome, orca on linux, and voiceover for mac os x and ios, among other options. to learn more about detecting and fixing accessibility issues check out our handling common accessibility problems article. using the store contract to persist our todos our little app lets us manage our todos quite easily, but is rather useless if we always get the same
list of hardcoded todos when we reload it. to make it truly useful, we have to find out how to persist our todos. first we need some way for our todos component to give back the updated todos to its parent. we could emit an updated event with the
list of todos, but it's easier just to bind the todos variable. let's open app.svelte and try it. first of all, add the following line below your todo...
...e to create custom stores with domain-specific logic. in the following example we create a counter store, which will only allow us to add one to the counter or reset its value: import { writable } from 'svelte/store'; function mystore() { const { subscribe, set, update } = writable(0); return { subscribe, addone: () => update(n => n + 1), reset: () => set(0) }; } if our to-do
list app gets too complex, we could let our todos store handle every state modification. we could move all the methods that modify the todo array (like addtodo(), removetodo(), etc) from our todos component to the store. if you have a central place where all the state modification is applied, components could just call those methods to modify the app's state and reactively display the info exposed by ...
...And 4 more matches
Getting started with Vue - Learn web development
find out more about installing npm and node.js here. to install the cli, run the following command in your terminal: npm install --global @vue/cli or if you'd prefer to use yarn: yarn global add @vue/cli once installed, to initialize a new project you can then open a terminal in the directory you want to create the project in, and run vue create <project-name>. the cli will then give you a
list of project configurations you can use. there are a few preset ones, and you can make your own. these options let you configure things like typescript, linting, vue-router, testing, and more. we’ll look at using this below. initializing a new project to explore various features of vue, we will be building up a sample todo
list app. we'll begin by using the vue cli to create a new app framewor...
...ignificant ones are as follows: .eslintrc.js: this is a config file for eslint. you can use this to manage your linting rules. babel.config.js: this is the config file for babel, which transforms modern javascript features being used in development code into older syntax that is more cross-browser compatible in production code. you can register additional babel plugins in this file. .browsers
listrc: this is a config for browsers
list. you can use this to control which browsers your tooling optimizes for. public: this directory contains static assets that are published, but not processed by webpack during build (with one exception; index.html gets some processing). favicon.ico: this is the favicon for your app. currently, it's the vue logo. index.html: this is the template for you...
...from inside the <script> element that import and register the component: delete these lines now: import helloworld from './components/helloworld.vue' components: { helloworld } your rendered app should no longer show an error, just a blank page, as we currently have no visible content inside <template>. let’s add a new <h1> inside <div id="app">. since we’re going to be creating a todo
list app below, let's set our header text to "to-do
list". add it like so: <template> <div id="app"> <h1>to-do
list</h1> </div> </template> app.vue will now show our heading, as you'd expect. summary let's leave this here for now. we've learnt about some of the ideas behind vue, created some scaffolding for our example app to live inside, inspected it, and made a few preliminary changes. ...
...And 4 more matches
Cross Process Object Wrappers
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. for example, this frame script sends a dom node to chrome when the user clicks it, as the clicked property of the third argument: // frame script addevent
listener("click", function (event) { sendasyncmessage("my-e10s-extension-message", {}, { clicked : event.target }); }, false); in the chrome script, the dom node is now accessible through a cross process object wrapper, as a property of the objects property of the message. the chrome script can get and set the wrapped object's properties and call its functions: // chrome script windowmm.addmessage...
...ener("click", function (event) { sendasyncmessage("my-e10s-extension-message", {}, { clicked : event.target }); }, false); in the chrome script, the dom node is now accessible through a cross process object wrapper, as a property of the objects property of the message. the chrome script can get and set the wrapped object's properties and call its functions: // chrome script windowmm.addmessage
listener("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 with a number of compatibility shims. one ...
...ontent object. this means that examples like this will actually work, even in multiprocess firefox: gbrowser.selectedbrowser.contentdocument.body.innerhtml = "replaced by chrome code"; it's still important to keep in mind, though, that this is access through a cpow and not direct access to content. bidirectional cpows a common pattern is for chrome code to access content objects and add event
listeners to them. to deal with this, cpows are bidirectional. 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. this means you can write code like this: // frame script /* on mouseover, send the button to the chrome script as a cpow. */ var button = content.docume...
...And 4 more matches
Frame script loading and lifetime
are associated with a browser tab and not with a page. so once you load them, they will stay loaded until the tab is closed, even if you reload the document or navigate. if you want to limit a script to the lifetime of a page you can create a sandbox instead, where the current content page is used as prototype. ...
... prototype. if you want a frame script to do something when a new document is loaded, you need to
listen for an appropriate dom event, generally domwindowcreated, domcontentloaded, or load. unloading frame scripts frame scripts are automatically unloaded when their hosting tab is closed. there is currently no way to unload them when loaded, other than closing the tab they were loaded into. to
listen for an event, when your frame script is unloaded (due to tab close for instance), you must set the third argument of addmessage
listener to true. ...
... scripts frame scripts are automatically unloaded when their hosting tab is closed. there is currently no way to unload them when loaded, other than closing the tab they were loaded into. to
listen for an event, when your frame script is unloaded (due to tab close for instance), you must set the third argument of addmessage
listener to true. ...
...And 4 more matches
Message manager overview
fferent kind of script. there are three different subtypes of frame message manager: the global message manager, the window message manager, and the browser message manager. all three enable chrome code to: load a script into a frame in the content the content process using a loadframescript() function. these scripts are called "frame scripts". communicate with frame scripts using addmessage
listener() and broadcastasyncmessage() or sendasyncmessage() functions. note that in this context, "browser" refers to the xul <browser> object, which is a frame that hosts a single web document. it does not refer to the more general sense of a web browser. global message manager the global message manager operates on every <browser> (that is, every open content tab). loadframescript() loa...
...e manager the global message manager operates on every <browser> (that is, every open content tab). loadframescript() loads the given script into every <browser> in every browser window. broadcastasyncmessage() sends the message to every <browser> in every browser window. ...
...oadcastasyncmessage() sends the message to every <browser> in every browser window. it's a chromemessagebroadcaster object, which implements the following interfaces: nsiframescriptloader nsimessage
listenermanager nsimessagebroadcaster you can access the global message manager like this: // chrome script let globalmm = cc["@mozilla.org/globalmessagemanager;1"] .getservice(ci.nsimessage
listenermanager); window message manager the window message manager is associated with a specific browser window, and operates on every <browser> (that is, every content tab) loaded into that window: loadframescript() loads the given script into every <browser> in that browser window broadcastasyncmessage() sends the message to every <browser> in that browser window. it's a chromemessagebroadc...
...And 4 more matches
AddonUpdateChecker
error_download_error there was an error while downloading the update information. error_parse_error the update information was malformed in some way. error_unknown_format the update information was not in any known format. error_securi...
... error_download_error there was an error while downloading the update information. error_parse_error the update information was malformed in some way. error_unknown_format the update information was not in any known format. error_security_error ...
...mation. error_parse_error the update information was malformed in some way. error_unknown_format the update information was not in any known format. error_security_error the update information was not signed by the update key used for retrieval. methods getcompatibilityupdate() retrieves the best matching compatibility update for the application from a
list of available update objects. updateinfo getcompatibilityupdate( in updateinfo updates[], in string version, in boolean ignorecompatibility, in string appversion, in string platformversion ) parameters updates an array of update objects version the version of the add-on to get new compatibility information for ignorecompatibility an optional parameter to get the first compatibi...
...And 4 more matches
Localization and Plurals
are needed for each word that needs to be localized, with plurals in mind. for all other properties files that link to this page, you'll need to provide enough plural forms of the desired word, and separate them with semi-colons (;). if you don't know how many plural forms you need, check the pluralrule number in chrome/global/intl.properties, and look up the corresponding entry in the following
list of plural rules.
list of plural rules this section contains a
list of plural rules ordered by their plural rule number. each entry indicates how many plural forms are needed when localizing a word. for each entry, there is a
list of families and languages in those families, to help you figure out if it's the rule you should pick for pluralrule. additionally, there is a brief description of each...
...for example, english uses plural rule 1, and localizing plurals would require a string of "plural;plurals" where the first word is the singular form and the second is the general plural form. ...
...ndÅŗe;sekundy;sekundow minutes=mjeÅšina;mjeÅšinje;mjeÅšiny;mjeÅšin hours=hodÅŗina;hodÅŗinje;hodÅŗiny;hodÅŗin days=dÅŗeÅ;dnjej;dny;dnjow testing extension to help make sure you pick the right plural rule and provide enough plural forms for strings, you should use the pluralform checker extension. after installing the extension, it should be available from the tools menu. ...
...And 4 more matches
Investigating leaks using DMD heap scan mode
ator. for instance, ~/logs/leak/. the command you need to run firefox will look something like this: xpcom_mem_bloat_log=1 moz_cc_log_shutdown=1 moz_disable_content_sandbox=t moz_cc_log_directory=$logdir moz_cc_log_process=content moz_cc_log_thread=main moz_dmd_shutdown_log=$logdir moz_dmd_log_process=tab ./mach run --dmd --mode=scan breaking this down: xpcom_mem_bloat_log=1: this reports a
list of the counts of every object created and destroyed and tracked by the xpcom leak tracking system. from this chart, you can see how many objects of a particular type were leaked through shutdown. this can come in handy during the manual analysis phase later, to get evidence to support your hunches. for instance, if you think that an nsfoo object might be holding your leaking object alive, you can...
...are created directly by the child processes. moz_cc_log_directory=$logdir: this selects the location for cycle collector logs to be saved. moz_cc_log_process=content moz_cc_log_thread=main: these options specify that we only want cc logs for the main thread of content processes, to make shutdown less slow. if your leak is happening in a different process or thread, change the options, which are
listed in xpcom/base/nscyclecollector.cpp. moz_dmd_shutdown_log=$logdir: this option specifies that we want a dmd log to be taken very late in xpcom shutdown, and the location for that log to be saved. like with the cc log, we want this log very late to avoid as many non-leaking things as possible. moz_dmd_log_process=tab: as with the cc, this means that we only want these logs in content processes,...
...ory. the command to invoke this looks like this: python $heapgraph/find_roots.py $cclog $winaddr this may take a few seconds. it will eventually produce some output. you'll want to save a copy of this output for later. the output will look something like this, after a message about loading progress: 0x7f0882fe3230 [fragmentorelement (xhtml) script https://www.example.com] --[[via hash] m
listenermanager]--> 0x7f0899b4e550 [event
listenermanager] --[m
listeners event=onload
listenertype=3 [i]]--> 0x7f0882ff8f80 [callbackobject] --[mincumbentglobal]--> 0x7f0897082c00 [nsglobalwindowinner # 2147483662 inner https://www.example.com] root 0x7f0882fe3230 is a ref counted object with 1 unknown edge(s). known edges: 0x7f08975a24c0 [fragmentorelement (xhtml) head https...
...And 4 more matches
NSS Memory allocation
nss makes extensive use of nspr's plarenapools for memory allocation. each block of memory allocated in a plarenapool is called a plarena. when a plarenapool is freed, all the arenas in that pool are put on an arena free
list. when nss attempts to allocate more memory for an arena pool, the plarenapool code attempts to use an arena from its free
list, and only gets a new arena from the heap if there are no arenas in the free
list that are large enough to satisfy the request. there are two consequences of the use of plarenapools that affect leak analysis. they are: 1. at the end of execution of a program, all the arenas in the free
list will appear to have been leaked. this makes it difficult to tell arenas that are truly leaked from those that are merely in the free
list. there is a fu...
...e request. there are two consequences of the use of plarenapools that affect leak analysis. they are: 1. at the end of execution of a program, all the arenas in the free
list will appear to have been leaked. this makes it difficult to tell arenas that are truly leaked from those that are merely in the free
list. there is a function named pl_arenafinish that really frees all the arenas on the free
list. see the prototype at http://mxr.mozilla.org/nspr/source/n.../ds/plarenas.h a program should call that function at the very end, after having shutdown nss and nspr, to really free the contents of the free
list. after that function returns, any arenas that still appear to be leaked have truly been leaked, and are not merely on the free
list. 2. leak analysis tools will frequently report the wrong ...
...arenas.h a program should call that function at the very end, after having shutdown nss and nspr, to really free the contents of the free
list. after that function returns, any arenas that still appear to be leaked have truly been leaked, and are not merely on the free
list. 2. leak analysis tools will frequently report the wrong call stack for the allocation of leaked arenas. when the arena free
list is in use, the first user of an arena will allocate it from the heap, but will then free it to the free
list. the second user will allocated it from the free
list and return it to the free
list. if and when an arena is leaked, the developer wants to see the call stack of the most recent allocation of the arena, not the stack of the oldest allocation of that arena. but leak analysis tools only rec...
...And 4 more matches
NSS_3.12_release_notes.html
_sha tls_dh_anon_with_camellia_128_cbc_sha tls_dh_dss_with_camellia_256_cbc_sha tls_dh_rsa_with_camellia_256_cbc_sha tls_dh_anon_with_camellia_256_cbc_sha tls_ecdh_anon_with_null_sha tls_ecdh_anon_with_rc4_128_sha tls_ecdh_anon_with_3des_ede_cbc_sha tls_ecdh_anon_with_aes_128_cbc_sha tls_ecdh_anon_with_aes_256_cbc_sha bugs fixed the following bugs have been fixed in nss 3.12. bug 354403: nss
list_createiterator returns pointer to a freed memory if the function fails to allocate a lock bug 399236: pkix wrapper must print debug output into stderr bug 399300: pkix error results not freed after use. bug 414985: crash in pkix_pl_ocsprequest_destroy bug 421870: strsclnt crashed in pkix tests. bug 429388: vfychain.main leaks memory bug 396044: warning: usage of uninitialized variable in ckfw/obj...
...sions in libpkix bug 395427: pkix_pl_initialize must not call nss_init bug 395850: build of libpkix tests creates links to nonexistant shared libraries and breaks windows build bug 398401: memory leak in pkix init. bug 399326: libpkix is unable to validate cert for certusagestatusresponder bug 400947: thread unsafe operation in pkix_pl_hashtable_add cause selfserv to crash. bug 402773: verify the
list of public header files in nss 3.12 bug 403470: strsclnt + tstclnt crashes when pkix enabled. bug 403685: application crashes after having called cert_pkixverifycert bug 408434: crash with pkix based verify bug 411614: explicit policy does not seem to work. bug 417024: convert libpkix error code into nss error code bug 422859: libpkix builds & validates chain to root not in the caller-provided anc...
...public header files in nss 3.12 bug 403470: strsclnt + tstclnt crashes when pkix enabled. bug 403685: application crashes after having called cert_pkixverifycert bug 408434: crash with pkix based verify bug 411614: explicit policy does not seem to work. ...
...And 4 more matches
nss tech note5
ypt include headers #include "nss.h" #include "pk11pub.h" make sure nss is initialized.the simplest init function, in case you don't need a nss database is nss_nodb_init(".") choose a cipher mechanism. note that some mechanisms (*_pad) imply the padding is handled for you by nss. if you choose something else, then data padding is the application's responsibility. you can find a
list of cipher mechanisms in security/nss/lib/softoken/pkcs11.c - grep for ckf_en_de_. ck_mechanism_type ciphermech = ckm_des_cbc_pad <big>(for example)</big> choose a slot on which to to do the operation pk11slotinfo* slot = pk11_getbestslot(ciphermech, null); or pk11slotinfo* slot = pk11_getinternalkeyslot(); /* alwys returns internal slot, may not be optimal */ prepare the key ...
...> clean up pk11_destroycontext(digestcontext, pr_true); you can also look at a sample program illustrating this hash / digest with secret key included include headers #include "nss.h" #include "pk11pub.h" make sure nss is initialized.the simplest init function, in case you don't need a nss database is nss_nodb_init(".") choose a digest mechanism. you can find a
list of digest mechanisms in security/nss/lib/softoken/pkcs11.c - grep for ckf_digest. ck_mechanism_type digestmech = ckm_md5 <big>(for example)</big> choose a slot on which to to do the operation pk11slotinfo* slot = pk11_getbestslot(digestmech, null); or pk11slotinfo* slot = pk11_getinternalkeyslot(); /* always returns int slot, may not be optimal */ prepare the key if u...
... pk11_destroycontext(digestcontext, pr_true); pk11_freesymkey(symkey); pk11_freeslot(slot); you can also look at a sample program illustrating this hmac include headers #include "nss.h" #include "pk11pub.h" make sure nss is initialized.the simplest init function, in case you don't need a nss database is nss_nodb_init(".") choose a hmac mechanism. ...
...And 4 more matches
PKCS #11 Module Specs
lication specific parameters in use. this data is currently stored in secmod.db or pkcs11.txt. this isn't part of the generic spec (that is other applications need not parse it, nor pkcs #11 modules need supply them or use them). nss="nss_params" nss_params are themselves name/value pairs, parsed with the same rules described above. valid names inside nss_params are: flags - comma separated
list of flag values, parsed case-insensitive. valid flag values are: internal - this library is actually the netscape internal library fips - this library is the netscape internal fips library. critical - if this library cannot be loaded, completely fail initialization. moduledb - this library includes nss specific functions to supply additional module specs for loading. moduledbonly - this...
...his pkcs #11 library should be rolled up. '0' means that tokens on this library should not supply trust information (default). the relative order of two pkcs#11 libraries which have the same trustorder value is undefined. cipherorder - integer value specifiying the order in which tokens are searched when looking for a token to do a generic operation (des/hashing, etc). ...
...es which have the same trustorder value is undefined. cipherorder - integer value specifiying the order in which tokens are searched when looking for a token to do a generic operation (des/hashing, etc). ciphers - comma separated
list of ciphers this token will enable that isn't already enabled by the library (currently only fortezza is defined) (case-insensitive). slotparams - space separated
list of name/value pairs where the name is a slotid and the value is a space separated
list of parameters related to that slotid. valid slotparams values are: slotflags - comma separated
list of cipher groups which this slot is expected to be the default implementation for (case-insensitive). valid flags are: rsa - this token should be used for all rsa operations (other than private key o...
...And 4 more matches
Gecko object attributes
« at apis support page introduction you can obtain object attributes by nsiaccessible.getattributes() method. object attributes are relevant for the entire subtree of the object they are on, unless they are overridden by a descendent with the same object attribute. this is in contrast to text attributes, which apply only to substrings in a text object. object attributes
list aria attributes all aria attributes used on dom element (i.e., any attribute prefixed by 'aria-') are exposed as object attributes; name is preserved except the 'aria-' prefix is cut. common attributes class the class name for an element from html, xul, svg, etc. this is useful for retrieving microformat semantics for an element. display similar with display css style. applied to: any visible accessib...
...r any object; useful for scripting. applied to: any role which related dom node has id attribute tag the actual markup tag used to create this element (also used in xul). applied to: any role xml-roles if a dynamic content accessibility role string is used, it is exposed here. this may provide more information than the mapped role, which is best-fit. ...
... it is exposed here. this may provide more information than the mapped role, which is best-fit. the role string may be a space-delimited
list of roles. applied to: any role group attributes level for headings, the heading level. for outline items, the indentation level. for diagrams with levels, each item can have its level specified. the level value is 1-based. applied to: grid, heading,
listitem, row, tab
list exposed in aria: aria-level posinset if this item is in a group, what is the item number within the group, where the size is defined by the setsize attribute. ...
...And 4 more matches
XForms Accessibility
ovides a quick guide to how accessibility is handled in gecko for xforms.. assistive technologies api for xforms is supported starting from firefox 3 (gecko 1.9). implementation of accessible objects for xforms elements is based on top of the existing object hierarchy introduced in the mozilla accessibility module. xforms elements behavior is implemented in accordance with accessible toolkit check
list. in general, when elements are similar to html elements, they are exposed to msaa/atk in a similar way. get build subsections below explain how you can obtain accessible xforms-enabled build. these are either downloading latest build of firefox or building it yourself. downloading builds notion: xforms is no longer distributed with firefox build. you must build it yourself. see section below...
...se ensure your .mozconfig file has the following option: ac_add_options --enable-extensions=default,xforms,schema-validation how to test there are two approaches to test xforms accessibility. the first is to use and assistive technology such as a screen reader, or an accessibility testing tool, to make sure xforms elements have proper accessible objects. or you may be guided by toolkit check
list to check keyboard navigation for xforms controls. you can try the following link to test xforms accessibility: visual xforms elements in xhtml document at bugzilla.mozilla.org visual xforms elements in xul document at bugzilla.mozilla.org you can see xforms sample tests at mozilla xforms project there are set of tests at beaufour.dk w3c's xforms test at w3.org keyboard navigation issues...
...forms element is bound to. children mozilla xforms implementation allows form control elements to have child elements. therefore accessible children are formed from any accessible child elements of form control element and from elements that are introduced by its presentation. forms controls module some of form control elements may be represented in few ways by different widgets. this section
lists accessible presentations for form control elements. input a key xforms element to show and change the instance data to which it is bound (see the spec, the docs). the follwoing representations input element are accessible: text field - see the docs. checkbox - see the docs datepicker - see the docs. calendar - see the docs. days
list - see the docs. months
list - see the docs. secret...
...And 4 more matches
Using XPCOM Components
e below). xul is just one way to expose the functionality of the cookiemanager component-but it's a particularly useful one in the mozilla world. the functionality of the cookiemanager component is available through the nsicookiemanager interface, which is comprised of the public methods in the table below. the nsicookiemanager interface removeall remove all cookies from the cookie
list. ...
...of the cookiemanager component-but it's a particularly useful one in the mozilla world. the functionality of the cookiemanager component is available through the nsicookiemanager interface, which is comprised of the public methods in the table below. the nsicookiemanager interface removeall remove all cookies from the cookie
list. enumerator enumerate through the cookie
list. ...
... one in the mozilla world. the functionality of the cookiemanager component is available through the nsicookiemanager interface, which is comprised of the public methods in the table below. the nsicookiemanager interface removeall remove all cookies from the cookie
list. enumerator enumerate through the cookie
list. remove remove a particular cookie from the
list. in xpcom the interface is guaranteed to stay the same even if the underlying implementation changes. the interfaces are public, in other words, and the implementations are private[private-xpcom-interfaces]. when a user selects one of the cookies displayed in the
list and then clicks the remove button, the remove method in the nsicookiemanager interface is called. the function is carried o...
...And 4 more matches
Observer Notifications
reated due to the presence of set-cookie header in the response header of any network request. this notification will come only after the "http-on-examine-response" is fired, but it will not always appear. download manager these topics indicate that events related to the download manager have occurred. topic description download-manager-ui-done called when the
list of downloads in the download manager windows finishes updating. this can happen multiple times, such as when the window first opens, when multiple items are removed, and when entering private browsing mode. download-manager-remove-download called when a download of the
list is removed or all the
list is cleared. the subject will be the download id wrapped in nsisupportspruint32, for ...
...ple times, such as when the window first opens, when multiple items are removed, and when entering private browsing mode. download-manager-remove-download called when a download of the
list is removed or all the
list is cleared. the subject will be the download id wrapped in nsisupportspruint32, for one download removed, or null for multi download remove, for example when the download
list is cleared. extension manager note: these notifications are no longer available starting with gecko 2.0, instead use addonmanager.addaddon
listener() to receive similar events. this topic indicates when the extension manager performs some action. note that any action will be taken the next time the application starts. see nsiextensionmanager for details. topic data descr...
...ed an addon has been enabled. em-action-requested item-disabled an addon has been disabled. em-action-requested item-cancel-action a previous action has been cancelled. idle service this topic indicates when actions related to the idle service, provided by the nsiidleservice interface. unlike the user-interaction-active and user-interaction-inactive topics
listed above, the idle service monitors user activity in general, whether related to the mozilla application or not (acting somewhat like the user activity/inactivity events a screen saver would be interested in). topic data description idle the length of time the user has been idle, in milliseconds. sent when the user becomes idle. idle-daily the length of t...
...And 4 more matches
inIDOMUtils
s;1"] .getservice(components.interfaces.inidomutils); method overview void addpseudoclasslock(in nsidomelement aelement, in domstring apseudoclass); void clearpseudoclasslocks(in nsidomelement aelement); [implicit_jscontext] jsval colornametorgb(in domstring acolorname); nsiarray getbindingurls(in nsidomelement aelement); nsidomnode
list getchildrenfornode(in nsidomnode anode, in boolean ashowinganonymouscontent); unsigned long long getcontentstate(in nsidomelement aelement); void getcsspropertynames([optional] in unsigned long aflags, [optional] out unsigned long acount, [retval, array, size_is(acount)] out wstring aprops); nsisupportsarray getcssstylerules(in nsidomelement aelement, [optional] in do...
...uleline(in nsidomcssstylerule arule); unsigned long getrulecolumn(in nsidomcssstylerule arule); unsigned long getselectorcount(in nsidomcssstylerule arule); astring getselectortext(in nsidomcssstylerule arule, in unsigned long aselectorindex); unsigned long long getspecificity(in nsidomcssstylerule arule, in unsigned long aselectorindex); nsidomfontface
list getusedfontfaces(in nsidomrange arange); bool haspseudoclasslock(in nsidomelement aelement, in domstring apseudoclass); boolean isignorablewhitespace(in nsidomcharacterdata adatanode); bool isinheritedproperty(in astring apropertyname); void parsestylesheet(in nsidomcssstylesheet asheet, in domstring ainput); void removepseudoclasslock(in nsidomeleme...
... returns an array of nsiuri objects representing the current xml binding for the specified element. nsiarray getbindingurls( in nsidomelement aelement ); parameters aelement a dom element to retrieve the bindings of. return value an array of nsiuri objects representing the current xbl binding (if any) for the element and its hierarchy of base bindings. getchildrenfornode() returns a
list of dom nodes that are children of the specified node. nsidomnode
list getchildrenfornode( in nsidomnode anode, in boolean ashowinganonymouscontent ); parameters anode a dom node for which to retrieve the style nodes. ashowinganonymouscontent whether you are interested in the xbl flattened tree. return value a dom node
list of the child nodes. if you have requested anonymous content,...
...And 4 more matches
nsIApplicationCache
torage policy of store_offline to access this cache. read only. groupid acstring the group id for this cache group. this is the uri of the cache manifest file. read only. usage unsigned long the disk usage of the application cache, in bytes. read only. constants constant value description item_manifest 1 this item is the application manifest. ...
... item_opportunistic 64 this item matched an opportunistic cache namespace and was cached for that reason. ...
... item_opportunistic 64 this item matched an opportunistic cache namespace and was cached for that reason. methods activate() makes this cache the active application cache for this group. future loads associated with this group will come from this cache. other caches from this cache group will be deactivated. void activate(); parameters none. ...
...And 4 more matches
nsICategoryManager
inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) implemented by: @mozilla.org/categorymanager;1. ...
... inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) implemented by: @mozilla.org/categorymanager;1. ...
... in string aentry ); parameters acategory the category being queried. ("protocol") aentry the entry being queried. ("http") return value the value of the given category's entry. this pointer must be released using nsimemory.free() when it is no longer needed. exceptions thrown ns_error_not_available indicates that either the category or entry is undefined. examples print out a
list of all categories this snippet shows how to print out a
list of all categories in c++. nsresult printallcategories() { nsresult rv; nscomptr<nsiservicemanager> svcmgr; rv = ns_getservicemanager(getter_addrefs(svcmgr)); if (ns_failed(rv)) return rv; nscomptr<nsicategorymanager> catmgr; rv = svcmgr->getservicebycontractid(ns_categorymanager_contractid, ...
...And 4 more matches
nsIChannel
is still valid for accessing protocol-specific results. for example, queryinterfacing to nsihttpchannel allows response headers to be retrieved for the corresponding http transaction. this interface must be used only from the xpcom main thread. implemented by netwerk/base/src/nsbasechannel.cpp and netwerk/protocol/http/src/nshttpchannel.cpp. method overview void asyncopen(in nsistream
listener a
listener, in nsisupports acontext); nsiinputstream open(); attributes attribute type description contentcharset acstring the character set of the channel's content if available and if applicable. this attribute only applies to textual data. setting contentcharset before the channel has been opened provides a hint to the channel on what...
...ample by the docshell) to indicate whether or not the channel corresponds to a document uri. load_retargeted_document_uri 17 if the end consumer for this load has been retargeted after discovering its content, this flag will be set: load_replace 18 this flag is set to indicate that this channel is replacing another channel. this means that: the stream
listener this channel will be notifying was initially passed to the asyncopen() method of some other channel this channel's uri is a better identifier of the resource being accessed than this channel's originaluri. this flag can be set, for example, for redirects or for cases when a single channel has multiple parts to it (and thus can follow onstoprequest with another onstartrequest/ons...
...fer_category. see nsicontentsniffer [en-us] note: channels may ignore this flag; however, new channel implementations should only do so with good reason. load_classify_uri 22 this flag tells the channel to use uri classifier service to check the uri when opening the channel. methods asyncopen() asynchronously open this channel. ...
...And 4 more matches
nsIMsgHeaderParser
exceptions thrown missing except...
...n string addrs, in string other_addrs, in prbool removealiasestome, out string newaddress); string unquotephraseoraddr(in string line, in boolean preserveintegrity); wstring unquotephraseoraddrwstring(in wstring line, in boolean preserveintegrity); methods extractheaderaddressmailboxes() given a string which contains a
list of header addresses, returns a comma-separated
list of just the 'mailbox' portions. if any of the addresses doesn't have a mailbox, then the user name is used instead. autf8string extractheaderaddressmailboxes( in string line ); parameters line the header line to parse. return value a comma-separated
list of just the mailbox parts of the addresses. exceptions thrown missing exception missing description native code only!extracth...
...esses doesn't have a mailbox, then the user name is used instead. autf8string extractheaderaddressmailboxes( in string line ); parameters line the header line to parse. return value a comma-separated
list of just the mailbox parts of the addresses. exceptions thrown missing exception missing description native code only!extractheaderaddressnames given a string which contains a
list of header addresses, returns a comma-separated
list of just the 'user name' portions. if any of the addresses doesn't have a name, then the mailbox is used instead. autf8string extractheaderaddressnames( in string line ); parameters line the header line to parse. return value a comma-separated
list of just the name parts of the addresses. exceptions thrown missing exception miss...
...And 4 more matches
nsIMsgSearchSession
alse; searchsession.appendterm(searchterm); searchsession.search(null); inherits from: nsisupports method overview void addsearchterm(in nsmsgsearchattribvalue attrib, in nsmsgsearchopvalue op, in nsimsgsearchvalue value, in boolean booleanand, in string arbitraryheader); nsimsgsearchterm createterm(); void appendterm(in nsimsgsearchterm term); void register
listener(in nsimsgsearchnotify
listener); void unregister
listener(in nsimsgsearchnotify
listener); void getnthsearchterm(in long whichterm, in nsmsgsearchattribvalue attrib, in nsmsgsearchopvalue op, in nsimsgsearchvalue value); long countsearchscopes(); void getnthsearchscope(in long which,out nsmsgsearchscopevalue scopeid, out nsimsgfolder folder); void a...
...meters attrib attribute for this term. op operator e.g. opcontains value value e.g. "dogbert" booleanand set to true if associated boolean operator is and. arbitraryheader user defined arbitrary header. ignored unless attrib = attribotherheader. ...
...ttribute for this term. op operator e.g. opcontains value value e.g. "dogbert" booleanand set to true if associated boolean operator is and. arbitraryheader user defined arbitrary header. ignored unless attrib = attribotherheader. ...
...And 4 more matches
nsIXmlRpcClient
null if the last call didn't retu...
...null if the last call didn't return an xml...
...32 boolean: nsisupportsprbool string: nsisupportscstring double: nsisupportsdouble datetime.iso8601: nsisupportsprtime base64: nsisupportscstring array: nsisupportsarray struct: nsidictionary faults (server side errors) are indicated by returning ns_error_failure. via nsixpconnect::getpendingexception()->data a nsixmlrpcfault object can be retreieved with more information on the fault. ...
...And 4 more matches
nsIZipReader
entriescount pruint32 the number of entries in the manifest. read only. methods close() closes a zip reader. subsequent attempts to extract() files or read from its input stream will result in an error. subsequent attempts to access a nsizipentry obtained from this zip reader will cause unspecified behavior. void close(); parameters none. example demonstrating this function:
list contents of xpi and read file contents extract() extracts a zip entry into a local file specified by outfile. the entry must be stored in the zip in either uncompressed or deflate-compressed format for the extraction to be successful. if the entry is a directory, the directory will be extracted non-recursively. void extract( in autf8string zipentry, in nsifile outfile ); parameters z...
...jar, getinputstream() must be called after parsemanifest. if aentryname is an external file which has meta-information stored in the jar, verifyexternalfile (not yet implemented) must be called before getprincipal. nsiprincipal getcertificateprincipal( in string aentryname ); parameters aentryname missing description return value an nsiprincipal. ...
... nsiinputstream getinputstream( in autf8string zipentry ); parameters zipentry the name of the entry to open() the stream from. ...
...And 4 more matches
Accessibility Inspector - Firefox Developer Tools
low the accessibility features to be automatically enabled, you can use the configuration editor (also known as about:config) to define the preference devtools.accessibility.auto-init.enabled, and set it to false. if you don't wish to use the accessibility features at all, you can use the configuration editor to set the preference devtools.accessibility.enabled to false. if you do this, the ways
listed above for activating the accessibility inspector do nothing. features of the accessibility panel the enabled accessibility panel looks like so: on the left-hand side, there is a tree diagram representing all the items in the accessibility tree for the current page. items with nested children have arrows that can be clicked to reveal the children, so you can move deeper into the hierarchy. ...
...ccessibility inspector do nothing. features of the accessibility panel the enabled accessibility panel looks like so: on the left-hand side, there is a tree diagram representing all the items in the accessibility tree for the current page. items with nested children have arrows that can be clicked to reveal the children, so you can move deeper into the hierarchy. each item has two properties
listed: role — the role this item has on the page (e.g., pushbutton, or footer). this can be either a default role provided by the browser, or a role given to it via a wai-aria role attribute. name — the name this item has on the page. the name depends on the element; for example, the name of most text elements is simply their textcontent, whereas form elements' names are the contents of their...
...ovided by the browser, or a role given to it via a wai-aria role attribute. name — the name this item has on the page. the name depends on the element; for example, the name of most text elements is simply their textcontent, whereas form elements' names are the contents of their associated <label>. on the right-hand side, you can see further information about the currently selected item. the
listed properties are as follows: name — the item's name, as described above. role — the item's role, as described above. actions — a
list of actions that can be performed on the item, for example, a pushbutton would have "press"
listed, while a link would have "jump"
listed. value — the value of the item. this can mean different things depending on the type of the item; for example, a f...
...And 4 more matches
Introduction to DOM Inspector - Firefox Developer Tools
dom inspector opens, it may or may not load an associated document, depending on the host application. if the dom inspector doesn't automatically load a document or loads a document other than the one you'd like to inspect, you can select the desired document a few different ways. ...
...ike to inspect, you can select the desired document a few different ways. inspecting content documents the inspect content document menupopup can be accessed from the file menu, and it will
list currently loaded content documents. in firefox and seamonkey browser, these will be the webpages you have opened in tabs. for thunderbird and seamonkey mail and news, any messages you're viewing will be
listed here. inspecting chrome documents the inspect chrome document menupopup can be accessed from the file menu , and it will contain the
list of currently loaded chrome windows and subdocuments. a browser window and the dom inspector are likely be already open and displayed in this
list. the dom inspector keeps track of all the windows that are open, so to inspect the dom of a particular window i...
... inspecting arbitrary urls you may also inspect the dom of arbitrary urls by using the inspect a url menuitem in the file menu, or by just entering a url into the dom inspector's address bar and clicking inspect or pressing enter. for example, you can enter http://www.mozilla.org in the address bar and see the dom structure of the mozilla.org home page. ...
...And 4 more matches
UI Tour - Firefox Developer Tools
this article is a quick tour of the main sections of the javascript debugger's user interface. the ui is split vertically into three panels source
list pane source pane the contents of the third pane depend on the current state of the debugger and may include the following sections: toolbar watch expressions breakpoints call stack scopes xhr breakpoints event
listener breakpoints dom mutation breakpoints source
list pane the source
list pane
lists all the javascript source files loaded into the page, and enables you to select one to debug. at the top level sources are organized by origin, and under that they're organized by the directory structure from which they are served. you can search for a file using ctrl + p (cmd + p on a mac). web extensio...
... there are several context menu options available for individual files and folders or groups; typically viewed by right-clicking on the item. for files, the following context menu options are available: copy source uri copies the full identifier of the file to the clipboard. ...
... there are several context menu options available for individual files and folders or groups; typically viewed by right-clicking on the item. for files, the following context menu options are available: copy source uri copies the full identifier of the file to the clipboard. ...
...And 4 more matches
Examine and edit CSS - Firefox Developer Tools
you can: toggle pseudo-classes; toggle classes; add a new rule; change the display based on the color scheme preference (as of firefox 72, you must set devtools.inspector.color-scheme-simulation.enabled to true in the configuration editor to enable this feature); change the display based on print media rules. ...
...ange the display based on print media rules. a warning icon appears next to unsupported css properties or rules that have invalid values. this can help you understand why certain styles are not being applied. in the following example, a spelling error, "background-colour" instead of "background-color" has made the rule invalid: rule display it displays each rule as in a stylesheet, with a
list of selectors followed by a
list of property:value; declarations. highlight matched elements: next to the selector is a target icon: click this to highlight all nodes in the page that match this selector. overridden declaration: declarations that are overridden by later rules are crossed out. see overridden declarations. inactive rules (not shown): if a rule is inactive (e.g., padding on a ...
...eclaration: declarations that are overridden by later rules are crossed out. see overridden declarations. inactive rules (not shown): if a rule is inactive (e.g., padding on a :visited pseudo-element), it is colored gray, with an info icon that gives more information when clicked. filter rules containing this property: next to overridden declarations is an icon you can click to filter the rules
list to show only those rules that include that property. see overridden declarations. enable/disable: if you hover over a declaration, a checkbox appears next to it: you can use this to toggle the declaration on or off. filename and line number: on the right-hand side is a link to the rule. see link to css file. if the element has a display: grid declaration, then it gets a grid icon next to it, ...
...And 4 more matches
about:debugging (before Firefox 68) - Firefox Developer Tools
about:debugging" in the firefox url bar. in the tools > web developer menu, click "service workers". select the web developer menu under the hamburger menu (), then select "service workers". when about:debugging opens, on the left-hand side, you'll see a sidebar enabling you to switch between the two main views: one for add-ons and one for workers. whether or not system add-ons appear in the
list on this page depends on the setting of the devtools.aboutdebugging.showsystemaddons preference. if you need to see system add-ons, navigate to about:config and make sure that this value is set to true. add-ons the add-ons section in about:debugging only supports restartless add-ons, including basic bootstrapped extensions, add-on sdk add-ons, and webextensions. this page enables you to do tw...
...is value is set to true. add-ons the add-ons section in about:debugging only supports restartless add-ons, including basic bootstrapped extensions, add-on sdk add-ons, and webextensions. this page enables you to do two things: load an add-on temporarily from disk connect the add-on debugger to any restartless add-ons connecting the add-on debugger the add-ons page in about:debugging
lists all restartless add-ons that are currently installed (note that this
list may include add-ons that came preinstalled with your firefox). next to each entry is a button labeled "debug". if the "debug" button is disabled, check the "enable add-on debugging" box. if you click "debug", you'll see a dialog asking you to accept an incoming connection. click "ok", and the add-on debugger will start i...
...s background scripts parsing the manifest.json file again, so changes to permissions, content_scripts, browser_action or any other keys will take effect. note that in firefox 49 onwards, the reload button is only enabled for temporary add-ons. it will be disabled for all other add-ons. tabs in firefox 49 onwards, a tabs page is available in about:debugging — this provides a complete
list of all the debuggable tabs open in the current firefox instance. each tab entry has a debug button next to it — when clicked, this will open up a toolbox specific to that tab, allowing you to debug that tab's contents. note that this feature isn't that immediately useful to debugging desktop tabs — you can open up a toolbox to debug a tab easily enough already — but this will become ...
...And 4 more matches
CSS Object Model (CSSOM) - Web APIs
ss rather than the html. it allows users to read and modify css style dynamically. ...
... css typed object model cssimagevalue csskeywordvalue cssmathinvert cssmathmax cssmathmi...
... css typed object model cssimagevalue csskeywordvalue cssmathinvert cssmathmax cssmathmin cssmathnega...
...And 4 more matches
DataTransfer.items - Web APIs
example this example shows the use of the items and types properties. ...
... example this example shows the use of the items and types properties. ...
... example this example shows the use of the items and types properties. ...
...And 4 more matches
Document.styleSheetSets - Web APIs
the stylesheetsets read-only property returns a live
list of all of the currently-available style sheet sets. syntax var sets = document.stylesheetsets; on return, sets is a
list of style sheet sets that are available. ...
... the stylesheetsets read-only property returns a live
list of all of the currently-available style sheet sets. syntax var sets = document.stylesheetsets; on return, sets is a
list of style sheet sets that are available. ...
... the stylesheetsets read-only property returns a live
list of all of the currently-available style sheet sets. syntax var sets = document.stylesheetsets; on return, sets is a
list of style sheet sets that are available. ...
...And 4 more matches
Element: mouseleave event - Web APIs
t of the dom tree, then it bubbles up the hierarchy until it is canceled by a handler or reaches the root. examples the mouseout documentation has an example illustrating the difference between mouseout and mouseleave. mouseleave the following trivial example uses the mouseenter event to change the border on the <div> when the mouse enters the space alloted to it. it then adds an item to the
list with the number of the mouseenter or mouseleave event. html <div id='mousetarget'> <ul id="unordered
list"> <li>no events yet!</li> </ul> </div> css styling the <div> to make it more visible. #mousetarget { box-sizing: border-box; width:15rem; border:1px solid #333; } javascript var entereventcount = 0; var leaveeventcount = 0; const mousetarget = document.getelementbyid('mousetar...
...e mouseenter or mouseleave event. html <div id='mousetarget'> <ul id="unordered
list"> <li>no events yet!</li> </ul> </div> css styling the <div> to make it more visible. ...
...<div id='mousetarget'> <ul id="unordered
list"> <li>no events yet!</li> </ul> </div> css styling the <div> to make it more visible. ...
...And 4 more matches
Element.querySelectorAll() - Web APIs
this string must be a valid css selector string; if it's not, a syntaxerror exception is thrown. see locating dom elements using selectors for more information about using selectors to identify elements. ...
...this string must be a valid css selector string; if it's not, a syntaxerror exception is thrown. see locating dom elements using selectors for more information about using selectors to identify elements. ...
...y elements. multiple selectors may be specified by separating them using commas. note: characters which are not part of standard css syntax must be escaped using a backslash character. since javascript also uses backspace escaping, special care must be taken when writing string literals using these characters. see escaping special characters for more information. return value a non-live node
list containing one element object for each descendant node that matches at least one of the specified selectors. note: if the specified selectors include a css pseudo-element, the returned
list is always empty. exceptions syntaxerror the syntax of the specified selectors string is not valid. examples dataset selector & attribute selectors <section class="box" id="sect1"> <div class="fun...
...And 4 more matches
HTMLInputElement.webkitdirectory - Web APIs
note: the behavior of webkitrelativepath is different in chromium < 72. see this bug for further details...
... don's 40th birthday pic2343.jpg pic2344.jpg pic2355.jpg pic2356.jpg vacations mars pic5533.jpg pic5534.jpg pic5556.jpg pic5684.jpg pic5712.jpg if the user chooses photoalbums, then the
list reported by files will contain file objects for every file
listed above—but not the directories. the entry for pic2343.jpg will have a webkitrelativepath of photoalbums/birthdays/don's 40th birthday/pic2343.jpg. this makes it possible to know the hierarchy even though the file
list is flat. note: the behavior of webkitrelativepath is different in chromium < 72. see this bug for further details. example in this example, a directory picker is presented wh...
...lativepath of photoalbums/birthdays/don's 40th birthday/pic2343.jpg. this makes it possible to know the hierarchy even though the file
list is flat. note: the behavior of webkitrelativepath is different in chromium < 72. see this bug for further details. example in this example, a directory picker is presented which lets the user choose one or more directories. when the change event occurs, a
list of all files contained within the selected directory hierarchies is generated and displayed. ...
...And 4 more matches
HTMLMediaāElementā.textTracks - Web APIs
the read-only texttracks property on htmlmediaelement objects returns a texttrack
list object
listing all of the texttrack objects representing the media element's text tracks, in the same order as in the
list of text tracks. you can detect when tracks are added to and removed from an <audio> or <video> element using the addtrack and removetrack events. however, these events aren't sent directly to the media element itself. instead, they're sent to the track
list object of the htmlmediaelement that corresponds to the type of track that was added to the element the returned
list is live; that is, as tracks are added to and removed from the media element, the
list's contents change dynamically. ...
...removetrack events. however, these events aren't sent directly to the media element itself. instead, they're sent to the track
list object of the htmlmediaelement that corresponds to the type of track that was added to the element the returned
list is live; that is, as tracks are added to and removed from the media element, the
list's contents change dynamically. once you have a reference to the
list, you can monitor it for changes to detect when new text tracks are added or existing ones removed. see event handlers in texttrack
list to learn more about watching for changes to a media element's track
list. ...
... each track is represented by a texttrack object which provides information about the track. ...
...And 4 more matches
IDBCursor.request - Web APIs
the idbcursor interface returns the idbrequest used to obtain the cursor. note: this feature is available in web workers. syntax var request = cursor.request; value an idbrequest object instance. examples when you open a cursor, the request property is then available on that cursor object, to tell you what request object the cursor originated from. ...
...cursor. note: this feature is available in web workers. syntax var request = cursor.request; value an idbrequest object instance. examples when you open a cursor, the request property is then available on that cursor object, to tell you what request object the cursor originated from. ...
...st = cursor.request; value an idbrequest object instance. examples when you open a cursor, the request property is then available on that cursor object, to tell you what request object the cursor originated from. ...
...And 4 more matches
IDBDatabase - Web APIs
div> a:hover text { fill: #0095dd; pointer-events: all;} properties idbdatabase.name read only a domstring that contains the name of the connected database. idbdatabase.version read only a 64-bit integer that contains the version of the connected database. when a database is first created, this attribute is an empty string. idbdatabase.objectstorenames read only a domstring
list that contains a
list of the names of the object stores currently in the connected database. methods inherits from: eventtarget idbdatabase.close() returns immediately and closes the connection to a database in a separate thread. idbdatabase.createmutablefile() creates a file handle, allowing files to be stored inside an indexeddb database. idbdatabase.createobjectstore() creates and re...
...s a new object store or index. idbdatabase.deleteobjectstore() destroys the object store with the given name in the connected database, along with any indexes that reference it. idbdatabase.transaction() immediately returns a transaction object (idbtransaction) containing the idbtransaction.objectstore method, which you can use to access your object store. runs in a separate thread. events
listen to these events using addevent
listener() or by assigning an event
listener to the oneventname property of this interface. abort fired when when a transaction is aborted and bubbles up to the connection object. also available via the onabort property. close fired when the database connection is unexpectedly closed. also available via the onclose property. error fired when a request retur...
...via the onversionchange property. example in the following code snippet, we open a database asynchronously (idbfactory), handle success and error cases, and create a new object store in the case that an upgrade is needed (idbdatabase). for a complete working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todo
list", 4); // these two event handlers act on the idbdatabase object, // when the database is opened successfully, or not dbopenrequest.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db // variable. this is u...
...And 4 more matches
KeyboardEvent.key - Web APIs
if the pressed key has a printed representation, the returned value is a non-empty unicode character string containing the printable representation of the key. ...
...al character, the returned value is one of the pre-defined key values. if the keyboardevent represents the press of a dead key, the key value must be "dead". some specialty keyboard keys (such as the extended keys for controlling media on multimedia keyboards) don't generate key codes on windows; instead, they trigger wm_appcommand events. these events get mapped to dom keyboard events, and are
listed among the "virtual key codes" for windows, even though they aren't actually key codes. if the key cannot be identified, the returned value is unidentified. keyboardevent sequence every keyboardevent is fired in a pre-determined sequence. for a given key press, the sequence of keyboardevents fired is as follows assuming that event.preventdefault is not called: a keydown event is first fir...
...1; flex: 1; } #test-target { display: block; width: 100%; margin-bottom: 10px; } javascript let textarea = document.getelementbyid('test-target'), consolelog = document.getelementbyid('console-log'), btnclearconsole = document.getelementbyid('btn-clear-console'); function logmessage(message) { document.getelementbyid("console-log").innerhtml += message + "<br>"; } textarea.addevent
listener('keydown', (e) => { if (!e.repeat) logmessage(`key "${e.key}" pressed [event: keydown]`); else logmessage(`key "${e.key}" repeating [event: keydown]`); }); textarea.addevent
listener('beforeinput', (e) => { logmessage(`key "${e.data}" about to be input [event: beforeinput]`); }); textarea.addevent
listener('input', (e) => { logmessage(`key "${e.data}" input [event: input]`...
...And 4 more matches
MediaDeviceInfo.groupId - Web APIs
. syntax var groupid = mediadeviceinfo.groupid; value a domstring which uniquely identifies the group of related devices to which this device belongs. specifications specification status comment media capture and streamsthe definition of 'groupid' in that specification. candidate recommendation initial definition. ...
...examples in this example, we assemble a
list of the devices which are part of the same group as a given device. this might be used to produce a user interface that gathers associated devices together for presentation purposes, or to make it easy for the user to choose to use the built-in camera and microphone on the same display at the same time. const getdevicegroup = maindevinfo => { let dev
list = []; navigator.mediadevices.enumeratedevices() .then(devices => { devices.foreach(device => { if (device.groupid === maindevinfo.groupid) { dev
list.push(device); } }); }); return dev
list; }; the getdevicegroup() function takes as input the mediadeviceinfo object describing the device for which a group
list is to be built. the function starts by initializin...
...iadevices.enumeratedevices() .then(devices => { devices.foreach(device => { if (device.groupid === maindevinfo.groupid) { dev
list.push(device); } }); }); return dev
list; }; the getdevicegroup() function takes as input the mediadeviceinfo object describing the device for which a group
list is to be built. the function starts by initializing the result array, dev
list, to be an empty array. then navigator.mediadevices.enumeratedevices() is called to get the
list of all media devices. once the promise resolves, we walk the
list using foreach(). ...
...And 4 more matches
MediaDevices.getSupportedConstraints() - Web APIs
s() method of the mediadevices interface returns an object based on the mediatracksupportedconstraints dictionary, whose member fields each specify one of the constrainable properties the user agent understands. syntax var supportedconstraints = navigator.mediadevices.getsupportedconstraints(); parameters none. ...
...r fields each specify one of the constrainable properties the user agent understands. syntax var supportedconstraints = navigator.mediadevices.getsupportedconstraints(); parameters none. return value a new object based on the mediatracksupportedconstraints dictionary
listing the constraints supported by the user agent. because only constraints supported by the user agent are included in the
list, each of these boolean properties has the value true. ...
...x var supportedconstraints = navigator.mediadevices.getsupportedconstraints(); parameters none. return value a new object based on the mediatracksupportedconstraints dictionary
listing the constraints supported by the user agent. because only constraints supported by the user agent are included in the
list, each of these boolean properties has the value true. example this example outputs a
list of the constraints supported by your browser. ...
...And 4 more matches
Node.isEqualNode() - Web APIs
odes using isequalnode() and output the results. ...
... living standard ...
... living standard ...
...And 4 more matches
Node.isSameNode() - Web APIs
nodes using issamenode() and output the results. ...
... living standard no change...
... living standard no change (was for a long time ...
...And 4 more matches
SubtleCrypto.exportKey() - Web APIs
into the "exported-key" space. */ async function exportcryptokey(key) { const exported = await window.crypto.subtle.exportkey( "raw", key ); const exportedkeybuffer = new uint8array(exported); const exportkeyoutput = document.queryselector(".exported-key"); exportkeyoutput.textcontent = `[${exportedkeybuffer}]`; } /* generate an encrypt/decrypt secret key, then set up an event
listener on the "export" button. */ window.crypto.subtle.generatekey( { name: "aes-gcm", length: 256, }, true, ["encrypt", "decrypt"] ).then((key) => { const exportbutton = document.queryselector(".raw"); exportbutton.addevent
listener("click", () => { exportcryptokey(key); }); }); pkcs #8 export this example exports an rsa private signing key as a pkcs #8 object. the expor...
...*/ window.crypto.subtle.generatekey( { name: "rsa-pss", // consider using a 4096-bit key for systems that require long-term security moduluslength: 2048, publicexponent: new uint8array([1, 0, 1]), hash: "sha-256", }, true, ["sign", "verify"] ).then((keypair) => { const exportbutton = document.queryselector(".pkcs8"); exportbutton.addeven...
...ner on the "export" button. */ window.crypto.subtle.generatekey( { name: "rsa-pss", // consider using a 4096-bit key for systems that require long-term security moduluslength: 2048, publicexponent: new uint8array([1, 0, 1]), hash: "sha-256", }, true, ["sign", "verify"] ).then((keypair) => { const exportbutton = document.queryselector(".pkcs8"); exportbutton.addevent
listener("click", () => { exportcryptokey(keypair.privatekey); }); }); subjectpublickeyinfo export this example exports an rsa public encryption key as a pem-encoded subjectpublickeyinfo object. see the complete code on github. /* convert an arraybuffer into a string from https://developers.google.com/web/updates/2012/06/how-to-convert-arraybuffer-to-and-from-string */ function ab2str(buf) ...
...And 4 more matches
TrackEvent - Web APIs
ce, which is part of the html dom specification, is used for events which represent changes to a set of available tracks on an html media element; these events are addtrack and removetrack. it's important not to confuse trackevent with the rtctrackevent interface, which is used for tracks which are part of an rtcpeerconnection. events based on trackevent are always sent to one of the media track
list types: events involving video tracks are always sent to the videotrack
list found in htmlmediaelement.videotracks events involving audio tracks are always sent to the audiotrack
list specified in htmlmediaelement.audiotracks events affecting text tracks are sent to the texttrack
list object indicated by htmlmediaelement.texttracks. constructor trackevent() creates and initializes a ne...
...r texttrack). methods trackevent has no methods of its own; however, it is based on event, so it provides the methods available on event objects. example this example sets up a function, handletrackevent(), which is callled for any addtrack or removetrack event on the first <video> element found in the document. ...
... based on event, so it provides the methods available on event objects. example this example sets up a function, handletrackevent(), which is callled for any addtrack or removetrack event on the first <video> element found in the document. ...
...And 4 more matches
ARIA: button role - Accessibility
d to make the button focusable and part of the page's tab order. the included css style is provided to make the <span> element look like a button, and to provide visual cues when the button has focus. the handlebtnclick and handlebtnkeydown event handlers perform the button's action when activated using a mouse click or the space or enter key. ...
...pan> element look like a button, and to provide visual cues when the button has focus. the handlebtnclick and handlebtnkeydown event handlers perform the button's action when activated using a mouse click or the space or enter key. in this case, the action is to add a new name to the
list of names. try the example by adding a name to the text box. the button will cause the name to be added to a
list. ...
...en the button has focus. the handlebtnclick and handlebtnkeydown event handlers perform the button's action when activated using a mouse click or the space or enter key. in this case, the action is to add a new name to the
list of names. try the example by adding a name to the text box. the button will cause the name to be added to a
list. ...
...And 4 more matches
::before (:before) - CSS: Cascading Style Sheets
nt: "»"; color: red; } result decorative example we can style text or images in the content property almost any way we want. ...
...ple we can style text or images in the content property almost any way we want. html <span class="ribbon">notice where the orange box is.</span> css .ribbon { background-color: #5bc8f7; } .ribbon::before { content: "look at this orange box."; background-color: #ffba10; border-color: black; border-style: dotted; } result to-do
list in this example we will create a simple to-do
list using pseudo-elements. ...
...rder-color: black; border-style: dotted; } result to-do
list in this example we will create a simple to-do
list using pseudo-elements. this method can often be used to add small touches to the ui and improve user experience. ...
...And 4 more matches
symbols - CSS: Cascading Style Sheets
ge-src> = <url> | <string><color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color><image-set-option> = [ <image> | <string> ] <resolution><id-selector> = <hash-token><cf-mixing-image> = <percentage>? && <image><cf-final-image> = <image> | <color><linear-gradient()> = linear-gradient( [ <angle> | to <side-or-corner> ]? ...
...color | <deprecated-system-color><image-set-option> = [ <image> | <string> ] <resolution><id-selector> = <hash-token><cf-mixing-image> = <percentage>? && <image><cf-final-image> = <image> | <color><linear-gradient()> = linear-gradient( [ <angle> | to <side-or-corner> ]? , <color-stop-
list> )<repeating-linear-gradient()> = repeating-linear-gradient( [ <angle> | to <side-or-corner> ]? , <color-stop-
list> )<radial-gradient()> = radial-gradient( [ <ending-shape> | <size> ]? [ at <position> ]? , <color-stop-
list> )<repeating-radial-gradient()> = repeating-radial-gradient( [ <ending-shape> | <size> ]? [ at <position> ]? , <color-stop-
list> )<conic-gradient()> = conic-gradient( [ from <angle> ]? [ at <position> ]?, <angular-color-stop-
list> )where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]? )...
...<percentage>#{3} , <alpha-value>? ) | rgba( <number>#{3} , <alpha-value>? )<hsl()> = hsl( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsl( <hue>, <percentage>, <percentage>, <alpha-value>? )<hsla()> = hsla( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsla( <hue>, <percentage>, <percentage>, <alpha-value>? )<side-or-corner> = [ left | right ] | [ top | bottom ]<color-stop-
list> = [ <linear-color-stop> [, <linear-color-hint>]? ]# , <linear-color-stop><ending-shape> = circle | ellipse<size> = closest-side | farthest-side | closest-corner | farthest-corner | <length> | <length-percentage>{2}<position> = [ [ left | center | right ] | [ top | center | bottom ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ]? | [ [ left | rig...
...And 4 more matches
@counter-style - CSS: Cascading Style Sheets
the @counter-style css at-rule lets you define counter styles that are not part of the predefined set of styles. a @counter-style rule defines how to convert a counter value into a string representation. @counter-style thumbs { system: cyclic; symbols: "\1f44d"; suffix: " "; } ul {
list-style: thumbs; } the initial version of css defined a set of useful counter styles. however, although more styles were added to this set of predefined styles over the years, this system proved too restrictive to fulfill the needs of worldwide typography. the @counter-style at-rule addresses this shortcoming in an open-ended manner, by allowing authors to define their own counter styles when the pre-defined styles aren't fitting their needs. syntax descriptors each @counter-style is identified by ...
...stom identifiers. how the symbols are used to construct the marker representation is up to the algorithm specified in the system descriptor. for example, if the system specified is fixed, then each of the n symbols specified in the descriptor will be used to represent the first n counter symbols. once the specified set of symbols have exhausted, the fallback style will be used for the rest of the
list. ...
... n symbols specified in the descriptor will be used to represent the first n counter symbols. once the specified set of symbols have exhausted, the fallback style will be used for the rest of the
list. the below @counter-style rule uses images instead of character symbols. image values for symbols is currently an 'at risk' feature, and is not implemented in any browser. @counter-style winners-
list { system: fixed; symbols: url(gold-medal.svg) url(silver-medal.svg) url(bronze-medal.svg); suffix: " "; } additive-symbols while the symbols specified in the symbols descriptor is used for constructing marker representation by most algorithms, some systems such as 'additive' rely on additive tuples described in this descriptor. each additive tuple consists of a counter symbol and a n...
...And 4 more matches
@font-feature-values - CSS: Cascading Style Sheets
he annotation() functional notation of font-variant-alternates. an annotation feature value definition allows only one value: ident1: 2 is valid, but ident2: 2 4 isn't. @ornaments specifies a feature name that will work with the ornaments() functional notation of font-variant-alternates. an ornaments feature value definition allows only one value: ident1: 2 is valid, but ident2: 2 4 isn't. @sty
listic specifies a feature name that will work with the sty
listic() functional notation of font-variant-alternates. a sty
listic feature value definition allows only one value: ident1: 2 is valid, but ident2: 2 4 isn't. @styleset specifies a feature name that will work with the styleset() functional notation of font-variant-alternates. a stylset feature value definition allows an unlimited number of...
... and are ignored. @character-variant specifies a feature name that will work with the character-variant() functional notation of font-variant-alternates. a character-variant feature value definition allows either one or two values: ident1: 3 maps to cv03=1, and ident2: 2 4 maps to cv02=4, but ident2: 2 4 5 is invalid. ...
...rk with the character-variant() functional notation of font-variant-alternates. a character-variant feature value definition allows either one or two values: ident1: 3 maps to cv03=1, and ident2: 2 4 maps to cv02=4, but ident2: 2 4 5 is invalid. ...
...And 4 more matches
Using media queries - CSS: Cascading Style Sheets
cific characteristics and parameters (such as screen resolution or browser viewport width). media queries are used for the following: to conditionally apply styles with the css @media and @import at-rules. to target specific media for the <style>, <link>, <source>, and other html elements with the media= attribute. to test and monitor media states using the window.matchmedia() and mediaquery
list.add
listener() javascript methods. note: the examples on this page use css's @media for illustrative purposes, but the basic syntax remains the same for all types of media queries. syntax a media query is composed of an optional media type and any number of media feature expressions. multiple queries can be combined in various ways by using logical operators. media queries are case-insensiti...
...ommas. and the and operator is used for combining multiple media features together into a single media query, requiring each chained feature to return true in order for the query to be true. it is also used for joining media features with media types. not the not operator is used to negate a media query, returning true if the query would otherwise return false. if present in a comma-separated
list of queries, it will only negate the specific query to which it is applied. if you use the not operator, you must also specify a media type. note: in level 3, the not keyword can't be used to negate an individual media feature expression, only an entire media query. only the only operator is used to apply a style only if an entire query matches, and is useful for preventing older browsers fro...
...s from applying selected styles. when not using only, older browsers would interpret the query screen and (max-width: 500px) simply as screen, ignoring the remainder of the query, and applying its styles on all screens. if you use the only operator, you must also specify a media type. , (comma) commas are used to combine multiple media queries into a single rule. each query in a comma-separated
list is treated separately from the others. thus, if any of the queries in a
list is true, the entire media statement returns true. in other words,
lists behave like a logical or operator. targeting media types media types describe the general category of a given device. although websites are commonly designed with screens in mind, you may want to create styles that target special devices such as pr...
...And 4 more matches
cross-fade() - CSS: Cascading Style Sheets
ined transparency. it can be used for many simple image manipulations, such as tinting an image with a solid color or highlighting a particular area of the page by combining an image with a radial gradient. syntax important: the specification and current implementations have different syntaxes. the specification syntax is explained first. specification syntax the cross-fade() function takes a
list of images with a percentage defining how much of each image is retained in terms of opacity when it is blended with the other images. the percent value must be coded without quotes, must contain the “%” symbol, and its value must be between 0% and 100%. the function can be used in css anywhere an ordinary image reference can be used. cross-fade percentages think of the percentage as an opa...
... 75%, url(black.png)); /* 75% white, 25% black */ cross-fade( url(white.png) 100%, url(black.png)); /* fully white */ cross-fade( url(green.png) 75%, url(red.png) 75%); /* both green and red at 75% */ if no percentages are declared, both the images will be 50% opaque, with a cross-fade rendering as an even merge of both images. the 50%/50% example seen above did not need to have the percentages
listed, as when a percentage value is omitted, the included percentages are added together and subtracted from 100%. the result, if greater than 0, is then divided equally between all images with omitted percentages. in the last example, the sum of both percentages is not 100%, and therefore both images include their respective opacities. if no percentages are declared and three images are included,...
...tage>, <percentage>, <alpha-value>? )<hsla()> = hsla( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsla( <hue>, <percentage>, <percentage>, <alpha-value>? )where <image-tags> = ltr | rtl<image-src> = <url> | <string><image-set-option> = [ <image> | <string> ] <resolution><id-selector> = <hash-token><linear-gradient()> = linear-gradient( [ <angle> | to <side-or-corner> ]? ...
...And 4 more matches
grid-template-columns - CSS: Cascading Style Sheets
id-template-columns css property defines the line names and track sizing functions of the grid columns. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...t. ...
... be stretched by the align-content and justify-content properties. fit-content( [ <length> | <percentage> ] ) represents the formula min(max-content, max(auto, argument)), which is calculated similar to auto (i.e. minmax(auto, max-content)), except that the track size is clamped at argument if it is greater than the auto minimum. repeat( [ <positive-integer> | auto-fill | auto-fit ] , <track-
list> ) represents a repeated fragment of the track
list, allowing a large number of columns that exhibit a recurring pattern to be written in a more compact form. subgrid the subgrid value indicates that the grid will adopt the spanned portion of its parent grid in that axis. rather than being specified explicitly, the sizes of the grid rows/columns will be taken from the parent grid’s definitio...
...And 4 more matches
Video player styling basics - Developer guides
this section summarises the modifications that were made to the original video player example to make the styling task easier, before the bulk of the work was started. html markup there are a few changes that were made to the html markup shown in the previous article. the custom video controls and <progress> element are now contained within <div> elements, rather than residing inside unordered
list items. the markup for the custom controls now looks as follows: <div id="video-controls" class="controls" data-state="hidden"> <button id="playpause" type="button" data-state="play">play/pause</button> <button id="stop" type="button" data-state="stop">stop</button> <div class="progress"> <progress id="progress" value="0" min="0"> <span id="progress-bar"></span> </p...
...pause') { if (video.paused || video.ended) { playpause.setattribute('data-state', 'play'); } else { playpause.setattribute('data-state', 'pause'); } } // mute button else if (type == 'mute') { mute.setattribute('data-state', video.muted ? ...
...tate', 'play'); } else { playpause.setattribute('data-state', 'pause'); } } // mute button else if (type == 'mute') { mute.setattribute('data-state', video.muted ? ...
...And 4 more matches
Overview of events and handlers - Developer guides
e type of the data structure used to represent the key properties of that event, and the javascript object which will 'emit' that event. the pattern is implemented by defining a javascript function which takes as an argument the data structure which was agreed upon, and registering the function using the name string with the object which will emit the event. the function is said to be a '
listener' or a 'handler' with both names used interchangeably. this pattern can easily be followed using completely custom code, as explained in the article on custom events. the pattern is also used by modern web browsers which define many events emitted in response to user input or browser activity. modern web browsers follow the event pattern using a standardized approach. browsers use as the data...
...ers which define many events emitted in response to user input or browser activity. modern web browsers follow the event pattern using a standardized approach. browsers use as the data structure for the properties of the event, an object derived from the eventprototype object. browsers use as the registration method for the function which will handle those data structures a method called addevent
listener which expects as arguments a string event type name and the handler function. finally, browsers define a large number of objects as event emitters and define a wide variety of event types generated by the objects. button event handler demo for example, browser <button> elements are intended to emit events named 'click' in response to a mouse click or, when displayed in touch sensitive surfa...
... by the objects. button event handler demo for example, browser <button> elements are intended to emit events named 'click' in response to a mouse click or, when displayed in touch sensitive surfaces, to a finger tap. ...
...And 4 more matches
Applying color to HTML elements using CSS - HTML: Hypertext Markup Language
p websites. with css, there are lots of ways to add color to your html elements to create just the look you want. this article is a primer introducing each of the ways css color can be used in html. fortunately, adding color to your html is actually really easy to do, and you can add color to nearly anything. we're going to touch on most of what you'll need to know when using color, including a
list of what you can color and what css properties are involved, how you describe colors, and how to actually use colors both in stylesheets and in scripts. we'll also take a look at how to let the user pick a color. then we'll wrap things up with a brief discussion of how to use color wisely: how to select appropriate colors, keeping in mind the needs of people with differing visual capabilities. t...
...discussion of how to use color wisely: how to select appropriate colors, keeping in mind the needs of people with differing visual capabilities. things that can have color at the element level, everything in html can have color applied to it. instead, let's look at things in terms of the kinds of things that are drawn in the elements, such as text and borders and so forth. for each, we'll see a
list of the css properties that apply color to them. at a fundamental level, the color property defines the foreground color of an html element's content and the background-color property defines the element's background color. these can be used on just about any element. text whenever an element is rendered, these properties are used to determine the color of the text, its background, and any deco...
...caret (sometimes referred to as the text input cursor) within the element. this is only useful in elements that are editable, such as <input> and <textarea> or elements whose html contenteditable attribute is set. boxes every element is a box with some sort of content, and has a background and a border in addition to whatever contents the box may have. borders see the section borders for a
list of the css properties you can use to set the colors of a box's borders. background-color the background color to use in areas of the element that have no foreground content. column-rule-color the color to use when drawing the line separating columns of text. outline-color the color to use when drawing an outline around the outside of the element. this outline is different from the border in...
...And 4 more matches
<audio>: The Embed Audio element - HTML: Hypertext Markup Language
des some useful styling techniques — it is written in the context of <video>, but much of it is equally applicable to <audio>. detecting addition and removal of tracks you can detect when tracks are added to and removed from an <audio> element using the addtrack and removetrack events. however, these events aren't sent directly to the <audio> element itself. ...
...ou can detect when tracks are added to and removed from an <audio> element using the addtrack and removetrack events. however, these events aren't sent directly to the <audio> element itself. instead, they're sent to the track
list object within the <audio> element's htmlmediaelement that corresponds to the type of track that was added to the element: htmlmediaelement.audiotracks an audiotrack
list containing all of the media element's audio tracks. you can add a
listener for addtrack to this object to be alerted when new audio tracks are added to the element. ...
...the track
list object within the <audio> element's htmlmediaelement that corresponds to the type of track that was added to the element: htmlmediaelement.audiotracks an audiotrack
list containing all of the media element's audio tracks. you can add a
listener for addtrack to this object to be alerted when new audio tracks are added to the element. htmlmediaelement.videotracks add an addtrack
listener to this videotrack
list object to be informed when video tracks are added to the element. htmlmediaelement.texttracks add an addtrack event
listener to this texttrack
list to be notified when new text tracks are added to the element. ...
...And 4 more matches
<li> - HTML: Hypertext Markup Language
the html <li> element is used to represent an item in a
list. it must be contained in a parent element: an ordered
list (<ol>), an unordered
list (<ul>), or a menu (<menu>). in menus and unordered
lists,
list items are usually displayed using bullet points. in ordered
lists, they are usually displayed with an ascending counter on the left, such as a number or letter. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories none. permitted content flow content. ...
...t, such as a number or letter. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories none. permitted content flow content. ...
...egories none. permitted content flow content. tag omission the end tag can be omitted if the
list item is immediately followed by another <li> element, or if there is no more content in its parent element. permitted parents an <ul>, <ol>, or <menu> element. though not a conforming usage, the obsolete <dir> can also be a parent. implicit aria role
listitem when child of an ol, ul or menu permitted aria roles menuitem, menuitemcheckbox, menuitemradio, option, none, presentation, radio, separator, tab, treeitem dom interface htmllielement attributes this element includes the global attributes. value this integer attribute indicates the current ordinal value of the
list item as defined by the <ol> element. the o...
...And 4 more matches
<select>: The HTML Select element - HTML: Hypertext Markup Language
s, etc. you can further nest <option> elements inside <optgroup> elements to create separate groups of options inside the dropdown. for further examples, see the native form widgets: drop-down content. attributes this element includes the global attributes. autocomplete a domstring providing a hint for a user agent's autocomplete feature. see the html autocomplete attribute for a complete
list of values and details on how to use autocomplete. autofocus this boolean attribute lets you specify that a form control should have input focus when the page loads. only one form element in a document can have the autofocus attribute. disabled this boolean attribute indicates that the user cannot interact with the control. if this attribute is not specified, the control inherits its setting f...
... be the id of a <form> in the same document. (if this attribute is not set, the <select> is associated with its ancestor <form> element, if any.) this attribute lets you associate <select> elements to <form>s anywhere in the document, not just inside a <form>. it can also override an ancestor <form> element. multiple this boolean attribute indicates that multiple options can be selected in the
list. if it is not specified, then only one option can be selected at a time. when multiple is specified, most browsers will show a scrolling
list box instead of a single line dropdown. name this attribute is used to specify the name of the control. required a boolean attribute indicating that an option with a non-empty string value must be selected. size if the control is presented as a scrol...
...the default value is 0. ...
...And 4 more matches
<video>: The Video Embed element - HTML: Hypertext Markup Language
r switches back and forth between this document and another document or application. buffered an attribute you can read to determine the time ranges of the buffered media. this attribute contains a timeranges object. controls if this attribute is present, the browser will offer controls to allow the user to control video playback, including volume, seeking, and pause/resume playback. controls
list the controls
list attribute, when specified, helps the browser select what controls to show on the media element whenever the browser shows its own set of controls (e.g. when the controls attribute is specified). the allowed values are nodownload, nofullscreen and noremoteplayback. use the disablepictureinpicture attribute if you want to disable the picture-in-picture mode (and the control...
...c., and then provide styling and layout information as required. video player styling basics provides some useful styling techniques. detecting track addition and removal you can detect when tracks are added to and removed from a <video> element using the addtrack and removetrack events. however, these events aren't sent directly to the <video> element itself. ...
...you can detect when tracks are added to and removed from a <video> element using the addtrack and removetrack events. however, these events aren't sent directly to the <video> element itself. instead, they're sent to the track
list object within the <video> element's htmlmediaelement that corresponds to the type of track that was added to the element: htmlmediaelement.audiotracks an audiotrack
list containing all of the media element's audio tracks. you can add a
listener for addtrack to this object to be alerted when new audio tracks are added to the element. ...
...And 4 more matches
Performance fundamentals - Web Performance
hey turn that upside down, starving your brain of inputs to create the illusion of discrete reality). on a computer display, a higher framerate simply makes for a more faithful imitation of reality. note: humans usually cannot perceive differences in framerate above 60hz. that's why most modern electronic displays are designed to refresh at that rate. a television probably looks choppy and unrea
listic to a hummingbird, for example. memory usage memory usage is another key metric. unlike responsiveness and framerate, users don't directly perceive memory usage, but memory usage closely approximates "user state". an ideal system would maintain 100% of user state at all times: all applications in the system would run simultaneously, and all applications would retain the state created by the u...
...the critical path is exactly and only the code that must run to produce the event. for example, to paint an application's first frame that comprises visually some html and css to style that html: the html must be parsed the do...
... that must run to produce the event. for example, to paint an application's first frame that comprises visually some html and css to style that html: the html must be parsed the dom for that html must be constructed resources like images in that part of the dom have to be loaded and decoded the css styles must be applied to that dom the styled document has to be reflowed nowhere in that
list is "load the js file needed for an uncommon menu"; "fetch and decode the image for the high scores
list", etc. those work items are not on the critical path to painting the first frame. it seems obvious, but to reach a user-perceived startup event more quickly, the main "trick" is run only the code on the critical path. shorten the critical path by simplifying the scene. the web platform is hig...
...And 4 more matches
Progressive web app structure - Progressive web apps (PWAs)
consists of a single html file (index.html) with basic css styling (style.css), and a few images, scripts, and fonts. ...
...you can <a href="https://github.com/mdn/pwa-examples/blob/master/js13kpwa">fork js13kpwa on github</a> to check its source code.</p> <button id="notifications">request dummy notifications</button> <section id="content"> // content i...
...er> </body> </html> the <head> section contains some basic info like title, description and links to css, web manifest, games content js file, and app.js — that's where our javascript application is initialized. the <body> is split into the <header> (containing linked image), <main> page (with title, description and place for a content), and <footer> (copy and links). the app's only job is to
list all the a-frame entries from the js13kgames 2017 competition. as you can see it is a very ordinary, one page website — the point is to have something simple so we can focus on the implementation of the actual pwa features. the css the css is also as plain as possible: it uses @font-face to load and use a custom font, and it applies some simple styling of the html elements. the overall approac...
...And 4 more matches
values - SVG: Scalable Vector Graphics
the values attribute has different meanings, depending upon the context where itʼs used, either it defines a sequence of values used over the course of an animation, or itʼs a
list of numbers for a color matrix, which is interpreted differently depending on the type of color change to be performed. ...
...r itʼs a
list of numbers for a color matrix, which is interpreted differently depending on the type of color change to be performed. five elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, <animatetransform>, and <fecolormatrix> animate, animatecolor, animatemotion, animatetransform for <animate>, <animatecolor>, <animatemotion>, and <animatetransform>, values is a
list of values defining the sequence of values over the course of the animation. if this attribute is specified, any from, to, and by attribute values set on the element are ignored. value <
list-of-values> default value none animatable no <
list-of-values> the value holds a semicolon-separated
list of one or more values. the type of the values is defined b...
...fied, any from, to, and by attribute values set on the element are ignored. value <
list-of-values> default value none animatable no <
list-of-values> the value holds a semicolon-separated
list of one or more values. the type of the values is defined by the href and attributename attributes. fecolormatrix for the <fecolormatrix> element, values is a
list of numbers interpreted differently depending on the value of the type attribute. ...
...And 4 more matches
Understanding WebAssembly text format - WebAssembly
is a module. in the text format, a module is represented as one big s-expression. s-expressions are a very old and very simple textual format for representing trees, and thus we can think of a module as a tree of nodes that describe the module’s structure and its code. unlike the abstract syntax tree of a programming language, though, webassembly’s tree is pretty flat, mostly consisting of
lists of instructions. first, let’s see what an s-expression looks like. each node in the tree goes inside a pair of parentheses — ( ... ). the first label inside the parenthesis tells you what type of node it is, and after that there is a space-separated
list of either attributes or child nodes. so that means the webassembly s-expression: (module (memory 1) (func)) represents a tree with th...
...eresting, let’s add some executable code to this module. 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). the locals are like vars in javascript, but with explicit types declared. the body is just a linear
list of low-level instructions. so this is similar to functions in other languages, even if it looks different because it is an s-expression. signatures and parameters the signature is a sequence of parameter type declarations followed by a
list of return type declarations. it is worth noting here that: the absence of a (result) means the function doesn’t return anything. in the current...
...he reference types) section below): i32: 32-bit integer i64: 64-bit integer f32: 32-bit float f64: 64-bit float a single parameter is written (param i32) and the return type is written (result i32), hence a binary function that takes two 32-bit integers and returns a 64-bit float would be written like this: (func (param i32) (param i32) (result f64) ... ) after the signature, locals are
listed with their type, for example (local i32). parameters are basically just locals that are initialized with the value of the corresponding argument passed by the caller. getting and setting locals and parameters locals/parameters can be read and written by the body of the function with the local.get and local.set instructions. the local.get/local.set commands refer to the item to be got/set by ...
...And 4 more matches
remote/child - Archive of obsolete content
parent module enables sdk code to load modules into child processes. the sdk/remote/child module is for these "child process modules". it provides two main things: access to web content loaded into this child process port mechanisms to communicate with the main process interacting with web content to interact with web content, the sdk/remote/child module provides a frames property that's a
list of all content frames loaded into this child process. each frame then has a content property that's the top-level dom window for the frame, and addevent
listener/removeevent
listener functions that enable you to
listen to dom events dispatched by the frame. communicating with the parent process to communicate with the parent process, the process, frames, and frame objects in sdk/remote/child hav...
... code in the parent. see the documentation for sdk/remote/parent for more details. globals properties process a process object. frames a frames object. process a link to the main process. properties port an event emitter that sends and receives events from the main process. isremote a boolean property indicating whether this process is remote from the main process or not. frames a
list of the content frames in this process. each element in this
list is a frame.
listen to attach and detach events to hear as frames are created and destroyed. methods forevery calls the callback for every existing frame and any new frames created in the future. this is a shortcut for enumerating existing frames and then
listening for attach events. getframeforwindow finds the frame for a top l...
...this process. each element in this
list is a frame.
listen to attach and detach events to hear as frames are created and destroyed. methods forevery calls the callback for every existing frame and any new frames created in the future. this is a shortcut for enumerating existing frames and then
listening for attach events. getframeforwindow finds the frame for a top level dom window. addevent
listener adds an event
listener for dom events dispatched to any existing and future frames. removeevent
listener removes an event
listener that was previously registered. properties port an event emitter that sends and receives events from every frame in this process. ...
...And 3 more matches
jpm - Archive of obsolete content
ox. assuming you don't want an old version of firefox, your options are firefox developer edition, firefox nightly, unbranded beta, or unbranded release. when testing your add-on, you will need to use the -b option to jpm run. see selecting a browser version. problems? if you do not see this, ask for help. sdk users and project team members discuss problems and proposals on the project mailing
list. someone else may have had the same problem you do, so try searching the
list. you are welcome to post a question, too. you can also chat with other sdk users in #jetpack on mozilla's irc network. command reference jpm supports the following commands: jpm init create a skeleton add-on as a starting point for your add-on. jpm run launch an instance of firefox with your a...
... of running the sign command: your add-on passed validation, was signed by mozilla, and a new signed xpi was downloaded to your working directory. your add-on failed validation, was not signed, and you got a link to a detailed report. after fixing the validation errors, you can run the command again. ...
...ing the sign command: your add-on passed validation, was signed by mozilla, and a new signed xpi was downloaded to your working directory. your add-on failed validation, was not signed, and you got a link to a detailed report. after fixing the validation errors, you can run the command again. you add-on passed validation but it could not be automatically signed because your add-on is
listed.
listed add-ons will require a manual review before they can be signed. your add-on at this exact version number already exists, so it was not signed. increment the version number in your package.json file and run the command again. under the hood, jpm sign creates an un
listed add-on inside addons.mozilla.org, which means you must distribute the xpi file yourself for your users to install it. if you...
...And 3 more matches
Install Manifests - Archive of obsolete content
ionname@example.org</em:id> <em:id>{daf44bf7-a45e-4450-979c-91cf07434c3d}</em:id> name the name of the add-on; intended for display in the ui. examples <em:name>my extension</em:name> targetapplication an object specifying an application targeted by this add-on. this means that the add-on will work with the application identified by the id property (<em:id>) specified (for a comprehensive
list of application ids and valid min/maxversions for them see valid application versions for add-on developers), from the minimum version (<em:minversion>) up to and including the maximum version (<em:maxversion>). however, while <em:maxversion> is a required property, it is ignored unless you also set <em:strictcompatibility> in the main <description> of your install.rdf (i.e. not in <em:targetappli...
...dons.mozilla.org - mozilla's update website may repackage your add-on and correct or reject malformed version strings. optional property reference you may need to supply these properties, depending on the capabilities of your add-on. abouturl the chrome:// url of the extension's about dialog box. this is only useful to extensions. if this property is specified, in the about:addons extensions
list, the about... link in the extension's context menu will show this dialog, rather than the default. note: as of gecko 2.0, the dialog receives the addon object representing your add-on as a parameter. examples <em:abouturl>chrome://myext/content/about.xul</em:abouturl> bootstrap a boolean value that tells the application whether the extension is boot-strappable. at the moment this only work...
...sion if present and given the value "true", this indicates that this add-on contains an embedded webextension. <em:hasembeddedwebextension>true</em:hasembeddedwebextension> homepageurl a link to the add-on's home page - intended for display in the user interface. examples <em:homepageurl>https://www.example.com/</em:homepageurl> iconurl a chrome:// url to an icon to display in the add-ons
list. the icon will be displayed at 32x32 in firefox 3.6 and lower. in firefox 4.0 and later the icon can be up to 48x48 pixels in size. if this property is not specified, a default icon is used. <em:iconurl>chrome://myext/skin/icon.png</em:iconurl> note: for the above example to work you will also have to add a skin package line to your chrome.manifest file. see chrome registration#skin. alternat...
...And 3 more matches
Adding Toolbars and Toolbar Buttons - Archive of obsolete content
me weird errors will begin to happen. always set the label and tooltiptext attributes of a toolbarbutton. in the case of a toolbaritem element (discussed later), use the title attribute instead of label. tooltips are very important for users that want to know what a button does before clicking it. setting the image for a toolbar button is done with css: #xulschoolhello-hello-world-button {
list-style-image: url("chrome://xulschoolhello/skin/hello-world.png"); } it's not really that simple to set the image for a toolbar button, because we need to consider the appearance of the button on different systems, and also consider the different button states, but we'll get into that further ahead. the css file with your toolbar styles needs to be included in the overlay file, as you would exp...
...onaltoolbar" /> </toolbox> </window> (note for mac os x: <window id="main-window"> and </window> are not required) our toolbar is added as a child of the toolbox element in the main browser window. the toolbox is the collection of toolbars in firefox, including the main menu bar. let's look at the attributes we used: the toolbarname is the name that will appear on the view > toolbars menu
list. this menu allows hiding and showing any toolbar. the customizable attribute determines if the user can customize the toolbar. you should normally set this to true, unless you have strong reasons not to want users changing your toolbar. the mode attribute is set to icons, which is the usual value. this can be changed in the customize dialog by the user. the context attribute should also be set...
...al value. this can be changed in the customize dialog by the user. the context attribute should also be set if you want a customizable toolbar. it points to the id of a popup element that holds the customization options that are displayed when the user right-clicks on the toolbar. this popup is already part of the main window, so it doesn't need to be implemented again. the defaultset attribute
lists the ids of the icons you want to include on your toolbar by default. it's a comma-separated
list of ids, and it can also include other special values: spacer, separator and spring. spacer represents an empty button space, separator a vertical separation line and spring a flexible empty area that stretches. finally, the insertbefore attribute places our toolbar above the bookmarks toolbar. this ...
...And 3 more matches
Index of archived content - Archive of obsolete content
tabs/utils test/assert test/harness test/httpd test/runner test/utils ui/button/action ui/button/toggle ui/frame ui/id ui/sidebar ui/toolbar util/array util/collection util/deprecate util/
list util/match-pattern util/object util/uuid window/utils release notes tools cfx cfx to jpm console jpm jpm-mobile jpmignore package.json ...
... implementing the widget overview storing annotations chrome authority creating event targets creating reusable modules developing for firefox mobile display a popup getting started (jpm) getting started (cfx)
list open tabs
listen for page load
listening for load and unload localization logging modifying web pages based on url modifying the page hosted by a tab open a web page troubleshooting unit testing using xpcom without chrome using third-party modul...
...service javascript timers javascript daemons management label and description lookupnamespaceuri lookupprefix miscellaneous modules on page load page loading post data to window preferences progress
listeners queryselector rosetta running applications svg animation svg general scrollbar sidebar stringview tabbox toolbar tree uri parsing view source for xul applications windows xml-related code snippets ...
...And 3 more matches
JXON - Archive of obsolete content
ou can read more about working with objects and how javascript is object-oriented). we can use several algorithms to convert its content to a javascript object tree. algorithm #1: a verbose way this simple recursive constructor will convert an xml dom tree to a javascript object tree. the text content of each element is stored into the keyvalue property, while nodeattributes, if they exist, are
listed under the child object keyattributes. the constructor's argument can be the entire xml document, a documentfragment or simply an element node. /*\ |*| |*| jxon snippet #1 mdndeveloper network |*| |*| https://developer.mozilla.org/docs/jxon |*| https://developer.mozilla.org/user:fusionchess |*| |*| this framework is released under the gnu public license, version 3 or later. |*| http://www.
...e": "function matchwo(a,b) {\n if (a < b && a < 0) { return 1; }\n else { return 0; }\n}", "keyattributes": { "type": "text/javascript" } }, "keyvalue": null }, "keyvalue": null } this is a recommanded technique if you don't know the structure of the xml document. algorithm #2: a less verbose way here is another, simpler, conversion method, in which nodeattributes are
listed under the same object of child nodes but have the “@” prefix (as suggested by the badgerfish convention). as above, the text content is stored into the keyvalue property. the constructor's argument can be the entire xml document, a documentfragment or simply an element node of it. /*\ |*| |*| jxon snippet #2 mdndeveloper network |*| |*| https://developer.mozilla.org/docs/jxon |*| https:...
...atch": { "@image": "black_cardigan.jpg", "keyvalue": "black" } } }] }, "script": { "@type": "text/javascript", "keyvalue": "function matchwo(a,b) {\n if (a < b && a < 0) { return 1; }\n else { return 0; }\n}" } } } this is a recommended technique if you know the structure of the xml document. algorithm #4: a very minima
list way the following is another possible way to do the conversion. it is very close to the parker convention, too. with this algorithm, all element nodes that contain other child element, text, or cdatasection nodes in the same level are treated as instances of boolean, number, string, or date constructors. so any child element node, if exists, will be nested in these types of objects. for example...
...And 3 more matches
Drag and Drop Example - Archive of obsolete content
o the file dragboard.js in a moment. next, a palette will be added to the right side of the window. it will contain three buttons, one to create new buttons, one to create check boxes and the other to create textboxes. this buttons will respond to the draggesture event and start a drag. ...
...ns, one to create new buttons, one to create check boxes and the other to create textboxes. this buttons will respond to the draggesture event and start a drag. <vbox> <button label="button" elem="button" ondraggesture="nsdraganddrop.startdrag(event,
listobserver)"/> <button label="check box" elem="checkbox" ondraggesture="nsdraganddrop.startdrag(event,
listobserver)"/> <button label="text box" elem="textbox" ondraggesture="nsdraganddrop.startdrag(event,
listobserver)"/> </vbox> the nsdraganddrop object will be called to do most of the work. we'll create a
listobserver object that will set the data to be dragged. note that each button here has an additional elem attribute. this is a made-up attribute. xul doesn't handle it and ...
... to do most of the work. we'll create a
listobserver object that will set the data to be dragged. note that each button here has an additional elem attribute. this is a made-up attribute. xul doesn't handle it and just ignores it, but we can still retrieve it with the dom's getattribute function. we need this so that we know what type of element to create when dragging. next, we'll define the two
listener objects. first, the
listobserver which needs a function to handle the start of the drag. ...
...And 3 more matches
Priority Content - Archive of obsolete content
update: i've removed documents from this
list that have been migrated into the wiki. the
list of completed documents is available through the devedge page. if you would like to sign up to do the migration of any of these works, just "edit" this page and add your name to the "migrators"
list for the piece. if there is devedge content you think should be migrated that isn't currently on this
list, feel free to add it. note: use example at sample:original document information to credit original authors. devedge devedge mirror note: if you're digging around the mirror and see anything there that you think should be migrated to devmo that isn't on this
list, feel free to add it below. a raw
list of everything that has not been migrated at all appears there. book length works in progr...
...patibility handbook original: netscape gecko compatibility handbook wiki location: gecko compatibility handbook migrators: mathieu deaudelin there are inline examples on this page that cannot be migrated. they are dependant on some code that cannot be integrated in the page. dependant on: updating dhtml web pages for next generation browsers on devedge the tune-up wizard (see below, in the wish
list section) mostly completed: popup window controls devedge article migrators: mathieu deaudelin there are inline examples on this page that cannot be migrated. they are dependant on some style instructions that can only be placed in the header of the page. started: scripting plugins: macromedia flash original: scripting plugins: macromedia flash wiki location: scripting plugins: macromed...
...w to migrate them (perhaps via "upload file" function that's normally used for images?) also check if any extra files live in the article's directory --jens.b 14:07, 26 apr 2005 (pdt) dependant on: mostly completed*: class xbdesignmode / devedge - joel coreson please put completed articles on the devedge page instead. ...
...And 3 more matches
Tamarin Build System Documentation - Archive of obsolete content
the tamarin source code and builds all of the shell executables, any errors will stop the phase and a red box will appear on the slave where the error occurred. the compile phase takes about 20-25 minutes. the smoke phase runs a set of tests on each platform until 2 minute is exceeded. the set of smoke tests can contain any shell build and any test suite (including performance). the smoke test
list is constantly updated to contain the most recent failures, most frequent failures, and the newest testcases. the idea is to catch test failures in a few minutes rather than running the complete test run (1h 45m). the smoke test including downloading the shell takes about 3-4 minutes. the test phase runs all functional testcases including acceptance tests, cmdline tests, and selftests. the acce...
...xt page] link to display more previous builds what are the goals of the build system (qos)? to provide quick and accurate results of building and testing tamarin on supported platforms and configurations to represent the build results in a clear and concise manor please give use feedback if you have any comments or suggestions to improve the build system how to add tests to the smokes? ...
... expectedfail or skip exp...
...And 3 more matches
Deprecated and defunct markup - Archive of obsolete content
{many elements on this page are wrongly marked as deprecated, this page needs review} the following xul tags and attribute should be considered deprecated, if not defunct. the
list below may include a few elements which are actually in use, but at a deeper level in the code. even some of the information on the tags below may be out of date, but is provided here for historical reference and to help anyone who comes across them in old code or documentation. ...
...he following xul tags and attribute should be considered deprecated, if not defunct. the
list below may include a few elements which are actually in use, but at a deeper level in the code. even some of the information on the tags below may be out of date, but is provided here for historical reference and to help anyone who comes across them in old code or documentation. ...
...tainer tag?) typo for <action> --neil 03 march 2011 <autorepeatbutton> (action occurs repeatedly on mouse hover--used to construct other elements; used in <arrowscrollbox> and large drop-down menus) so, not deprecated? ...
...And 3 more matches
MenuItems - Archive of obsolete content
accel" modifier key varies on each platform, but is the key typically used for shortcut keys. for instance, if the "accel" key is control, the menu might display "ctrl + o". although there isn't usually a need to do so, you can also set a custom label for the keyboard shortcut on the menu using the acceltext attribute. you might do this if the key associated with the item changes, for instance a
list of open windows displayed on a window menu. <menuitem label="first window" acceltext="1"/> here the keyboard shortcut label will be '1', however you will need to write code to handle the key as well. adding icons to menu items an icon may be added to a menu item using the image attribute. the icon will appear to the left of the menuitem label. in addition to the image, a special class "menui...
... label="add bookmark" image="addbookmark.png"/> as the image appears on a menu item, you will want to ensure you use a fairly small image. although the exact size will vary depending on the theme being used, the size of menu item images should generally be around 16 by 16 pixels. instead of specifying the icon with the image attribute, you can also reference the image in a style sheet with the '
list-style-image' property. #add-bookmark {
list-style-image: url('addbookmark.png'); } this technique can also be used to apply an image for the menu element, except you would want to use the "menu-iconic:" class instead. <menuitem id="bookmark" class="menu-iconic" label="bookmarks" image="bookmarks.png"/> menu icon animation in order to animate the menu item icon on hover a -moz-image-regio...
...px square is the icon in normal state the bottom part in hovered state. note that the image element is on a child level underneath the menu or menuitem, and it will have the class menu-iconic-icon. ...
...And 3 more matches
Adding more elements - Archive of obsolete content
« previousnext » we will conclude the discussion of boxes by adding some boxes to the find files dialog. adding elements to our find files example we will add some more elements to the find files dialog now. first, we will add the capability to search for other information such as the file size and date. ...
... find files dialog. adding elements to our find files example we will add some more elements to the find files dialog now. first, we will add the capability to search for other information such as the file size and date. <hbox> <menu
list id="searchtype"> <menupopup> <menuitem label="name"/> <menuitem label="size"/> <menuitem label="date modified"/> </menupopup> </menu
list> <spacer style="width: 10px;"/> <menu
list id="searchmode"> <menupopup> <menuitem label="is"/> <menuitem label="is not"/> </menupopup> </menu
list> <spacer style="width: 10px;"/> <textbox id="find-text" flex="1" style="min-width: 15em;"/> </hbox> two drop down boxes have been added to the dialog. a spacer has been added in between each element to separate them. the...
...not. you will also notice that the label was removed. if you resize the window vertically, the elements do not change size. this is because they are inside horizontal boxes. in might be more appropriate if the find and cancel buttons always stayed along the bottom of the window. this is easy to do by adding a spacer in between the two horizontal boxes. ...
...And 3 more matches
browser - Archive of obsolete content
nkhandler, homepage, showcaret, src, type properties accessibletype, cangoback, cangoforward, contentdocument, contentprincipal, contenttitle, contentvieweredit, contentviewerfile, contentwindow, currenturi, docshell, documentcharsetinfo, homepage, markupdocumentviewer, messagemanager, preferences, securityui, sessionhistory, webbrowserfind, webnavigation, webprogress methods addprogress
listener, goback, goforward, gohome, gotoindex, loaduri, loaduriwithflags, reload, reloadwithflags, removeprogress
listener, stop, swapdocshells examples <!-- shows mozilla homepage inside a groupbox --> <groupbox flex="1"> <caption label="mozilla homepage"/> <browser type="content" src="http://www.mozilla.org" flex="1"/> </groupbox> attributes autocompleteenabled type: boolean set...
...ment. most of its methods are callable directly on the element itself, such as goback and goforward. it also contains the load constants used by reloadwithflags and loaduriwithflags. webprogress type: nsiwebprogress this read-only property contains an nsiwebprogress object which is used to monitor the progress of a document loading. ...
... goback() return type: no return value go...
...And 3 more matches
menuseparator - Archive of obsolete content
image type: uri the uri of the image to appear on the element. if this attribute is empty or left out, no image appears. the position of the image is determined by the dir and orient attributes. label type: string the label that will appear on the element. if this is left out, no text appears. for an editable menuitem element the value of this attribute is copied to the menu
list.value property upon user selection of the menuitem. selected type: boolean indicates whether the element is selected or not. this value is read-only. to change the selection, set either the selectedindex or selecteditem property of the containing element. tabindex type: integer the tab order of the element. the tab order is the order in which the focus is moved when the user...
...in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not require validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable). for user editable menu
list elements, the contents, as visible to the user, are read and set using the menu
list.value syntax. for those elements, setattribute("value", myvalue) and getattribute("value") do not access or affect the contents displayed to the user. properties accessibletype type: integer a value indicating the type of accessibility object for the element. accesskey ...
...property's value is true if this element is selected, or false if it is not. this property is read only. this property is available for menuitem and menuseparator elements in firefox 3. tabindex type: integer gets and sets the value of the tabindex attribute. value type: string gets and sets the value of the value attribute. ...
...And 3 more matches
notification - Archive of obsolete content
image type: uri the uri of the image to appear on the element. if this attribute is empty or left out, no image appears. the position of the image is determined by the dir and orient attributes. label type: string the label that will appear on the element. if this is left out, no text appears. for an editable menuitem element the value of this attribute is copied to the menu
list.value property upon user selection of the menuitem. persistence type: integer the persistence may be set to a non-zero value so that the notificationbox's removetransientnotifications method does not remove them. this may be used to close a set of notifications as a group without affecting other notifications. priority type: integer numeric value that specifies the order in wh...
...in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not require validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable). for user editable menu
list elements, the contents, as visible to the user, are read and set using the menu
list.value syntax. for those elements, setattribute("value", myvalue) and getattribute("value") do not access or affect the contents displayed to the user. properties accessibletype type: integer a value indicating the type of accessibility object for the element. image ...
...e of the label attribute. persistence type: integer gets and sets the value of the persistence attribute. priority type: string gets and sets the value of the priority attribute. type type: string gets and sets the value of the type attribute. value type: string gets and sets the value of the value attribute. ...
...And 3 more matches
prefpane - Archive of obsolete content
. image type: uri the uri of the image to appear on the element. if this attribute is empty or left out, no image appears. the position of the image is determined by the dir and orient attributes. label type: string the label that will appear on the element. if this is left out, no text appears. for an editable menuitem element the value of this attribute is copied to the menu
list.value property upon user selection of the menuitem. onpaneload type: script code code defined here is called when the pane has been loaded, much like the load event for a window. selected type: boolean this attribute will be set to true for the currently selected prefpane. to change the selected pane, use the prefwindow's showpane method. ...
...operties contentheight (readonly) the height (in pixels) of current pane's content. image type: image url gets and sets the value of the image attribute. label type: string gets and sets the value of the label attribute. loaded indicates whether the pane is fully loaded. preferenceelements type: dom node
list holds a
list of the ui elements in the pane that are attached to preferences. preferences type: dom node
list holds a
list of the preference elements in the pane. selected type: boolean this property's value is true if this element is selected, or false if it is not. this property is read only. this property is available for menuitem and menusep...
...returns the preference element to which a user interface element is attached. void userchangedvalue(in domelement element); the user changed the value in a widget that the preferences system does not automatically track state changes for (1) and the preference element associated with the widget should be updated based on the state held by the widget. ...
...And 3 more matches
tabbox - Archive of obsolete content
t a tabs element which contains the tabs and the second a tabpanels element which contains the contents of the pages. more information is available in the xul tutorial. ...
...thus, if this attribute is not used, the tabbox or an element inside it must have the focus for the keyboard navigation to apply. parent keyboard navigation is captured at the parent of the tabbox. window keyboard navigation is captured at the window level. tab navigation will occur as long as any elem...
...re --></tabpanel> <tabpanel><!-- tabpanel second elements go here --></tabpanel> <tabpanel><button label="click me"/></tabpanel> <tabpanel><!-- tabpanel fourth elements go here --></tabpanel> </tabpanels> </tabbox> attributes eventnode type: one of the values below indicates where keyboard navigation events are
listened to. if this attribute is not specified, events are
listened to from the tabbox. thus, if this attribute is not used, the tabbox or an element inside it must have the focus for the keyboard navigation to apply. parent keyboard navigation is captured at the parent of the tabbox. window keyboard navigation is captured at the window level. tab navigation will occur as long as any element in the window is focused. document keyboard navigati...
...And 3 more matches
tabs - Archive of obsolete content
by assigning its index to this property. by assigning -1 to this property, all items will be deselected. returns -1 if no items are selected selecteditem type: element holds the currently selected item. if no item is currently selected, this value will be null. you can select an item by setting this value. a select event will be sent to the controlling container (i.e. the
listbox, rich
listbox, radiogroup, etc., not the
list item that was selected) when it is changed either via this property, the selectedindex property, or changed by the user. tabbox type: tabbox element returns the tabbox element that contains the tabs. tabindex type: integer gets and sets the value of the tabindex attribute. value type: string gets and sets t...
...cted) when it is changed either via this property, the selectedindex property, or changed by the user. tabbox type: tabbox element returns the tabbox element that contains the tabs. tabindex type: integer gets and sets the value of the tabindex attribute. value type: string gets and sets the value of the value attribute. ...
... tabbox type: tabbox element returns the tabbox element that contains the tabs. tabindex type: integer gets and sets the value of the tabindex attribute. value type: string gets and sets the value of the value attribute. for textbox and user editable menu
list elements, the contents, as visible to the user, are read and set using the textbox.value and menu
list.value syntax. ...
...And 3 more matches
toolbar - Archive of obsolete content
er. when set to false, the default, the toolbar is visible. this only has an effect on windows and needs to be combined with type="menubar" and a menubar element. currentset not in seamonkey 1.x type: comma-separated string the current set of displayed items on the toolbar. this will be modified when the user customizes the toolbar. the value of this attribute should be a comma-separated
list of item ids from the toolbarpalette or, additionally, any of the following strings: "separator", "spring", "spacer". customindex not in seamonkey 1.x type: integer this value is the index of the toolbar in the
list of the custom toolbars. the value is updated automatically by the toolbar customization dialog. customizable not in seamonkey 1.x type: boolean set this attribute to ...
...for example, back-button,forward-button,print-button. grippyhidden seamonkey only type: boolean when set to true, the grippy will be hidden. ...
...for example, back-button,forward-button,print-button. ...
...And 3 more matches
Desktop gamepad controls - Game development
javascript code thanks to the browsers implementing such feature. an api exposes all the information you need to hook up your game's logic and successfully control the user interface and gameplay. api status, browser and hardware support the gamepad api is still in working draft status, although browser support is already quite good — around 63% global coverage, according to caniuse.com. ...
... already quite good — around 63% global coverage, according to caniuse.com. the
list of supported devices is also quite extensive — most popular gamepads (e.g. xbox 360 or ps3) should be suitable for web implementations. pure javascript approach let's think about implementing pure javascript gamepad controls in our little controls demo first to see how it would work. ...
...te good — around 63% global coverage, according to caniuse.com. the
list of supported devices is also quite extensive — most popular gamepads (e.g. xbox 360 or ps3) should be suitable for web implementations. pure javascript approach let's think about implementing pure javascript gamepad controls in our little controls demo first to see how it would work. ...
...And 3 more matches
Mobile touch controls - Game development
s: battle at andromeda is built with phaser and managing the controls is phaser-based, but it could also be done in pure javascript. 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. ...
...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.addevent
listener("touchstart", handlestart); el.addevent
listener("touchmove", handlemove); el.addevent
listener("touchend", handleend); el.addevent
listener("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). the events are as follows: touchstart is f...
...layer's ship by touching the screen on a mobile device. we will use two events: touchstart and,touchmove both handled by one function. ...
...And 3 more matches
Paddle and keyboard controls - Game development
th, paddleheight); ctx.fillstyle = "#0095dd"; ctx.fill(); ctx.closepath(); } allowing the user to control the paddle we can draw the paddle wherever we want, but it should respond to the user's actions. it's time to implement some keyboard controls. we will need the following: two variables for storing information on whether the left or right control button is pressed. two event
listeners for keydown and keyup events. we want to run some code to handle the paddle movement when the buttons are pressed. two functions handling the keydown and keyup events the code that will be run when the buttons are pressed. the ability to move the paddle left and right pressed buttons can be defined and initialized with boolean variables like in the example. add these lines somewhere nea...
...that will be run when the buttons are pressed. the ability to move the paddle left and right pressed buttons can be defined and initialized with boolean variables like in the example. add these lines somewhere near the rest of your variables: var rightpressed = false; var leftpressed = false; the default value for both is false because at the beginning the control buttons are not pressed. ...
...he ability to move the paddle left and right pressed buttons can be defined and initialized with boolean variables like in the example. add these lines somewhere near the rest of your variables: var rightpressed = false; var leftpressed = false; the default value for both is false because at the beginning the control buttons are not pressed. to
listen for key presses, we will set up two event
listeners. add the following lines just above the setinterval() line at the bottom of your javascript: document.addevent
listener("keydown", keydownhandler, false); document.addevent
listener("keyup", keyuphandler, false); when the keydown event is fired on any of the keys on your keyboard (when they are pressed), the keydownhandler() function will be executed. the same pattern is true for the second ...
...And 3 more matches
Pseudo-classes and pseudo-elements - Learn web development
once again the relevant mdn page for each selector is helpful in explaining browser support. ...
... the site css arrow please, which helps you to generate an arrow with css. look at the css as you create your arrow and you will see the ::before and ::after pseudo-elements in use. whenever you see these selectors, look at the content property to see what is being added to the document. reference section there are a large number of pseudo-classes and pseudo-elements, and it is useful to have a
list to refer to. below are tables
listing them, with links to their reference pages on mdn. use this as a reference to see the kind of things that are available for you to target. pseudo-classes selector description :active matches when the user activates (for example clicks on) an element. :any-link matches both the :link and :visited states of a link. ...
...ich is last among its siblings. :last-of-type matches an element of a certain type that is last among its siblings. :left in paged media, matches left-hand pages. :link matches unvisited links. :local-link matches links pointing to pages that are in the same site as the current document. ...
...And 3 more matches
Advanced form styling - Learn web development
o recap what we said in the previous article, we have: the bad: some elements are more difficult to style, requiring more complex css or some more specific tricks: checkboxes and radio buttons <input type="search"> the ugly: some elements can't be styled thoroughly using css. these include: elements involved in creating dropdown widgets, including <select>, <option>, <optgroup> and <data
list>. <input type="color"> date-related controls such as <input type="datetime-local"> <input type="range"> <input type="file"> <progress> and <meter> let's first talk about the appearance property, which is pretty useful for making all of the above more stylable. appearance: controlling os-level styling in the previous article we said that historically, styling of web form controls was larg...
...istent in behavior; interestingly enough, both chromium-based browsers (chrome, opera, edge), safari, and firefox all support the -webkit- prefixed version (-webkit-appearance). firefox settled on this because web developers mostly seemed to be using the -webkit- prefixed version, so it was better for compatibility. if you look at the reference page you'll see a lot of different possible values
listed for -webkit-appearance, however by far the most helpful value, and probably the only one you'll use, is none. this stops any control you apply it to from using system-level styling, as much as possible, and lets you build up the styles yourself using css. for example, let's take the following controls: <form> <p> <label for="search">search: </label> <input id="search" name="search" ...
...me-local"], input[type="color"], select { box-shadow: inset 1px 1px 3px #ccc; border-radius: 5px; } label { margin-bottom: 5px; } button { width: 60%; margin: 0 auto; } note: if you want to test these examples across a number of browsers simultaneously, you can find it live here (also see here for the source code). also bear in mind that we've added some javascript to the page that
lists the files selected by the file picker, below the control itself. this is a simplified version of the example found on the <input type="file"> reference page. as you can see, we've done fairly well at getting these to look uniform across modern browsers. we've applied some global normalizing css to all the controls and their labels, to get them to size in the same way, adopt their parent font,...
...And 3 more matches
Introduction to web APIs - Learn web development
ow appear on a page or some new content displayed, for example, that's the dom in action. find out more about these types of api in manipulating documents. apis that fetch data from the server to update small sections of a webpage on their own are very commonly used. this seemingly small detail has had a huge impact on the performance and behaviour of sites — if you just need to update a stock
listing or
list of available new stories, doing it instantly without having to reload the whole entire page from the server can make the site or app feel much more responsive and "snappy". apis that make this possible include xmlhttprequest and the fetch api. you may also come across the term ajax, which describes this technique. find out more about such apis in fetching data from the server. apis fo...
...f the facebook ecosystem to benefit your app, for example by providing app login using facebook login, accepting in-app payments, rolling out targetted ad campaigns, etc. the telegram apis allows you to embed content from telegram channels on your website, in addition to providing support for bots. the youtube api, which allows you to embed youtube videos on your site, search youtube, build play
lists, and more. the pinterest api provides tools to manage pinterest boards and pins to include them in your website. the twilio api, which provides a framework for building voice and video call functionality into your app, sending sms/mms from your apps, and more. the mastodon api enables you to manipulate features of the mastodon social network programmatically. note: you can find informatio...
...tn = document.queryselector('button'); const volumeslider = document.queryselector('.volume'); const audiosource = audioctx.createmediaelementsource(audioelement); next up we include a couple of event handlers that serve to toggle between play and pause when the button is pressed and reset the display back to the beginning when the song has finished playing: // play/pause audio playbtn.addevent
listener('click', function() { // check if context is in suspended state (autoplay policy) if (audioctx.state === 'suspended') { audioctx.resume(); } // if track is stopped, play it if (this.getattribute('class') === 'paused') { audioelement.play(); this.setattribute('class', 'playing'); this.textcontent = 'pause' // if track is playing, stop it }...
...And 3 more matches
Third-party APIs - Learn web development
make a connection between the api and your app. in the case of this api, you need to include the api key as a get parameter every time you request data from the service at the correct url. find the following line: let key = ' ... '; replace the existing api key with the actual api key you got in the previous section. ...
...ce at the correct url. find the following line: let key = ' ... '; replace the existing api key with the actual api key you got in the previous section. add the following line to your javascript, below the "// event
listeners to control the functionality" comment. this runs a function called submitsearch() when the form is submitted (the button is pressed). ...
...re-rerun the fetch request with the new value included in the page url parameter. this works because the nytimes api only returns 10 results at a time — if more than 10 results are available, it will return the first 10 (0-9) if the page url parameter is set to 0 (or not included at all — 0 is the default value), the next 10 (10-19) if it is set to 1, and so on. ...
...And 3 more matches
Working with JSON - Learn web development
uperheroes for example, we could then access the data inside it using the same dot/bracket notation we looked at in the javascript object basics article. for example: superheroes.hometown superheroes['active'] to access data further down the hierarchy, you simply have to chain the required property names and array indexes together. for example, to access the third superpower of the second hero
listed in the members
list, you'd do this: superheroes['members'][1]['powers'][2] first we have the variable name — superheroes. inside that we want to access the members property, so we use ["members"]. members contains an array populated by objects. we want to access the second object inside the array, so we use [1]. inside this object, we want to access the powers property, so we use ["pow...
...s the superhero cards: function showheroes(jsonobj) { const heroes = jsonobj['members']; for (let i = 0; i < heroes.length; i++) { const myarticle = document.createelement('article'); const myh2 = document.createelement('h2'); const mypara1 = document.createelement('p'); const mypara2 = document.createelement('p'); const mypara3 = document.createelement('p'); const my
list = document.createelement('ul'); myh2.textcontent = heroes[i].name; mypara1.textcontent = 'secret identity: ' + heroes[i].secretidentity; mypara2.textcontent = 'age: ' + heroes[i].age; mypara3.textcontent = 'superpowers:'; const superpowers = heroes[i].powers; for (let j = 0; j < superpowers.length; j++) { const
listitem = document.createelement('li');
listite...
...this array contains multiple objects that contain the inform...
...And 3 more matches
Getting started with Svelte - Learn web development
his case we are embedding the value of the name prop right after the hello text. <main> <h1>hello {name}!</h1> <p>visit the <a href="https://svelte.dev/tutorial">svelte tutorial</a> to learn how to build svelte apps.</p> </main> svelte also supports tags like {#if...}, {#each...}, and {#await...} — these examples allow you to conditionally render a portion of the markup, iterate through a
list of elements, and work with async values, respectively. the <style> section if you have experience working with css, the following snippet should make sense: <style> main { text-align: center; padding: 1em; max-width: 240px; margin: 0 auto; } h1 { color: #ff3e00; text-transform: uppercase; font-size: 4em; font-weight: 100; } @media (min-width: 640px) ...
...xecutes the togglename() function, which in turn updates the value of the name variable. as you can see, the <h1> label is automatically updated. behind the scenes, svelte created the javascript code to update the dom whenever the value of the name variable changes, without using any virtual dom or other complex reconciliation mechanism. note the use of : in on:click. that's svelte's syntax for
listening to dom events. inspecting main.js: the entry point of our app let’s open src/main.js, which is where the app component is being imported and used. this file is the entry point for our app, and it initially looks like this: import app from './app.svelte'; const app = new app({ target: document.body, props: { name: 'world' } }); export default app; main.js starts by importing...
... note: if you just want to download the files without cloning the git repo, you can use the degit tool like this — npx degit opensas/mdn-svelte-tutorial. you can also download a specific folder with npx degit opensas/mdn-svelte-tutorial/01-getting-started. degit won't create a local git repo, it will just download the files of the specified fol...
...And 3 more matches
Styling Vue components with CSS - Learn web development
tutorial will not be using such tools, it's good to know that when including such code in the assets folder it will be processed automatically. ...
... next, in your src/main.js file, import the reset.css file like so: import './assets/reset.css'; this will cause the file to get picked up during the build step and automatically added to our site. the reset styles should be applied to the app now. the images below show the look of the app before and after the reset is applied. before: after: noticeable changes include the removal of the
list bullets, background color changes, and changes to the base button and input styles. adding global styles to single file components now that we've reset our css to be uniform across browsers, we need to customize the styles a bit more. there are some styles that we want to apply across components in our app. while adding these files directly to the reset.css stylesheet would work, we'll instead ...
...now we can go through and begin editing our components to use some of these styles. adding css classes in vue we should apply the button css classes to the <button> in our todoform component. since vue templates are valid html, this is done in the same way to how you might do it in plain html — by adding a class="" att...
...And 3 more matches
Information for External Developers Dealing with Accessibility
a desktop application, in order to make it accessible with 3rd party assistive technologies, containing practical tips and the details of mozilla's implementation. accessibility api cross reference should be helpful at anyone looking at implementing accessibility api support for a product on multiple platforms. contains info on accessible roles, states and events. accessible toolkit check
list a
list of what needs to be done for accessibility when building new toolkits, widget by widget. in addition, here is a
list of official keyboard ui guidelines for each desktop: windows keys: guidelines on keyboard ui design and on implementing keyboard shortcuts: an excellent resource from microsoft. mac keys: keyboard shortcuts quick reference for mac os x complete ...
...ty when building new toolkits, widget by widget. in addition, here is a
list of official keyboard ui guidelines for each desktop: windows keys: guidelines on keyboard ui design and on implementing keyboard shortcuts: an excellent resource from microsoft. ...
...ks for those who wish to learn more about web accessibility or open source accessibility. join the mozilla accessibility community live chat both end users and developers are invited for discussion on the live irc channel at irc.mozilla.org/#accessibility. since this is a worldwide effort, there is always a good chance to find someone to chat with there, day or night. ...
...And 3 more matches
Information for users
date information on any issues related to compatibility with assistive technologies such as screen readers, screen magnifiers, voice input software and on screen keyboards. planning ahead for accessibility this document is intended to help testers and designers understand and plan what still needs to be added to our ui for full usable accessibility. ...
...ftware and on screen keyboards. planning ahead for accessibility this document is intended to help testers and designers understand and plan what still needs to be added to our ui for full usable accessibility. ...
...hemes with extra large and bright icons themes with extra large and extra bold text join the mozilla accessibility community live chat both end users and developers are invited for discussion on the live irc channel at irc.mozilla.org/#accessibility. since this is a worldwide effort, there is always a good chance to find someone to chat with there, day or night. ...
...And 3 more matches
Limitations of chrome scripts
this page describes patterns that used to work in the chrome process that will no longer work in multiprocess firefox. these are the sorts of things that will break an old add-on in multiprocess firefox. the fix is generally some variant of "do that in a frame script loaded into the content process". this is one of a pair of articles: the other one
lists limitations of frame scripts. compatibility shims for many of the patterns described here we've implemented compatibility shims so the patterns still work. for example: whenever extensions try to access web content from the chrome process, the browser will return a cross process object wrapper that gives the chrome code synchronous access to the content. you'll get the shims for your add-on by default, unless you set the multiproce...
...ntent to check is forwarded as a cpow. the chrome process then checks the content against the policy supplied by the add-on, and forwards the response back to the child to be enforced. to make the shim unnecessary: define and register nsicontentpolicy in the content process. if you need to ensure that the policy is only registered once, use a process script to register the policy. nsiwebprogress
listener this api will work in the chrome process. there is a shim that gives you access to the domwindow property of the nsiwebprogress object passed into onstatechange. however, the domwindow is passed asynchronously, so by the time the chrome process receives it, the dom might have changed (for example, because code running in the content process modified it or we navigated to a different page). w...
...tatechange. however, the domwindow is passed asynchronously, so by the time the chrome process receives it, the dom might have changed (for example, because code running in the content process modified it or we navigated to a different page). we're working on fixing this issue in bug 1118880. also note that unlike other shims, this shim is always active. alternatively, you can use nsiwebprogress
listener in the content process. observers in the chrome process depending on the topic, you need to register observers in either the chrome process or in a frame script. for most topics you need to register observers in the chrome process. however, you must
listen to content-document-global-created and document-element-inserted in a frame script. observers for these topics get content objects as ...
...And 3 more matches
Browser API
browser api consists of two major parts: custom <iframe> attributes: by adding a mozbrowser attribute to the <iframe> element we can make it appear like a top-level browser window to the embedded content. this means that window.top, window.parent, window.frameelement, etc. should not reflect the frame hierarchy. api extensions: the api includes several new methods and events to manipulate and
listen for changes to the embedded content's state, interited by the htmliframeelement interface. browser api interfaces to support the requirement of a browser <iframe>, the htmliframeelement dom interface has been extended with new methods that give the <iframe> some super powers. navigation methods the following navigation methods allow navigation through the browsing history of the <iframe>. ...
... unmutes any audio playing in the browser <iframe>. htmliframeelement.getmuted() indicates whether the browser <iframe> is currently muted. event-related methods in order to manage the browser <iframe>'s content, many new events were added (see below). the following methods are used to deal with those events: the <iframe> gains support for the methods of the eventtarget interface addevent
listener(), removeevent
listener(), and dispatchevent(). htmliframeelement.sendmouseevent() sends a mouseevent to the <iframe>'s content. utility methods last, there are some utility methods, useful for apps that host a browser <iframe>. htmliframeelement.getstructureddata() retrieves any structured microdata (and hcard and hcalendar microformat data) contained in the html loaded in the browse...
...er api methods removed in firefox 65 in firefox 65, several of the mozilla browser api methods were removed in an effort to cut down on domrequest usage in the browser, and remove the parts of the browser api that are no longer needed (it is used only by the firefox devtools at this point). see bug 1503070 for more details. the methods removed in firefox 65 are: htmliframeelement.addnextpaint
listener() defines a handler to
listen for the next mozafterpaint event in the browser <iframe>. htmliframeelement.clearmatch() clears any content highlighted by findall() or findnext(). htmliframeelement.download() downloads a specified url, storing it at the specified filename/path. htmliframeelement.executescript() allows a specified script to be executed against a page loaded in the browser...
...And 3 more matches
HTML parser threading
arser is not script-created, nshtml5parser::markasnotscriptcreated() is called to create an nshtml5streamparser for the nshtml5parser. due to legacy interface design oddities, an nshtml5parser is initialized by calling nshtml5parser::parse(nsiuri*, nsirequestobserver*, void*, nsdtdmode). that method call doesn't yet cause anything to be parsed, though. actual network data is passed to an nsistream
listener. nshtml5streamparser is the nsistream
listener implementation obtained by calling nsistream
listener* nshtml5parser::getstream
listener(). the nsistream
listener methods (onstartrequest, ondataavailable and onstoprequest) are called on the main thread. onstartrequest does all sorts of initialization on the main thread. at that point, nothing has happened on the parser thread yet and the nshtml5st...
...es back to the main thread to call release on nshtml5streamparser on the main thread. normal (non-speculative) parsing initially, dodataavailable performs character encoding sniffing on the data if an encoding wasn't declared on the enclosing protocol (http) level. once a unicode decoder has been set up, dodataavailable passes the byte data to the decoder whose output is accumulated into a linked
list of nshtml5owningutf16buffer objects. nshtml5owningutf16buffer objects are then passed to the tokenizer in sequence by the parseavailabledata() method. the tokenizer calls into the tree builder which outputs nshtml5treeoperation objects (tree ops) into a queue. each tree op represents a small operation, such as element creation or appending a node into another, that can later be performed on the m...
...f the speculation, an index into the nshtml5owningutf16buffer defining the exact starting point within the buffer, the line number of the tokenizer at that point and a snapshot of the tree op state. the line number and the snapshot are also added to the tree op that attempts to execute scripts (before flushing it). the tree builder snapshot contains a copy of the tree builder stack, a copy of the
list of open formatting elements and copies of various fields that define the tree builder state. it contains all the information that is necessary to load back into the tree builder to restore it into a behaviorally equivalent state. the flush timer is disengaged, because it's not useful to make the tree builder flush ops into the queue of the speculation incrementally. after the speculation has been...
...And 3 more matches
Getting Started with Chat
: windows mac linux colloquy ā irssi ā ā ā* xchat ā ā ā key: ā — binary or executable program available ā — only available by downloading and compiling source code ā* — binary or executable may be available. if not, you'll have to download source code and compile. ...
...complete
list of irc clients go here. web-based clients there are also a few web-based clients which allow connecting to irc by clicking on irc:// links. one of the simplest web-based clients is mibbit, another is irccloud. these operate very much in the same way as the previously mentioned desktop clients and chatzilla. mibbit does not require flash or any other plugins. ...
...a member of the mozilla community: (remember to use irc.mozilla.org and port 6697 or 6667 for your server settings) #qa a channel for qa discussion #developers a channel for mozilla development discussion #sumo a channel for support with firefox for more information about the mozilla irc network and more channels, go here. commands the following is a
list of commands you should be familiar with. simply type them into the message box at the bottom of the screen and press enter: /join #channel joins you to the specified channel until you quit your irc client or quit the channel /leave leave the current channel /mode #channel +k password sets a password for the channel. if #channel is not specified, the command is...
...And 3 more matches
IME handling guide
ains how gecko handles ime. introduction ime is an abbreviation of input method editor. this is a technical term from windows but these days, this is used on other platforms as well. ime is a helper application of a user's text input. it handles native key events before or after focused application (depending on the platform) and creates a composition string (a.k.a. preedit string), suggests a
list of what the user attempts to input, commits composition string as a selected item off the
list and commits composition string without any conversion. ime is used by chinese, japanese, korean and taiwan users for inputting chinese characters because the number of them is beyond thousands and cannot be input from the keyboard directly. however, especially on mobile devices nowadays, ime is also use...
...ć®ć§ć" (nakano). then, converts each clause with chinese characters: "ē§ć®", "ååćÆ" and "äøéć§ć" (in the following screenshot each clause is underlined and not connected adjacently. these clauses are called "converted clause"). if one or more clauses were not converted as expected, the user can choose one of the clauses with arrow keys and look for the expected result form the
list in the drop down menu (in the following screenshot, the clause with the thicker underline is called "selected clause"). basically, composition string and each clause style is rendered by gecko. and the drop down menu is created by ime. each clause is represented with selection in the editor. from chrome script, you can check it with nsiselectioncontroller. in native code, you can access it wi...
...nager imestatemanager looks for a textcomposition instance whose native ime context is same as the widget' which dispatches the widget event. if there is no proper textcomposition instance, it creates the instance. and it sends the event to the textcomposition instance. note that all instances of textcomposition are managed by imestatemanager. when an instance is created, it's registered to the
list. when composition completely ends, it's unregistered from the
list (and released automatically). mozilla::textcomposition textcomposition manages a composition and dispatches dom compositionupdate events. when this receives an ecompositionchange, ecompositioncommit or ecompositioncommitasis event, it dispatches the event to the stored node which was the event target of ecompositionstart event.
...And 3 more matches
Integrated Authentication
egotiated as the authentication protocol. so, it is paramount that the browser does not freely exchange ntlm user credentials with any server that requests them. the ntlm response includes a hash of the user's logon credentials. on older versions of windows this hash is computed using a relatively weak algorithm (see hertel for more info on ntlm authentication). ...
...ely exchange ntlm user credentials with any server that requests them. the ntlm response includes a hash of the user's logon credentials. on older versions of windows this hash is computed using a relatively weak algorithm (see hertel for more info on ntlm authentication). mozilla currently supports a white
list of sites that are permitted to engage in spnego authentication with the browser. ...
...s hash is computed using a relatively weak algorithm (see hertel for more info on ntlm authentication). mozilla currently supports a white
list of sites that are permitted to engage in spnego authentication with the browser. this
list is intended to be configured by an it department prior to distributing mozilla to end-users. ...
...And 3 more matches
Addon
"required" and others "optional," which means that the optional methods or property may not exist on addon instances for some types of add-ons. api consumers should take care to verify the existence of these methods or properties before relying on them. ...
..." and others "optional," which means that the optional methods or property may not exist on addon instances for some types of add-ons. api consumers should take care to verify the existence of these methods or properties before relying on them. ...
... creator read only addonauthor the creator of the add-on. foreigninstall read only boolean true or false depending on whether the add-on is a third party add-on installation or not. id read only string the id ...
...And 3 more matches
Interfacing with the Add-on Repository
importing the repository code module before you can use the add-on repository api, you need to import the code module: components.utils.import("resource://gre/modules/addonrepository.jsm"); having done this, you can then access the api through the resulting addonrepository object. ...
... importing the repository code module before you can use the add-on repository api, you need to import the code module: components.utils.import("resource://gre/modules/addonrepository.jsm"); having done this, you can then access the api through the resulting addonrepository object. ...
... starting a request to start a search of the repository, you can use either of the following met...
...And 3 more matches
PromiseWorker.jsm
with args `args` return self[method](...args); }; worker.postmessage = function(...args) { // post a message to the main thread self.postmessage(...args); }; worker.close = function() { // close the worker self.close(); }; worker.log = function(...args) { // log (or discard) messages (optional) dump('worker: ' + args.join(' ') + '\n'); }; // connect it to message port. self.addevent
listener('message', msg => worker.handlemessage(msg)); abstractworker is a base class for the worker, and it's designed to be used by derived class, which provides above four methods (dispatch, postmessage, close, and log). but you can instantiate abstractworker itself and set its properties later, instead of creating derived class. main thread file the basepromiseworker object needs to be importe...
...w basepromiseworker('path_to_worker_file.js'); you're now ready to start using promiseworker. sending a message from main thread to send a message to a worker from the main thread, one normally uses postmessage(). for promiseworker objects, however, you can't do that. instead, use the post() method, as seen below. post syntax promise = myworker.post(afunctionname, aargs, aclosure, atransfer
list); parameters afunctionname the name of the function to be called as it appears in the worker file. aargs an array of arguments to pass to the function named afunctionname in the worker file. if the worker function does not have any arguments and the empty array should be passed here. if any of the arguments is a promise, it is resolved before posting the message. if any of the argumen...
... function named afunctionname in the worker file. if the worker function does not have any arguments and the empty array should be passed here. if any of the arguments is a promise, it is resolved before posting the message. ...
...And 3 more matches
source-editor.jsm
ough source-editor.jsm. ...
... void destroy(); void init(element aelement, object aconfig, function acallback); search operations number find(string astring, [optional] object options); number findnext(boolean awrap); number findprevious(boolean awrap); event management void addevent
listener(string aeventtype, function acallback); void removeevent
listener(string aeventtype, function acallback); undo stack operations boolean canredo(); boolean canundo(); void endcompoundchange(); boolean redo(); void resetundo(); void startcompoundchange(); boolean undo(); display management operations void focus(); number gettopindex(); boolean hasfocus()...
... constant value description sourceeditor.events.blur "blur" fired when the editor loses focus. sourceeditor.events.breakpoint_change "breakpointchange" fired when a new breakpoint is added, or when an existing breakpoint is removed. this happens both when the api is used to make the change or when the ui is used to do it. sourceeditor.eve...
...And 3 more matches
Localizing with Koala
earch for "koala". click add to komodo edit... restart komodo when the installation is complete. you should see a new button in komodo's toolbar, with two options: startpage and management. before you can use them, you need to create a new koala project. creating a new project create a new koala project by going to file > new > new project from template... choose "koala" in the categories
list. choose "koala" in the templates
list. choose a name for your project (e.g. l10n.kpf). choose the directory in which the project will live in (e.g. c:\mozilla\l10n on windows, /home/user/mozilla/l10n on linux or /users/user/mozilla/l10n on mac os x). due to a bug in koala (bug 21930), it is recommended that you don't choose a path that contains spaces (like c:\documents and settings\user\...). ...
...hen the comparison is done, you should see a new line in "last used compares" section of koala's startpage. it's a handy shortcut to run the comparison in the future. if the sidebar with the results of the comparison doesn't show up automatically: open the projects sidebar by choosing view > tabs & sidebars > projects from the menu. switch to "koala file view" in the sidebar (choose it from the
list that appears when you click on the arrow pointing down situated next to the sidebar's [x] button). you should now see the results of the comparison in the "koala file view" sidebar. translating files let's translate the searchbar-related strings mentioned in the beginning of this document. they can be found in two files, inside the browser/chrome/browser directory: searchbar.dtd, search.pro...
...arch') is found in search.properties file. it has to be generated every time the user switches between pages. on the other hand, "manage search engines..." is generated only once, on start-up, and doesn't need to change. therefore, it is located in searchbar.dtd file. let's translate these strings now. type "search" in koala file view sidebar filter field and click "search". ...
...And 3 more matches
Scroll-linked effects
ed effect is an effect implemented on a webpage where something changes based on the scroll position, for example updating a positioning property with the aim of producing a parallax scrolling effect. this article discusses scroll-linked effects, their effect on performance, related tools, and possible mitigation techniques. scrolling effects explained often scrolling effects are implemented by
listening for the scroll event and then updating elements on the page in some way (usually the css position or transform property.) you can find a sampling of such effects at css scroll api: use cases. these effects work well in browsers where the scrolling is done synchronously on the browser's main thread. however, most browsers now support some sort of asynchronous scrolling in order to provide a ...
...ere the "toolbar" div will stick to the top of the screen as you scroll down. <body style="height: 5000px" onscroll="document.getelementbyid('toolbar').style.top = math.max(100, window.scrolly) + 'px'"> <div id="toolbar" style="position: absolute; top: 100px; width: 100px; height: 20px; background-color: green"></div> </body> this implementation of sticky positioning relies on the scroll event
listener to reposition the "toolbar" div. as the scroll event
listener runs in the javascript on the browser's main thread, it will be asynchronous relative to the user-visible scrolling. therefore, with asynchronous scrolling, the event handler will be delayed relative to the user-visible scroll, and so the div will not stay visually fixed as intended. instead, it will move with the user's scrolling,...
...th asynchronous scrolling, the event handler will be delayed relative to the user-visible scroll, and so the div will not stay visually fixed as intended. instead, it will move with the user's scrolling, and then "snap" back into position when the scroll event handler runs. this constant moving and snapping will result in a jittery visual effect. one way to implement this without the scroll event
listener is to use the css property designed for this purpose: <body style="height: 5000px"> <div id="toolbar" style="position: sticky; top: 0px; margin-top: 100px; width: 100px; height: 20px; background-color: green"></div> </body> this version works well with asynchronous scrolling because position of the "toolbar" div is updated by the browser as the user scrolls. example 2: scroll snapping be...
...And 3 more matches
TraceMalloc
ormat option, -u. 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. bloatblame accumulates allocation counts and ignores free calls. if you run with --trace-malloc -, your code can call ns_tracemallocdumpallocations(pathname) at opportune times, and a human-readable
listing of the current heap, including stack traces for every allocation, will be written to pathname. this file can be post-processed by tools in mozilla/tools/trace-malloc as follows: histogram.pl, which produces a type histogram that can be diffed with histogram-diff.sh to produce output that looks like this: ---- base ---- ---- incr ---- ----- difference ---- type count ...
... also, your javascript can call the following dom window methods: tracemallocdisable() - turn off tracing, first flushing any buffered log events for all log files. tracemallocenable() - turn on tracing. tracemallocopenlogfile(filename) - open a new log file and return its log file descriptor (or -1 on...
...dentified by logfd, flushing its buffer of any events first. if logfd identifies the current log file, change the current log file to the default log file given by the --trace-malloc command line argument. tracemalloclogtimestamp(caption) - log a timestamp event to the current log file, annotating the log even with the caption string. tracemallocdumpallocations(pathname) - dump a human-readable
listing of all traced, live allocations. see nstracemalloc.h for detailed comments on the log file format. analyzing the shutdown log the shutdown log is a basic tool for finding memory leaks. the shutdown log contains the stack trace of every allocation that has not been deallocated by shutdown. some of these are false positives, allocations that are truly needed until shutdown. ideally, these would...
...And 3 more matches
PRHostEnt
h_addrtype host address type. ...
...his structure is output from pr_gethostbyname and pr_gethostbyaddr and passed to pr_enumeratehostent. clients should avoid directly accessing any of the structure's fields. syntax #include <prnetdb.h> typedef struct prhostent { char *h_name; char **h_aliases; #if defined(_win32) print16 h_addrtype; print16 h_length; #else print32 h_addrtype; print32 h_length; #endif char **h_addr_
list; } prhostent; fields the structure has the following fields: h_name pointer to the official name of host. h_aliases pointer to a pointer to
list of aliases. the
list is terminated with a null entry. h_addrtype host address type. for valid nspr usage, this field must have a value indicating either an ipv4 or an ipv6 address. h_length length of internal representation of the address in...
... description this structure is used by many of the network address functions. ...
...And 3 more matches
FC_Finalize
n. if the library is not initialized, it does nothing. the preserved argument is not used and must be null. return value fc_finalize always returns ckr_ok. fc_finalize should check the preserved argument and return ckr_arguments_bad if preserved is not null. ...
...is not initialized, it does nothing. the preserved argument is not used and must be null. return value fc_finalize always returns ckr_ok. fc_finalize should check the preserved argument and return ckr_arguments_bad if preserved is not null. ...
...he preserved argument is not used and must be null. return value fc_finalize always returns ckr_ok. fc_finalize should check the preserved argument and return ckr_arguments_bad if preserved is not null. ...
...And 3 more matches
NSS_3.12.3_release_notes.html
rved support for the watcom c compiler is removed the file watcomfx.h is removed. bugs fixed the following bugs have been fixed in nss 3.12.3. bug 159483: cert name matching: rfc 2818 vs. backwards compatibility (wildcards) bug 334678: prng_fips1861.c redefines the macro bsize on hp-ux bug 335016: mpp_pprime (miller-rabin probabi
listic primality test) may choose 0 or 1 as the random integer bug 347037: make shlibsign depend on the softoken only bug 371522: auto-update of crls stops after first update bug 380784: pk11mode in non fips mode failed. bug 394077: libpkix need to return revocation status of a cert bug 412468: modify certutil bug 417092: modify pkix_certselector api to return an error if cert was rejected...
...: tolerate incorrect encoding of dsa signatures in ssl 3.0 handshakes bug 444404: libpkix reports unknown issuer for nearly all certificate errors bug 452391: certutil -k incorrectly reports ec private key as an orphan bug 453234: support for seed cipher suites to tls rfc4010 bug 453364: improve pk11_cipherop error reporting (was: pk11_createcontextbysymkey returns null bug 456406: slot
list leaks in symkeyutil bug 461085: rfe: export function cert_comparecerts bug 462293: crash on fork after softoken is dlclose'd on some unix platforms in nss 3.12 bug 463342: move some headers to freebl/softoken bug 463452: sql db creation does not set files protections to 0600 bug 463678: need to add rpath to 64-bit libraries on hp-ux bug 464088: option to build nss without dbm (handy f...
..._asciitoname fails when avas in an rdn are separated by '+' bug 477186: infinite loop in cert_getcertchainfromcert bug 477777: selfserv crashed in client/server tests. bug 478171: consolidate the coreconf/xxx.mk files for windows bug 478563: add _msc_ver (the cl version) to coreconf. bug 478724: nss build fails on windows since 20090213.1 nightly build. ...
...And 3 more matches
Index
to explain the changes that are happening, with a focus on how they will affect gecko code that uses jsapi. at a high level, there are three issues to be aware of: 8 getting spidermonkey source code guide, spidermonkey you can get the spidermonkey source code in gzipped form or directly from the mercurial repository. 9 hacking tips spidermonkey this page
list a few tips to help you investigate issues related to spidermonkey. all tips
listed here are dealing with the javascript shell obtained at the end of the build documentation of spidermonkey. it is separated in 2 parts, one section related to debugging and another section related to drafting optimizations. many of these tips only apply to debug builds of the js shell; they will not function in a re...
...erence, reference, référence(2), spidermonkey js::callargs is helper class encapsulating access to the callee, this value, arguments, and argument count for a function call. 30 js::clonefunctionobject jsapi reference, reference, référence(2), spidermonkey js::clonefunctionobject creates a new function object from funobj. the new object has the same code and argument
list as funobj. if scopechain is supplied, it uses scopechain as its enclosing scope. if scopechain is omitted, it creates a new function object in cx's global. this can be helpful if funobj is an extant function that you wish to use as if it were enclosed by a newly-created global object. 31 js::compile jsapi reference, reference, référence(2), spidermonkey js::compile compiles...
... js_clearscope removes all of obj's own properties, except the special __proto__ and __parent__ properties, in a single operation. properties belonging to objects on obj's prototype chain are not affected. 205 js_clonefunctionobject jsapi reference, spidermonkey js_clonefunctionobject creates a new function object from funobj. the new object has the same code and argument
list as funobj, but uses parent as its enclosing scope. this can be helpful if funobj is an extant function that you wish to use as if it were enclosed by a newly-created global object. 206 js_comparestrings jsapi reference, spidermonkey js_comparestrings compares two js strings, str1 and str2. if the strings are identical in content and length, js_comparestrings stores 0 in *resu...
...And 3 more matches
Shell global objects
variables scriptargs an array that contains arguments passed to js shell. scriptpath a string that is a path of script. ...
... variables scriptargs an array that contains arguments passed to js shell. scriptpath a string that is a path of script. ...
... variables scriptargs an array that contains arguments passed to js shell. scriptpath a string that is a path of script. console an object that has following property: log evaluate and print expressions to stdout. ...
...And 3 more matches
Querying Places
he search result the history service: nsinavhistoryservice, executes the query the first first step is to create the query and options, and fill them with the parameters you want. use nsinavhistoryservice.getnewquery() and nsinavhistoryservice.getnewqueryoptions() to retrieve empty objects. the defaults for these objects will result in a query that returns all of your browser history in a flat
list: chromeutils.definemodulegetter(this, "placesutils", "resource://gre/modules/placesutils.jsm"); // no query options set will get all history, sorted in database order, // which is nsinavhistoryqueryoptions.sort_by_none. let options = placesutils.history.getnewqueryoptions(); // no query parameters will return everything let query = placesutils.history.getnewquery...
...queryoptions(); // no query parameters will return everything let query = placesutils.history.getnewquery(); // execute the query let result = placesutils.history.executequery(query, options); result types nsinavhistoryqueryoptions has a resulttype property that allows configuration of the grouping and level of detail to be returned in the results. the different values for this property are
listed below. these values are also properties of nsinavhistoryqueryoptions, and are accessed like this: components.interfaces.nsinavhistoryqueryoptions.results_as_visit. results_as_uri: this is the default, and returns one result node of type result_type_uri for each uri that matches the query. the visit date for each node will be the last visit date for that url. results_as_visit: this option re...
...from subsequent query objects are ignored. this is bug 320332. bookmark queries there is a quick-start for doing simple bookmark queries in retrieving part of the bookmarks tree. the contents of bookmark folders can be retrieved by setting the "folders" member in the query object. this item is an array of folder ids from the bookmark service. typically, you will only have one folder id in this
list, which will given you the contents of that folder. you can set multiple folders and the result will be the intersection of all the folders. for sorting, you will generally want to use sort_by_none (the default) since this will return items in their "natural" order as specified by the user in the bookmarks manager. other sortings will work, however. for bookmark queries you will generally want n...
...And 3 more matches
XPCOM Stream Guide
it(file, ioflags, perm, behaviorflags); channels have streams too any implementation of nsichannel will have an input stream as well, but unless you own the channel, you shouldn't try to read from the input stream. there are two ways of getting the input stream: by calling the channel's .open() method for a synchronous read, or by calling the channel's .asyncopen() method with an nsistream
listener object. you can get an nsichannel object from the io service's newchannel(spec, charset, baseuri) method or its .newchannelfromuri(uri) method. the "safe file output stream" mozilla provides a "safe file output stream" implementation. this implementation actually writes the contents of the file you're trying to create to a temporary file. if everything goes well, calling the stream's .fini...
... files, with the .openfileoutputstream(file, modeflags) and .opensafefileoutputstream(file, modeflags) methods, and for closing those output streams with the .closesafefileoutputstream(inputstream) method. as we mentioned earlier, you can use the io service to get any channel, and from there an input stream. the io service is available through the services.jsm module as the .io property. stream
listeners a stream
listener is an object you build to let you know when there is data in a stream ready for you to consume. most streams are asynchronous: they make no assumptions that all the data a resource provides is available immediately. (this is particularly true of streams that reach out over a network connection, like http and ftp channels.) stream
listeners implement three methods. from th...
...ream
listener is an object you build to let you know when there is data in a stream ready for you to consume. most streams are asynchronous: they make no assumptions that all the data a resource provides is available immediately. (this is particularly true of streams that reach out over a network connection, like http and ftp channels.) stream
listeners implement three methods. from the nsistream
listener interface, the .ondataavailable(request, context, inputstream, offset, count) method gives you the input stream and the number of bytes available. the stream
listener must read exactly count bytes before exiting. from the nsirequestobserver interface, the .onstartrequest(request, context) method tells you when the request begins, while the .onstoprequest(request, context) method tells you whe...
...And 3 more matches
IAccessibleText
a2_event_text_updated event handlers. this data is only guaranteed to be valid while the thread notifying the event continues. once the handler has returned, the validity of the data depends on how the server manages the life cycle of its objects. also, note that the server may have different life cycle management strategies for controls depending on whether or not a control manages its children.
lists, trees, and tables can have a large number of children and thus it's possible that the child objects for those controls would only be created as needed. servers should document their life cycle strategy as this will be of interest to assistive technology or script engines accessing data out of process or from other threads. servers only need to save the last inserted block of text() and a scope ...
..._text_removed/updated event handlers. this data is only guaranteed to be valid while the thread notifying the event continues. once the handler has returned, the validity of the data depends on how the server manages the life cycle of its objects. also, note that the server may have different life cycle management strategies for controls depending on whether or not a control manages its children.
lists, trees, and tables can have a large number of children and thus it's possible that the child objects for those controls would only be created as needed. servers should document their life cycle strategy as this will be of interest to assistive technology or script engines accessing data out of process or from other threads. servers only need to save the last removed block of text() and a scope o...
...s are 0s. s_false if there is nothing to return, [out] values are 0s. s_ok. setcaretoffset() sets the position of the caret. the caret position/offset is that of the character logically following it, for example to the right of it in a left to right language. setting the caret position may or may not alter the current selection(). a change of the selection() is notified to the accessibility event
listeners with an ::ia2_event_text_selection_changed event. when the new caret position differs from the old one (which, of course, is the standard case) this is notified to the accessibility event
listeners with an ::ia2_event_text_caret_moved event. hresult setcaretoffset( [in] long offset ); parameters offset the new index of the caret. this caret is actually placed to the left side of the char...
...And 3 more matches
mozIPersonalDictionary
correction the cor...
...rrection(in wstring word, [array, size_is(count)] out wstring words, out pruint32 count); void ignoreword(in wstring word); void load(); void removecorrection(in wstring word,in wstring correction, in wstring lang); void removeword(in wstring word, in wstring lang); void save(); attributes attribute type description word
list nsistringenumerator get the (lexicographically sorted)
list of words. read only. methods addcorrection() adds a misspelling to the
list of corrections. note that this method is not currently implemented. void addcorrection( in wstring word, in wstring correction, in wstring lang ); parameters word the incorrect spelling of the word to add to the
list of corrections. correction the correct spelling of the word. lang the language of the word. a...
...ters word the word to add to the dictionary. lang the language of the word. note that this parameter is currently unused. check() checks a unicode string. boolean check( in wstring word, in wstring lang ); parameters word the word to check. lang the language of the word. note that this parameter is currently ignored. return value true if the word is in either the dictionary or the ignore
list, false if it is not in either
list. endsession() clears the ignore
list. void endsession(); parameters none. getcorrection() gets a
list of previous corrections for the word. void getcorrection( in wstring word, [array, size_is(count)] out wstring words, out pruint32 count ); parameters word the word to get the
list of corrections for. words the
list of corrections. count the number of c...
...And 3 more matches
nsIDNSService
terfaces.nsidnsservice); note: starting in gecko 7.0, the "happy eyeballs" strategy is used to reduce lengthy timeouts when attempting backup connections during attempts to connect from clients that have broken ipv6 connectivity. this is done by disabling ipv6 on backup connections. method overview nsicancelable asyncresolve(in autf8string ahostname, in unsigned long aflags, in nsidns
listener a
listener, in nsieventtarget a
listenertarget); void init(); obsolete since gecko 1.8 nsidnsrecord resolve(in autf8string ahostname, in unsigned long aflags); void shutdown(); obsolete since gecko 1.8 attributes attribute type description myhostname autf8string read only. constants resolve flag constants various flags that ma...
...takes precedence. resolve_speculate (1 << 4) indicates request is speculative. speculative requests return errors if prefetching is disabled by configuration. resolve_disable_ipv6 (1 << 5) if this flag is set, only ipv4 addresses will be returned by asyncresolve() and resolve(). methods asyncresolve() begins off an asynchronous host lookup. ...
... by configuration. resolve_disable_ipv6 (1 << 5) if this flag is set, only ipv4 addresses will be returned by asyncresolve() and resolve(). methods asyncresolve() begins off an asynchronous host lookup. a specified nsidns
listener is invoked when the resolution process is completed. nsicancelable asyncresolve( in autf8string ahostname, in unsigned long aflags, in nsidns
listener a
listener, in nsieventtarget a
listenertarget ); parameters ahostname the host name or ip-address-literal to resolve. aflags a bitwise or of the resolve flag constants. a
listener the
listener to be notified when the result is available. a
listenertarget optional parameter (may be null). if not null, this parameter specifies the nsieventtarget of the thread on...
...And 3 more matches
nsIDOMXULElement
dom/interfaces/xul/nsidomxulelement.idlscriptable represents a xul element within the dom. 66 introduced gecko 1.0 inherits from: nsidomelement last changed in gecko 1.9 (firefox 3) method overview void blur(); void click(); void docommand(); void focus(); nsidomnode
list getelementsbyattribute(in domstring name, in domstring value); nsidomnode
list getelementsbyattributens(in domstring namespaceuri, in domstring name, in domstring value); attributes attribute type description align domstring gets/sets the value of the element's align attribute. allowevents boolean true if the element's allowevents attribute is the string "true", otherwise false. removes the attribute if you set it to false. boxobject nsiboxobject read only. gets or crea...
...me, in domstring value); attributes attribute type description align domstring gets/sets the value of the element's align attribute. allowevents boolean true if the element's allowevents attribute is the string "true", otherwise false. removes the attribute if you set it to false. boxobject nsiboxobject read only. gets or creates a box object for the element; browser, editor, iframe,
listbox, menu, menupopup, scrollbox, tooltip and tree elements receive specialized box objects allowing access to additional properties not normally available from script. builder nsixultemplatebuilder read only. retrives the element's template builder, if it has a template. classname domstring gets/sets the value of the element's class attribute. collapsed boolean true if the element's collapse...
...d() generates and dispatches a basic command event, as if the element was clicked with no keyboard modifiers. void docommand(); parameters none. focus() attempts to set focus to the element; will not work for example for disabled elements. void focus(); parameters none. getelementsbyattribute() searches the dom subtree for elements with the given attribute that are not in a namespace. ...
...And 3 more matches
nsIFeedProcessor
toolkit/components/feeds/public/nsifeedprocessor.idlscriptable this interface parses rss or atom feeds, triggering callbacks based on their contents during and after the processing. 1.0 66 introduced gecko 1.8.1 inherits from: nsistream
listener last changed in gecko 1.8.1 (firefox 2 / thunderbird 2 / seamonkey 1.1) implemented by: @mozilla.org/feed-processor;1. to create an instance, use: var feedprocessor = components.classes["@mozilla.org/feed-processor;1"] .createinstance(components.interfaces.nsifeedprocessor); method overview void parseasync(in nsirequestobserver requestobserver, in nsiuri uri); void parsefromstream(in nsiinputstream stream, in nsiuri uri); void parsefromstring(in astring str, in nsiuri u...
...you must not call any of the other parsing methods on the nsifeedprocessor interface during an asynchronous parse. void parseasync( in nsirequest...
...you must not call any of the other parsing methods on the nsifeedprocessor interface during an asynchronous parse. void parseasync( in nsirequestobserver requestobserver,...
...And 3 more matches
nsIHttpChannelInternal
unpredictable ways. 66 introduced gecko 1.0 inherits from: nsisupports last changed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) method overview void getrequestversion(out unsigned long major, out unsigned long minor); void getresponseversion(out unsigned long major, out unsigned long minor); void httpupgrade(in acstring aprotocolname, in nsihttpupgrade
listener a
listener); void setcookie(in string acookieheader); void setupfallbackchannel(in string afallbackkey); attributes attribute type description canceled boolean returns true if and only if the channel has been canceled. read only. channelisfordownload boolean external handlers may set this to true to notify the channel that it is open on behalf of a download. documenturi nsi...
...umbers. void getresponseversion( out unsigned long major, out unsigned long minor ); parameters major on return, contains the response's major version number. minor on return, contains the response's minor version number. httpupgrade() allows for the use of http to bootstrap another protocol via the rfc 2616 upgrade request header in conjunction with a 101 level response. ...
...t unsigned long major, out unsigned long minor ); parameters major on return, contains the response's major version number. minor on return, contains the response's minor version number. httpupgrade() allows for the use of http to bootstrap another protocol via the rfc 2616 upgrade request header in conjunction with a 101 level response. ...
...And 3 more matches
Component; nsIPrefBranch
me); void deletebranch(in string astartingat); boolean getboolpref(in string aprefname, requires gecko 54 [optional] in boolean adefaultvalue); string getcharpref(in string aprefname,requires gecko 54 [optional] in string adefaultvalue); requires gecko 58 utf8tring getstringpref(in string aprefname, [optional] in utf8string adefaultvalue); void getchild
list(in string astartingat, [optional] out unsigned long acount, [array, size_is(acount), retval] out string achildarray); void getcomplexvalue(in string aprefname, in nsiidref atype, [iid_is(atype), retval] out nsqiresult avalue); long getintpref(in string aprefname,requires gecko 54 [optional] in long adefaultvalue); long getpreftype(in string aprefname); void loc...
...et the new value of the modified preference. for example, if your observer is registered with addobserver("bar.", ...) on a branch with root "foo.", modifying the preference "foo.bar.baz" will trigger the observer, and adata parameter will be "bar.baz". void addobserver( in string adomain, in nsiobserver aobserver, in boolean aholdweak ); parameters adomain the preference on which to
listen for changes. this can be the name of an entire branch to observe. for example holding the "root" prefbranch and calling addobserver("foo.bar.", ...) will observe changes to foo.bar.baz and foo.bar.bzip. aobserver the object to be notified if the preference changes. the structure of aobserver is any object with an observe function. see nsiobserver and here is a quick snippet: var myobserver ...
...dividual utf-8 string preference. utf8string getstringpref( in string aprefname, [optional] in utf8string adefaultvalue ); parameters aprefname the string preference to retrieve. adefaultvalue optional - a default value to use if the preference does not exist (instead of throwing an exception). return value returns utf8tring - the value of the requested string preference. ...
...And 3 more matches
nsIPrincipal
ity(in string capability, inout voidptr annotation); native code only! void enablecapability(in string capability, inout voidptr annotation); native code only! boolean equals(in nsiprincipal other); jsprincipals getjsprincipals(in jscontext cx); native code only! void getpreferences(out string prefbranch, out string id, out string subjectname, out string granted
list, out string denied
list, out boolean istrusted); boolean iscapabilityenabled(in string capability, in voidptr annotation); native code only! void revertcapability(in string capability, inout voidptr annotation); native code only! void setcanenablecapability(in string capability, in short canenable); native code only! boolean subsumes(in nsiprincipal other); ...
... native code only!getjsprincipals returns the js equivalent of the principal. jsprincipals getjsprincipals( in jscontext cx ); parameters cx missing description return value missing description getpreferences() returns the security preferences associated with this principal. ...
...incipals returns the js equivalent of the principal. jsprincipals getjsprincipals( in jscontext cx ); parameters cx missing description return value missing description getpreferences() returns the security preferences associated with this principal. ...
...And 3 more matches
nsIPrintingPrompt
void showpagesetup( in nsiprintsettings printsettings, in nsiobserver aobs ); parameters printsettings printsettings for page setup. aobs optional an observer to know if the contents of the print settings object has chan...
... void showpagesetup( in nsiprintsettings printsettings, in nsiobserver aobs ); parameters printsettings printsettings for page setup. aobs optional an observer to know if the contents of the print settings object has changed while the dialog...
...rprint, in nsiprintsettings printsettings ); parameters webbrowserprint represents the document to be printed. printsettings printsettings for print "job". showprogress() shows the print progress dialog. ...
...And 3 more matches
nsISHistory
in a non-embedded situation, the owner of the session history component must create a instance of it and set it in the nsiwebnavigation object. implemented by: @mozilla.org/browser/shistory;1. ...
...ation, the owner of the session history component must create a instance of it and set it in the nsiwebnavigation object. implemented by: @mozilla.org/browser/shistory;1. ...
... owner of the session history component must create a instance of it and set it in the nsiwebnavigation object. implemented by: @mozilla.org/browser/shistory;1. to create an instance, use: var shistory = components.classes["@mozilla.org/browser/shistory;1"] .createinstance(components.interfaces.nsishistory); method overview void addshistory
listener(in nsishistory
listener a
listener); nsishentry getentryatindex(in long index, in boolean modifyindex); void purgehistory(in long numentries); void reloadcurrententry(); void removeshistory
listener(in nsishistory
listener a
listener); attributes attribute type description count long the number of toplevel documents currently available in session history. re...
...And 3 more matches
nsIStreamConverter
netwerk/streamconv/public/nsistreamconverter.idlscriptable provides an interface to implement when you have code that converts data from one type to another. inherits from: nsistream
listener last changed in gecko 1.7 suppose you had code that converted plain text into html. you could implement this interface to allow everyone else to use your conversion logic using a standard api. stream converter users there are currently two ways to use a stream converter: synchronous: stream to stream. ...
...ml. you could implement this interface to allow everyone else to use your conversion logic using a standard api. stream converter users there are currently two ways to use a stream converter: synchronous: stream to stream. you can supply the service with a stream of type x and it will convert it to your desired output type and return a converted (blocking) stream to you. asynchronous: nsistream
listener to nsistream
listener. you can supply data directly to the converter by calling it's nsistream
listener.ondataavailable() method. it will then convert that data from type x to your desired output type and return converted data to you via the nsistream
listener you passed in by calling its nsistream
listener.ondataavailable() method. stream converter suppliers registering a stream converter: stre...
...r itself with the component manager using a contractid in the format below. second, the stream converter must add the contractid to the registry. ...
...And 3 more matches
nsIThreadPool
type description idlethreadlimit unsigned long get/set the maximum number of idle threads that are kept alive. once there are more than this many idle worker threads, the idle threads start getting destroyed. idlethreadtimeout unsigned long get/set the amount of time in milliseconds that a thread must be idle before it becomes eligible to be destroyed. ...
... idlethreadlimit unsigned long get/set the maximum number of idle threads that are kept alive. once there are more than this many idle worker threads, the idle threads start getting destroyed. idlethreadtimeout unsigned long get/set the amount of time in milliseconds that a thread must be idle before it becomes eligible to be destroyed. ...
...igned long get/set the maximum number of idle threads that are kept alive. once there are more than this many idle worker threads, the idle threads start getting destroyed. idlethreadtimeout unsigned long get/set the amount of time in milliseconds that a thread must be idle before it becomes eligible to be destroyed. ...
...And 3 more matches
nsIWindowWatcher
inherits from: nsisupports last changed in gecko 0.9.6 usage notes: this component has an activewindow property. clients may expect this property to be always current, so to properly integrate this component the application will need to keep it current by setting the property as the active window changes. this component should not keep a (xpcom) reference to any windows; the implementation will claim no ownership. ...
... non-floating-palette-type) window, storing and returning it on demand. users must keep this attribute current, including after the topmost window is closed. this attribute will be null if the active window is not an nsidomwindow; for example, if the active window is an alert. methods getchromeforwindow() retrieve the chrome window mapped to the given dom window. nsiwindowwatcher keeps a
list of all top-level dom windows currently open, along with their corresponding chrome interfaces. since dom windows lack a (public) means of retrieving their corresponding chrome, this method will do that. nsiwebbrowserchrome getchromeforwindow( in nsidomwindow awindow ); parameters awindow the nsidomwindow whose chrome window the caller needs. return value an nsiwebbrowserchrome object ...
... open windows in the order they were opened, guaranteeing that each will be visited exactly once. nsisimpleenumerator getwindowenumerator(); parameters none. return value an nsisimpleenumerator which will itself return nsisupports objects which can be nsisupports.queryinterface() (queryinterfaced) to an nsidomwindow. openwindow() creates a new window. it will automatically be added to our
list. note: this method may examine the javascript context stack for purposes of determining the security context to use for the search for a given window named aname. note: this method will try to set the default charset for the new window to the default charset of aparent. this is not guaranteed, however. note: this method may dispatch a "toplevel-window-ready" notification via nsiobser...
...And 3 more matches
Blocking By Domain - Plugins
nt hasn't yet been ported to html and is valuable to users. rather than block plugins entirely, firefox is limiting the impact of plugins by blocking certain domains from using plugins. these blocks improve firefox security and performance and also make the click-to-activate feature more valuable to users by reducing unnecessary prompts. according to the firefox plugin roadmap, the plugin block
list is planned for firefox 55. effects of plugin blocking once a site is included in plugin blocking, it is not possible for that site or any subframes within that site to use plugins. any attempt to use a plugin (via the <object> or <embed> element) will behave as if the plugin was not installed, and use fallback content as specified by the html standard. plugin detection mechanisms such as navig...
...te to use plugins. any attempt to use a plugin (via the <object> or <embed> element) will behave as if the plugin was not installed, and use fallback content as specified by the html standard. plugin detection mechanisms such as navigator.mimetypes and navigator.plugins will also behave as if the plugin were not installed. there are two versions of plugin blocking: first-party plugin blocking
list sites on this
list may not use plugins. third-party plugin block
list sites on this
list may not use plugins when they are loaded into a third-party iframe in another site. criteria in order to improve firefox security and performance, there are two major categories of sites mozilla may choose to add to plugin domain blocking: sites commonly embedded in a 3rd-party context web sites whi...
...gory may include advertisers, social media sites, and other utilities. top sites many popular sites work properly without plugins, but still prompt users for activation. in order to improve site performance and reduce the number of plugin prompts that users see, popular sites that show unnecessary plugin prompts or slow the browser down with unnecessary plugins will be added to the plugin block
list. ...
...And 3 more matches
Edit fonts - Firefox Developer Tools
of the screen, the fonts tab appears beneath the html pane. to access it: open the page inspector. select the fonts tab; the last of the tabs shown in the right-hand side of the css pane. the fonts tab has three major sections: "fonts used" by the currently inspected element. the new fonts editor. in firefox 61 and 62, this section does not exist. "all fonts on page" — this section
lists all of the fonts in use on the page. in firefox 61 and 62, this area is labeled "other fonts in page" and doesn't include the fonts mentioned in the "fonts used" section. fonts used the top section of the font editor shows the fonts used by the currently inspected element, grouped by font family. fonts are considered "used" when there is text content in the inspected element that has the f...
...ws the fonts used by the currently inspected element, grouped by font family. fonts are considered "used" when there is text content in the inspected element that has the font applied to it. empty elements will not have any fonts used and will display the message "no fonts were found for the current element." fonts will be included in this section for one of the following reasons: they are
listed in the element's font-family css declaration value. they are applied to the element as part of the browser's default styling (times new roman for most browsers), and no author-defined font has been supplied. they are used by a descendant of the inspected element, for example, when it is a container for other elements which have text content with fonts applied. they are system fallback fonts ...
... container for other elements which have text content with fonts applied. they are system fallback fonts used when nothing from the font-family css declaration has been applied. fonts editor firefox 63 adds the font editor — a new area below "fonts used" with additional controls for editing the fonts’ characteristics. for standard (static) fonts, you will be able to change the settings
listed below size the font-size for the inspected element. this can be set using em, rem, %, px, vh, or vw units. you can select values using the slider or enter a numeric value directly into the text box. note: if you want to use a different unit such as pt for font-size or line-height, you can set the property value applied to the currently inspected element to use that unit via the rules vie...
...And 3 more matches
Responsive Design Mode - Firefox Developer Tools
ent area for web pages is set to the screen size for a mobile device. initially, it's set to 320 x 480 pixels. note: the device you select when in responsive design mode and the orientation (portrait or landscape) is saved between sessions. information for the selected device is centered over the display. from left to right, the display includes: name of the selected device - a drop-down
list that includes whatever devices you have selected from the device settings screen. screen size - you can edit the width and height values to change the device size by editing a number directly or using the up and down keys to increase or decrease the value by 1 pixels on each keypress or hold and shift to change the value by 10. the mouse wheel changes the size values by 1 pixel at a time ...
...en sessions screenshots are saved to firefox's default download location. if you checked "screenshot to clipboard" in the developer tools settings page, then the screenshot will be copied to the system clipboard. dpr (pixel ratio) - beginning with firefox 68, the dpr is no longer editable; create a custom device in order to change the dpr throttling - a drop-down
list where you can select the connection throttling to apply, for example 2g, 3g, or lte enable/disable touch simulation - toggles whether or not responsive design mode simulates touch events. while touch event simulation is enabled, mouse events are translated into touch events; this includes (starting in firefox 79) translating a mouse-drag event into a touch-drag event. (note that when touch simul...
...you can make them automatic. for example: developer toolbox with rdm you can show or hide the developer tools toolbox independently of toggling responsive design mode itself: while responsive design mode is enabled, you can continue browsing as you normally would in the resized content area. device selection just above the viewport there is a label "no device selected"; click this to see a
list of device names. select a device, and responsive design mode sets the following properties to match the selected device: screen size device pixel ratio (the ratio of device physical pixels to device-independent pixels) touch event simulation additionally, firefox sets the user-agent http request header to identify itself as the default browser on the selected device. for example, if you've...
...And 3 more matches
Animation.playbackRate - Web APIs
ely pauses the animation (however, its playstate does not necessarily become paused). examples in the growing/shrinking alice game example, clicking or tapping the bottle causes alice's growing animation (alicechange) to reverse, causing her to shrink: var shrinkalice = function() { alicechange.playbackrate = -1; alicechange.play(); } // on tap or click, alice will shrink. ...
...necessarily become paused). examples in the growing/shrinking alice game example, clicking or tapping the bottle causes alice's growing animation (alicechange) to reverse, causing her to shrink: var shrinkalice = function() { alicechange.playbackrate = -1; alicechange.play(); } // on tap or click, alice will shrink. ...
...lay(); } // on tap or click, alice will shrink. bottle.addevent
listener("mousedown", shrinkalice, false); bottle.addevent
listener("touchstart", shrinkalice, false); contrariwise, clicking on the cake causes her to "grow," playing alicechange forwards again: var growalice = function() { alicechange.playbackrate = 1; alicechange.play(); } // on tap or click, alice will grow. ...
...And 3 more matches
AudioTrack - Web APIs
udiotrack object is to toggle its enabled property in order to mute and unmute the track. properties enabled a boolean value which controls whether or not the audio track's sound is enabled. setting this value to false mutes the track's audio. id read only a domstring which uniquely identifies the track within the media. this id can be used to locate a specific track within an audio track
list by calling audiotrack
list.gettrackbyid(). the id can also be used as the fragment part of the url if the media supports seeking by media fragment per the media fragments uri specification. kind read only a domstring specifying the category into which the track falls. for example, the main audio track would have a kind of "main". label read only a domstring providing a human-readable label f...
...ode, such as "en-us" or "pt-br". sourcebuffer read only the sourcebuffer that created the track. returns null if the track was not created by a sourcebuffer or the sourcebuffer has been removed from the mediasource.sourcebuffers attribute of its parent media source. usage notes to get an audiotrack for a given media element, use the element's audiotracks property, which returns an audiotrack
list 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(). this first example gets the first audio track on the media: var firsttrack = tracks[0]; the next example scans through all of the media's ...
...reach(function(track) { if (track.language === userlanguage) { track.enabled = true; } else { track.enabled = false; } }); the language is in standard (rfc 5646) format. for us english, this would be "en-us", for example. example this example returns an array of track kinds and labels for potential use in a user interface to select audio tracks for a specified media element. ...
...And 3 more matches
Event.eventPhase - Web APIs
constants event phase constants these values describe which phase the event flow is currently being evaluated. ...
...ntly being evaluated. constant value description event.none 0 no event is being processed at this time. event.capturing_phase 1 the event is being propagated through the target's ancestor objects. this process starts with the window, then document, then the htmlhtmlelement, and so on through the elements until the target's parent is reached. event
listeners registered for capture mode when eventtarget.addevent
listener() was called are triggered during this phase. event.at_target 2 the event has arrived at the event's target. event
listeners registered for this phase are called at this time. if event.bubbles is false, processing the event is finished after this phase is complete. event.bubbling_phase 3 the event is ...
...d for this phase are called at this time. if event.bubbles is false, processing the event is finished after this phase is complete. event.bubbling_phase 3 the event is propagating back up through the target's ancestors in reverse order, starting with the parent, and eventually reaching the containing window. this is known as bubbling, and occurs only if event.bubbles is true. event
listeners registered for this phase are triggered during this process. for more details, see section 3.1, event dispatch and dom event flow, of the dom level 3 events specification. example html <h4>event propagation chain</h4> <ul> <li>click 'd1'</li> <li>analyse event propagation chain</li> <li>click next div and repeat the experience</li> <li>change capturing mode</li> <li>repea...
...And 3 more matches
Event - Web APIs
ly, such as by calling the htmlelement.click() method of an element, or by defining the event, then sending it to a specified target using eventtarget.dispatchevent(). there are many types of events, some of which use other interfaces based on the main event interface. event itself contains the properties and methods which are common to all events. many dom elements can be set up to accept (or "
listen" for) these events, and execute code in response to process (or "handle") them. event-handlers are usually connected (or "attached") to various html elements (such as <button>, <div>, <span>, etc.) using eventtarget.addevent
listener(), and this generally replaces using the old html event handler attributes. further, when properly added, such handlers can also be disconnected if needed using rem...
... these events, and execute code in response to process (or "handle") them. event-handlers are usually connected (or "attached") to various html elements (such as <button>, <div>, <span>, etc.) using eventtarget.addevent
listener(), and this generally replaces using the old html event handler attributes. further, when properly added, such handlers can also be disconnected if needed using removeevent
listener(). note: one element can have several such handlers, even for the exact same event—particularly if separate, independent code modules attach them, each for its own independent purposes. (for example, a webpage with an advertising-module and statistics-module both monitoring video-watching.) when there are many nested elements, each with its own handler(s), event processing can become ve...
...ments, each with its own handler(s), event processing can become very complicated—especially where a parent element receives the very same event as its child elements because "spatially" they overlap so the event technically occurs in both, and the processing order of such events depends on the event bubbling and capture settings of each handler triggered. interfaces based on event below is a
list of interfaces which are based on the main event interface, with links to their respective documentation in the mdn api reference. note that all event interfaces have names which end in "event". animationevent audioprocessingevent beforeinputevent beforeunloadevent blobevent clipboardevent closeevent compositionevent cssfontfaceloadevent customevent devicelightevent devicemotioneve...
...And 3 more matches
EventSource - Web APIs
nnection to an event source has opened. additionally, the event source itself may send messages with an event field, which will create ad-hoc events keyed to that value. examples in this basic example, an eventsource is created to receive unnamed events from the server; a page with the name sse.php is responsible for generating the events. var evtsource = new eventsource('sse.php'); var event
list = document.queryselector('ul'); evtsource.onmessage = function(e) { var newelement = document.createelement("li"); newelement.textcontent = "message: " + e.data; event
list.appendchild(newelement); } each received event causes our eventsource object's onmessage event handler to be run. it, in turn, creates a new <li> element and writes the message's data into it, then appends the new elem...
....queryselector('ul'); evtsource.onmessage = function(e) { var newelement = document.createelement("li"); newelement.textcontent = "message: " + e.data; event
list.appendchild(newelement); } each received event causes our eventsource object's onmessage event handler to be run. it, in turn, creates a new <li> element and writes the message's data into it, then appends the new element to the
list element already in the document. note: you can find a full example on github — see simple sse demo using php. to
listen to named events, you'll require a
listener for each type of event sent. ...
...handler to be run. it, in turn, creates a new <li> element and writes the message's data into it, then appends the new element to the
list element already in the document. note: you can find a full example on github — see simple sse demo using php. to
listen to named events, you'll require a
listener for each type of event sent. ...
...And 3 more matches
HTMLElement: animationcancel event - Web APIs
other words, any time it stops running without sending an animationend event. this might happen when the animation-name is changed such that the animation is removed, or when the animating node is hidden using css. therefore, either directly or because any of its containing nodes are hidden. an event handler for this event can be added by setting the onanimationcancel property, or using addevent
listener(). bubbles yes cancelable no interface animationevent event handler property onanimationcancel examples this code gets an element that's currently being animated and adds a
listener to the animationcancel event. it then sets the element's display property to none, which will trigger the animationcancel event. const animated = document.
...elable no interface animationevent event handler property onanimationcancel examples this code gets an element that's currently being animated and adds a
listener to the animationcancel event. it then sets the element's display property to none, which will trigger the animationcancel event. ...
...adds a
listener to the animationcancel event. it then sets the element's display property to none, which will trigger the animationcancel event. ...
...And 3 more matches
HTMLElement: transitioncancel event - Web APIs
the transitioncancel event is fired when a css transition is canceled. see globaleventhandlers.ontransitioncancel for more information. ...
...itioncancel for more information. ...
...rty globaleventhandlers.ontransitioncancel examples this code gets an element that has a transition defined and adds a
listener to the transitioncancel event: const transition = document.queryselector('.transition'); transition.addevent
listener('transitioncancel', () => { console.log('transition canceled'); }); the same, but using the ontransitioncancel property instead of addevent
listener(): const transition = document.queryselector('.transition'); transition.ontransitioncancel = () => { console.log('transition canceled'); }; live example in the following example, we have a simple <div> element, styled with a transition that includes a delay: <div class="transition"></div> <div class="message"></div> .transition { width: 100px; height: 100px; background: rgba(25...
...And 3 more matches
HTMLImageElement.loading - Web APIs
the image's presentation using the image element's width and height attributes. by establishing the intrinsic aspect ratio in this manner, you prevent elements from shifting around while the document loads, which can be disconcerting or offputting at best and can cause users to click the wrong thing at worst, depending on the exact timing of the deferred loads and reflows. ...
... and height attributes. by establishing the intrinsic aspect ratio in this manner, you prevent elements from shifting around while the document loads, which can be disconcerting or offputting at best and can cause users to click the wrong thing at worst, depending on the exact timing of the deferred loads and reflows. ...
...hile the document loads, which can be disconcerting or offputting at best and can cause users to click the wrong thing at worst, depending on the exact timing of the deferred loads and reflows. example the addimageto
list() function shown below adds a photo thumbnail to a
list of items, using lazy-loading to avoid loading the image from the network until it's actually needed. ...
...And 3 more matches
HTMLSelectElement.selectedOptions - Web APIs
the read-only htmlselectelement property selectedoptions contains a
list of the <option> elements contained within the <select> element that are currently selected. the
list of selected options is an htmlcollection object with one entry per currently selected option. an option is considered selected if it has an htmloptionelement.selected attribute. syntax var selectedcollection = htmlselectelement.selectedoptions; value an htmlcollection which
lists every currently selected htmloptionelement which is either a child of the htmlselectelement or of an htmloptgroupelement within the <select> element. in other words, any option contained within the <select> element may be part of the results, but option groups are not included in the
list. if no options are currently selected, the collecti...
... is set to allow multiple items to be selected, and it is 7 rows tall. note also the <button>, whose role it is to trigger fetching the htmlcollection of selected elements using the selected property. ...
...o trigger fetching the htmlcollection of selected elements using the selected property. ...
...And 3 more matches
IDBCursor.advance() - Web APIs
advance() works in a similar way to idbcursor.continue, except that it allows you to jump multiple records at a time, not just always go onto the next record. note that in each iteration of the loop, you can grab data from the current record under the cursor object using cursor.value.foo. ...
... it allows you to jump multiple records at a time, not just always go onto the next record. note that in each iteration of the loop, you can grab data from the current record under the cursor object using cursor.value.foo. ...
...the next record. note that in each iteration of the loop, you can grab data from the current record under the cursor object using cursor.value.foo. ...
...And 3 more matches
IDBCursor.source - Web APIs
is iterating over. example in this simple fragment we create a transaction, retrieve an object store, then use a cursor to iterate through all the records in the object store. within each iteration we log the source of the cursor, which will log our idbobjectstore object to the console, something like this: idbobjectstore {autoincrement: false, transaction: idbtransaction, indexnames: domstring
list, keypath: "albumtitle", name: "rushalbum
list"…} the cursor does not require us to select the data based on a key; we can just grab all of it. also note that in each iteration of the loop, you can grab data from the current record under the cursor object using cursor.value.foo. for a complete working example, see our idbcursor example (view example live.) function displaydata() { var transac...
...ushalbum
list"…} the cursor does not require us to select the data based on a key; we can just grab all of it. also note that in each iteration of the loop, you can grab data from the current record under the cursor object using cursor.value.foo. ...
...on a key; we can just grab all of it. also note that in each iteration of the loop, you can grab data from the current record under the cursor object using cursor.value.foo. ...
...And 3 more matches
IDBDatabase: abort event - Web APIs
the abort event is fired on idbdatabase when a transaction is aborted and bubbles up to the connection object. bubbles yes cancelable no interface event event handler property onabort examples this example opens a database (creating the database if it does not exist), then opens a transaction, adds a
listener to the abort event, then aborts the transaction to trigger the event. ...
.... bubbles yes cancelable no interface event event handler property onabort examples this example opens a database (creating the database if it does not exist), then opens a transaction, adds a
listener to the abort event, then aborts the transaction to trigger the event. ...
...database if it does not exist), then opens a transaction, adds a
listener to the abort event, then aborts the transaction to trigger the event. ...
...And 3 more matches
IDBDatabase.transaction() - Web APIs
exception description invalidstateerror the close() method has previously been called on this idbdatabase instance. notfounderror an object store specified in in the storenames parameter has been deleted or removed. typeerror the value for the mode parameter is invalid. ...
...eter is invalid. invalidaccesserror the function was called with an empty
list of store names. example in this example we open a database connection, then use transaction() to open a transaction on the database. for a complete example, see our to-do notifications app (view example live.) var db; // let us open our database var dbopenrequest = window.indexeddb.open("todo
list", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. ...
...(view example live.) var db; // let us open our database var dbopenrequest = window.indexeddb.open("todo
list", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. ...
...And 3 more matches
IDBOpenDBRequest: blocked event - Web APIs
the blocked handler is executed when an open connection to a database is blocking a versionchange transaction on the same database. ...
... the blocked handler is executed when an open connection to a database is blocking a versionchange transaction on the same database. ...
...handler property onblocked examples using addevent
listener(): // open the database const dbopenrequest = window.indexeddb.open('todo
list', 4); dbopenrequest.onupgradeneeded = (event) => { const db = event.target.result; db.onerror = () => { console.log('error creating database'); }; // create an objectstore for this database var objectstore = db.createobjectstore('todo
list', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: fals...
...And 3 more matches
IDBRequest: error event - Web APIs
the error handler is executed when an error caused a request to fail. ...
... bubbles yes cancelable no interface event event handler property onerror examples this example opens a database and tries to add a record,
listening for the error event for the add() operation (this will occur if, for example, a record with the given tasktitle already exists): // open the database const dbopenrequest = window.indexeddb.open('todo
list', 4); dbopenrequest.addevent
listener('upgradeneeded', event => { const db = event.target.result; db.onerror = () => { console.log('error creating database'); }; // create an objectstore for this database var objectstore = db.createobjectstore('todo
list', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours'...
...// define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }); dbopenrequest.addevent
listener('success', event => { const db = dbopenrequest.result; // open a read/write db transaction, ready for adding the data const transaction = db.transaction(['todo
list'], 'readwrite'); const objectstore = transaction.objectstore('todo
list'); const newitem = { tasktitle: 'my task', hours: 10, minutes: 10, day: 10, month: 'january', year: 2020 }; const objectstorerequest = objectstore...
...And 3 more matches
IDBRequest: success event - Web APIs
the success event is fired when an idbrequest succeeds. ...
... the success event is fired when an idbrequest succeeds. ...
... the success event is fired when an idbrequest succeeds. ...
...And 3 more matches
IDBTransaction: abort event - Web APIs
ut the same index key when the key has a uniqueness constraint), an explicit abort() call an uncaught exception in the request's success/error handler, an i/o error (an actual failure to write to disk, for example disk detached, or other os/hardware failure) quota exceeded. ...
...er, an i/o error (an actual failure to write to disk, for example disk detached, or other os/hardware failure) quota exceeded. examples this example opens a database (creating the database if it does not exist), then opens a transaction, adds a
listener to the abort event, then aborts the transaction to trigger the event. ...
...ener to the abort event, then aborts the transaction to trigger the event. ...
...And 3 more matches
IDBTransaction: complete event - Web APIs
the complete handler is executed when a transaction successfully completed. ...
... the complete handler is executed when a transaction successfully completed. ...
... handler property oncomplete examples using addevent
listener(): // open the database const dbopenrequest = window.indexeddb.open('todo
list', 4); dbopenrequest.onupgradeneeded = event => { const db = event.target.result; db.onerror = () => { console.log('error creating database'); }; // create an objectstore for this database var objectstore = db.createobjectstore('todo
list', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: fals...
...And 3 more matches
KeyboardEvent.code - Web APIs
o represents the ' key on dvorak keyboards and the a key on azerty keyboards. that makes it impossible to use the value of code to determine what the name of the key is to users if they're not using an anticipated keyboard layout. to determine what character corresponds with the key event, use the keyboardevent.key property instead. ...
...de values the code values for windows, linux, and macos are
list on the keyboardevent: code values page. examples exercising keyboardevent html <p>press keys on the keyboard to see what the keyboardevent's key and code values are for each one.</p> <div id="output"> </div> css #output { font-family: arial, helvetica, sans-serif; border: 1px solid black; } javascript window.addevent
listener("keydown", function(event) { let str = "keyboardevent: key='" + event.key + "' | code='" + event.code + "'"; let el = document.createelement("span"); el.innerhtml = str + "<br/>"; document.getelementbyid("output").appendchild(el); }, true); try it out to ensure that keystrokes go to the sample, click in the output box below before pressing keys. handle keyboard event...
...keyboardevent: key='" + event.key + "' | code='" + event.code + "'"; let el = document.createelement("span"); el.innerhtml = str + "<br/>"; document.getelementbyid("output").appendchild(el); }, true); try it out to ensure that keystrokes go to the sample, click in the output box below before pressing keys. handle keyboard events in a game this example establishes an event
listener for keydown events that handle keyboard input for a game that uses the typical "wasd" keyboard layout for steering forward, left, backward, and right. this will use the same four keys physically regardless of what the actual corresponding characters are, such as if the user is using an azerty keyboard. html <p>use the wasd (zqsd on azerty) keys to move and steer.</p> <svg xmlns="http://www.
...And 3 more matches
Page Visibility API - Web APIs
t becomes visible or hidden, as well as features to look at the current visibility state of the page. notes: the page visibility api is especially useful for saving resources and improving performance by letting a page avoid performing unnecessary tasks when the document isn't visible. when the user minimizes the window or switches to another tab, the api sends a visibilitychange event to let
listeners know the state of the page has changed. you can detect the event and perform some actions or behave differently. for example, if your web app is playing a video, it can pause the video when the user puts the tab into the background, and resume playback when the user returns to the tab. the user doesn't lose their place in the video, the video's soundtrack doesn't interfere with audio in the ...
... ...
...tychange"; } var videoelement = document.getelementbyid("videoelement"); // if the page is hidden, pause the video; // if the page is shown, play the video function handlevisibilitychange() { if (document[hidden]) { videoelement.pause(); } else { videoelement.play(); } } // warn if the browser doesn't support addevent
listener or the page visibility api if (typeof document.addevent
listener === "undefined" || hidden === undefined) { console.log("this demo requires a browser, such as google chrome or firefox, that supports the page visibility api."); } else { // handle page visibility change document.addevent
listener(visibilitychange, handlevisibilitychange, false); // when the video pauses, set the title. // this shows the paused videoelement.addevent
listener("pause...
...And 3 more matches
ParentNode.replaceChildren() - Web APIs
parent node without any argument specified: mynode.replacechildren(); transferring nodes between parents replacechildren() enables you to easily transfer nodes between parents, without having to resort to verbose looping code. for example, say we have a simple application allowing you to choose what food you want for your party. ...
...option>vegan veggie pizza</option> </select> </div> <div class="buttons"> <button id="to-yes">transfer to "yes" --></button> <button id="to-no"><-- transfer to "no"</button> </div> <div> <label for="yes">yes please!</label> <select id="yes" multiple size="10"> </select> </div> </main> it would make sense to use some simple css to lay out the two select
lists in a line alongside one another, with the control buttons in between them: main { display: flex; } div { margin-right: 20px; } label, button { display: block; } .buttons { display: flex; flex-flow: column; justify-content: center; } select { width: 200px; } what we want to do is transfer any selected options in the "no"
list over to the "yes"
list when the "yes" button is pre...
...uttons in between them: main { display: flex; } div { margin-right: 20px; } label, button { display: block; } .buttons { display: flex; flex-flow: column; justify-content: center; } select { width: 200px; } what we want to do is transfer any selected options in the "no"
list over to the "yes"
list when the "yes" button is pressed, and transfer any selected options in the "yes"
list over to the "no"
list when the "no" button is pressed. ...
...And 3 more matches
RTCPeerConnection - Web APIs
g values specified by the enum rtcpeerconnectionstate.currentlocaldescription read only the read-only property rtcpeerconnection.currentlocaldescription returns an rtcsessiondescription object describing the local end of the connection as it was most recently successfully negotiated since the last time the rtcpeerconnection finished negotiating and connecting to a remote peer. ...
...presented by the description was first instantiated.currentremotedescription read only the read-only property rtcpeerconnection.currentremotedescription returns an rtcsessiondescription object describing the remote end of the connection as it was most recently successfully negotiated since the last time the rtcpeerconnection finished negotiating and connecting to a remote peer. ...
...alidationerror event handler is a property containing the code to execute whent the idpvalidationerror event, of type rtcidentityerrorevent, is received by this rtcpeerconnection. such an event is sent when the associated identity provider (idp) encounters an error while validating an identity assertion.onnegotiationneeded the rtcpeerconnection interface's onnegotiationneeded property is an event
listener which specifies a function which is called to handle the negotiationneeded event when it occurs on an rtcpeerconnection instance. this event is fired when a change has occurred which requires session negotiation. this negotiation should be carried out as the offerer, because some session changes cannot be negotiated as the answerer.onpeeridentity the rtcpeerconnection.onpeeridentity event ha...
...And 3 more matches
Report - Web APIs
erface of the reporting api represents a single report. reports can be accessed in a number of ways: via the reportingobserver.takerecords() method — this returns all reports in an observer's report queue, and then empties the queue. via the reports parameter of the callback function passed into the reportingobserver() constructor upon creation of a new observer instance. this contains the
list of reports currently contained in the observer's report queue. by sending requests to the endpoints defined via the report-to http header. properties report.body read only the body of the report, which is a reportbody object containing the detailed report information. report.type read only the type of report generated, e.g. deprecation or intervention. report.url read only the url o...
...ver.observe(); because of the event handler we set up inside the reportingobserver() constructor, we can now click the button to display the report details. ...
...the reportingobserver() constructor, we can now click the button to display the report details. ...
...And 3 more matches
Sensor APIs - Web APIs
w.ambientlightsensor) { // go dark... } defensive programming as stated in feature detection, checking for a particular sensor api is insufficient for feature detection. the existence of an actual sensor must be confirmed as well. this is where defensive programming is needed. defensive programming requires three strategies. checking for thrown errors when instantiating a sensor object.
listening for errors thrown during its use. handling the errors gracefully so that the user experience is enhanced rather than degraded. the code example below illustrates these principles. the try...catch block catches errors thrown during sensor instantiation. it implements a handler for sensor.onerror to catch errors thrown during use. the only time anything is shown to the user is when permissi...
... type isn't supported by the device. if a feature policy blocks use of a feature it is because your code is inconsistent with the policies set on your server. this is not something that would ever be shown to a user. see feature-policy for implementation instructions. ...
... if (error.name === 'securityerror') { // see the note above about feature policy. ...
...And 3 more matches
Using server-sent events - Web APIs
new eventsource("ssedemo.php"); if the event generator script is hosted on a different origin, a new eventsource object should be created with both the url and an options dictionary. ...
...xample, assuming the client script is on example.com: const evtsource = new eventsource("//api.example.com/ssedemo.php", { withcredentials: true } ); once you've instantiated your event source, you can begin
listening for messages from the server by attaching a handler for the message event: evtsource.onmessage = function(event) { const newelement = document.createelement("li"); const event
list = document.getelementbyid("
list"); newelement.innerhtml = "message: " + event.data; event
list.appendchild(newelement); } this code
listens for incoming messages (that is, notices from the server that do not have an event field on them) and appends the message text to a
list in the document's html. you can also
listen for events with addevent
listener(): evtsource.addevent
listener("ping", ...
...ages (that is, notices from the server that do not have an event field on them) and appends the message text to a
list in the document's html. you can also
listen for events with addevent
listener(): evtsource.addevent
listener("ping", function(event) { const newelement = document.createelement("li"); const time = json.parse(event.data).time; newelement.innerhtml = "ping at " + time; event
list.appendchild(newelement); }); this code is similar, except that it will be called automatically whenever the server sends a message with the event field set to "ping"; it then parses the json in the data field and outputs that information. when not used over http/2, sse suffers from a limitation to the maximum number of open connections, which can be especially painful when opening multiple ta...
...And 3 more matches
ServiceWorkerGlobalScope: notificationclick event - Web APIs
the notificationclick event is fired to indicate that a system notification spawned by serviceworkerregistration.shownotification() has been clicked. ...
... the notificationclick event is fired to indicate that a system notification spawned by serviceworkerregistration.shownotification() has been clicked. ...
...xamples you can use the notificationclick event in an addevent
listener method: self.addevent
listener('notificationclick', function(event) { console.log('on notification click: ', event.notification.tag); event.notification.close(); // this looks to see if the current is already open and // focuses if it is event.waituntil(clients.matchall({ type: "window" }).then(function(client
list) { for (var i = 0; i < client
list.length; i++) { var client = client
list[i]; if (client.url == '/' && 'focus' in client) return client.focus(); } if (clients.openwindow) return clients.openwindow('/'); })); }); or use the onnotificationclick event handler property: self.onnotificationclick = function(event) { console.log('on notification click: ', even...
...And 3 more matches
ServiceWorkerRegistration - Web APIs
tration interface of the service worker api represents the service worker registration. you register a service worker to control one or more pages that share the same origin. the lifetime of a service worker registration is beyond that of the serviceworkerregistration objects that represent them within the lifetime of their corresponding service worker clients. the browser maintains a persistent
list of active serviceworkerregistration objects. note: this feature is available in web workers. properties also implements properties from its parent interface, eventtarget. serviceworkerregistration.scope read only returns a unique identifier for a service worker registration. this must be on the same origin as the document that registers the serviceworker. serviceworkerregistration.inst...
...ewing. unimplemented properties serviceworkerregistration.periodicsync read only returns a reference to the periodicsyncmanager interface, which manages periodic background synchronization processes. this was mentioned as an idea in the sw explainer at some point, but as yet has not been implemented anywhere. event handlers serviceworkerregistration.onupdatefound read only an event
listener property called whenever an event of type updatefound is fired; it is fired any time the serviceworkerregistration.installing property acquires a new service worker. methods also implements methods from its parent interface, eventtarget. serviceworkerregistration.getnotifications() returns a promise that resolves to an array of notification objects. serviceworkerregistration.shownotif...
...ted version of the service worker without consulting caches. serviceworkerregistration.unregister() unregisters the service worker registration and returns a promise. the service worker will finish any ongoing operations before it is unregistered. examples in this example, the code first checks whether the browser supports service workers and if so registers one. ...
...And 3 more matches
SpeechGrammar.src - Web APIs
specifications specification status comment...
... specifications specification status comment web speech api...
... specifications specification status comment web speech apithe definition of 'src' i...
...And 3 more matches
SpeechGrammar.weight - Web APIs
specifications specification status comment...
... specifications specification status comment web speech api...
... specifications specification status comment web speech apithe definition of 'weight...
...And 3 more matches
SpeechGrammar - Web APIs
specifications specification status comment...
... specifications specification status comment web speech api...
... specifications specification status comment web speech apithe definition of 'speech...
...And 3 more matches
TouchEvent - Web APIs
ch-sensitive surface changes. this surface can be a touch screen or trackpad, for example. the event can describe one or more points of contact with the screen and includes support for detecting movement, addition and removal of contact points, and so forth. touches are represented by the touch object; each touch is described by a position, size and shape, amount of pressure, and target element.
lists of touches are represented by touch
list objects. <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/event" target...
...ext></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constructor touchevent() creates a touchevent object. properties this interface inherits properties from its parent, uievent and event. touchevent.altkey read only a boolean value indicating whether or not the alt key was down when the touch event was fired. touchevent.changedtouches read only a touch
list of all the touch objects representing individual points of contact whose states changed between the previous touch event and this one. touchevent.ctrlkey read only a boolean value indicating whether or not the control key was down when the touch event was fired. touchevent.metakey read only a boolean value indicating whether or not the meta key was down when the touch event was fired. touc...
... boolean value indicating whether or not the control key was down when the touch event was fired. touchevent.metakey read only a boolean value indicating whether or not the meta key was down when the touch event was fired. touchevent.shiftkey read only a boolean value indicating whether or not the shift key was down when the touch event was fired. touchevent.targettouchesread only a touch
list of all the touch objects that are both currently in contact with the touch surface and were also started on the same element that is the target of the event. touchevent.touches read only a touch
list of all the touch objects representing all current points of contact with the surface, regardless of target or changed status. touchevent.rotation read only change in rotation (in degrees) sinc...
...And 3 more matches
Touch events - Web APIs
uch-sensitive surface. this may be a screen or trackpad. touch point a point of contact with the surface. this may be a finger (or elbow, ear, nose, whatever, but typically a finger) or stylus. interfaces touchevent represents an event that occurs when the state of touches on the surface changes. touch represents a single point of contact between the user and the touch surface. touch
list represents a group of touches; this is used when the user has, for example, multiple fingers on the surface at the same time. example this example tracks multiple touchpoints at a time, allowing the user to draw in a <canvas> with more than one finger at a time. it will only work on a browser that supports touch events. note: the text below uses the term "finger" when describing the contact ...
...eate a canvas <canvas id="canvas" width="600" height="600" style="border:solid black 1px;"> your browser does not support canvas element. </canvas> <br> log: <pre id="log" style="border: 1px solid #ccc;"></pre> setting up the event handlers when the page loads, the startup() function shown below will be called. function startup() { var el = document.getelementbyid("canvas"); el.addevent
listener("touchstart", handlestart, false); el.addevent
listener("touchend", handleend, false); el.addevent
listener("touchcancel", handlecancel, false); el.addevent
listener("touchmove", handlemove, false); } document.addevent
listener("domcontentloaded", startup); this simply sets up all the event
listeners for our <canvas> element so we can handle the touch events as they occur. tracking new t...
...inpath(); ctx.arc(touches[i].pagex, touches[i].pagey, 4, 0, 2 * math.pi, false); // a circle at the start ctx.fillstyle = color; ctx.fill(); console.log("touchstart:" + i + "."); } } this calls event.preventdefault() to keep the browser from continuing to process the touch event (this also prevents a mouse event from also being delivered). then we get the context and pull the
list of changed touch points out of the event's touchevent.changedtouches property. after that, we iterate over all the touch objects in the
list, pushing them onto an array of active touchpoints and drawing the start point for the draw as a small circle; we're using a 4-pixel wide line, so a 4-pixel radius circle will show up neatly. drawing as the touches move each time one or more fingers move, ...
...And 3 more matches
window.postMessage() - Web APIs
e the other window's document should be located. failing to provide a specific target discloses the data you send to any interested malicious site. transfer optional is a sequence of transferable objects that are transferred with the message. the ownership of these objects is given to the destination side and they are no longer usable on the sending side. the dispatched event otherwindow can
listen for dispatched messages by executing the following javascript: window.addevent
listener("message", receivemessage, false); function receivemessage(event) { if (event.origin !== "http://example.org:8080") return; // ... } the properties of the dispatched message are: data the object passed from the other window. origin the origin of the window that sent the message at the time ...
... to be the current or future origin of that window, which might have been navigated to a different location since postmessage was called. source a reference to the window object that sent the message; you can use this to establish two-way communication between two windows with different origins. security concerns if you do not expect to receive messages from other sites, do not add any event
listeners for message events. this is a completely foolproof way to avoid security problems. if you do expect to receive messages from other sites, always verify the sender's identity using the origin and possibly source properties. any window (including, for example, http://evil.example.com) can send a message to any other window, and you have no guarantees that an unknown sender will not send malic...
... its location. popup.postmessage("hello there!", "http://example.com"); function receivemessage(event) { // do we trust the sender of this message? (might be // different from what we originally opened, for example). ...
...And 3 more matches
Accessibility Information for Web Authors - Accessibility
ebsites. other organizations such as schools are starting to follow these guidelines as well. web content accessibility guidelines (wcag) 1.0 another important set of guidelines from the w3c web accessibility initiative (wai). the european union is looking to base their upcoming accessibility regulations on these guidelines. these guidelines are discussed on the wai interest group discussion
list. how-to's key-navigable custom dhtml widgets in mozilla & ie this document discusses how to use tabindex, element.focus() and onkeypress to make custom dhtml widgets such as menus or tree views keyboard accessible. accessible web page authoring ibm has put together a simple, practical resource for web authors to learn accessibility the fast and painless way. highly recommended, an ...
...able link to the reference/guideline. just wonderful! the html advanced validator may also be downloaded from firefox add-ons: html validator. color contrast analyzer by juicy studio "contrast is the perceived difference between two adjacent colors. (...) contrast is extremely important in web design." wheel of color: pump up the contrast, robert hess, msdn "for this year's
list of worst design mistakes, (...) i asked readers of my newsletter to nominate the usability problems they found the most irritating. (...) about one-third complained about low contrast between text and background." top ten web design mistakes of 2005: 1. legibility problems how can a web author establish easily and quickly if the background color and foreground (text) color in use in his ...
...istive technologies such as screen readers, screen magnifiers and alternative input devices. join the mozilla accessibility community live chat both end users and developers are invited for discussion on the live irc channel at irc.mozilla.org/#accessibility. since this is a worldwide effort, there is always a good chance to find someone to chat with there, day or night. ...
...And 3 more matches
Web accessibility for seizures and physical reactions - Accessibility
d and strong is flashing/strobe lights. dr. selim benbadis of usf's comprehensive epilepsy program notes, "the only thing that is really documented is flashing lights, which can trigger seizures in patients with photosensitive epilepsy. only a few types of epilepsies are photosensitive though, and the vast majority of epilepsies are not." in addition to seizures brought about by photosensitivity,
listening to certain pieces of music can also trigger what are called musicogenic seizures, although these types of seizures seem to be much more rare. for a great introduction on the topic of musicogenic seizures, visit epilepsy ontario's web page on musicogenic seizures. seizures and epilepsy are not the same. in its article, "a revised definition of epilepsy" the epilepsy foundation notes that…"...
...h sensitivities to photosensitive or musicogenic triggers. seizures can be fatal, but even the ones that are "only" debilitating can be of such severity, that they render the user incapacitated. other disorders, such as disorientation, nausea, vomiting, and more can also be so severe that the user is unable to function. the epilepsy foundation's article, photosensitivity and seizures, provides a
list of triggers that may cause seizures in photosensitive people; here's an excerpt from that
list: television screens or computer monitors due to the flicker or rolling images. certain video games or tv broadcasts containing rapid flashes or alternating patterns of different colors. intense strobe lights like visual fire alarms. natural light, such as sunlight, especially when shimmering off w...
...verse physical response possible from flashing, flickering, blnking, and other such stimuli. in 1997, a japanese cartoon featured an animated "virus bomb". some of the children watching the cartoon reacted by having seizures, others by suffering nausea, shaking, and vomitting blood. the reactions from the children were so severe, they had to be rushed to the emergency room. the physical disorders
listed below are all possible consequences: each of these physical reactions may be so severe as to be incapacitating. seizures vestibuler disordera migraines nausea vomiting flashing, blinking, & flickering although "flashing" and "blinking" are sometimes used interchangably, they are not the same. according to the w3c, blinking is a distraction problem, whereas flashing refers to content t...
...And 3 more matches
:nth-last-child() - CSS: Cascading Style Sheets
of siblings is even: 2, 4, 6, etc., counting from the end. functional notation <an+b> represents elements whose numeric position in a series of siblings matches the pattern an+b, for every positive integer or zero value of n. the index of the first element, counting from the end, is 1. the values a and b must both be <integer>s. ...
...ional notation <an+b> represents elements whose numeric position in a series of siblings matches the pattern an+b, for every positive integer or zero value of n. the index of the first element, counting from the end, is 1. the values a and b must both be <integer>s. ...
...ts the last three elements */ tr:nth-last-child(-n+3) { background-color: pink; } /* selects every element starting from the second to last item */ tr:nth-last-child(n+2) { color: blue; } /* select only the last second element */ tr:nth-last-child(2) { font-weight: 600; } result quantity query a quantity query styles elements depending on how many of them there are. ...
...And 3 more matches
OpenType font features guide - CSS: Cascading Style Sheets
more of these features enabled by default (kerning and default ligatures are common examples), while others are left to the designer or developer to choose to enable in specific scenarios. ...
... caution: there are many css attributes defined to leverage font features, but unfortunately many are not fully implemented. they are all defined and shown here, but many will only work using the lower-level font-feature-settings property. ...
...eful, readable, and polished: ligatures like 'ff' or 'fi' make letter spacing and reading more even and smooth. fractions can make home improvement and recipe sites much easier to read and understand. numerals within paragraphs of text set as 'oldstyle' sit more comfortably between lower-case letters, and likewise setting them as 'tabular numbers' will make them line up better when setting a
list of costs in a table say. 'lining' figures on the other hand sit more uniformly on their own or in front of capitalized words. while none of these features individually will render a site useless due to their absence, each of them in turn can make a site easier to use and more memorable for its attention to detail. opentype features are like secret compartments in fonts. unlock them and you'll...
...And 3 more matches
CSS reference - CSS: Cascading Style Sheets
use this css reference to browse an alphabetical index of all of the standard css properties, pseudo-classes, pseudo-elements, data types, and at-rules. you can also browse key css concepts and a
list of selectors organized by type. also included is a brief dom-css / cssom reference. basic rule syntax style rule syntax style-rule ::= selectors-
list { properties-
list } ... where : selectors-
list ::= selector[:pseudo-class] [::pseudo-element] [, selectors-
list] properties-
list ::= [property : value] [; properties-
list] see the index of selectors, pseudo-classes, and pseudo-elements below. the syntax for each specified value depends on the data type defined for each specified property. style rule examples strong { color: red; } div.menu-bar li:hover > ul {...
...umn-gapcolumn-rulecolumn-rule-colorcolumn-rule-stylecolumn-rule-widthcolumn-spancolumn-widthcolumnsconic-gradient()containcontentcontrast()<counter>counter-incrementcounter-resetcounter-set@counter-stylecounters()cross-fade()cubic-bezier()::cue::cue-regioncursor<custom-ident>d:defaultdeg<dimension>:dirdirection:disableddisplay<display-box><display-inside><display-internal><display-legacy><display-
listitem><display-outside>dpcmdpidppxdrop-shadow()eelement()ellipse()em:emptyempty-cells:enabledenv()exffallback (@counter-style)filter<filter-function>:first:first-child::first-letter (:first-letter)::first-line (:first-line):first-of-typefit-content()<flex>flexflex-basisflex-directionflex-flowflex-growflex-shrinkflex-wrapfloat:focusfont@font-facefont-familyfont-family (@font-face)font-feature-settin...
...mage-set()@importin:in-range:indeterminateinheritinitialinline-sizeinsetinset()inset-blockinset-block-endinset-block-startinset-inlineinset-inline-endinset-inline-start<integer>:invalidinvert()isolationjjustify-contentjustify-itemsjustify-selfkkhz@keyframesl:lang:last-child:last-of-typeleader():leftleft@left-bottom<length><length-percentage>letter-spacingline-breakline-heightlinear-gradient():link
list-style
list-style-image
list-style-position
list-style-typelocal()mmarginmargin-blockmargin-block-endmargin-block-startmargin-bottommargin-inlinemargin-inline-endmargin-inline-startmargin-leftmargin-rightmargin-top::markermarks (@page)maskmask-bordermask-border-modemask-border-outsetmask-border-repeatmask-border-slicemask-border-sourcemask-border-widthmask-clipmask-compositemask-imagemask-modemask-or...
...And 3 more matches
background - CSS: Cascading Style Sheets
:background-position: refer to the size of the background positioning area minus size of background image; size refers to the width for horizontal offsets and to the height for vertical offsetsbackground-size: relative to the background positioning areacomputed valueas each of the properties of the shorthand:background-image: as specified, but with <url> values made absolutebackground-position: a
list, each item consisting of two keywords representing the origin and two offsets from that origin, each given as an absolute length (if given a <length>), otherwise as a percentagebackground-size: as specified, but with relative lengths converted into absolute lengthsbackground-repeat: a
list, each item consisting of two keywords, one per dimensionbackground-origin: as specifiedbackground-clip: as s...
...rted into absolute lengthsbackground-repeat: a
list, each item consisting of two keywords, one per dimensionbackground-origin: as specifiedbackground-clip: as specifiedbackground-attachment: as specifiedbackground-color: computed coloranimation typeas each of the properties of the shorthand:background-color: a colorbackground-image: discretebackground-clip: discretebackground-position: repeatable
list of simple
list of length, percentage, or calcbackground-size: repeatable
list of simple
list of length, percentage, or calcbackground-repeat: discretebackground-attachment: discrete formal syntax [ <bg-layer> , ]* <final-bg-layer>where <bg-layer> = <bg-image> | <bg-position> [ / <bg-size> ]? | <repeat-style> | <attachment> | <box> | <box><final-bg-layer> = <'background-color'> | <bg-image> | <b...
...ge-src> = <url> | <string><color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color><image-set-option> = [ <image> | <string> ] <resolution><id-selector> = <hash-token><cf-mixing-image> = <percentage>? && <image><cf-final-image> = <image> | <color><linear-gradient()> = linear-gradient( [ <angle> | to <side-or-corner> ]? ...
...And 3 more matches
font-family - CSS: Cascading Style Sheets
the font-family css property specifies a prioritized
list of one or more font family names and/or generic family names for the selected element. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. values are separated by commas to indicate that they are alternatives. the browser will select the first font in the
list that is installed or that can be downloaded using a @font-face at-rule. it is often convenient to use the shorthand property font to set font-size and other font related properties all at once. ...
...est. values are separated by commas to indicate that they are alternatives. the browser will select the first font in the
list that is installed or that can be downloaded using a @font-face at-rule. it is often convenient to use the shorthand property font to set font-size and other font related properties all at once. you should always include at least one generic family name in a font-family
list, since there's no guarantee that any given font is available. this lets the browser select an acceptable fallback font when necessary. the font-family property specifies a
list of fonts, from highest priority to lowest. font selection does not simply stop at the first font in the
list that is on the user's system. rather, font selection is done one character at a time, so that if an available fo...
...for example, "times" and "helvetica" are font families...
...And 3 more matches
Creating and triggering events - Developer guides
*/ }, false); // dispatch the event. ...
...*/ }, false); // dispatch the event. ...
...rer), see the old-fashioned way below. adding custom data – customevent() to add more data to the event object, the customevent interface exists and the detail property can be used to pass custom data. ...
...And 3 more matches
<input type="button"> - HTML: Hypertext Markup Language
ple button we'll begin by creating a simple button with a click event handler that starts our machine (well, it toggles the value of the button and the text content of the following paragraph): <form> <input type="button" value="start machine"> </form> <p>the machine is stopped.</p> const button = document.queryselector('input'); const paragraph = document.queryselector('p'); button.addevent
listener('click', updatebutton); function updatebutton() { if (button.value === 'start machine') { button.value = 'stop machine'; paragraph.textcontent = 'the machine has started!'; } else { button.value = 'start machine'; paragraph.textcontent = 'the machine is stopped.'; } } the script gets a reference to the htmlinputelement object representing the <input> in the dom, saving...
......
..., let the user trigger a button using a key or combination of keys on the keyboard. to add a keyboard shortcut to a button — just as you would with any <input> for which it makes sense — you use the accesskey global attribute. ...
...And 3 more matches
<input type="time"> - HTML: Hypertext Markup Language
e. 12-hour 24-hour edge the edge time control is somewhat more elaborate, opening up an hour and minute picker with sliding reels. it, like chrome, uses a 12- or 24-hour format for inputting times, based on system locale: 12-hour 24-hour value a domstring representing a time, or empty. events change and input supported common attributes autocomplete,
list, readonly, and step idl attributes value, valueasdate, valueasnumber, and
list. methods select(), stepdown(), and stepup(). value a domstring containing the value of the time entered into the input. you can set a default value for the input by including a valid time in the value attribute when creating the <input> element, like so: <label for="appt-time">choose a...
...>"</code>. </p> </form> the javascript code adds code to the time input to watch for the input event, which is triggered every time the contents of an input element change. when this happens, the contents of the <span> are replaced with the new value of the input element. var starttime = document.getelementbyid("starttime"); var valuespan = document.getelementbyid("value"); starttime.addevent
listener("input", function() { valuespan.innertext = starttime.value; }, false); when a form including a time input is submitted, the value is encoded before being included in the form's data. the form's data entry for a time input will always be in the form name=hh%3amm, or name=hh%3amm%3ass if seconds are included (see using the step attribute). additional attributes in addition to the attrib...
..., the value is encoded before being included in the form's data. the form's data entry for a time input will always be in the form name=hh%3amm, or name=hh%3amm%3ass if seconds are included (see using the step attribute). ...
...And 3 more matches
<link>: The External Resource Link element - HTML: Hypertext Markup Language
s. as this attribute is only used when rel="preload" or rel="prefetch" has been set on the <link> element. it specifies the type of content being loaded by the <link>, which is necessary for request matching, application of correct content security policy, and setting of correct accept request header. furthermore, rel="preload" uses this as a signal for request prioritization. the table below
lists the valid values for this attribute and the elements or resources they apply to. value applies to audio <audio> elements document <iframe> and <frame> elements embed <embed> elements fetch fetch, xhr this value also requires <link> to contain the crossorigin attribute. ...
...ylesheet should be loaded and applied to the document. if disabled is specified in the html when it is loaded, the stylesheet will not be loaded during page load. instead, the stylesheet will be loaded on-demand, if and when the disabled attribute is changed to false or removed. setting the disabled property in the dom causes the stylesheet to be removed from the document's document.stylesheets
list. href this attribute specifies the url of the linked resource. a url can be absolute or relative. hreflang this attribute indicates the language of the linked resource. it is purely advisory. allowed values are determined by bcp47. use this attribute only if the href attribute is present. importance indicates the relative importance of the resource. priority hints are delegated using th...
...cted manipulation. see subresource integrity. media this attribute specifies the media that the linked resource applies to. its value must be a media type / media query. this attribute is mainly useful when linking to external stylesheets — it allows the user agent to pick the best adapted one for the device it runs on. notes: in html 4, this can only be a simple white-space-separated
list of media description literals, i.e., media types and groups, where defined and allowed as values for this attribute, such as print, screen, aural, braille. html5 extended this to any kind of media queries, which are a superset of the allowed values of html 4. browsers not supporting css3 media queries won't necessarily recognize the adequate link; do not forget to set fallback links, the restri...
...And 3 more matches
<menu> - HTML: Hypertext Markup Language
the html <menu> element represents a group of commands that a user can perform or activate. this includes both
list menus, which might appear across the top of a screen, as well as context menus, such as those that might appear underneath a button after it has been clicked. content categories flow content. if the element's children include at least one <li> element: palpable content. permitted content if the element is in the
list menu state: flow content, or alternatively, zero or more occurrences of <li>, <script>, and <template>. ...
...s context menus, such as those that might appear underneath a button after it has been clicked. content categories flow content. if the element's children include at least one <li> element: palpable content. permitted content if the element is in the
list menu state: flow content, or alternatively, zero or more occurrences of <li>, <script>, and <template>. (
list menu is the default state, unless the parent element is a <menu> in the context menu state.) if the element is in the context menu state: zero or more occurrences, in any order, of <menu> (context menu state only), <menuitem>, <hr>, <script>, and <template>. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that accep...
...ement is a <menu> in the context menu state.) if the element is in the context menu state: zero or more occurrences, in any order, of <menu> (context menu state only), <menuitem>, <hr>, <script>, and <template>. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that accepts flow content. implicit aria role
list permitted aria roles directory, group,
listbox, menu, menubar, none, presentation, radiogroup, tab
list, toolbar or tree dom interface htmlmenuelement attributes this element includes the global attributes. label the name of the menu as shown to the user. used within nested menus, to provide a label through which the submenu can be accessed. must only be speci...
...And 3 more matches
Cross-Origin Resource Sharing (CORS) - HTTP
t” is one that meets all the following conditions: one of the allowed methods: get head post apart from the headers automatically set by the user agent (for example, connection, user-agent, or the other headers defined in the fetch spec as a “forbidden header name”), the only headers which are allowed to be manually set are those which the fetch spec defines as a “cors-safe
listed request-header”, which are: accept accept-language content-language content-type (but note the additional requirements below) dpr downlink save-data viewport-width width the only allowed values for the content-type header are: application/x-www-form-urlencoded multipart/form-data text/plain no event
listeners are registered on any xmlhttprequestupload obj...
... place additional restrictions on the values allowed in the accept, accept-language, and content-language headers. if any of those headers have ”nonstandard” values, webkit/safari does not consider the request to be a “simple request”. what values webkit/safari consider “nonstandard” is not documented, except in the following webkit bugs: require preflight for non-standard cors-safe
listed request headers accept, accept-language, and content-language allow commas in accept, accept-language, and content-language request headers for simple cors switch to a black
list model for restricted accept headers in simple cors requests no other browsers implement these extra restrictions, because they’re not part of the spec. for example, suppose web content at https://foo.example wis...
...ource in question. note that this header is similar to the allow response header, but used strictly within the context of access control. the server also sends access-control-allow-headers with a value of "x-pingother, content-type", confirming that these are permitted headers to be used with the actual request. like access-control-allow-methods, access-control-allow-headers is a comma separated
list of acceptable headers. finally, access-control-max-age gives the value in seconds for how long the response to the preflight request can be cached for without sending another preflight request. in this case, 86400 seconds is 24 hours. note that each browser has a maximum internal value that takes precedence when the access-control-max-age is greater. preflighted requests and redirects not all ...
...And 3 more matches
Feature-Policy: usb - HTTP
'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. ...
... 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. ...
... 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. ...
...And 3 more matches
HTTP headers - HTTP
n with an http request or response. an http header consists of its case-insensitive name followed by a colon (:), then by its value. whitespace before the value is ignored. custom proprietary headers have historically been used with an x- prefix, but this convention was deprecated in june 2012 because of the inconveniences it caused when nonstandard fields became standard in rfc 6648; others are
listed in an iana registry, whose original content was defined in rfc 4229. iana also maintains a registry of proposed new http headers. headers can be grouped according to their contexts: general headers apply to both requests and responses, but with no relation to the data transmitted in the body. request headers contain more information about the resource to be fetched, or about the client req...
... the credentials flag is true. access-control-allow-headers used in response to a preflight request to indicate which http headers can be used when making the actual request. access-control-allow-methods specifies the methods allowed when accessing the resource in response to a preflight request. access-control-expose-headers indicates which headers can be exposed as part of the response by
listing their names. access-control-max-age indicates how long the results of a preflight request can be cached. access-control-request-headers used when issuing a preflight request to let the server know which http headers will be used when the actual request is made. access-control-request-method used when issuing a preflight request to let the server know which http method will be used when t...
...and reverse proxies, and can appear in the request headers and the response headers. redirects location indicates the url to redirect a page to. request context from contains an internet email address for a human user who controls the requesting user agent. host specifies the domain name of the server (for virtual hosting), and (optionally) the tcp port number on which the server is
listening. referer the address of the previous web page from which a link to the currently requested page was followed. referrer-policy governs which referrer information sent in the referer header should be included with requests made. user-agent contains a characteristic string that allows the network protocol peers to identify the application type, operating system, software vendor or softwar...
...And 3 more matches
The arguments object - JavaScript
several strings this example defines a function that concatenates several strings. the function's only formal argument is a string containing the characters that separate the items to concatenate. function myconcat(separator) { let args = array.prototype.slice.call(arguments, 1); return args.join(separator); } you can pass as many arguments as you like to this function. ...
...fines a function that concatenates several strings. the function's only formal argument is a string containing the characters that separate the items to concatenate. function myconcat(separator) { let args = array.prototype.slice.call(arguments, 1); return args.join(separator); } you can pass as many arguments as you like to this function. ...
...nction. it returns a string
list using each argument in the
list: // returns "red, orange, blue" myconcat(', ', 'red', 'orange', 'blue'); // returns "elephant; giraffe; lion; cheetah" myconcat('; ', 'elephant', 'giraffe', 'lion', 'cheetah'); // returns "sage. basil. oregano. pepper. parsley" myconcat('. ', 'sage', 'basil', 'oregano', 'pepper', 'parsley'); defining a function that creates html
lists this example defines a function that creates a string containing html for a
list. the only formal argument for the function is a string that is "u" if the
list is to be unordered (bulleted), or "o" if the
list is to be ordered (numbered). ...
...And 3 more matches
Intl.NumberFormat() constructor - JavaScript
optional an object with some or all of the following properties: compactdisplay only used when notation is "compact". takes either "short" (default) or "long". currency the currency to use in currency formatting. possible values are the iso 4217 currency codes, such as "usd" for the us dollar, "eur" for the euro, or "cny" for the chinese rmb — see the current currency & funds code
list. there is no default value; if the style is "currency", the currency property must be provided. currencydisplay how to display the currency in currency formatting. possible values are: "symbol" to use a localized currency symbol such as €, this is the default value, "narrowsymbol" to use a narrow format symbol ("$100" rather than "us$100"), "code" to use the iso currency code, ...
...but not zero style the formatting style to use , the default is "decimal". "decimal" for plain number formatting. "currency" for currency formatting. "percent" for percent formatting "unit" for unit formatting unit the unit to use in unit formatting, possible values are core unit identifiers, defined in uts #35, part 2, section 6. a subset of units from the full
list was selected for use in ecmascript. pairs of simple units can be concatenated with "-per-" to make a compound unit. there is no default value; if the style is "unit", the unit property must be provided. unitdisplay the unit formatting style to use in unit formatting, the defaults is "short". "long" (e.g., 16 litres) "short" (e.g., 16 l) "narrow" (e.g., 16l) usegrouping w...
... minimumintegerdigits the minimum number of integer digits to use. possible values are from 1 to 21; the default is 1. minimumfractiondigits the minimum number of fraction digits to use. ...
...And 3 more matches
SVG 2 support in Mozilla - SVG: Scalable Vector Graphics
svg 2 is the next major version of the svg standard, which is a complete rework of the svg 1.2 draft. version 2 contains a lot of changes regarding the last stable version svg 1.1. those changes are
listed below including their support status within mozilla applications. ...
... svg 2 is the next major version of the svg standard, which is a complete rework of the svg 1.2 draft. version 2 contains a lot of changes regarding the last stable version svg 1.1. those changes are
listed below including their support status within mozilla applications. ...
...those changes are
listed below including their support status within mozilla applications. ...
...And 3 more matches
Communicating using "postMessage" - Archive of obsolete content
e name of the event, and the handler function. the handler function is passed the message payload. handling message events in the add-on script to send a message to a content script, use the worker's postmessage function. again, panel and page integrate worker directly: // post a message to the panel's content scripts panel.postmessage(addonmessage); however, for page-mod objects you need to
listen to the onattach event and use the worker supplied to that: var pagemod = require('sdk/page-mod').pagemod({ include: ['*'], contentscript: pagemodscript, onattach: function(worker) { worker.postmessage(addonmessage); } }); to receive messages from a content script, use the worker's on function. to simplify this most content modules provide an onmessage property as an argument to t...
...nction. ...
...er user-defined events is that as soon as you need to send more than one type of message, then both sending and receiving messages gets more complex. suppose the content script wants to send mouseout events as well as mouseover. ...
...And 2 more matches
page-worker - Archive of obsolete content
e page has been loaded, at the time the window.onload event fires this property is optional and defaults to "end". contentscriptoptions object read-only value exposed to content scripts under self.options property. any kind of jsonable value (object, array, string, etc.) can be used here. optional. onmessage function use this to add a
listener to the page worker's message event. page a page object loads the page specified by its contenturl option and executes any content scripts that have been supplied to it in the contentscript and contentscriptfile options. the page is not displayed to the user. the page worker is loaded as soon as the page object is created and stays loaded until its destroy method is called or the...
...s created and stays loaded until its destroy method is called or the add-on is unloaded. methods destroy() unloads the page worker. after you destroy a page worker, its memory is freed and you must create a new instance if you need to load another page. postmessage(message) sends a message to the content scripts. parameters message : value the message to send. must be json-able. on(type,
listener) registers an event
listener with the page worker. see working with events for help with events. parameters type : string the type of event to
listen for.
listener : function the
listener function that handles the event. remove
listener(type,
listener) unregisters an event
listener from the page worker. parameters type : string the type of event for which
listener was registered. l...
... properties port object that allows you to: send events to the content script using the port.emit function receive events from the content script using the port.on function see the guide to communicating using port for details. contenturl the url of content to load. ...
...And 2 more matches
Inline options - Archive of obsolete content
the title attribute is used as a label for the controls. to set a description, either use the desc attribute, or a text node as a child of the <setting> tag...
...the title attribute is used as a label for the controls. to set a description, either use the desc attribute, or a text node as a child of the <setting> tag. settings ...
...title="text"/> <setting pref="extensions.myaddon.password" type="string" title="password" inputtype="password"/> <!-- color example --> <setting pref="extensions.myaddon.color" type="color" title="color"/> <!-- file and directory examples --> <setting pref="extensions.myaddon.file" type="file" title="file"/> <setting pref="extensions.myaddon.directory" type="directory" title="directory"/> <!--
list example (this example would be stored as an integer) --> <setting pref="extensions.myaddon.options1" type="menu
list" title="options 1"> <menu
list> <menupopup> <menuitem value="500" label="small"/> <menuitem value="800" label="medium"/> <menuitem value="1200" label="large"/> </menupopup> </menu
list> </setting> <!-- radio button example (this example would be stored a...
...And 2 more matches
Adding Events and Commands - Archive of obsolete content
« previousnext » event handlers just like with html, most javascript code execution is triggered by event handlers attached to dom elements. the most commonly used event is the onload event, which is used in overlays and other windows to detect when the window has loaded and then run initialization code: // rest of overlay code goes here. window.addevent
listener( "load", function() { xulschoolchrome.browseroverlay.init(); }, false); you can do something similar with the onunload event, to do any cleanup you may need. please read appendix a for recommendations on how to use the load event to initialize your add-on without having a negative performance impact on firefox. another way to attach event handlers, just like html, is to place the handler in the xul code: <overlay id="x...
...act on firefox. another way to attach event handlers, just like html, is to place the handler in the xul code: <overlay id="xulschoolhello-browser-overlay" onload="xulschoolchrome.browseroverlay.init();" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> we prefer the first method because it keeps a better separation of content and behavior. also, note that the addevent
listener method receives the event name without the "on" prefix, while element attributes do have the prefix. there's a long
list of events you can
listen to, and which you use depend on the situation. elements only implement the events that are relevant to them, but there are several events that are implemented for most elements. these are some notable events you should keep in mind: oncommand. th...
... used events in xul. it's very useful because it represents the most common action for input controls such as menu items, buttons and checkboxes. for a button, it represents the action of the user clicking on it, or focusing it with the keyboard and then pressing the enter key. it's an abstraction of the main way to interact with a control element. onselect. fired when the selection in a tree or
listbox changes. onclick. triggered when the user clicks on the element, including right clicks. you shouldn't normally use this event to trigger actions on input controls such as buttons. use oncommand instead. onfocus and onblur. used when an element receives or loses focus when the user is navigating with the keyboard. you can combine these with -moz-user-focus to add custom focus behavior to ele...
...And 2 more matches
Adding windows and dialogs - Archive of obsolete content
« previousnext » opening windows and dialogs to open a new window, use the javascript window.open function just like with html windows. window.open( "chrome://xulschoolhello/content/somewindow.xul", "xulschoolhello-some-window", "chrome,centerscreen"); the first argument is the url to open, the second is an id to identify the window, and the last is an optional comma-separated
list of features, which describe the behavior and appearance of the window. if this value is null or empty, the default toolbars of the main window will be added to the new one, which is rarely what you want. the window.open page has a detailed description of the features you can use and their values. the following features are very important and you should always keep them in mind: chrome. this ca...
...ause they interrupt the user's browsing and can become annoying very quickly. this feature should only be used when there's no way to continue without having the user do something. never open modal windows at startup. resizable. indicates the user can resize the window or not. in general, windows should not be resizable unless they display dynamically generated content from a datasource, such as
lists or trees that may need resizing to have a better view of the content. to open a new dialog, use the function window.opendialog, an extension of the open function. it allows you to send a set of optional parameters that can be used to communicate with the dialog. let somevalue = 2; let returnvalue = { accepted : false , result : "" }; window.opendialog( "chrome://xulschoolhello/content/so...
...izetocontent function is what you need in this case. input controls most additional xul windows and dialogs in extensions are some kind of input form. let's look into the most commonly used form elements and how to use them in your xul windows. there isn't much we need to add from what the xul tutorial explains, so go ahead and read the following sections: input controls numeric controls
list controls there are some other aspects to take into account when handling input controls, which we cover in the following sections. groupboxes the groupbox element should be easy to understand: it groups a series of xul controls together. it's a box container with styling that is usually a visible border around its contents, so that it's clear what is being grouped together. it is frequently u...
...And 2 more matches
Appendix C: Avoiding using eval in Add-ons - Archive of obsolete content
other script tag containing generated, remotely retrieved code, is generally not secure. ...
... execute any retrieved jsonp code in an unprivileged sandbox (which is complicated!), but if you have a choice, just avoid jsonp altogether! passing around functions/code as strings often you'll want to pass functions or code to other functions, most notoriously settimeout and addevent
listener. often this is done passing around strings. ...
...); format_computer(); alert('done');", 100); as a general rule of thumb, just don't pass code around as strings and execute it by calling eval, settimeout and friends. alternative: use (anonymous) functions you can always create a small anonymous function to pass around instead. closures will ensure the code is still valid, even if your outer function already returned from execution. ...
...And 2 more matches
Appendix E: DOM Building and Insertion (HTML & XUL) - Archive of obsolete content
they're not in any namespace) elem.setattributens(attrns.namespace || "", attrns.shortname, val); } } // create and append this element's chil...
...they're not in any namespace) elem.setattributens(attrns.namespace || "", attrns.shortname, val); } } // create and append this element's children var childelems = array.sl...
...nstanceof doc.defaultview.node ? childelem : array.isarray(childelem) ? tag.apply(null, childelem) : doc.createtextnode(childelem)); } }); return elem; } return tag.apply(null, jsontemplate); } in the above, the namespaces object defines the namespace prefixes which can be used in the given dom tree. ...
...And 2 more matches
Observer Notifications - Archive of obsolete content
up with a notification topic that is unique so you know it will not conflict with firefox or other extensions topics. to remove an observer for a specific topic, you use the removeobserver method. the method takes the observer object and notification topic as parameters. observerservice.removeobserver(testobserver, "xulschoolhello-test-topic"); after you have registered some observers to
listen to a notification topic, you can then use the notifyobservers method to send a notification to all of them. the method takes three parameters. the first parameter can be any xpcom object to pass to those observers (can be null), the second parameter is the notification topic and the last parameter is an additional string to pass to those observers (can be null). observerservice.notifyobserve...
...rvers( subject, "xulschoolhello-test-topic", "hello"); } in the notifytest method, the notifyobservers call is used to notify all registered observers about the notification topic "xulschoolhello-test-topic". the input parameter is an instance of nsisupportsstring with some text and the last input parameter is a string "hello". in a chrome browser overlay file, we register an observer to
listen to the notification topic "xulschoolhello-test-topic" when the window loads. keep in mind that you have to remove observers that are not longer needed. not doing so will result in memory leaks. therefore, the registered observer is unregistered when the browser window is unloaded. /** * controls the browser overlay for the hello world extension. */ xulschoolchrome.browseroverlay = { /* o...
...fication topic. * @param adata the additional string associated with the notification. */ observe : function(asubject, atopic, adata) { if (atopic == "xulschoolhello-test-topic") { asubject.queryinterface(ci.nsisupportsstring); window.alert("subject: " + asubject.data); // => "this is a test" window.alert("data: " + adata); // => "hello" } } } window.addevent
listener( "load", function() { xulschoolchrome.browseroverlay.init(); }, false); window.addevent
listener( "unload", function() { xulschoolchrome.browseroverlay.uninit(); }, false); in the observe method the notification topic is verified because you can have one observer
listening to several topics. you may notice that we explicitly set the interface of the asubject object to nsisupportsstring ...
...And 2 more matches
Setting Up a Development Environment - Archive of obsolete content
kage xpi files, we use make. we chose make because this is the same system used by mozilla to build firefox, and it is available for all operating systems. make is a default tool in most unix-based systems. it can be installed on mac os x as part of the xcode tools package, and on windows with cygwin. in cygwin installations you'll have to explicitly check the make and zip utilities from the long
list of packages to download and install. also make sure that make is in the executable system path. after setting up make, you should be able to open a command line window, run "make -ver", and get the installed version of make as output. we recommend you set up make in your system, since our examples come with all the necessary files to build and install the resulting xpi using this tool. it will ...
...n one or more interfaces. these idl files are compiled into binary form and included in the extension as xpt files. to compile an idl file to xpt, you need a command line tool called xpidl. this tool is included in the mozilla gecko sdk. if you need to compile idls, go to the sdk page and download a compiled version for your system. also note any prerequisites you may need. if your system is not
listed in the supported builds, you'll have to build the sdk yourself from the mozilla source. good luck with that. you should also set up your environment so that xpidl.exe (or just xpidl on other systems) is in the default executable path, and also add a variable called gecko_sdk, that points to your sdk build: export gecko_sdk=/path/to/your/sdk our build system should pick it up from there. ...
...ormally displays javascript errors that occur on web pages, but with some tweaking you can get error information from your extension. read this piece on development preferences. developer extensions there's a wide variety of firefox extensions that aid web development and add-on development. a good place to look for them is the mozilla add-ons site, and there's also a good development extension
list here. you should also take some time to play around with the web developer tools that are included in firefox. some of them can be very useful for add-on development and overlap with the add-ons
listed. in this section we'll cover a few that we have found to be very useful. dom inspector the dom inspector used to be part of firefox as an installer option, but since firefox 3 it has been separat...
...And 2 more matches
Supporting search suggestions in search plugins - Archive of obsolete content
firefox supports search suggestions in opensearch plugins; as the user types in the search bar, firefox queries the url specified by the search plugin to fetch live search suggestions. once the
list has been retrieved, it's displayed in a popup box that appears under the search bar, which lets the user select a suggested search term. if the user continues to type, a new set of suggestions is requested from the search engine, and the displayed
list is refreshed. implementing suggestion support in the search plugin to support search suggestions, a search plugin needs to define an extra <url> element with its type attribute set to "application/x-suggestions+json". (this means that a suggestion-supporting engine plugin will have two <url> elements, the other one being the main text/html...
... see creating opensearch plugins for firefox to learn more about how to implement a search plugin. implementing search suggestion support on the server the majority of the work in handling search suggestions is actually implemented on the server side. if you're a web site designer, and want to support search suggestions, you need to implement support for returning the suggestions in javasc...
... a search term, it then sends an http get request to the url specified by the <url> element. your server should then decide upon the suggestions to offer using whatever means it sees fit, and return a json array of results: query string the first element in the array is the original query string. this allows firefox to verify that the suggestions match the current search term. completion
list an array of suggested search terms. the array should be enclosed in square brackets. for example: ["term 1", "term 2", "term 3", "term 4"] descriptions this optional element is an array of descriptions for each of the suggestions in thecompletion
list . these can be any additional information the search engine might want to return to be displayed by the browser, such as the number of result...
...And 2 more matches
MMgc - Archive of obsolete content
ct in unmanaged memory, the unmanaged object must be a subclass of gcroot. gcroot must be subclassed by any unmanaged memory class that holds gc pointers. class mygcobject : public mmgc::gcobject { ... }; class mygcroot : public mmgc::gcroot { mygcobject* mygcobject; }; note that a gcroot is not a garbage-collected object. it is an unmanaged memory object that contains gc pointers. mmgc keeps a
list of all gcroots in the system and makes sure that it marks them. gcroots are generally expected to be allocated using mmgc's unmanaged memory allocators, so that mmgc can figure out how big the gcroot object is. use of gcroot is required to have gc pointers from unmanaged memory, since without gcroot, those pointers won't be marked by the mark phase of the gc. note that gcroot can be used either b...
...emporarily not working) <gflash>600 300 gc.swf</gflash> one pass the mark sweep algorithm described above decomposes into clearmarks/mark/finalize/sweep. in our original implementation clearmarks/finalize/sweep visited every gc page and every object on that page. 3 passes! now we have one pass where marks are cleared during sweep so clear marks isn't needed at the start. also finalize builds up a
lists of pages that need sweeping so sweep doesn't need to visit every page. this has been shown to cut the finalize/sweep pause in half (which happens back to back atomically). overall this wasn't a huge performance increase due to the fact the majority of our time is spent in the mark phase. conservative collection mmgc is a conservative mark/sweep collector. conservative means that it may not recla...
...her. gcheap the gc library has a tiered memory allocation strategy, consisting of 3 parts: a page-granular memory allocator called the gcheap a set of fixed size allocators for sizes up to 2k a large allocator for items over 2k when you want to allocate something we figure out what size class it's in and then ask that allocator for the memory. each fixed size allocator maintains a doubly linked
list of 4k blocks that it obtains from the gcheap. these 4k blocks are aligned on 4k boundaries so we can easily allocate everything on 8-byte boundaries (a necessary consequence of the 32-bit atom design-- 3 type bits and 29 pointer bits). also we store the gcalloc::gcblock structure at the beginning of the 4k block so each allocation doesn't need a pointer to its block (just zero the lower 12 bits o...
...And 2 more matches
MCD, Mission Control Desktop, AKA AutoConfig - Archive of obsolete content
loor(random()*l); j = floor(random()*l); } t = this[i]; this[i] = this[j]; this[j] = t; } return this; } // mix up the ldap servers so we don't hit the same one each time ldap_servers.shuffle(10); .... // 4) call ldap servers to get ldap attributes (mail & cn), this will finally call processldapvalues, "3)" just above. ...
...etenv("home"); } else { // windows settings var env_user = getenv("username"); var env_home = getenv("homepath"); } var env_mozdebug= getenv("mozilla_debug"); final production script here's the complete final and commented production script: //mozilla autoconfiguration, jehan procaccia & roberto aguilar //put everything in a try/catch try { /* 1) define environment variables, 2)
list & randomize ldap replicas, 3) define processldapvalues(), 4) call ldap server to get ldap attributes (mail & cn) getldapattributes() 5) set user preferences */ // 1) env variables if(getenv("user") != "") { // *nix settings var env_user = getenv("user"); var env_home = getenv("home"); } else { // windows settings var env_user = getenv("username"); var env_home = getenv("homepa...
...or("no error -> mci (jehan.procaccia@int-evry.fr)" + "\nthis message is displayed with displayerror()! \ndebug 1 mozilla.cfg v3.2, no failed, s2ia again!", "\nmail:" + mail + "\nuid:" +uid + "\ncn:" +cn + "\nuser:" + env_user); } } } // 4) call ldap servers to get ldap attributes (mail & cn), this will finally call processldapvalues, "3)" just above. ...
...And 2 more matches
Getting Started - Archive of obsolete content
l of the css and images are extracted, but if you make some changes and run mozilla as it is, you will not see them because it's still set to look at the files in the jar files. to point mozilla at the correct files we need to open up \mozilla\chrome\installed-chrome.txt in a text editor. you should probably make a backup of this file now, just in case you make a mistake. in the file you'll see a
list. do a search for classic.jar</cde>. on every line that references <code>classic.jar we need to make some changes (there are about 5 lines). delete the bolded text: original skin,install,url,jar:resource:/chrome/classic.jar!/skin/classic/global/ modified skin,install,url,resource:/chrome/classic/skin/classic/global/ once you have made these modifications, save them and run mozilla. if ...
...this is what we're going to create now. take a screenshot of mozilla running your theme and create an image that is 438x89 pixels in size. place it in \myskin and call it preview.png (if it's a jpg or gif call it preview.jpg or preview.gif). make a copy of contents.rdf and place it in \myskin and open it up in your text editor. this file is a small xml database which is used to describe the skin.
list all the skins being supplied by this theme <rdf:seq about="urn:mozilla:skin:root"> <rdf:li resource="urn:mozilla:skin:myskin/1.0" /> in the code search for the part
listed above. change the blue part to whatever you want your theme called and then its version number. then scroll down to the next section. <rdf:description about="urn:mozilla:skin:myskin/1.0" chrome:displayname="my skin" ...
..." chrome:displayname="my skin" chrome:accesskey="m" chrome:author="me" chrome:description="this is my custom skin for mozilla" chrome:name="myskin/1.0" chrome:image="preview.png"> the blue areas are explained below. the first line should match the line that you modified in the previous section. the display name. that is what the user sees in the preference panels
list of themes. the access key is what key you can press to activate the skin in the preferences. replace the author section with your name. the description shows up below the preview image. place your theme name and version number on this line point to your preview.png/preview.jpg/preview.gif here the packages section
lists which components of the browser suit that you are modifying. if we also...
...And 2 more matches
Layout System Overview - Archive of obsolete content
ould be too slow, at least on low-end machines. thus the html editor and text controls put considerable performance requirements on the layout system's handling of dynamic content manipulation. the fundamentals of frames: block and line there are many types of frames that are designed to model various formatting requirements of different html and xml elements. css2 defines several (block, inline,
list-item, marker, run-in, compact, and various table types) and the standard html form controls require their own special frame types to be formatted as expected. the most essential frame types are block and inline, and these correspond to the most important layout concepts, the block and line. a block is a rectangular region that is composed of one or more lines. a line is a single row of text or ot...
...view, the frames, style set, and reflow queue are the most important high-level parts of the presentation shell. frame manager the frame manager is used to, well, manage frames. frames are basic formatting objects used in layout, and the frame manager is responsible for making frames available to clients. there are several collections of frames maintained by the frame manager. the most basic is a
list of all of the frames starting at the root frame. clients generally do not want to incur the expense of traversing all of the frames from the root to find the frame they are interested in, so the frame manager provides some other mappings based on the needs of the clients. the most crucial mapping is the primary frame map. this collection provides access to a frame that is designated as the primar...
...e data for elements that currently have no frames. (note: the original architecture of the layout system included the creation of frames for elements with no display. this changed somewhere along the line, but there is no indication of why the change was made. presumably it is more time and space-efficient to prevent frame creation for elements with no display.) the frame manager also maintains a
list of forms and form controls, as content nodes. this is presumably related to the fact that layout is responsible for form submission, but this is a design flaw that is being corrected by moving form submission into the content world. these collections of forms and form controls should be removed eventually. css frame constructor the frame constructor is responsible for resolving style values for c...
...And 2 more matches
Introducing the Audio API extension - Archive of obsolete content
once the buffer is full, the event mozaudioavailable is triggered. this event therefore contains the raw samples of a period ...
...content scripts can specify the audio stream's characteristics, then write audio samples. users mu...
...content scripts can specify the audio stream's characteristics, then write audio samples. users must create an audio object and then use the mozsetup() function to specify ...
...And 2 more matches
New Security Model for Web Services - Archive of obsolete content
from similar uris of untrusted domains, then it could allow a script loaded from an indistinguishable domain to exploit firewall-protected resources. also, this technique prevents the script from accessing many legitimate external resources not provided in the same domain as the script. this prevents a script from accessing web services and data published from any domain besides its own. ...
...ed domains, then it could allow a script loaded from an indistinguishable domain to exploit firewall-protected resources. also, this technique prevents the script from accessing many legitimate external resources not provided in the same domain as the script. this prevents a script from accessing web services and data published from any domain besides its own. white-
listing by creating a white
list of trusted uris from which scripts are trusted to not compromise internal resources, it is possible to release domains from the stricter same-source sandbox. a white
list is a good tool for including always-trusted domains, but on the web, it is often a script from a relatively-untrusted domain that must be granted access to other untrusted domains, without compromising internal domains. more-co...
...ris from which scripts are trusted to not compromise internal resources, it is possible to release domains from the stricter same-source sandbox. a white
list is a good tool for including always-trusted domains, but on the web, it is often a script from a relatively-untrusted domain that must be granted access to other untrusted domains, without compromising internal domains. ...
...And 2 more matches
Space Manager High Level Design - Archive of obsolete content
information is used by block layout to correctly compute where other floated elements should be placed, and how much space is available to normal in-flow elements that flow around the floated bits. the space manager works in concert with several other classes to do its job. the classes that are considered part of the space manager are: nsspacemanager nsbanddata nsblockbanddata bandrect / band
list (private structs) frameinfo (private struct) nsbandtrapezoid outside of the space manager itself, the clients of the space manager also play an important part in the management of he available and used space. the primary classes that interact with the space manager are: nsblockreflowstate nsblockframe nsboxtoblockadaptor the general interaction model is to create a space manager for a blo...
...on about the frames occupying a band of occupied or available space nsblockbanddata: a specialization of nsbanddata that is used by nsblockreflowstate to determine the available space, float impacts, and where floats are cleared. essentially a css-specific wrapper for generic nsbanddata. bandrect: keeps the bounds of a band, along with the frames associated with the band. bandrects are a linked
list (provided by prc
liststr super-class) and also provide some geometry-management methods (splitvertically, splithorizontally) and some methods that query or manipulate the frames associated with the band (isoccupiedby, addframe, removeframe). band
list: a subclass of bandrect that provides a
list interface - head(), tail(), isempty(), etc. frameinfo: a structure that keeps information about the re...
... some geometry-management methods (splitvertically, splithorizontally) and some methods that query or manipulate the frames associated with the band (isoccupiedby, addframe, removeframe). band
list: a subclass of bandrect that provides a
list interface - head(), tail(), isempty(), etc. frameinfo: a structure that keeps information about the rectangle associated with a specific frame, in a linked
list. nsbandtrapezoid: represents the discrete regions within a band that are either available, occupied by a single frame, or occupied by several frames. ...
...And 2 more matches
insertItemAt - Archive of obsolete content
it at the specified position. you may optionally set a value. the new item element is returned. ...
...d position. you may optionally set a value. the new item element is returned. ...
...value. the new item element is returned. ...
...And 2 more matches
controllers - Archive of obsolete content
« xul reference controllers type: nsicontrollers a controllers
list attached to the element. the controllers are used to respond to commands. the document's command dispatcher will locate controllers to handle a command by using the focused element's
list. ...
...rs
list attached to the element. the controllers are used to respond to commands. the document's command dispatcher will locate controllers to handle a command by using the focused element's
list. ...
...e controllers are used to respond to commands. the document's command dispatcher will locate controllers to handle a command by using the focused element's
list. ...
...And 2 more matches
SQLite Templates - Archive of obsolete content
lon, in this case 'filename.sqlite'. sqlite files typically have the 'sqlite' extension. as with xml datasources, the ref attribute isn't currently used for sqlite sources, so you should just set the ref attribute to a dummy value; '*' is typically used. the query for an sqlite datasource is just an sql select statement, as text inside the query element. this simple example shows how to display a
listbox containing the values in one column in a database table. <
listbox datasources="profile:userdata.sqlite" ref="*" querytype="storage"> <template> <query> select name from myfriends </query> <action> <
listitem uri="?" label="?name"/> </action> </template> </
listbox> the query returns the
list of values from the 'name' column in the table 'myfriends'. the action b...
...orage"> <template> <query> select name from myfriends </query> <action> <
listitem uri="?" label="?name"/> </action> </template> </
listbox> the query returns the
list of values from the 'name' column in the table 'myfriends'. the action body, starting at the node with uri="?" is repeated for each result returned from the query. if the query returns six results, six
listitems will be generated. the labels have the special value '?name'. the syntax with the question mark is similar as with the other query types. it means, substitute the attribute value with the value of a column from the result. in this case, '?name' means replace this with the value of the name column. the effect is a
listbox containing the names from the database. you can return multiple columns...
...y to look up females, all you need to do is get a reference to the param element and adjust the contents. you would likely want to add an id to the param element so that the getelementbyid method may be used to refer to it. you can add as many parameters as necessary for the query. the example above used a string parameter. if you want a numeric parameter, you should also set the type attribute. ...
...And 2 more matches
Simple Query Syntax - Archive of obsolete content
uery> <content uri="?start"/> <member container="?start" child="?photo"/> </query> the template builder uses the simple query syntax whenever a template does not have a <query> element. if a <query> element is present, the full syntax is used instead. in the simple syntax, the builder will use the default query shown above, although the variable names are randomly generated. since the photos
list iterates over the children of a container, we can use the simple syntax. here is what it might look like: <template> <vbox class="box-padded" uri="rdf:*"> <image src="rdf:*"/> <label value="rdf:http://purl.org/dc/elements/1.1/title"/> </vbox> </template> there is no <query> or <action> element used. instead, the builder uses a default query, and the action is placed directly inside ...
... predicate you wish to filter by and the value of the attribute will be the value to filter by. any results that match the criteria are accepted and any that do not match are rejected. you can use multiple attributes to filter by several criteria. in this case, all of the criteria must match for the result to be accepted. ...
... might be: <triple subject="?photo" predicate="http://www.xulplanet.com/rdf/country" object="http://www.daml.org/2001/09/countries/iso#it"/> adjusting simple query conditions the simple syntax is limited in the kind of filtering it can do, however it is often sufficient for many purposes. ...
...And 2 more matches
Sorting Results - Archive of obsolete content
datasource, again, the results are in the order the query generates them, although except in the case of an rdf seq, this order is arbitrary as rdf triples don't occur in any particular order. when the reference node is an rdf seq container and the results are in that container, however, the template builder orders the results in the order the items appear in the seq. for instance, the photos are
listed in the same order in this example as they appear in the seq in the datasource. this method of sorting a seq works best for the simple query syntax since it is obvious how the starting ref relates to the end member results (they are just the children), or for extended syntax queries that follow a similar pattern. for more complex queries, this natural sorting will not work, because the sort serv...
...is case, the natural order of the results will just be the order that the template builder generates the results. for ascending or descending sorts, this doesn't matter, since it will ignore whether results are containers and just sort by a value, alphabetically or numerically depending on the type of data. when using a tree, sorting may be performed on each column of the tree. for instance, if a
list of photos was displayed in a two column tree showing the title and description, you could sort by either title or description. the user can change the sort column and direction by clicking the column headers, however, you can programmatically change the sort as well. sorting tree results we'll examine sorting of trees first since trees are the most common element used with sorted items. using a t...
...n about sorting only applies to tree builders. for other elements or content trees, sorting is done by placing the attributes on the root element. content sorting for content builders (templates that do not use flags="dont-build-content"), sorting is done by placing the sort and sortdirection attributes on the root node of the template. the sortactive attribute is not needed. in this example, the
list of people is sorted ascending by name. <
listbox datasources="people2.xml" ref="*" querytype="xml" sort="?name" sortdirection="ascending"> <template> <query expr="*/*"/> <action> <
listitem uri="?" label="?name"/> </action> </template> </
listbox> it will often be the case that multiple items have the same value, especially for larger amounts of data. you can specify ...
...And 2 more matches
XML Templates - Archive of obsolete content
queries use syntax that is specific to xml. the datasources attribute should be set to the url of an xml document, either a local file or a remote web site. the ref attribute isn't currently used for xml sources, as the root of the document is always the starting point for xml queries; you should just set the ref attribute to a dummy value, for example '*' which is typically used. an example: <
listbox datasources="people.xml" ref="*" querytype="xml"> <template> ... </template> <
listbox> the url in the datasources attribute may be a relative url or an absolute url. note: if you want to have the state of the disclosure triangles ("twisties") be persistent, be sure to give each node a unique "id" attribute. these are used to track the current state of the disclosure triangles. sup...
...if you want to have the state of the disclosure triangles ("twisties") be persistent, be sure to give each node a unique "id" attribute. these are used to track the current state of the disclosure triangles. support for this was introduced in gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4). for this and the following examples, we are going to use the following xml document containing a
list of people: <people> <person name="napoleon bonaparte" gender="male"/> <person name="cleopatra" gender="female"/> <person name="julius caesar" gender="male"/> <person name="ferdinand magellan" gender="male"/> <person name="laura secord" gender="female"/> </people> xml query syntax the query syntax is fairly simple for xml datasources. just place an expr attribute on the query element ...
...leopatra" gender="female"/> <person name="julius caesar" gender="male"/> <person name="ferdinand magellan" gender="male"/> <person name="laura secord" gender="female"/> </people> xml query syntax the query syntax is fairly simple for xml datasources. just place an expr attribute on the query element containing an xpath expression returns the set of results to output. here is an example: <
listbox datasources="people.xml" ref="*" querytype="xml"> <template> <query expr="person"/> <action> <
listitem uri="?" label="?name"/> </action> </template> </
listbox> the expr attribute is a very simple xpath expression which simply retrieves the person elements from within the datasource. as there are five in the xml document, five results will be generated. the action element...
...And 2 more matches
Introduction to RDF - Archive of obsolete content
okmarks, the history or mail messages. mozilla provides datasources for this common data so that you can easily use them. you can use any of the provided rdf datasources to populate trees with data or you can point to an rdf file stored in xml which contains the data. this makes it very convenient to display trees with lots of rows in them. rdf can also populate other xul elements as well such as
listboxes and menus. we'll see this in the next section. a very brief overview of rdf will be provided here. for more information about rdf, see the rdf specification. rdf/xml rdf consists of a model, which is a graph representation of data. rdf/xml is an xml language which can be used to represent rdf data. it contains a fairly simple set of elements. the sample below shows a simple rdf template. <?
...his has some similarities to the xul header. instead of the window element, the rdf element is used. you can see the namespace for rdf was declared so that the rdf elements are recognized properly. inside, the rdf element, you will place the data. to see some example rdf/xml files, look at those provided with mozilla. they have the extension rdf. rdf database let's take the example of a bookmarks
list generated from rdf. a bookmarks
list contains a set of records, each with a set of data associated with it, such as a url, a bookmark title and a visited date. think of the bookmarks as a database, which is stored as a large table with numerous fields. in the case of rdf however, the
lists may be hierarchical as well. this is necessary so that we can have folders or categories of bookmarks. each ...
...rks as a database, which is stored as a large table with numerous fields. in the case of rdf however, the
lists may be hierarchical as well. this is necessary so that we can have folders or categories of bookmarks. each of the fields in an rdf database is a resource, each with a name associated with it. the name is described by a uri. ...
...And 2 more matches
Modifying a XUL Interface - Archive of obsolete content
ions. the syntax of these functions is as follows: parent.appendchild(child); parent.insertbefore(child, referencechild); parent.replacechild(newchild, oldchild); parent.removechild(child); it should be fairly straightforward from the function names what these functions do. the insertbefore() function inserts a new child node before an existing one. this is used to insert into the middle of a
list of children of the parent element instead of at the end like appendchild() does. the replacechild() function removes an existing child and adds a new one in its place at the same position in the
list of its parent element. finally the removechild() function removes a child from the
list of its parent element. note that for all these functions, the object referred to by the variable reference...
...tnode.appendchild(this.nextsibling.clonenode(true));"/> <vbox> <button label="first"/> <button label="second"/> </vbox> </hbox> when the copy button is pressed.. we retrieve the nextsibling of the button, which will be the vbox element. a copy of this element is made using the clonenode() function and the copy is appended using appendchild(). ...
...d(this.nextsibling.clonenode(true));"/> <vbox> <button label="first"/> <button label="second"/> </vbox> </hbox> when the copy button is pressed.. we retrieve the nextsibling of the button, which will be the vbox element. a copy of this element is made using the clonenode() function and the copy is appended using appendchild(). ...
...And 2 more matches
Tabboxes - Archive of obsolete content
u would place the content for a page within this element. the first tabpanel corresponds to the first tab, the second tabpanel corresponds to the second tab and so on. the tabbox is the outer element. it consists of two children, a tabs element which contains the row of tabs and a tabpanels elements which contains the tabbed pages. shown below is the general syntax of a tabbox: <tabbox id="tab
list"> <tabs> <!-- tab elements go here --> </tabs> <tabpanels> <!-- tabpanel elements go here --> </tabpanels> </tabbox> the tab elements are placed inside a tabs element, which is much like a regular box. the tabs element itself has been placed inside a tabbox. the tabbox also contains a tabpanels element which will appear below the tabs due to the vertical orientation on the whole...
...ndex="1"> <tabs> <tab label="search"/> <tab label="options"/> </tabs> <tabpanels> <tabpanel id="searchpanel" orient="vertical"> <description> enter your search criteria below and select the find button to begin the search. ...
...riteria below and select the find button to begin the search. ...
...And 2 more matches
XUL Parser in Python/source - Archive of obsolete content
source code for the xul parser in python. import sys, glob, xmllib import os, re el_
list = {} w = open('res.html', 'w') # unfortunately, i had to put this hack in here to suppress the printing out of the resolved namespace: # "xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul window", etc. ...
... = {} w = open('res.html', 'w') # unfortunately, i had to put this hack in here to suppress the printing out of the resolved namespace: # "xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul window", etc. ...
... open('res.html', 'w') # unfortunately, i had to put this hack in here to suppress the printing out of the resolved namespace: # "xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul window", etc. ...
...And 2 more matches
XUL element attributes - Archive of obsolete content
rdf properties (an rdf predicate) that indicate that a resource is a container. when generating content from a template this is used to determine which resources from the datasource are containers and thus can have child nodes and which ones are not containers. this attribute should be placed on the same element that the datasources and the ref attribute is on. it may be set to a space-separated
list of rdf properties or resources. context type: id should be set to the value of the id of the popup element that should appear when the user context-clicks on the element. a context-click varies on each platform. usually it will be a right click. you can use the special value '_child' to indicate the first menupopup child of the element. contextmenu type: id alternate name for th...
... should appear when the user context-clicks on the element. a context-click varies on each platform. usually it will be a right click. you can use the special value '_child' to indicate the first menupopup child of the element. contextmenu type: id alternate name for the context attribute, but also has a corresponding script property contextmenu. datasources type: space separated
list of datasource uris a space-separated
list of datasources that an element's template will use for content generation. these can be either internal datasources such as rdf:bookmarks or a url. the datasources attribute may be placed on most elements, although it will usually be found on trees and menu related elements. the element should have a template element as a child. for rdf templates, the s...
...ted element, this will make all of its children have the width of the widest child. for a vertically oriented element, this will make its children all have the height of the tallest child. never all of the children are displayed at the size required by the content or as specified by the width and height attributes or the css width and height properties. flags type: space-separated
list of the values below a set of flags used for miscellaneous purposes. two flags are defined, which may be the value of this attribute. dont-test-empty: for template generated content, the builder will not check that a container is empty. dont-build-content: this flag may be used on a tree to indicate that content elements should not be generated. this results in a performance enhancement, bu...
...And 2 more matches
description - Archive of obsolete content
in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not require validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable). for user editable menu
list elements, the contents, as visible to the user, are read and set using the menu
list.value syntax. for those elements, setattribute("value", myvalue) and getattribute("value") do not access or affect the contents displayed to the user. properties accessibletype type: integer a value indicating the type of accessibility object for the element. crop ...
... crop type: string gets and sets the value of the crop attribute. disabled type: boolean gets and sets the value of the disabled attribute. tabindex type: integer gets and sets the value of the tabindex attribute. value type: string gets and sets the value of the value attribute. ...
...led type: boolean gets and sets the value of the disabled attribute. tabindex type: integer gets and sets the value of the tabindex attribute. value type: string gets and sets the value of the value attribute. for textbox and user editable menu
list elements, the contents, as visible to the user, are read and set using the textbox.value and menu
list.value syntax. ...
...And 2 more matches
key - Archive of obsolete content
r the key element to be activated. for the shortcut defined using the key element to work, you must specify a command attribute (or an oncommand handler) on the key element. to display the shortcut defined with the key element in the ui, you can use <menuitem key="key element's id" command="command id" .../>. in order to use (non-default) key commands within specific elements, you will need to
listen for key events. more information is available in the xul tutorial. attributes command, disabled, key, keycode, keytext, modifiers, oncommand, phase examples (example needed) attributes command type: id set to the id of a command element that is being observed by the element. disabled type: boolean indicates whether the element is disabled or not. if this attribute i...
...s, is normally preferred to use of the attribute, as it may need to update additional state. key type: character the character that must be pressed. this should be set to a displayable character. keycode type: string key code for keys that do not have displayable characters, such as the enter key or function keys, use this attribute instead of the key attribute. valid keys are
listed at keyboard shortcuts. keytext type: string a label for the keyboard shortcut. this text would appear next to a menuitem label if that menuitem is associated with the key element via its key attribute. modifiers type: space-separated
list of the values below a
list of modifier keys that should be pressed to invoke the keyboard shortcut. multiple keys may be separated by spaces...
...llowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
...And 2 more matches
menupopup - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a container used to display the contents of a popup menu. when a menupopup is open, it floats above the window and may extend outside the window border. there are several ways in which a menupopup may be used: it may be placed inside a menu, menu
list, toolbarbutton, or a button with the type attribute set to "menu" to create a popup that will open when the menu or button is pressed. it may be attached to any element using the popup attribute. when the element is clicked with the left mouse button, the menupopup will be displayed. it may be attached to any element using the context attribute. when a context menu is opened, the menupopup will be displayed. a context menu may be opened by rig...
...al and popup guide. attributes ignorekeys, left, onpopuphidden, onpopuphiding, onpopupshowing, onpopupshown, position, top properties accessibletype, anchornode, popupboxobject, position, state, triggernode methods hidepopup, moveto, openpopup, openpopupatscreen, setconsumerollupevent, showpopup, sizeto examples the following example shows how a menupopup may be attached to a menu
list. <menu
list> <menupopup> <menuitem label="mozilla" value="http://mozilla.org"/> <menuitem label="slashdot" value="http://slashdot.org"/> <menuitem label="sourceforge" value="http://sf.net"/> <menuitem label="freshmeat" value="http://freshmeat.net"/> </menupopup> </menu
list> the following example shows how a menupopup can be used as a context menu for an element. when the lab...
...t yet been shown. this state will occur during the popupshowing event. hiding: the popup is about to be hidden. this state will occur during the popuphiding event. triggernode type: nsidomnode this read-only property holds the dom node that generated the event triggering the opening of the popup. the value is null if the popup isn't open. ...
...And 2 more matches
preference - Archive of obsolete content
e, it indicates that the value of the preference is the reverse of the user interface element attached to it. for instance, checking the checkbox disables the preference instead of enabling it. name type: string the name of the preference to change. for example, the browser's home page is set with the preference browser.startup.homepage. ...
... checking the checkbox disables the preference instead of enabling it. name type: string the name of the preference to change. for example, the browser's home page is set with the preference browser.startup.homepage. overview an onchange attribute is an event
listener to the object for the event change. 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 ...
...ned from the defaultvalue property. valuefrompreferences gets and sets the value stored in the user preference, specified in name. (this always accesses the nsiprefbranch apis regardless of the instantapply mode in effect). methods reset() return type: no return value resets the preference to its default value. for a textbox it also clears the undo transaction
list (gecko 1.9). type getelementvalue(in domelement element); retrieves the value that should be written to preferences based on the current state of the supplied element. this function calls onsynctopreference. boolean iselementeditable(in domelement element) returns true, if the given element is "editable" (see below). void setelementvalue(in domelement element); initializes the supplied e...
...And 2 more matches
scale - Archive of obsolete content
in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not require validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable). for user editable menu
list elements, the contents, as visible to the user, are read and set using the menu
list.value syntax. for those elements, setattribute("value", myvalue) and getattribute("value") do not access or affect the contents displayed to the user. properties disabled type: boolean gets and sets the value of the disabled attribute. increment type: integer ...
...max type: integer gets and sets the value of the max attribute. pageincrement type: integer gets and sets the value of the pageincrement attribute. tabindex type: integer gets and sets the value of the tabindex attribute. value type: string gets and sets the value of the value attribute. ...
... type: integer gets and sets the value of the pageincrement attribute. tabindex type: integer gets and sets the value of the tabindex attribute. value type: string gets and sets the value of the value attribute. for textbox and user editable menu
list elements, the contents, as visible to the user, are read and set using the textbox.value and menu
list.value syntax. ...
...And 2 more matches
tab - Archive of obsolete content
image type: uri the uri of the image to appear on the element. if this attribute is empty or left out, no image appears. the position of the image is determined by the dir and orient attributes. label type: string the label that will appear on the element. if this is left out, no text appears. for an editable menuitem element the value of this attribute is copied to the menu
list.value property upon user selection of the menuitem. last-tab type: boolean this attribute will be set to true for the last tab. this attribute should not be set manually, but is useful in a theme if the last tab should be styled differently. linkedpanel type: id the id of the linked tabpanel element that will be displayed when the tab is selected. if this attribute is not used...
...property's value is true if this element is selected, or false if it is not. this property is read only. this property is available for menuitem and menuseparator elements in firefox 3. tabindex type: integer gets and sets the value of the tabindex attribute. value type: string gets and sets the value of the value attribute. ...
...y. this property is available for menuitem and menuseparator elements in firefox 3. tabindex type: integer gets and sets the value of the tabindex attribute. value type: string gets and sets the value of the value attribute. for textbox and user editable menu
list elements, the contents, as visible to the user, are read and set using the textbox.value and menu
list.value syntax. ...
...And 2 more matches
textbox - Archive of obsolete content
xtbox to let the user step through values. there are several attributes that allow the number textbox to be configured, including decimalplaces, min, max, increment, wraparound, hidespinbuttons, and textbox.value. password a textbox that hides what is typed, used for entering passwords. search a textbox intended for searching. the command event will fire as the user modifies the value. a
listener for the command event should update search results. if the searchbutton attribute is set to true, the command event is only fired if the user presses the search button or presses the enter key. you may specify grey text to appear when the search box is empty using the emptytext attribute, and a timeout may be set for the command event using the timeout attribute (defaults to 500). timed ...
...abel attribute if it is present and not empty. otherwise it returns the value of the associated label element, if applicable. otherwise it returns the placeholder or emptytext property. the getter is mostly useful for screen readers. note: prior to firefox 3, and always in thunderbird and seamonkey, the label property of an autocomplete textbox returns its value, for compatibility with the menu
list element. max type: integer gets and sets the value of the max attribute. maxlength type: integer the maximum number of characters that the textbox allows to be entered. min type: integer gets and sets the value of the min attribute. placeholder type: string gets and sets a string that appears in the textbox when it has no value. ...
...se() return type: no return value decreases the value of the scale or number box by the increment. increase() return type: no return value increases the value of the scale or number box by the increment. reset() return type: no return value resets the preference to its default value. for a textbox it also clears the undo transaction
list (gecko 1.9). select() return type: no return value selects all the text in the textbox. setselectionrange( start, end ) return type: no return value sets the selected portion of the textbox, where the start argument is the index of the first character to select and the end argument is the index of the character after the selection. set both arguments to...
...And 2 more matches
treecell - Archive of obsolete content
appears in which the user can edit the contents of the cell. the tree and treecol must also be marked as editable in order for this to work. the tree must be a content tree for this to work on treecells. label type: string the label that will appear on the element. if this is left out, no text appears. for an editable menuitem element the value of this attribute is copied to the menu
list.value property upon user selection of the menuitem. mode type: one of the values below for columns that are progress meters, this determines the type of progress meter to use. none no progress meter is displayed. the cell text is displayed instead. normal the cell uses its value attribute to determine the amount of the bar that is filled in. undetermined the progressmet...
... type: one of the values below for columns that are progress meters, this determines the type of progress meter to use. none no progress meter is displayed. the cell text is displayed instead. normal the cell uses its value attribute to determine the amount of the bar that is filled in. undetermined the progressmeter is indeterminate. properties type: space-separated
list of property names sets the properties of the element, which can be used to style the element. for more information, see styling a tree. ref type: uri for template-generated elements, this attribute is used to specify the root rdf node where content generation begins. this will correspond to the value of an about attribute on an rdf container. this attribute should be placed alongside th...
...in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not require validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable). for user editable menu
list elements, the contents, as visible to the user, are read and set using the menu
list.value syntax. for those elements, setattribute("value", myvalue) and getattribute("value") do not access or affect the contents displayed to the user. properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, dat...
...And 2 more matches
wizardpage - Archive of obsolete content
lable in the xul tutorial. attributes description, label, next, pageid properties next, pageid attributes description type: string descriptive text to appear in addition to the dialog title. label type: string the label that will appear on the element. if this is left out, no text appears. for an editable menuitem element the value of this attribute is copied to the menu
list.value property upon user selection of the menuitem. next type: id set to the pageid of the next wizardpage after this one. when set, the page with this pageid is displayed when the next button is pressed. this can be used to create wizards that do not have a linear sequence. if one of the pages has a next attribute, all of the pages should have one, except that last page. pageid ty...
...be used to create wizards that do not have a linear sequence. if one of the pages has a next attribute, all of the pages should have one, except that last page. pageid type: id this attribute should be set to a string that identifies the page's identifer in the wizard. this is used with the next attribute. the wizard always starts with the wizardpage that appears first in the wizard child
list. properties next type: string wizardpage id set to the pageid of the next page after this one. when set, the page with this pageid is displayed when the next button is pressed. this can be used to create wizards that do not have a linear sequence. if one of the pages has a next attribute, all of the pages should have one, except that last page. pageid type: string wizardpage id ...
...wizards that do not have a linear sequence. if one of the pages has a next attribute, all of the pages should have one, except that last page. pageid type: string wizardpage id this attribute should be set to a string that identifies the page's identifer in the wizard. this is used with the next attribute. the wizard always starts with the wizardpage that appears first in the wizard child
list. inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, ...
...And 2 more matches
Custom app bundles for Mac OS X - Archive of obsolete content
e your xulrunner-based application in a way which is consistent with the expectations of mac os x users. application bundle layout application bundles are essentially just directory structures that conform to a standard layout and naming convention. ...
...es are essentially just directory structures that conform to a standard layout and naming convention. ...
...ications, as shown above in application bundle layout, there are some specific rules for what content goes where: the top-level directory is given a name that ends with .app which designates the whole package as an application bundle. the first sub-directory is called contents and within that directory you will place several files and folders that are needed by your application bundle. ...
...And 2 more matches
Mozilla release FAQ - Archive of obsolete content
a evangelism effort mozdev projects irc server: irc.mozilla.org channel #mozillazine note that recent versions of mozilla include an irc client. other irc clients can be found at irchelp.org. usenet all newsgroups in the netscape.public.mozilla.* hierarchy. if your news server doesn't carry these, you can use the mozilla news server. (some people receive the newsgroups via a mailing
list. take this into consideration when posting things) ftp see the mozilla ftp mirror section for ftp sites under which license terms was mozilla released? mozilla is released under the npl/mpl (netscape/mozilla public licenses) which are in some ways similar to the gnu gpl, and in some ways similar to a bsd-style license. take a look at mozilla.org's npl area for details. what are all of the co...
...ilestone release [number] (no longer used) i'm wondering how to do xxx with navigator 3.x... the mozilla newsgroups are intended to be used by people who will be working with mozilla, either in an organizational fashion, suggesting features, or coding. visit netscape's website for help on that software. i went and made a suggestion and people were rude to me. why? if you posted it to the mailing
list/newsgroups, remember that on usenet, people are not always polite to each other. some people are just rude, and some people have a low tolerance for uninformed people. if you're new to the mozilla newsgroups, you probably should be reading the newsgroup for a few days regularly before you post anything. reading this faq might help as well. i did all that, and people were still rude to me. why? if...
...ll cmd.exe (as opposed to 4dos or 4nt) will probably yield better results. regarding compilation options, it would be good not to compile with optimization, because it's much slower to build, and on windows platforms, there's a bug in some versions of vc++ that makes mozilla crash in many common circumstances if compiled with optimization on. ...
...And 2 more matches
Table Reflow Internals - Archive of obsolete content
eflowee's first reflow must be of this type (reflower's responsibility). resize - reflowee gets a change in available space only. similar to initial, except it can reoccur. incremental - has a reflow path (tree) where each node has a command with a target frame, reflow command types are: dirty - something changed inside a target (e.g. ...
...anged - a target changed sty
listicly (recall, size is a style property) content changed - a target's content changed (e.g. ...
... the same as previous table caches max element, preferred widths in case they are requested and it isn't rebalanced cell caches prior avail width. if this doesn't change, the row may not have to reflow the cell table incremental reflow outer table is a target when a caption is added or removed (dirty) or the table or caption margin changes (style changed). caption is a target when it changes sty
listically (style changed). table, row group, row, col group, col is a target when a child is added or removed (dirty) or it changes sty
listically (style changed). in the dirty cases, a target posted the reflow command in appendframes, insertframes, or deleteframe. table incremental reflow in the style change cases where a target is between the table and the cell, the table is told to rebalance. whe...
...And 2 more matches
E4X for templating - Archive of obsolete content
d != undefined) { // we need undefined condition for e4x return h(cond); } else if (_else) { return _else(cond); } return ''; // empty string allows conditions in attribute as well as element content } for example: {_if(elems.length(), function () <description>{elems[0]}</description>, function _else () <label>no data</label> )} note that the simple xml
list() constructor (<></>) may be 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 abo...
... /* the first two arguments are optional: (h is a handler with an explicit argument v only, or beg...
...} } else { for (k in arr) { if (it < min) { ++it; continue; } if (it > max) { break; } ret+=h(k, arr[k], it, lev); ++it; } } return ret; } the following real case example iterates over an array of the lines in an e4x child element to produce an xml
list of multiple vbox's representing each line: <vbox> {foreach(e(someel.somechild[0]).split('\n'), function (line) <description>{line}</description> )} </vbox> the following example shows iteration over an e4x object itself: {foreach(elems, function (k, elem, iter) <> <row>{k}: {elem}</row> <row><image src="chrome://myext/skin/images/fillerrow.jpg" /></row> </>)} or if the e4x child...
...And 2 more matches
XForms Custom Controls - Archive of obsolete content
trol on the form. as mentioned in the spec, the appearance attribute can be used to influence the look and feel of a control even when all other conditions remain constant. for example, in the mozilla xforms extension we will render a combobox widget when appearance='minimal' on a select1 control. should the form author instead choose to use appearance='compact' on this control, we would render a
listbox widget. here is a snippet from our .css file to show the type of css rule we would use to make such a determination. xf|select1[appearance="compact"] { -moz-binding: url('chrome://xforms/content/select-xhtml.xml#xformswidget-select1-compact'); } the mediatype attribute can be used by the form author to align the type of presentation with the type of data that the bound instance node contain...
...-output-mediatype-anyuri'); } custom data types if you define a new schema data type or you use a built-in data type and find the current xforms control for this type to be insufficient, then you should write a new custom control. for example, if you have an instance node of type xsd:date and you'd like to see the date displayed in a local format. ...
...this is because xsd:integer is inherited from the xsd:decimal data type. we recommend that you use this attribute to create the css binding rule for your custom control. ...
...And 2 more matches
Archive of obsolete content
owsers. it's here for historical reference only. see the complete index of archived content note to writers: we need to try to keep the subpages here organized instead of all dumped into one large folder. try to create subtrees for categories of material. also, only move pages here that are extremely obsolete. if anyone might rea
listically need the information in a living product, it may not be appropriate to move it here. in general, it may be best to discuss it in the mdn web docs room on matrix before moving content here. .htaccess ( hypertext access ) file accessing : htaccess files can be opened using any text editor, like windows notepad, vin, sublime text editor or any...
...e the interface conventions we've come to expect from web pages. api archived documentation about obsolete web standards apis. archived mozilla and build documentation these articles are archived, obsolete documents about mozilla, gecko, and the process of building mozilla projects. archived open web documentation the documentation
listed below is archived, obsolete material about open web topics. beginner tutorials this page includes archived beginners tutorials, from various places around mdn. case sensitivity in class and id names creating a dynamic status bar extension concepts covered in the previous sample won't be reiterated here; instead, refer to the downloadable sample c...
...cript objects using xml. there are no real standards for this conversion, but some conventions begin to appear on the web. there are some cases in which the whole content of an xml document must be read from the javascript interpreter (like for web-apps languages or settings xml documents, for example). in these cases jxon could represent the most practical way. ...
...And 2 more matches
Desktop mouse and keyboard controls - Game development
we'll look at this below. ...
... phaser-based, but it could also be done in pure javascript. 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. pure javascript approach let's think about implementing pure javascript keyboard/mouse controls in the game first to see how it would work. first, we'd need an event
listener to
listen for the pressed keys: document.addevent
listener('keydown', keydownhandler, false); document.addevent
listener('keyup', keyuphandler, false); whenever any key is pressed down, we're executing the keydownhandler function, and when press finishes we're executing the keyuphandler function, so we know when it's no longer pressed. to do that we'll hold the information on whether the keys...
... whenever any key is pressed down, we're executing the keydownhandler function, and when press finishes we're executing the keyuphandler function, so we know when it's no longer pressed. 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. inside them we can get the code of the key that was pressed from the keycode property of the event object, see which key it is, and then set the proper variable. there are no helpers so you have to remember what the given codes are (or look them up); 37 is the left arrow: function keydownhandler(event) { if(eve...
...And 2 more matches
2D maze game with device orientation - Game development
left absolute position on canvas in pixels. name of the image asset the button is using. function that will be executed when someone clicks the button. the execution context. frame from the image asset used as the button's "hover" state. frame from the image asset used as the button's "normal" or "out" state. frame from t...
...hus increase the velocity in the proper direction. implementing the device orientation api probably the most interesting part of the game is its usage of the device orientation api for control on mobile devices. thanks to this you can play the game by tilting the device in the direction you want the ball to roll. ...
...n api probably the most interesting part of the game is its usage of the device orientation api for control on mobile devices. thanks to this you can play the game by tilting the device in the direction you want the ball to roll. here’s the code from the create() function responsible for this: window.addevent
listener("deviceorientation", this.handleorientation, true); we’re adding an event
listener to the "deviceorientation" event and binding the handleorientation function which looks like this: handleorientation: function(e) { var x = e.gamma; var y = e.beta; ball._player.body.velocity.x += x; ball._player.body.velocity.y += y; }, the more you tilt the device, the more force is applied to the ball, therefore the faster it moves (the velocity is higher). note: to f...
...And 2 more matches
Visual typescript game engine - Game development
se session * in your application just setup this variable to the false. */ private appuseaccountssystem: boolean = false; /** * appusebroadcaster disable or enable broadcaster for * video chats. */ private appusebroadcaster: boolean = false; /** * possible variant by default : * "register", "login" */ private startuphtmlform: string = "register"; private game
list: any[]; /** * implement default gameplay variable's */ private defaultgameplaylevelname: string = "level1"; private autostartgameplay: boolean = true; start the dependency system from app.ts the first game template is platformer. this is high-level programming in this software. class gameplay extends platformer, it good for start. class starter is base class for my canvas part an...
... = "level1"; private autostartgameplay: boolean = true; start the dependency system from app.ts the first game template is platformer. this is high-level programming in this software. class gameplay extends platformer, it good for start. class starter is base class for my canvas part and matter.ts (matter.js) implementation. it is injected to the platformer to make full operated work. ...
...cted to the platformer to make full operated work. games
list args for ioc constructor is for now just symbolic for now. (wip) in ioc, you can make strong class dependency relations. use it for your own structural changes. main dependency file // symbolic for now const plarformergameinfo = { name: "crypto-runner", title: "play platformer crypto runner!", }; // symbolic for now const games
list: any[] = [ plarformergameinfo, ]; const master = new ioc(games
list); const appicon: appicon = new appicon(master.get.browser); master.singlton(platformer, master.get.starter); console.log("platformer: ", master.get.platformer); master.get.platformer.attachappevents(); project structure builds/ is autogenerated. don't edit or add content in this folder. src,/ is the main client part (brow...
...And 2 more matches
HTML: A good basis for accessibility - Learn web development
ver which you don't have full control, or you might have third party content on your page (such as ad banners) over which you have no control. the goal isn't "all or nothing." however, — every improvement you can make will help the cause of accessibility. text content one of the best accessibility aids a screen reader user can have is an excellent content structure with headings, paragraphs,
lists, etc. an excellent semantic example might look something like the following: <h1>my heading</h1> <p>this is the first section of my document.</p> <p>i'll add another paragraph here too.</p> <ol> <li>here is</li> <li>a
list for</li> <li>you to read</li> </ol> <h2>my subheading</h2> <p>this is the first subsection of my document. i'd love people to be able to find this content!</p> <h...
... you try navigating through this, you'll see that this is pretty easy to navigate: the screen reader reads each header out as you progress through the content, notifying you what a heading is, what is a paragraph, etc. it stops after each element, letting you go at whatever pace is comfortable for you. you can jump to the next/previous heading in many screen readers. you can also bring up a
list of all headings in many screen readers, allowing you to use them as a handy table of contents to find specific content. people sometimes write headings, paragraphs, etc. using presentational html and line breaks, something like the following: <font size="7">my heading</font> <br><br> this is the first section of my document. <br><br> i'll add another paragraph here too. <br><br> 1. here is <br...
...dings in many screen readers, allowing you to use them as a handy table of contents to find specific content. people sometimes write headings, paragraphs, etc. using presentational html and line breaks, something like the following: <font size="7">my heading</font> <br><br> this is the first section of my document. <br><br> i'll add another paragraph here too. <br><br> 1. here is <br><br> 2. a
list for <br><br> 3. you to read <br><br> <font size="5">my subheading</font> <br><br> this is the first subsection of my document. i'd love people to be able to find this content! <br><br> <font size="5">my 2nd subheading</font> <br><br> this is the second subsection of my content. i think is more interesting than the last one. if you try our longer version out with a screen reader (see bad-semantic...
...And 2 more matches
HTML: A good basis for accessibility - Learn web development
ver which you don't have full control, or you might have third party content on your page (such as ad banners) over which you have no control. the goal isn't "all or nothing." however, — every improvement you can make will help the cause of accessibility. text content one of the best accessibility aids a screen reader user can have is an excellent content structure with headings, paragraphs,
lists, etc. an excellent semantic example might look something like the following: <h1>my heading</h1> <p>this is the first section of my document.</p> <p>i'll add another paragraph here too.</p> <ol> <li>here is</li> <li>a
list for</li> <li>you to read</li> </ol> <h2>my subheading</h2> <p>this is the first subsection of my document. i'd love people to be able to find this content!</p> <h...
... you try navigating through this, you'll see that this is pretty easy to navigate: the screen reader reads each header out as you progress through the content, notifying you what a heading is, what is a paragraph, etc. it stops after each element, letting you go at whatever pace is comfortable for you. you can jump to the next/previous heading in many screen readers. you can also bring up a
list of all headings in many screen readers, allowing you to use them as a handy table of contents to find specific content. people sometimes write headings, paragraphs, etc. using presentational html and line breaks, something like the following: <font size="7">my heading</font> <br><br> this is the first section of my document. <br><br> i'll add another paragraph here too. <br><br> 1. here is <br...
...dings in many screen readers, allowing you to use them as a handy table of contents to find specific content. people sometimes write headings, paragraphs, etc. using presentational html and line breaks, something like the following: <font size="7">my heading</font> <br><br> this is the first section of my document. <br><br> i'll add another paragraph here too. <br><br> 1. here is <br><br> 2. a
list for <br><br> 3. you to read <br><br> <font size="5">my subheading</font> <br><br> this is the first subsection of my document. i'd love people to be able to find this content! <br><br> <font size="5">my 2nd subheading</font> <br><br> this is the second subsection of my content. i think is more interesting than the last one. if you try our longer version out with a screen reader (see bad-semantic...
...And 2 more matches
Grids - Learn web development
> <div>five</div> <div>six</div> <div>seven</div> </div> .container { display: grid; grid-template-columns: 200px 200px 200px; } flexible grids with the fr unit in addition to creating grids using lengths and percentages, we can use the fr unit to flexibly size grid rows and columns. this unit represents one fraction of the available space in the grid container. change your track
listing to the following definition, creating three 1fr tracks. .container { display: grid; grid-template-columns: 1fr 1fr 1fr; } you should now see that you have flexible tracks. the fr unit distributes space in proportion, therefore you can give different positive values to your tracks, for example if you change the definition like so: .container { display: grid; grid-template-col...
...ged in the spec, as the intention is to make them usable in multiple layout methods. the prefixed versions will be maintained as an alias so will be safe to use for some time. to be on the safe side, you could double up and add both properties to make your code more bulletproof. ...
...n multiple layout methods. the prefixed versions will be maintained as an alias so will be safe to use for some time. to be on the safe side, you could double up and add both properties to make your code more bulletproof. .container { display: grid; grid-template-columns: 2fr 1fr 1fr; grid-gap: 20px; gap: 20px; } repeating track
listings you can repeat all, or a section of, your track
listing using repeat notation. ...
...And 2 more matches
Beginner's guide to media queries - Learn web development
ximum values is much more useful for responsive design so you will rarely see width or height used alone. there are a number of other media features that you can test for, although some of the newer features introduced in level 4 and 5 of the media queries specification have limited browser support. each feature is documented on mdn along with browser support information, and you can find a full
list at using media queries: media features. orientation one well-supported media feature is orientation, which allows us to test for portrait or landscape mode. to change the body text color if the device is in landscape orientation, use the following media query. @media (orientation: landscape) { body { color: rebeccapurple; } } open this example in the browser, or view the sourc...
...d only or with voice commands. using pointer can help you to design better interfaces that respond to the type of interaction a user is having with a screen. for example, you could create larger hit areas if you know that the user is interacting with the device as a touchscreen. more complex media queries with all of the different possible media queries, you may want to combine them, or create
lists of queries — any of which could be matched. "and" logic in media queries to combine media features you can use and in much the same way as we have used and above to combine a media type and feature. for example, we might want to test for a min-width and orientation. the body text will only be blue if the viewport is at least 600 pixels wide and the device is in landscape mode. @media screen...
...aning of the entire media query. therefore in this next example the text will only be blue if the orientation is portrait. @media not all and (orientation: landscape) { body { color: blue; } } open this example in the browser, or view the source. how to choose breakpoints in the early days of responsive design, many designers would attempt to target very specific screen sizes.
lists of the sizes of the screens of popular phones and tablets were published in order that designs could be created to neatly match those viewports. there are now far too many devices, with a huge variety of sizes, to make that feasible. this means that instead of targetting specific sizes for all designs, a better approach is to change the design at the size where the content starts to break in so...
...And 2 more matches
Example 2 - Learn web development
this is the second example that explain how to build custom form widgets. ...
...>apple</li> </ul> </div> <form> css content .widget select, .no-widget .select { position : absolute; left : -5000em; height : 0; overflow : hidden; } /* --------------- */ /* required styles */ /* --------------- */ .select { position: relative; display : inline-block; } .select.active, .select:focus { box-shadow: 0 0 3px 1px #227755; outline: none; } .select .opt
list { position: absolute; top : 100%; left : 0; } .select .opt
list.hidden { max-height: 0; visibility: hidden; } /* ------------ */ /* fancy styles */ /* ------------ */ .select { font-size : 0.625em; /* 10px */ font-family : verdana, arial, sans-serif; -moz-box-sizing : border-box; box-sizing : border-box; padding : 0.1em 2.5em 0.2em 0.5em; /* 1px 25px 2px 5px */ ...
...cal-align: top; } .select:after { content : "ā¼"; position: absolute; z-index : 1; height : 100%; width : 2em; /* 20px */ top : 0; right : 0; padding-top : .1em; -moz-box-sizing : border-box; box-sizing : border-box; text-align : center; border-left : .2em solid #000; border-radius: 0 .1em .1em 0; background-color : #000; color : #fff; } .select .opt
list { z-index : 2;
list-style: none; margin : 0; padding: 0; background: #f0f0f0; border: .2em solid #000; border-top-width : .1em; border-radius: 0 0 .4em .4em; box-shadow: 0 .2em .4em rgba(0,0,0,.4); -moz-box-sizing : border-box; box-sizing : border-box; min-width : 100%; max-height: 10em; /* 100px */ overflow-y: auto; overflow-x: hidden; } .select .option { pa...
...And 2 more matches
How to structure a web form - Learn web development
ross multiple pages, but if a form is getting long and must be on a single page, putting the different related sections inside different fieldsets improves usability. because of its influence over assistive technology, the <fieldset> element is one of the key elements for building accessible forms; however it is your responsibility not to abuse it. if possible, each time you build a form, try to
listen to how a screen reader interprets it. if it sounds odd, try to improve the form structure. the <label> element as we saw in the previous article, the <label> element is the formal way to define a label for an html form widget. this is the most important element if you want to build accessible forms — when implemented properly, screenreaders will speak a form element's label along with any r...
...ave multiple labels and multiple inputs with the same id! common html structures used with forms beyond the structures specific to web forms, it's good to remember that form markup is just html. this means that you can use all the power of html to structure a web form. as you can see in the examples, it's common practice to wrap a label and its widget with a <li> element within a <ul> or <ol>
list. <p> and <div> elements are also commonly used.
lists are recommended for structuring multiple checkboxes or radio buttons. in addition to the <fieldset> element, it's also common practice to use html titles (e.g. <h1>, <h2>) and sectioning (e.g. <section>) to structure complex forms. above all, it is up to you to find a comfortable coding style that results in accessible, usable forms. each se...
...marked: <h1>payment form</h1> <p>required fields are followed by <strong><abbr title="required">*</abbr></strong>.</p> next we'll add a larger section of code into the form, below our previous entry. here you'll see that we are wrapping the contact information fields inside a distinct <section> element. moreover, we have a set of two radio buttons, each of which we are putting inside its own
list (<li>) element. we also have two standard text <input>s and their associated <label> elements, each contained inside a <p>, and a password input for entering a password. add this code to your form: <section> <h2>contact information</h2> <fieldset> <legend>title</legend> <ul> <li> <label for="title_1"> <input type="radio" id="title_1" name=...
...And 2 more matches
UI pseudo-classes - Learn web development
attribute set). :checked, :indeterminate, and :default: respectively target checkboxes and radio buttons that are checked, in an indeterminate state (neither checked or not checked), and the default selected option when the page loads (e.g. an <input type="checkbox"> with the checked attribute set, or an <option> element with the selected attribute set). there are many others too, but the ones
listed above are the most obviously useful. some of the others are aimed at solving very specific niche problems, or simply not very well supported in browsers yet. the ones
listed above all have pretty good browser support, but of course, you should test your form implementations carefully to make sure they work for your target audience. note: a number of the pseudo-classes discussed here are conce...
...we've directly selected the inputs we want to disable using input[type="text"]:disabled, but we also wanted to gray out the corresponding text labels. these weren't quite as easy to select, so we've used a class to provide them with that styling. ...
..."text"]:disabled, but we also wanted to gray out the corresponding text labels. these weren't quite as easy to select, so we've used a class to provide them with that styling. ...
...And 2 more matches
HTML basics - Learn web development
as the title suggests, this article will give you a basic understanding of html and its functions. so what is html? html is not a programming language; it is a markup language that defines the structure of your content. ...
...nce of headings on your pages, without skipping levels. paragraphs as explained above, <p> elements are for containing paragraphs of text; you'll use these frequently when marking up regular text content: <p>this is a single paragraph</p> add your sample text (you should have it from what should your website look like?) into one or a few paragraphs, placed directly below your <img> element. ...
...t skipping levels. paragraphs as explained above, <p> elements are for containing paragraphs of text; you'll use these frequently when marking up regular text content: <p>this is a single paragraph</p> add your sample text (you should have it from what should your website look like?) into one or a few paragraphs, placed directly below your <img> element.
lists a lot of the web's content is
lists and html has special elements for these. marking up
lists always consist of at least 2 elements. the most common
list types are ordered and unordered
lists: unordered
lists are for
lists where the order of the items doesn't matter, such as a shopping
list. these are wrapped in a <ul> element. ordered
lists are for
lists where the order of the items does matter, such as a recipe. these are wr...
...And 2 more matches
Debugging HTML - Learn web development
til that dreaded moment when an error occurs — you've done something wrong, so your code doesn't work — either not at all, or not quite how you wanted it to. for example, the following shows an error reported when trying to compile a simple program written in the rust language. here, the error message is relatively easy to understand — "unterminated double quote string". if you look at the
listing, you can probably see how println!(hello, world!"); might logically be missing a double quote. however, error messages can quickly get more complicated and less easy to interpret as programs get bigger, and even simple cases can look a little intimidating to someone who doesn't know anything about rust. debugging doesn't have to be scary though — the key to being comfortable with writing a...
...sted elements: nesting elements properly is also very important for code behaving correctly. <strong>strong <em>strong emphasised?</strong> what is this?</em> <li>unclosed attributes: another common source of html problems. let's look at an example: <a href="https://www.mozilla.org/>link to mozilla homepage</a> </ul> let's review the problems: the paragraph and
list item elements have no closing tags. looking at the image above, this doesn't seem to have affected the markup rendering too badly, as it is easy to infer where one element should end and another should begin. the first <strong> element has no closing tag. this is a bit more problematic, as it isn't easy to tell where the element is supposed to end. in fact, the whole of the rest of the text ha...
...w to use your browser's developer tools, take a few minutes to review discover browser developer tools. in the dom inspector, you can see what the rendered markup looks like: using the dom inspector, let's explore our code in detail to see how the browser has tried to fix our html errors (we did the review in firefox; other modern browsers should give the same result): the paragraphs and
list items have been given closing tags. it isn't clear where the first <strong> element should be closed, so the browser has wrapped each separate block of text with its own strong tag, right down to the bottom of the document! the incorrect nesting has been fixed by the browser as shown here: <strong>strong <em>strong emphasised?</em> </strong> <em> what is this?</em> the link wit...
...And 2 more matches
Whatās in the head? Metadata in HTML - Learn web development
note: many <meta> features just aren't used any more. for example, the keyword <meta> element (<meta name="keywords" content="fill, in, your, keywords, here">) — which is supposed to provide keywords f...
...er in the google search engine. note: many <meta> features just aren't used any more. for example, the keyword <meta> element (<meta name="keywords" content="fill, in, your, keywords, here">) — which is supposed to provide keywords for search engines to determine relevance of that page for different search terms — is ignored by search engines, because spammers were just filling the keyword
list with hundreds of keywords, biasing results. other types of metadata as you travel around the web, you'll find other types of metadata, too. a lot of the features you'll see on websites are proprietary creations, designed to provide certain sites (such as social networking sites) with specific pieces of information they can use. for example, open graph data is a metadata protocol that facebook...
... twitter.com. for example: <meta name="twitter:title" content="mozilla developer network"> adding custom icons to your site to further enrich your site design, you can add references to custom icons in your metadata, and these will be displayed in certain contexts. the most commonly used of these is the favicon (short for "favorites icon", referring to its use in the "favorites" or "bookmarks"
lists in browsers). the humble favicon has been around for many years. it is the first icon of this type: a 16-pixel square icon used in multiple places. you may see (depending on the browser) favicons displayed in the browser tab containing each open page, and next to bookmarked pages in the bookmarks panel. a favicon can be added to your page by: saving it in the same directory as the site's in...
...And 2 more matches
Introducing asynchronous JavaScript - Learn web development
javascript is. this section recaps some of the information we saw in the previous article. a lot of the functionality we have looked at in previous learning area modules is synchronous — you run some code, and the result is returned as soon as the browser can do so. ...
... once the alert is dismissed, we create a <p> element. we then give it some text content. finally, we append the paragraph to the document body. while each operation is being processed, nothing else can happen — rendering is paused. ...
...ting code in the background. when the background code finishes running, it calls the callback function to let you know the work is done, or to let you know that something of interest has happened. using callbacks is slightly old-fashioned now, but you'll still see them in use in a number of older-but-still-commonly-used apis. ...
...And 2 more matches
Basic math in JavaScript — numbers and operators - Learn web development
of numbers you are dealing with in javascript, you handle them in exactly the same way. note: actually, javascript has a second number type, bigint, used for very, very large integers. but for the purposes of this course, we'll just worry about number values. it's all numbers to me let's quickly play with some numbers to reacquaint ourselves with the basic syntax we need. enter the commands
listed below into your developer tools javascript console. first of all, let's declare a couple of variables and initialize them with an integer and a float, respectively, then type the variable names back in to check that everything is in order: let myint = 5; let myfloat = 6.667; myint; myfloat; number values are typed in without quote marks — try declaring and initializing a couple more v...
... is taught in math classes in school — multiply and divide are always done first, then add and subtract (the calculation is always evaluated from left to right). if you want to override operator precedence, you can put parentheses round the parts that you want to be explicitly dealt with first. so to get a result of 6, we could do this: (num2 + num1) / (8 + 2); try it and see. note: a full
list of all javascript operators and their precedence can be found in expressions and operators. increment and decrement operators sometimes you'll want to repeatedly add or subtract one to or from a numeric variable value. this can be conveniently done using the increment (++) and decrement (--) operators. we used ++ in our "guess the number" game back in our first splash into javascript article, ...
...nd decrement (--) operators. we used ++ in our "guess the number" game back in our first splash into javascript article, when we added 1 to our guesscount variable to keep track of how many guesses the user has left after each turn. guesscount++; note: these operators are most commonly used in loops, which you'll learn about later on in the course. for example, say you wanted to loop through a
list of prices, and add sales tax to each one. you'd use a loop to go through each value in turn and do the necessary calculation for adding the sales tax in each case. the incrementor is used to move to the next value when needed. we've actually provided a simple example showing how this is done — check it out live, and look at the source code to see if you can spot the incrementors! we'll look at ...
...And 2 more matches
What went wrong? Troubleshooting JavaScript - Learn web development
ong the following lines: this is a pretty easy error to track down, and the browser gives you several useful bits of information to help you out (the screenshot above is from firefox, but other browsers provide similar information). from left to right, we've got: a red "x" to indicate that this is an error. an error message to indicate what's gone wrong: "typeerror: guesssubmit.addevent
listener is not a function" a "learn more" link that links through to an mdn page that explains what this error means in greater detail. the name of the javascript file, which links through to the debugger tab of the developer tools. if you follow this link, you'll see the exact line where the error is highlighted. the line number where the error is, and the character number in that line wher...
...which links through to the debugger tab of the developer tools. if you follow this link, you'll see the exact line where the error is highlighted. the line number where the error is, and the character number in that line where the error is first seen. in this case, we've got line 86, character number 3. if we look at line 86 in our code editor, we'll find this line: guesssubmit.addevent
listener('click', checkguess); the error message says "guesssubmit.addevent
listener is not a function", which means that the function we're calling is not recognized by the javascript interpreter. often, this error message actually means that we've spelled something wrong. if you are not sure of the correct spelling of a piece of syntax, it is often good to look up the feature on mdn. the best way ...
...ized by the javascript interpreter. often, this error message actually means that we've spelled something wrong. if you are not sure of the correct spelling of a piece of syntax, it is often good to look up the feature on mdn. the best way to do this currently is to search for "mdn name-of-feature" with your favorite search engine. here's a shortcut to save you some time in this instance: addevent
listener(). so, looking at this page, the error appears to be that we've spelled the function name wrong! remember that javascript is case sensitive, so any slight difference in spelling or casing will cause an error. changing addevent
listener to addevent
listener should fix this. do this now. note: see our typeerror: "x" is not a function reference page for more details about this error. syntax ...
...And 2 more matches
Aprender y obtener ayuda - Learn web development
en you are learning! note: online code editors are also really useful for sharing code you've written, for example, if you are collaborating on learning with someone else who isn't in the same location, or are sending it someone to ask for help with it. you can share the web address of the example with them so they can see it. note: you might favor one learning method over the others, but rea
listically a hybrid approach is probably what you will end up with. and you'll probably come up with other methods than the three we covered above. making a plan it is a good idea to create a plan to help you achieve what you want to achieve through your learning. a goal statement it sounds silly, but why not start with a single sentence that says what you want to achieve? the following have diff...
...robably what you will end up with. and you'll probably come up with other methods than the three we covered above. making a plan it is a good idea to create a plan to help you achieve what you want to achieve through your learning. a goal statement it sounds silly, but why not start with a single sentence that says what you want to achieve? the following have different scopes, but are all rea
listic and achievable: i want to become a professional web developer in two years' time. i want to learn enough to build a website for my local amateur tennis club. i want to learn html and css so i can expand my job role to take over updating the content on our company website. the following are not quite as reasonable: i want to go from a complete beginner to becoming a senior web develope...
...eeks' holiday i'll need to do work on this for 10 hours per week. i am free on evenings and weekends, so i'll plan my time around those." how much time you can spend on this of course depends on what your circumstances are. if you are at school, then you've got way more free time than if you have a job and children to provide for. it is still possible to achieve your goals, but you have to be rea
listic about how quickly you can do it. if you are doing a university or college course to learn web development, then most of this planning is done for you — lucky you! when you have worked out a weekly schedule, then you should keep a record of what you manage to do each week in a simple spreadsheet or even in a notebook! also, it might be a good idea to have some sub-goals worked out to allow ...
...And 2 more matches
Client-Server Overview - Learn web development
submit a form, or run a search, the browser sends an http request to the server. this request includes: a url identifying the target server and resource (e.g. an html file, a particular data point on the server, or a tool to run). a method that defines the required action (for example, to get a file or to save or update some data). the different methods/verbs and their associated actions are
listed below: get: get a specific resource (e.g. an html file containing information about a product, or a
list of products). post: create a new resource (e.g. add a new article to a wiki, add a new contact to a database). head: get the metadata information about a specific resource without getting the body like get would. you might for example use a head request to find out the last tim...
...e detail. in order to "keep things real" we'll use the context of a sports-team manager website where a coach can select their team name and team size in an html form and get back a suggested "best lineup" for their next game. the diagram below shows the main elements of the "team coach" website, along with numbered labels for the sequence of operations when the coach accesses their "best team"
list. the parts of the site that make it dynamic are the web application (this is how we will refer to the server-side code that processes http requests and returns http responses), the database, which contains information about players, teams, coaches and their relationships, and the html templates. after the coach submits the form with the team name and number of players, the sequence of operatio...
...t request is used because the request is only fetching data (not modifying data). the web server detects that the request is "dynamic" and forwards it to the web application for processing (the web server determines how to handle different urls based on pattern matching rules defined in its configuration). the web application identifies that the intention of the request is to get the "best team
list" based on the url (/best/) and finds out the required team name and number of players from the url. the web application then gets the required information from the database (using additional "internal" parameters to define which players are "best", and possibly also getting the identity of the logged in coach from a client-side cookie). the web application dynamically creates an html page by put...
...And 2 more matches
Ember Interactivity: Footer functionality, conditional rendering - Learn web development
in todo-data.js, add the following getter underneath the existing all() getter to define what the incomplete todos actually are: get incomplete() { return this.todos.filter(todo => { return todo.iscompleted === false; }); } using array.filter(), we declare that "incomplete" todos are ones that have iscompleted equal t...
...> { return todo.iscompleted === false; }); } using array.filter(), we declare that "incomplete" todos are ones that have iscompleted equal to false. next, add the following action underneath the existing add(text) action: @action clearcompleted() { this.todos = this.incomplete; } this is rather nice for clearing the todos — we just need to set the todos array to equal the
list of incomplete todos. finally, we need to make use of this new functionality in our footer.hbs template. go to this file now. first of all, replace this line: <strong>0</strong> todos left with this, which populates the incomplete number with the length of the incomplete array: <strong>{{this.todos.incomplete.length}}</strong> todos left next, replace this: <button ty...
... summary that's enough for now. at this point, not only can we mark todos as complete, but we can clear them as well. now the only thing left to wire up the footer are the three filtering links: "all", "active", and "completed". we'll do that in the next arti...
...And 2 more matches
Deployment and next steps - Learn web development
to exclude from source control. in our case we will tell git to exclude files in the node_modules directory by creating a .gitignore file in the root folder of your local project, with the following content: node_modules/ now let's go back to gitlab. after creating a new repo gitlab will greet you with a message explaining different options to upload your existing files. follow the steps
listed under the push an existing folder heading: cd your_root_directory # go into your project's root directory git init git remote add origin https://gitlab.com/[your-user]/mdn-svelte-todo.git git add . git commit -m "initial commit" git push -u origin master note: you could use the git protocol instead of https, which is faster and saves you from typing your username and password every tim...
...e's a push to our master branch. since our app will be published at a subdirectory (like https://your-user.gitlab.io/mdn-svelte-todo), we'll have to make the references to the javascript and css files in our public/index.html file relative. to do this, we just remove the leading slashes (/) from the /global.css, /build/bundle.css, and /build/bundle.js urls, like this: <title>svelte to-do
list</title> <link rel='icon' type='image/png' href='favicon.png'> <link rel='stylesheet' href='global.css'> <link rel='stylesheet' href='build/bundle.css'> <script defer src='build/bundle.js'></script> do this now. now we just have to commit and push our changes to gitlab. do this by running the following commands: > git add public/index.html > git add .gitlab-ci.yml > git commit -m "ad...
...e stores to work with a central data repository, and we created our own custom store to persist our application's data to web storage. we also took a look at svelte's typescript support. in this article we've learned about a couple of zero-fuss options to deploy our app in production and seen how to setup a basic pipeline to deploy our app to gitlab on every commit. then we provided you with a
list of svelte resources to go further with your svelte learning. congratulations! after completing this series of tutorials you should have a strong base from which to start developing professional web applications with svelte. previous overview: client-side javascript frameworks in this module introduction to client-side frameworks framework main features react getting started wi...
...And 2 more matches
Handling common JavaScript problems - Learn web development
) — download it from the atom page linked above. go to atom's preferences... dialog (e.g. by choosing atom > preferences... on mac, or file > preferences... on windows/linux) and choose the install option in the left-hand menu. in the search packages text field, type "jslint" and press enter/return to search for linting-related packages. you should see a package called lint at the top of the
list. install this first (using the install button), as other linters rely on it to work. after that, install the linter-jshint plugin. after the packages have finished installing, try loading up a javascript file: you'll see any issues highlighted with green (for warnings) and red (for errors) circles next to the line numbers, and a separate panel at the bottom provides line numbers, error messages,...
...breakpoint to it (you'll see a blue arrow appear over the top of it). now refresh the page (cmd/ctrl + r) — the browser will pause execution of the code at line 51. at this point, the right-hand side will update to show some very useful information. under breakpoints, you'll see the details of the break-point you have set. under call stack, you'll see a few entries — this is basically a
list of the series of functions that were invoked to cause the current function to be invoked. at the top, we have showheroes() the function we are currently in, and second we have onload, which stores the event handler function containing the call to showheroes(). under scopes, you'll see the currently active scope for the function we are looking at. we only have three — showheroes, block, and win...
...odernizr is the industry standard for feature detection tests. as a last point, don't confuse feature detection with browser sniffing (detecting what specific browser is accessing the site) — this is a terrible practice that should be discouraged at all costs. see using bad browser sniffing code, later on, for more details. note: some features are known to be undetectable — see modernizr's
list of undetectables. note: feature detection will be covered in a lot more detail in its own dedicated article, later in the module. libraries javascript libraries are essentially third party units of code that you can attach to your page, providing you with a wealth of ready-made functionality that can be used straight away, saving you a lot of time in the process. a lot of javascript librari...
...And 2 more matches
Introducing a complete toolchain - Learn web development
ne way that the featured tools can be used for a project. note: it's also worth repeating that not all of these tools need to be run on the command line. many of today's code editors (such as vs code and atom) have integration support for a lot of tools via plugins. introducing our case study the toolchain that we are creating in this article will be used to build and deploy a mini site that
lists data (taken from one of nasa's open apis) concerning potentially hazardous space objects that threaten our existence on earth! it looks like this: you can see a live version of the site at near-misses.netlify.com. tools used in our toolchain in this article we're going to use the following tools and features: jsx, a react-related set of syntax extensions that allow you to do things like ...
...the aim of keeping complexity to a minimum. for example, we could have included a tool to minimize our svg file sizes during build. however, this project has only 4 svg images, which were manually minified using svgo before adding them to the project. a couple of prerequisites besides the tools we're going to install that contribute to our toolchain, we mentioned two web services in the above
list of tools. let's take this opportunity to make sure we are set up with them before we continue. you will need to create accounts with each of github and netlify if you wish to complete the tutorial. as mentioned previously, github is a source code repository service that adds community features such as issue tracking, following project releases and much more. in the next chapter we will push to...
... netlify is what provides the "home on the web" mentioned above — free hosting for us to deploy our test app to. once you've signed up for github (click the sign up link on the homepage if you don't already have an account, and follow the instructions), you can use your github account for authentication on netlify (click sign up, then choose github from the "sign up with one of the following"
list), so technically you only need to create one new account. later on you'll need to connect your netlify account to your github repository to deploy this project; we'll see how to do that in the next chapter. three stages of tools as we talked about in chapter 1, the toolchain will be structured into the following phases: safety net: making the software development experience stable and more ...
...And 2 more matches
Information for Assistive Technology Vendors
information for assistive technology vendors accessibility features in mozilla & call for testers! mozilla now has enough accessibility support that we're reading for early adopters and testers to start giving it a try. please read this page if you're interested in an alternative accessible browser. keyboard documentation this
lists mozilla's keyboard docs in a single long document. gecko info for windows accessibility vendors mozilla supports msaa (microsoft active accessibility) in html and in our user interface (based on xul technology). this makes it possible for the vendors of windows accessibility software, such as screen readers, voice dictation packages and screen magnifiers to provide support for mozilla. in addition, we provide some simple interfaces via which...
...n readers, voice dictation packages and screen magnifiers to provide support for mozilla. join the mozilla accessibility community live chat both end users and developers are invited for discussion on the live irc channel at irc.mozilla.org/#accessibility. since this is a worldwide effort, there is always a good chance to find someone to chat with there, day or night. ...
...ckages and screen magnifiers to provide support for mozilla. join the mozilla accessibility community live chat both end users and developers are invited for discussion on the live irc channel at irc.mozilla.org/#accessibility. since this is a worldwide effort, there is always a good chance to find someone to chat with there, day or night. ...
...And 2 more matches
Software accessibility: Where are we today?
se applications assumed that computer users could: read and react to text and images displayed on the screen. type on a standard keyboard. select text, pictures, and other information using a mouse react to sounds played. this tends to be somewhat less of a limitation in that most software doesn't rely exclusively on audio to relay feedback. if a person was unable to do one of the above-
listed tasks, they found themselves unable to use many popular computer applications. here are some of the groups of people that have problems doing some of those tasks: print disabled: blind, deaf-blind, low vision, obstructed vision, dyslexic, cognitively disabled and illiterate individuals. physically disabled: users have amputations, paralysis, repetitive stress, cerebral palsy, muscular dyst...
...pital letter, first press the shift key, release it, then press the letter to be capitalized. the sticky key technique is utilized by people who have only one usable hand, or who have no use of their hands and type using a stick in their mouth. single switch technologies enable persons with severe physical disabilities. some, like stephen hawking, enter information by choosing among
lists of options. they might press a switch down to begin moving a highlight bar through the
list, and release the switch when the desired option is highlighted. special keyboards exist to make data entry easier. however, any special features are generally handled in the keyboard itself, so that no special programming is required. speech recognition technology lets people t...
... into mainstream software. consistent keyboard support and hotkeys many people can't use a mouse. extremely consistent keystroke support is a very important consideration. blind testers have knack for finding ways to improve keystroke support in almost any given piece of software. testing with people that have disabilities generally benefits everyone. use the accessible toolkit check
list to make sure your ui controls adhere to standards. a major limitation - the lack of context the solutions developed by these accessibility vendors have greatly increased the employment and personal fulfillment opportunities of hundreds of thousands of persons with disabilities, and the importance of their work cannot be diminished. however, all these solutions fell short of providing people with...
...And 2 more matches
Eclipse CDT
ing cmd-shift-r/ctrl-shift-r. although eclipse doesn't do fuzzy matching when you type a file name, it does allow you to use wildcards. to quickly switch between a source file and its header file, use ctrl-tab. to quickly switch to a recently viewed document use cmd-f6/ctrl-f6. if you want to change this awkward key binding, the command you need to rebind is "next editor". to show a filterable
list of open documents (similar to the way emacs gives you a
list of open buffers), use cmd-e/ctrl-e. if you click the yellow, double arrow button at the top of the project explorer tab on the left, it will keep the selected file in the project explorer tab in sync with the file that you're currently editing. organizing views use ctrl-m to toggle maximization of the current editor view (the editor ...
... search tab. code assistance note: indexing, by its very nature, is specific to a given compiler configuration. be aware that when eclipse gives results for any of the actions that follow, it will not include results for sections of the code that are ifdef'ed out by the configuration used to create your object directory. for example, if you are using a mac and you search for callers of nsdisplay
listbuilder::isintransform, the results will not include the caller in nsobjectframe.cpp because that caller is wrapped in "#ifndef xp_macosx". just something to keep in mind. ;-) to jump to the definition of a symbol (or the declaration of a symbol if already at the definition), hover over the symbol, hold down the ctrl/cmd key, move the mouse slightly to linkify the symbol, then click on it. (havin...
...he symbol, then click on it. (having to move the mouse slightly is eclipse bug 26873). alternately, you can jump to the definition of the symbol under the cursor by pressing f3. to do a c++ symbol search select "search > c/c++" from the menubar, or use ctrl-h and select the "c/c++" search tab. to quickly find the definition of an enum, class, method, etc. use ctrl-shift-t/cmd-shift-t. to get a
list of autocomplete options in an editor tab, start typing the name of an identifier and then type ctrl-space. unfortunately, the autocomplete
list cannot (currently) be configured to appear automatically as soon as you start typing a character that might be the start of an identifier name. to see the callers of a method (and their callers, etc.), select the method and use the context menu to select...
...And 2 more matches
Contributing to the Mozilla code base
e are even many ways to contribute to the mozilla mission without programming. if getting involved in design, support, translation, testing, or other types of contributions sparks your interest please see community webiste. perhaps you do not know programming yet, but you want to start learning? there are plenty of resources available on the mdn web docs! step 1: find something to work on bugs
listed as 'assigned' are not usually a good place to start unless you're sure you have something worthy to contribute. someone else is already working on it! even with no assignee, it is polite to check if someone has recently commented that they're looking at fixing the issue. once you have found something to work on, go ahead and comment! let the bug submitter, reviewer, and component owner know th...
...ade the assignee. fix your pet peeve if there's something you'd like to fix about firefox, thunderbird, or your other favorite mozilla application, this can be a great place to start. there are a number of ways to do this: search bugzilla for relevant keywords. see pages on bugzilla for further help learn the bugzilla component, with which your pet peeve is implemented, using the components
list. browse this component on bugzilla for related bugs ask in our matrix channels : #introduction:mozilla.org or #developers:mozilla.org find a bug we've identified as a good fit for new contributors. with more than a million bugs filed in bugzilla, it can be hard to know where to start, so we've created these bug categories to make getting involved a little easier: codetribute - our site for...
... the bug fix and through the submission and landing process. good first bugs - are the best way to take your first steps into the mozilla ecosystem. they're all about small changes, sometimes as little as a few lines, but they're a great way to learn about setting up your development environment, navigating bugzilla, and making contributions to the mozilla codebase. visit firefox-dev.tools - we
list firefox developer tools bugs for new contributors. student projects - are larger projects, such as might be suitable for a university student for credit. of course, if you are not a student, feel free to fix one of these bugs. we maintain two
lists: one for projects based on the existing codebase, and one for implementing new applications. use a bug searching tool there are several tools deve...
...And 2 more matches
mach
ble to type: $ ./mach if all is well, you should see a help message. of course, in a random dir you just get a cryptic error message to improve the experience. for full help: $ ./mach help try building the tree: $ ./mach build if you get error messages, make sure that you have all of the build requisites for your system. ...
... as that is preferred on windows. mach will print timings with each line of output from the build. this gives you an idea of how long things take. mach will colorize terminal output (on terminals that support it - typically most terminals except on windows) mach will scan build output for compiler warnings and will automatically record them to a database which can be queried with mach warnings-
list and mach warnings-summary. not all warnings are currently detected. do not rely on mach as a substitute for raw build output. mach will invoke make in silent mode. this suppresses excessive (often unncessary) output. is mach a build system? no. mach is just a generic command dispatching tool that happens to have a few commands that interact with the real build system. historically, mach was b...
...s quickly realized and mach grew to fit those needs. generally, mozilla wants to move to a python-based build system but the transition period will be rather long. does mach work with mozconfigs? yes! you use the control file mozconfig like you have always used them. does mach have its own configuration file? yes. you can specify configuration settings in a ~/.mozbuild/machrc file. to see the
list of the 4 available settings ( which are: alias , test , try , runprefs ) type : $ ./mach settings should i implement x as a mach command? there are no hard or fast rules. generally speaking, if you have some piece of functionality or action that is useful to multiple people (especially if it results in productivity wins), then you should consider implementing a mach command for it. some ot...
...And 2 more matches
Storage access policy: Block cookies from trackers
component within the firefox product on bugzilla. alternatively you can report broken sites directly in firefox by clicking "report a problem" in the content blocking section of the control center (this shortcut may not be available in all versions of firefox). tracking protection explained how does firefox determine which resources are tracking resources? firefox uses the tracking protection
list to determine which resources are tracking resources. the tracking protection
list is maintained by disconnect. when the
list is applied in firefox, we make two important changes: first, we only use the "basic protection" version of the
list, which excludes some categories of trackers. in the future, we may expand our protections to use the "strict protection" version of the
list. second, fire...
...re tracking resources. the tracking protection
list is maintained by disconnect. when the
list is applied in firefox, we make two important changes: first, we only use the "basic protection" version of the
list, which excludes some categories of trackers. in the future, we may expand our protections to use the "strict protection" version of the
list. second, firefox uses an additional "entity
list", which prevents domains from being classified as trackers when they are loaded on a top-level site owned by the same organization. firefox uses the built-in tracking protection url classifier to determine which resources match the tracking protection
list. domains are matched against the
list in accordance with the safebrowsing v4 specification. specifically, we check the exact hostname of the...
...ins from being classified as trackers when they are loaded on a top-level site owned by the same organization. firefox uses the built-in tracking protection url classifier to determine which resources match the tracking protection
list. domains are matched against the
list in accordance with the safebrowsing v4 specification. specifically, we check the exact hostname of the resource against the
list, as well as the last four hostnames formed by starting with the last five components and successively removing the leading component. ...
...And 2 more matches
Refcount tracing and balancing
results in slower code, but at least you get some data about where the leaks might be occurring from. you must also set one or two additional environment variables, xpcom_mem_log_classes and xpcom_mem_log_objects, to reduce the set of objects being logged, in order to improve performance to something vaguely tolerable. ...
...an object's serial number is simply a unique number, starting at one, that is assigned to the object when it is allocated. ...
...ied by the xpcom_mem_bloat_log variable; see the bloatview documentation for more details). an object's serial number is simply a unique number, starting at one, that is assigned to the object when it is allocated. you may use an object's serial number with the following variable to further restrict the reference count tracing: xpcom_mem_log_objects set this variable to a comma-separated
list of object serial number or ranges of serial number, e.g., 1,37-42,73,165 (serial numbers start from 1, not 0). when this is set, along with xpcom_mem_log_classes and xpcom_mem_refcnt_log, a stack track will be generated for only the specific objects that you
list. for example, env xpcom_mem_log_classes=nsdocshell xpcom_mem_log_objects=2 xpcom_mem_refcnt_log=./refcounts.log ./mach run will lo...
...And 2 more matches
An overview of NSS Internals
in order to support multiple operating systems (os), it is based on a cross platform portability layer, called the netscape portable runtime (nspr), which provides cross platform application programming interfaces (apis) for os specific apis like file system access, memory management, network communication, and multithreaded programming. nss offers lots of functionality; we'll walk through the
list of modules, design principles, and important relevant standards. in order to allow interoperability between software and devices that perform cryptographic operations, nss conforms to a standard called pkcs#11. (note that it's important to look at the number 11, as there are other pkcs standards with different numbers that define quite different topics.) a software or hardware module confor...
...at are exchanged between parties are transported using a container; the container is called a certificate, following standard x.509 version 3. a certificate contains lots of other details; for example, it contains a signature by a third party that expresses trust in the ownership relationship for the certificate. the trust assigned by the third party might be restricted to certain uses, which are
listed in certificate extensions that are contained in the certificate. many (if not most) of the operations performed by nss involve the use of x.509 certificates (often abbreviated as “cert”, unfortunately making it easy to confuse with the term “computer emergency response team“). when checking whether a certificate is trusted or not, it's necessary to find a relevant trust anchor (ro...
...istent recording of certificates, you may initialize nss in a no-database mode. usually, nss will flush all data to disk as soon as new data has been added to permanent storage. storage consists of multiple files: a key database file, which contains your secret keys, and a certificate database file which contains the public portion of your own certificates, the certificates of peers or cas, and a
list of trust decisions (such as to not trust a built-in ca, or to explicitly trust other cas). examples for the database files are key3.db and cert8.db, where the numbers are file version numbers. a third file contains the
list of external pkcs#11 modules that have been registered to be used by nss. the file could be named secmod.db, but in newer database generations a file named pkcs11.txt is used. ...
...And 2 more matches
Cryptography functions
the mozilla cross reference (mxr) link for each function provides access to the function definition, prototype definition, and source code references. the nss version column indicates which versions of nss support the function. ...
... pk11_exportencryptedprivatekeyinfo mxr 3.2 and later pk11_exportencryptedprivkeyinfo mxr 3.9 and later pk11_exportprivatekeyinfo mxr 3.2 and later pk11_finalize mxr 3.2 and later pk11_findbestkeamatch mxr 3.2 and later pk11_findcertandkeybyrecipient
list mxr 3.2 and later pk11_findcertandkeybyrecipient
listnew mxr 3.2 and later pk11_findcertbyissuerandsn mxr 3.2 and later pk11_findcertfromdercert mxr 3.2 and later pk11_findcertfromnickname mxr 3.2 and later pk11_findcertinslot mxr 3.2 and later ...
...atekeyfromcert mxr 3.2 and later pk11_findslotbyname mxr 3.2 and later pk11_findslotsbynames mxr 3.9 and later pk11_fortezzahaskea mxr 3.2 and later pk11_fortezzamapsig mxr 3.2 and later pk11_freeslot mxr 3.2 and later pk11_freeslot
list mxr 3.2 and later pk11_freeslot
listelement mxr 3.11 and later pk11_freesymkey mxr 3.2 and later pk11_generatefortezzaiv mxr 3.2 and later pk11_generatekeypair mxr 3.2 and later pk11_generatekeypairwithflags mxr 3.10.2 and later pk1...
...And 2 more matches
NSS 3.24 release notes
into which the certificate is configured (which incorrectly identifies a key agreement type rather than a certificate). 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. also, partial support for rsa probabi
listic signature scheme (rsa-pss) certificates has been added. although these certificates can be configured, they will not be used by nss in this version. for functions that use temporary arenas, allocating a portcheaparena on the stack is more performant than allocating a plarenapool on the heap. rather than declaring a plarenapool pointer and calling port_newarena/port_freearena to allocate or fre...
...ce on the heap, declare a portcheaparenapool on the stack and use port_initcheaparena/port_destroycheaparena to initialize and destroy it. items allocated from the arena are still created on the heap, only the arena itself is stack-allocated. note: this approach is only useful when the arena use is tightly bounded, for example, if it is only used in a single function. new elements this section
lists and briefly describes the new functions, types, and macros in nss 3.24. new functions in ssl.h ssl_configservercert - configures an ssl/tls socket with a certificate, private key, and other information. in secport.h port_initcheaparena - initializes an arena that was created on the stack. (see portcheaparenapool.) port_destroycheaparena - destroys an arena that was crea...
...ocated arena pool, to be used for temporary arena allocations. new macros in pkcs11t.h ckm_tls12_mac in secoidt.h sec_oid_tls_ecdhe_psk - this oid governs the use of the tls_ecdhe_psk_with_aes_128_gcm_sha256 cipher suite, which is used only for session resumption in tls 1.3. notable changes in nss 3.24 additions, deprecations, and other changes in nss 3.24 are
listed below. deprecate the following functions. (applications should instead use the new ssl_configservercert function.) ssl_setstapledocspresponses ssl_setsignedcerttimestamps ssl_configsecureserver ssl_configsecureserverwithcertchain deprecate the nss_findcertkeatype function, as it reports a misleading value for certificates that might be used for signing rather than key ex...
...And 2 more matches
Python binding for NSS
hon str objects or python unicode objects. if a python unicode object is passed to a nss/nspr function it will be encoded as utf-8 first before being passed to nss/nspr. python-nss tries to be flexible when generating a print representation of complex objects. for simplicity you can receive a block of formatted text but if you need more control, such as when building gui elments you can access a
list of "lines", each line is paired with an indentation level value. the (indent, text) pairs allow you to insert the item into a gui tree structure or simply change the indentation formatting. deprecated elements of the python-nss api are marked with python deprecation warnings as well as being documented in the nss module documentation. as of python 2.7 deprecation warnings are no longer reported ...
...de nss.certverifylog error.certverifyerror (exception) nss.authorityinfoaccess nss.authorityinfoaccesses the following class methods were added: nss.certificate.is_ca_cert nss.certificate.verify nss.certificate.verify_with_log nss.certificate.get_cert_chain nss.certificate.check_ocsp_status nss.pk11slot.
list_certs nss.certverifylognode.format_lines nss.certverifylog.format_lines nss.crldistributionpts.format_lines the following class properties were added: nss.certverifylognode.certificate nss.certverifylognode.error nss.certverifylognode.depth nss.certverifylog.count the following module functions were added:...
...g.format_lines nss.crldistributionpts.format_lines the following class properties were added: nss.certverifylognode.certificate nss.certverifylognode.error nss.certverifylognode.depth nss.certverifylog.count the following module functions were added: nss.x509_cert_type nss.key_usage_flags nss.
list_certs nss.find_certs_from_email_addr nss.find_certs_from_nickname nss.nss_get_version nss.nss_version_check nss.set_shutdown_callback nss.get_use_pkix_for_validation nss.set_use_pkix_for_validation nss.enable_ocsp_checking nss.disable_ocsp_checking nss.set_ocsp_cache_settings nss.set_ocsp_failure_mode nss.set_ocsp...
...And 2 more matches
FC_GetInfo
role). return value fc_getinfo always returns ckr_ok. fc_getinfo should return ckr_arguments_bad if pinfo is null. fc_getinfo should return ckr_cryptoki_not_initialized if the library is not initialized. examples note the use of the %.32s format string to print the manufacturerid and librarydescription members of the ck_info structure. ...
...lue fc_getinfo always returns ckr_ok. fc_getinfo should return ckr_arguments_bad if pinfo is null. fc_getinfo should return ckr_cryptoki_not_initialized if the library is not initialized. examples note the use of the %.32s format string to print the manufacturerid and librarydescription members of the ck_info structure. ...
...should return ckr_arguments_bad if pinfo is null. fc_getinfo should return ckr_cryptoki_not_initialized if the library is not initialized. examples note the use of the %.32s format string to print the manufacturerid and librarydescription members of the ck_info structure. #include <assert.h> #include <stdio.h> ck_function_
list_ptr pfunction
list; ck_rv crv; ck_info info; crv = fc_getfunction
list(&pfunction
list); assert(crv == ckr_ok); ... ...
...And 2 more matches
FC_Initialize
ibrary is already initialized. ckr_device_error we failed to create the oid tables, random number generator, or internal locks. (note: we probably should return ckr_host_memory instead.) the software integrity test or power-up self-tests failed. the nss cryptographic module is in a fatal error state. ckr_host_memory: we ran out of memory. ...
...initialized. ckr_device_error we failed to create the oid tables, random number generator, or internal locks. (note: we probably should return ckr_host_memory instead.) the software integrity test or power-up self-tests failed. the nss cryptographic module is in a fatal error state. ckr_host_memory: we ran out of memory. ...
...es, random number generator, or internal locks. (note: we probably should return ckr_host_memory instead.) the software integrity test or power-up self-tests failed. the nss cryptographic module is in a fatal error state. ckr_host_memory: we ran out of memory. ...
...And 2 more matches
sslerr.html
ssl_error_rx_unknown_alert -12231 "ssl received an alert record with an unknown alert description." received an alert report: all the error codes in the following block indicate that the local socket received an ssl3 or tls alert record from the remote peer, reporting some issue that it had with an ssl record or handshake message it received. ...
... unable to delete module. sec_error_old_krl -8082 new krl is not later than the current one. sec_error_ckl_conflict -8081 new ckl has different issuer than current ckl. sec_error_cert_not_in_name_space -8080 certificate issuer is not permitted to issue a certificate with this name. ...
...c_error_ckl_conflict -8081 new ckl has different issuer than current ckl. sec_error_cert_not_in_name_space -8080 certificate issuer is not permitted to issue a certificate with this name. ...
...And 2 more matches
Network Security Services
network security services (nss) is a set of libraries designed to support cross-platform development of security-enabled client and server applications. applications built with nss can support ssl v3, tls, pkcs #5, pkcs #7, pkcs #11, pkcs #12, s/mime, x.509 v3 certificates, and other security standards. for detailed information on standards supported, see overview of nss. for a
list of frequently asked questions, see the faq. nss is available under the mozilla public license. for information on downloading nss releases as tar files, see download pki source. if you're a developer and would like to contribute to nss, you might want to read the documents highlevel overview of internal details of nss and getting started with nss. documentation background information ...
...heck out and build nss releases. nss developer tutorial how to make changes in nss. coding style, maintaining abi compatibility. nss tools tools for developing, debugging, and managing applications that use nss. sample code demonstrates how nss can be used for cryptographic operations, certificate handling, ssl, etc. third-party code a
list of third-party code included in the nss library. nss 3.2 test suite archived version. describes how to run the standard nss tests. nss performance reports archived version. links to performance reports for nss 3.2 and later releases. encryption technologies available in nss 3.11 archived version.
lists the cryptographic algorithms used by nss 3.11. nss 3.1 loada...
...more information, extracting roots and their trust bits nss is built on top of netscape portable runtime (nspr) netscape portable runtime nspr project page. nspr reference nspr api documentation. ...
...And 2 more matches
The Publicity Stream API
seerror - if the activity contains syntax errors (not proper json) invalidactivity - if the activity contains semantic errors (i.e. missing required properties) finally, the publicizeactivity() function will throw an exception if required arguments are missing, or if unsupported arguments are present. ...
...mantic errors (i.e. missing required properties) finally, the publicizeactivity() function will throw an exception if required arguments are missing, or if unsupported arguments are present. getpublicitystream( onsuccess: <function>, { [ onerror: <function> ], [ for_apps: <
list> ], [ since: <date> ], [ before: <date> ], [ count: <int> ]): provides a means for a web store to receive a
list of the current user's socially relevant app activity by being called from an origin which hosts a web store. ...
... onerror is an error callback that will be invoked if the installation fails. ...
...And 2 more matches
Fun With XBL and XPConnect
object. exposing the xpcom interfaces one somewhat nasty trick you need to do is to manually expose the interfaces of the xpcom object that you want your widget to support. all you have to do is specifically defining a method on the xbl widget which forwards the method call to the xpcom object. <method name="autocomplete"> <argument name="asearchstring"/> <argument name="result
listener"/> <body> <![cdata[ return this.autocompletesession.autocomplete(null, anonymouscontent[0], asearchstring, this.autocomplete
listener); ]]> </body> </method> you can see that the body of the method is just getting the auto complete session object and calling the auto complete method on it. implementing a widget interface the next thing ...
... object and calling the auto complete method on it. implementing a widget interface the next thing i needed to do was to implement an interface on the widget which i could then pass into the auto complete session. i wanted the auto complete session to call back into the widget with search results. ...
...imilar to what i did for the xpcom object: <property name="autocomplete
listener"> <![cdata[ ({ onautocompleteresult: function(aitem, aoriginalstring, amatch) { if ( aitem ) { anonymouscontent[0].value = amatch; } } }) ]]> </property> as long as the js for the value of autocomplete
listener evaluates to an object (and wrapping the expression with a set of parens like i did, does this), then the value of autocomplete
listener is an object that implements my interface. now i can pass the result of autocomplete
listener into methods that require an auto complete
listener (like my auto complete session object). creating the event handler the last part is the easy part. i wanted a h...
...And 2 more matches
nsIControllers
content/xul/document/public/nsicontrollers.idlscriptable represents a
list of nsicontroller elements. inherits from: nsisupports last changed in gecko 1.9 (firefox 3) this interface is used to manage instances of the nsicontroller interface. windows and text inputs have default controllers that allow commands such as cmd_copy to act on the focused element or window. xul elements can also have controllers, although they do not have any default controllers. implemented by: @mozilla.org/xul/xul-controllers;1. you should not normally need to create an instance, as you normally need to alter the window or element's existing
list of controllers. to create an instance, use: var controllers = components.classes["@mozilla.org/xul/xul-controllers;1"] .createins...
...controller controller); void insertcontrollerat(in unsigned long index, in nsicontroller controller); void removecontroller(in nsicontroller controller); nsicontroller removecontrollerat(in unsigned long index); attributes attribute type description commanddispatcher nsidomxulcommanddispatcher obsolete since gecko 1.9 methods appendcontroller() adds a controller to the end of the
list. void appendcontroller( in nsicontroller controller ); parameters controller a controller to be added to the
list of controllers. exceptions thrown ns_error_out_of_memory getcontrollerat() returns the controller instance at the given position. nsicontroller getcontrollerat( in unsigned long index ); parameters index the position of the wanted controller. return value the controller at...
...er. return value the controller element that was inserted with that id. exceptions thrown ns_error_failure the id is greater than the number of controllers that have been inserted, or the controller has since been removed. getcontrollercount() returns the current number of controllers. unsigned long getcontrollercount(); parameters none. return value the number of controllers currently in the
list of controllers. getcontrollerforcommand() searches for a controller that supports the given command. nsicontroller getcontrollerforcommand( in string command ); parameters command the name of a command, e.g. cmd_copy return value the first controller in the
list that supports the given command. getcontrollerid() returns the order of insertion of a controller. unsigned long getcontrollerid( ...
...And 2 more matches
nsIEditorSpellCheck
teinstance(components.interfaces.nsieditorspellcheck); method overview void addwordtodictionary(in wstring word); boolean canspellcheck(); void checkcurrentdictionary(); boolean checkcurrentword(in wstring suggestedword); boolean checkcurrentwordnosuggest(in wstring suggestedword); astring getcurrentdictionary(); void getdictionary
list([array, size_is(count)] out wstring dictionary
list, out pruint32 count); wstring getnextmisspelledword(); void getpersonaldictionary(); wstring getpersonaldictionaryword(); wstring getsuggestedword(); void ignorewordalloccurrences(in wstring word); void initspellchecker(in nsieditor editor, in boolean enableselectionchecking); void re...
...in wstring suggestedword ); parameters suggestedword the word to check. return value true if the word is misspelled; otherwise false. getcurrentdictionary() returns the name of the dictionary currently in use. astring getcurrentdictionary(); parameters none. return value the name of the dictionary currently in use. typically, this is an iso language code, such as "en-us". getdictionary
list() retrieves a
list of the currently available dictionaries. the strings will typically be language ids, such as "en-us". void getdictionary
list( [array, size_is(count)] out wstring dictionary
list, out pruint32 count ); parameters dictionary
list an array into which the
list of dictionary name strings are placed. count on return, contains the number of entries in the dictionar...
...) retrieves a
list of the currently available dictionaries. the strings will typically be language ids, such as "en-us". void getdictionary
list( [array, size_is(count)] out wstring dictionary
list, out pruint32 count ); parameters dictionary
list an array into which the
list of dictionary name strings are placed. count on return, contains the number of entries in the dictionary
list array. getnextmisspelledword() when interactively spell checking the document, this will return the value of the next word that is misspelled. this also computes the suggestions which you can get by calling getsuggestedword(). wstring getnextmisspelledword(); parameters none. return value the next misspelled word in the document. ...
...And 2 more matches
nsIMessenger
ttachment); void saveallattachments(in unsigned long count, [array, size_is(count)] in string contenttypearray, [array, size_is(count)] in string urlarray, [array, size_is(count)] in string displaynamearray, [array, size_is(count)] in string messageuriarray); void saveattachmenttofile(in nsifile afile, in acstring aurl, in acstring amessageuri, in acstring acontenttype, in nsiurl
listener a
listener); void detachattachment(in string contenttpe, in string url, in string displayname, in string messageuri, in boolean savefirst, [optional] in boolean withoutwarning); void detachallattachments(in unsigned long count, [array, size_is(count)] in string contenttypearray, [array, size_is(count)] in string urlarray, [array, size_is(count)] in string displaynamearray, [a...
... display purposes. messageuri the url of the message containing the attachment. isexternalattachment is the attachment inside a message or saved somewhere externally. if set to true the attachment is opened inside the message pane which in turn should trigger the helper app dialog. same as just using the openurl() method. saveallattachments() launches a filepicker and saves all attachments
listed in an array. void saveallattachments(in unsigned long count, [array, size_is(count)] in string contenttypearray, [array, size_is(count)] in string urlarray, [array, size_is(count)] in string displaynamearray, [array, size_is(count)] in string messageuriarray); parameters count the number ...
...f file names for each attachment. messageuriarray an array of message uris for each attachment. saveattachmenttofile() save an attachment to a particular nsifile. void saveattachmenttofile(in nsifile afile, in acstring aurl, in acstring amessageuri, in acstring acontenttype, in nsiurl
listener a
listener); parameters afile the nsifile to save to. aurl the url of the attachment. amessageuri the url of the message containing this attachment. acontenttype the content type of the attachment. a
listener an nsiurl
listener to be notified when the file is saved. detachattachment() deletes an attachment from a message. void detachattachment(in string contenttype, ...
...And 2 more matches
nsIMsgFilterCustomAction
this should be localized. ...
...type * @param scope the search scope * * @return true if valid */ boolean isvalidfortype(in nsmsgfiltertypetype type, in nsmsgsearchscopevalue scope); /** * after the user inputs a particular action value for the action, determine * if that value is valid. * * @param actionvalue the value entered. ...
...*/ attribute boolean allowduplicates; /* * the custom action itself * * generally for the apply method, folder-based methods give correct * results and are preferred if available. otherwise, be careful * that the action does correct notifications to maintain counts, and correct * manipulations of both imap and local non-database storage of message * metadata...
...And 2 more matches
nsIScriptError
owid(in wstring message, in wstring sourcename, in wstring sourceline, in pruint32 linenumber, in pruint32 columnnumber, in pruint32 flags, in string category, in unsigned long long innerwindowid); autf8string tostring(); attributes attribute type description category string a string indicating the category of error that occurred see categories for a
list. read only. columnnumber pruint32 the column number where the error occurred. this is used to draw the arrow pointing to the problem character. read only. errormessage astring the error message in a string format without any context/line number information. note: nsiconsolemessage.message will return the error formatted with file/line information. ...
...rror occurred. this is used to draw the arrow pointing to the problem character. read only. errormessage astring the error message in a string format without any context/line number information. note: nsiconsolemessage.message will return the error formatted with file/line information. read only. flags pruint32 flags; see flag constants for a
list. read only. innerwindowid unsigned long long the inner window id with which the error is associated. this is zero if the error was initialized by calling nsiscripterror.init() instead of initwithwindowid(). read only. linenumber pruint32 the number of the line where the error occurred. read only. outerwindowid unsigned long long the window id with whi...
...in the source file on which the error occurred. you are responsible for providing that line. you may pass null if you are lazy; that will prevent showing the source line in javascript console. linenumber the number of the line where the error occurred. columnnumber the column number where the error occurred. this is used to draw an arrow pointing to the problem character. flags one of flags
listed in flag constants. category a string indicating what kind of code caused the message. there are quite a few category strings and they don't seem to be
listed in a single place. see categories for a partial
list. initwithwindowid() initializes the nsiscripterror object with the given inner window's id. note: prior to gecko 12.0, this method was provided by the nsiscripterror2 interface, w...
...And 2 more matches
nsISmsRequestManager
srequestmanager;1. ...
...stance, use: var smsrequestmanager = components.classes["@mozilla.org/sms/smsrequestmanager;1"] .createinstance(components.interfaces.nsismsrequestmanager); method overview long addrequest(in nsidommozsmsrequest arequest); long createrequest(in nsidommozsmsmanager amanager, out nsidommozsmsrequest arequest); void notifycreatemessage
list(in long arequestid, in long a
listid, in nsidommozsmsmessage amessage); void notifygetsmsfailed(in long arequestid, in long aerror); void notifygotnextmessage(in long arequestid, in nsidommozsmsmessage amessage); void notifygotsms(in long arequestid, in nsidommozsmsmessage amessage); void notifymarkedmessageread(in long arequestid, in bool aread); void notifymarkmessagereadfailed(in long arequestid, in long aerror); vo...
...essage amessage); void notifygetsmsfailed(in long arequestid, in long aerror); void notifygotnextmessage(in long arequestid, in nsidommozsmsmessage amessage); void notifygotsms(in long arequestid, in nsidommozsmsmessage amessage); void notifymarkedmessageread(in long arequestid, in bool aread); void notifymarkmessagereadfailed(in long arequestid, in long aerror); void notifynomessagein
list(in long arequestid); void notifyreadmessage
listfailed(in long arequestid, in long aerror); void notifysmsdeleted(in long arequestid, in bool adeleted); void notifysmsdeletefailed(in long arequestid, in long aerror); void notifysmssendfailed(in long arequestid, in long aerror); void notifysmssent(in long arequestid, in nsidommozsmsmessage amessage); constants all sms related errors th...
...And 2 more matches
nsISyncMessageSender
for example, a child-process message manager will send messages that are only delivered to its one parent-process message manager. see message manager interfaces for more details on the distinction between message senders and message broadcasters. both sendsyncmessage() and sendrpcmessage() will block until a reply is received, but they may be temporarily interrupted to process an urgent incoming message (such as a cpow request). ...
... throws ns_error_not_initialized ...
...ndrpcmessage([optional] in astring messagename, [optional] in jsval obj, [optional] in jsval objects, [optional] in nsiprincipal principal); sendsyncmessage() like sendasyncmessage(), except blocks the sender until all
listeners of the message have been invoked. returns an array containing return values from each
listener invoked. send messagename and obj to the "other side" of this message manager. this invokes
listeners who registered for messagename using a nsimessage
listenermanager. see nsimessage
listener::receivemessage() for the format of the data delivered to
listeners. throws ns_error_not_initialized if the sender is not initialized. for example, we will throw ns_error_not_initialized if we try ...
...And 2 more matches
nsIXMLHttpRequest
his strips all user data (cookies, tokens, etc). using event handlers from native code (not sure if it's up-to-date) from native code, the way to set up onload and onerror handlers is a bit different. here is a comment from johnny stenback <jst@netscape.com>: the mozilla implementation of nsixmlhttprequest implements the interface nsidomeventtarget and that's how you're supported to add event
listeners. try something like this: nscomptr<nsidomeventtarget> target(do_queryinterface(myxmlhttpreq)); target->addevent
listener(ns_literal_string("load"), my
listener, pr_false) where my
listener is your event
listener object that implements the interface nsidomevent
listener. the 'onload', 'onerror', and 'onreadystatechange' attributes moved to nsijsxmlhttprequest, but if you're coding in c++ you shou...
...and then think twice about it. ...
...and then think twice about it. ...
...And 2 more matches
Setting HTTP request headers
ed to observe the "http-on-modify-request" topic. (and yes, "http-on-modify-request" is a string.) note: there are many topics, besides just "http-on-modify-request", that you can get notifications about, for example "http-on-examine-response" and "xpcom-shutdown". you can also make up your own topics and send out your own notifications. for more information about notifications framework and a
list of common notification topics, see observer notifications. observers to get notified about some topic (like "http-on-modify-request") we need to create an observer. an observer is a component implementing nsiobserver interface. and once the observer is registered for a topic, it will get notified about the topic by having its observe method called. below is an example observer that adds a custom...
... component as described here: https://developer.mozilla.org/en/xpcom/xpcom_changes_in_gecko_2.0#javascript_components. ...
...d here: https://developer.mozilla.org/en/xpcom/xpcom_changes_in_gecko_2.0#javascript_components. ...
...And 2 more matches
XPIDL
declarations. at the top level, we can define typedefs, native types, or interfaces. interfaces may furthermore contain typedefs, natives, methods, constants, or attributes. most declarations can have properties applied to them. types there are three ways to make types: a typedef, a native, or an interface. in addition, there are a few built-in native types. the built-in native types are those
listed under the type_spec production above. the following is the correspondence table: table 1: standard idl types idl c++ in parameter c++ out parameter js type notes boolean bool bool* boolean char char char* string only chars in range \u0000-\u00ff permitted double double double* number float fl...
...* string full unicode set permitted most of the time you don't want to use this type but astring. array<t> const nstarray<t>& nstarray<t>& array the c++-exposed type t will be an owned variant. (e.g. ns[c]string, refptr<t>, or uint32_t) string, wstring, [ptr] native and [ref] native are unsupported as element types. ...
... typedefs in idl are basically as they are in c or c++: you define first the type that you want to refer to and then the name of the type. types can of course be one of the fundamental types, or any other type declared via a typedef, interface, or a native type. native types are types which correspond to a given c++ type. most native types are not scriptable: if it is not present in the
list above, then it is certainly not scriptable (some of the above, particularly jsid, are not scriptable). the contents of the parentheses of a native type declaration (although native declarations without parentheses are parsable, i do not trust that they are properly handled by the xpidl handlers) is a string equivalent to the c++ type. xpidl itself does not interpret this string, it just literall...
...And 2 more matches
Filter Incoming Mail
filter incoming mail to filter incoming mail, the first step is to detect new messages inconming. the, you've got components.interfaces.nsimsgdbhdr from where you can modify the mail. by example, to modify the mail subject : var newmail
listener = { msgadded: function(amsghdr) { if( !amsghdr.isread ) { // here we are, a new mail has popped // let get a javascript string object from the subject property // querying mime conversion interface var mimeconvert = components.classes["@mozilla.org/messenger/mimeconverter;1"] .getservice(components.interfaces.nsimimeconverter); var subject = mimeconvert.decodemimeheader(amsghdr.subject, null, false, true); // here with have a string to modify with javascript. by example, setting it to lower case ...
... you can take a look at a working code in the capskiller add-on repository. ...
... you can take a look at a working code in the capskiller add-on repository. ...
...And 2 more matches
Add to iPhoto
en that happens. some global types there are a few global data types used by all of our frameworks. these are declared near the top of the code: const osstatus = ctypes.int32_t; const cfindex = ctypes.long; const optionbits = ctypes.uint32_t; osstatus used to represent the status code resulting from an operation. cfindex a core foundation long integer type used to represent indexes into
lists. i debated including this in the corefoundation object, and probably would have if i were being more formal, but opted against it for clarity's sake. optionbits a 32-bit bit field data type. core foundation the majority of the system routines we'll be using come from core foundation. among these are routines for managing cfstring, cfurl, and cfarray objects, among others. these are core sys...
...shut down, we do need to close the library we opened using the js-ctypes api; that's where the shutdown() method comes in: shutdown: function() { this.lib.close(); } select api declarations let's take a look at a few of the key apis we declare for core foundation, to see how it's done. cfrange cfrange is a structure that identifies a range; that is, it identifies an offset to an item in a
list and a number of items. in c, the declaration looks like this: typedef struct { cfindex location; cfindex length; } cfrange; to declare this for use with js-ctypes, we use the following code: this.cfrange = new ctypes.structtype("cfrange", [ {'location': ctypes.int32_t}, {'length': ctypes.int32_t}]); this defines corefoundation.cfrange to rep...
... an optionbits value providing a bit field of special options. a pointer to an apple event parameter; we aren't using this, so i'm just using a voidptr_t here. a pointer to an lsapplicationparameters structure that describes what application to launch a pointer to the first element of an array to receive the serial numbers of the launc...
...And 2 more matches
Standard OS Libraries
u just need to supply the path to appropriate files and set up the proper types of values/arguments in the js-ctypes code. this article allows you to find out what types to give to values/arguments by supplying links to the documentation of the os libraries. windows windows has many standard os libraries. the most common, found on all windows os version, is "winapi". ...
... in the js-ctypes code. this article allows you to find out what types to give to values/arguments by supplying links to the documentation of the os libraries. windows windows has many standard os libraries. the most common, found on all windows os version, is "winapi". windows also has the "winapi
lists" and ".net framework" (i'm not sure if it can be accessed jsctypes but probably). a complete
list of windows apis can be found at the msdn api index. winapi this is the one that is most commonly used by js-ctypes. this comes shipped by default with all installations of windows operating systems since win98. it's also known as winapi32 or just winapi. 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 argument...
...so i went to the msdn winapi index page and then went to the "cursors" category and came across getcursorpos. i then searched it on msdn and saw that it needed the user32.dll. (msdn - getcursorpos) this example was created on windows xp sp2. it is a full working example; just copy & paste it to try it out. ...
...And 2 more matches
Streams - Plugins
uffer allocated by the browser is deleted after returning from the function, so the plug-in must make a copy of the data it needs to keep. as an example, suppose that a plug-in (and the http server) supports byte-range requests, and that the browser is in the process of pushing data to the plug-in. if the user now requests a specific page of the document, the plug-in calls npn_requestread with a
list of byte ranges. the open stream is converted from normal mode to seek mode in an effort to pass the plug-in data that was already on the way, rather than just discarding it. all npp_write calls for streaming data eventually stop, and npp_write calls will be completed only for data requested with npn_requestread. the browser does not create a new stream for each byte range it requests. instead, a...
...stream must be put in np_seek mode initially, because the browser must cache all the stream data on disk in order to access it randomly. for streams that are not inherently seekable and not initially in mode np_seek: npn_requestread returns the error code nperr_stream_not_seekable. ...
...ll the stream data on disk in order to access it randomly. for streams that are not inherently seekable and not initially in mode np_seek: npn_requestread returns the error code nperr_stream_not_seekable. ...
...And 2 more matches
Network request details - Firefox Developer Tools
this pane provides more detailed information about the request. network request details clicking on a row displays a new pane in the right-hand side of the network monitor, which provides more detailed information about the request. the screenshots and descriptions in this section reflect firefox 78. earlier versions appeared similarly, but might not include some functionality. ...
... at the top of this pane enable you to switch between the following pages: headers messages (only for websocket items) cookies params response cache timings security (only for secure pages) stack trace (only when the request has a stack trace, e.g. a script called by another script). clicking the icon at the right-hand end of the toolbar closes the details pane and returns you to the
list view. headers tab the headers tab has a toolbar, followed by three main sections. this includes: information about the request status: the response status code for the request; click the "?" icon to go to the reference page for the status code. version: the version of http used. transferred: the amount of data transferred for the request. referrer policy: the value of the ref...
..." } ] } } request headers the request headers section shows details about the request headers. for each line in the request headers section, a question mark links to the documentation for that request header, if one is available. a raw toggle button in the section heading controls whether the headers are shown with formatting, or as plain, unformatted text. cookies tab this tab
lists full details of any cookies sent with the request or response: as with headers, you can filter the
list of cookies displayed. the full
list of cookie attributes is shown—see the following screenshot showing response cookies with further attributes shown. the samesite attribute has been shown since firefox 62 (bug 1452715). params tab this tab displays the get parameters and post data o...
...And 2 more matches
Storage Inspector - Firefox Developer Tools
the storage inspector enables you to inspect various types of storage that a web page can use. currently it can be used to inspect the following storage types: cache storage — any dom caches created using the cache api. cookies — all the cookies created by the page or any iframes inside of the page. cookies created as a part of response of network calls are also
listed, but only for calls that happened while the tool is open. indexeddb — all indexeddb databases created by the page or any iframes inside the page, their object stores and the items stored in these object stores. local storage — all local storage items created by the page or any iframes inside the page. session storage — all session storage items created by the page or any iframes inside the page. for the time ...
...nu bar or are on macos), or by pressing its shift + f9 keyboard shortcut. the toolbox will appear at the bottom of the browser window, with the storage inspector activated. it's just called "storage" in the developer toolbox. storage inspector user interface the storage inspector ui is split into three main components: storage tree table widget sidebar storage tree the storage tree
lists all the storage types that the storage inspector can inspect: under each type, objects are organized by origin. for cookies, the protocol does not differentiate the origin. for indexed db or local storage an origin is a combination of protocol + hostname. for example, "http://mozilla.org" and "https://mozilla.org" are two different origins so local storage items cannot be shared between them.
...lla.org" are two different origins so local storage items cannot be shared between them. under "cache storage", objects are organized by origin and then by the name of the cache: indexeddb objects are organized by origin, then by database name, then by object store name: with the cookies, local storage, and session storage types, there's only one level in the hierarchy, so stored items are
listed directly under each origin: you can click on each item in the tree to expand or collapse its children. the tree is live, so if a new origin gets added (by adding an iframe, for example), it will be added to each storage type automatically. clicking on a tree item will display detailed information about that item in the table widget on the right. for example, clicking on an origin which is a...
...And 2 more matches
Battery Status API - Web APIs
xtends window.navigator with a navigator.getbattery() method returning a battery promise, which is resolved in a batterymanager object providing also some new events you can handle to monitor the battery status. example in this example, we watch for changes both to the charging status (whether or not we're plugged in and charging) and for changes to the battery level and timing. ...
...g) and for changes to the battery level and timing. this is done by
listening for the chargingchange, levelchange, chargingtimechange, dischargingtimechange events. ...
... function updateallbatteryinfo(){ updatechargeinfo(); updatelevelinfo(); updatecharginginfo(); updatedischarginginfo(); } updateallbatteryinfo(); battery.addevent
listener('chargingchange', function(){ updatechargeinfo(); }); function updatechargeinfo(){ console.log("battery charging? " + (battery.charging ? ...
...And 2 more matches
Drawing shapes with canvas - Web APIs
the position of the top left corner of the blue square becomes x pixels from the left and y pixels from the top, at coordinate (x,y). later in this tutorial we'll see how we can translate the origin to a different position, rotate the grid and even scale it, but for now we'll stick to the default. drawing rectangles unlike svg, <canvas> only supports two primitive shapes: rectangles and paths (
lists of points connected by lines). all other shapes must be created by combining one or more paths. luckily, we have an assortment of path drawing functions which make it possible to compose very complex shapes. first let's look at the rectangle. there are three functions that draw rectangles on the canvas: fillrect(x, y, width, height) draws a filled rectangle. strokerect(x, y, width, height)...
... to create a rectangular outline 50x50 pixels within the cleared square. in upcoming pages we'll see two alternative methods for clearrect(), and we'll also see how to change the color and stroke style of the rendered shapes. unlike the path functions we'll see in the next section, all three rectangle functions draw immediately to the canvas. drawing paths now let's look at paths. a path is a
list of points, connected by segments of lines that can be of different shapes, curved or not, of different width and of different color. a path, or even a subpath, can be closed. to make shapes using paths, we take some extra steps: first, you create the path. then you use drawing commands to draw into the path. once the path has been created, you can stroke or fill the path to render it. here...
...path and used to build the path up. path methods methods to set different paths for objects. closepath() adds a straight line to the path, going to the start of the current sub-path. stroke() draws the shape by stroking its outline. fill() draws a solid shape by filling the path's content area. the first step to create a path is to call the beginpath(). internally, paths are stored as a
list of sub-paths (lines, arcs, etc) which together form a shape. every time this method is called, the
list is reset and we can start drawing new shapes. note: when the current path is empty, such as immediately after calling beginpath(), or on a newly created canvas, the first path construction command is always treated as a moveto(), regardless of what it actually is. for that reason, you will alm...
...And 2 more matches
console - Web APIs
rt() log a message and stack trace to console if the first argument is false. console.clear() clear the console. console.count() log the number of times this line has been called with the given label. console.countreset() resets the value of the counter with the given label. console.debug() outputs a message to the console with the log level debug. console.dir() displays an interactive
listing of the properties of a specified javascript object. this
listing lets you use disclosure triangles to examine the contents of child objects. console.dirxml() displays an xml/html element representation of the specified object if possible or the javascript object view if it is not possible. console.error() outputs an error message. you may use string substitution and additional arguments wi...
...ur categories of output you can generate, using the console.log(), console.info(), console.warn(), and console.error() methods respectively. each of these results in output styled differently in the log, and you can use the filtering controls provided by your browser to only view the kinds of output that interest you. there are two ways to use each of the output methods; you can simply pass in a
list of objects whose string representations get concatenated into one string, then output to the console, or you can pass in a string containing zero or more substitution strings followed by a
list of objects to replace them. outputting a single object the simplest way to use the logging methods is to output a single object: var someobject = { str: "some text", id: 5 }; console.log(someobject); ...
...the object is:", someobject); this output will look like this: [09:28:22.711] my first car was a dodge charger . ...
...And 2 more matches
DeprecationReportBody - Web APIs
ver.observe(); because of the event handler we set up inside the reportingobserver() constructor, we can now click the button to display the report details. ...
...the reportingobserver() constructor, we can now click the button to display the report details. ...
...tton to display the report details. ...
...And 2 more matches
Detecting device orientation - Web APIs
r detects a change to the orientation of the device. by receiving and processing the data reported by these orientation events, it's possible to interactively respond to rotation and elevation changes caused by the user moving the device. the second event is the devicemotionevent, which is sent when a change in acceleration was added. ...
...e deviceorientationevent because it is
listening for changes in acceleration as opposed to orientation. sensors that are commonly capable of detecting devicemotionevent include sensors in laptops to protect moving storage devices. deviceorientationevent is more commonly found in mobile devices. processing orientation events all you need to do in order to begin receiving orientation change is to
listen to the deviceorientation event: note: gyronorm.js is a polyfill for normalizing the accelerometer and gyroscope data on mobile devices. this is useful for overcoming some of the differences in device support for device orientation. ...
...ore commonly found in mobile devices. processing orientation events all you need to do in order to begin receiving orientation change is to
listen to the deviceorientation event: note: gyronorm.js is a polyfill for normalizing the accelerometer and gyroscope data on mobile devices. this is useful for overcoming some of the differences in device support for device orientation. window.addevent
listener("deviceorientation", handleorientation, true); after registering your event
listener (in this case, a javascript function called handleorientation()), your
listener function periodically gets called with updated orientation data. the orientation event contains four values: deviceorientationevent.absolute deviceorientationevent.alpha deviceorientationevent.beta deviceorientationevent.
...And 2 more matches
Document: DOMContentLoaded event - Web APIs
e. synchronous javascript pauses parsing of the dom. if you want the dom to get parsed as fast as possible after the user has requested the page, you can make your javascript asynchronous and optimize loading of stylesheets. if loaded as usual, stylesheets slow down dom parsing as they're loaded in parallel, "stealing" traffic from the main html document. ...
...can make your javascript asynchronous and optimize loading of stylesheets. if loaded as usual, stylesheets slow down dom parsing as they're loaded in parallel, "stealing" traffic from the main html document. examples basic usage document.addevent
listener('domcontentloaded', (event) => { console.log('dom fully loaded and parsed'); }); delaying domcontentloaded <script> document.addevent
listener('domcontentloaded', (event) => { console.log('dom fully loaded and parsed'); }); for( let i = 0; i < 1000000000; i++) {} // this synchronous script is going to delay parsing of the dom, // so the domcontentloaded event is going to launch later. </script> checking whether loading is already complete domcontentloaded may fire before your script has a chance to run, so it is wise to...
..., (event) => { console.log('dom fully loaded and parsed'); }); for( let i = 0; i < 1000000000; i++) {} // this synchronous script is going to delay parsing of the dom, // so the domcontentloaded event is going to launch later. ...
...And 2 more matches
Events and the DOM - Web APIs
introduction this chapter describes the dom event model. the event interface itself is described, as well as the interfaces for event registration on nodes in the dom, and event
listeners, and several longer examples that show how the various event interfaces relate to one another. there is an excellent diagram that clearly explains the three phases of event flow through the dom in the dom level 3 events draft. also see example 5: event propagation in the examples chapter for a more detailed example of how events move through the dom. ...
... dom, and event
listeners, and several longer examples that show how the various event interfaces relate to one another. there is an excellent diagram that clearly explains the three phases of event flow through the dom in the dom level 3 events draft. also see example 5: event propagation in the examples chapter for a more detailed example of how events move through the dom. registering event
listeners there are 3 ways to register event handlers for a dom element. ...
...es relate to one another. there is an excellent diagram that clearly explains the three phases of event flow through the dom in the dom level 3 events draft. also see example 5: event propagation in the examples chapter for a more detailed example of how events move through the dom. registering event
listeners there are 3 ways to register event handlers for a dom element. eventtarget.addevent
listener // assuming mybutton is a button element mybutton.addevent
listener('click', greet, false) function greet(event){ // print and have a look at the event object // always print arguments in case of overlooking any other arguments console.log('greet:', arguments) alert('hello world') } this is the method you should use in modern web pages. note: internet explorer 6–8 didn't...
...And 2 more matches
File.webkitRelativePath - Web APIs
e to the directory selected by the user in an <input> element with its webkitdirectory attribute set. syntax relativepath = file.webkitrelativepath value a usvstring containing the path of the file relative to the ancestor directory the user selected. example in this example, a directory picker is presented which lets the user choose one or more directories. ...
... a usvstring containing the path of the file relative to the ancestor directory the user selected. example in this example, a directory picker is presented which lets the user choose one or more directories. when the change event occurs, a
list of all files contained within the selected directory hierarchies is generated and displayed. ...
...le relative to the ancestor directory the user selected. example in this example, a directory picker is presented which lets the user choose one or more directories. when the change event occurs, a
list of all files contained within the selected directory hierarchies is generated and displayed. ...
...And 2 more matches
HTMLElement: animationend event - Web APIs
pleted. if the animation aborts before reaching completion, such as if the element is removed from the dom or the animation is removed from the element, the animationend event is not fired. ...
... the animation is removed from the element, the animationend event is not fired. ...
...@keyframes slidein { from { margin-left: 100%; width: 300%; } to { margin-left: 0%; width: 100%; } } js const animation = document.queryselector('p.animation'); const animationeventlog = document.queryselector('.animation-example>.event-log'); const applyanimation = document.queryselector('.animation-example>button.activate'); let iterationcount = 0; animation.addevent
listener('animationstart', () => { animationeventlog.textcontent = `${animationeventlog.textcontent}'animation started' `; }); animation.addevent
listener('animationiteration', () => { iterationcount++; animationeventlog.textcontent = `${animationeventlog.textcontent}'animation iterations: ${iterationcount}' `; }); animation.addevent
listener('animationend', () => { animationeventlog.textconte...
...And 2 more matches
HTMLElement: animationstart event - Web APIs
once the delay period has expired. a negative delay will cause the event to fire with an elapsedtime equal to the absolute value of the delay (and, correspondingly, the animation will begin playing at that time index into the sequence). ...
..., correspondingly, the animation will begin playing at that time index into the sequence). ...
...frames slidein { from { transform: translatex(100%) scalex(3); } to { transform: translatex(0) scalex(1); } } js const animation = document.queryselector('p.animation'); const animationeventlog = document.queryselector('.animation-example>.event-log'); const applyanimation = document.queryselector('.animation-example>button.activate'); let iterationcount = 0; animation.addevent
listener('animationstart', () => { animationeventlog.textcontent = `${animationeventlog.textcontent}'animation started' `; }); animation.addevent
listener('animationiteration', () => { iterationcount++; animationeventlog.textcontent = `${animationeventlog.textcontent}'animation iterations: ${iterationcount}' `; }); animation.addevent
listener('animationend', () => { animationeventlog.textconte...
...And 2 more matches
HTMLElement: transitionend event - Web APIs
transitioned state, and when it fully reverts to the default or non-transitioned state. if there is no transition delay or duration, if both are 0s or neither is declared, there is no transition, and none of the transition events are fired. if the transitioncancel event is fired, the transitionend event will not fire. ...
...elay or duration, if both are 0s or neither is declared, there is no transition, and none of the transition events are fired. if the transitioncancel event is fired, the transitionend event will not fire. ...
...itionstart, transitionrun, transitioncancel and transitionend events fire. in this example, to cancel the transition, stop hovering over the transitioning box before the transition ends. for the transition end event to fire, stay hovered over the transition until the transition ends. ...
...And 2 more matches
HTMLLinkElement - Web APIs
settings attributes for details. htmllinkelement.disabled is a boolean which represents whether the link is disabled; currently only used with style sheet links. htmllinkelement.href is a domstring representing the uri for the target resource. htmllinkelement.hreflang is a domstring representing the language code for the linked resource. ...
... linkstyle.sheet read only returns the stylesheet object associated with the given element, or null if there is none. ...
... linkstyle.sheet read only returns the stylesheet object associated with the given element, or null if there is none. ...
...And 2 more matches
HTMLSelectElement.add() - Web APIs
alue 2"; sel.add(opt1, null); sel.add(opt2, null); /* produces the following, conceptually: <select> <option value="1">option: value 1</option> <option value="2">option: value 2</option> </select> */ the before parameter is optional. so the following is accepted. ... sel.add(opt1); sel.add(opt2); ... ...
...option> </select> */ the before parameter is optional. so the following is accepted. ... sel.add(opt1); sel.add(opt2); ... append to an existing collection var sel = document.getelementbyid("existing
list"); var opt = document.createelement("option"); opt.value = "3"; opt.text = "option: value 3"; sel.add(opt, null); /* takes the existing following select object: <select id="existing
list"> <option value="1">option: value 1</option> <option value="2">option: value 2</option> </select> and changes it to: <select id="existing
list"> <option value="1">option: value 1</option> <option value="2">option: value 2</option> <option value="3">option: value 3</option> </select> */ the before parameter is optional. so the following is accepted. ... sel.add(opt)...
.../option> </select> and changes it to: <select id="existing
list"> <option value="1">option: value 1</option> <option value="2">option: value 2</option> <option value="3">option: value 3</option> </select> */ the before parameter is optional. so the following is accepted. ... sel.add(opt); ... ...
...And 2 more matches
IDBCursor.direction - Web APIs
of travel using the 2nd argument of idbobjectstore.opencursor. the cursor does not require us to select the data based on a key; we can just grab all of it. also note that in each iteration of the loop, you can grab data from the current record under the cursor object using cursor.value.foo. ...
...e cursor does not require us to select the data based on a key; we can just grab all of it. also note that in each iteration of the loop, you can grab data from the current record under the cursor object using cursor.value.foo. ...
... grab all of it. also note that in each iteration of the loop, you can grab data from the current record under the cursor object using cursor.value.foo. ...
...And 2 more matches
IDBCursor.key - Web APIs
hich is our key). the cursor does not require us to select the data based on a key; we can just grab all of it. also note that in each iteration of the loop, you can grab data from the current record under the cursor object using cursor.value.foo. ...
...on a key; we can just grab all of it. also note that in each iteration of the loop, you can grab data from the current record under the cursor object using cursor.value.foo. ...
... the cursor object using cursor.value.foo. ...
...And 2 more matches
IDBCursor.primaryKey - Web APIs
y): hemispheres the cursor does not require us to select the data based on a key; we can just grab all of it. also note that in each iteration of the loop, you can grab data from the current record under the cursor object using cursor.value.foo. ...
...on a key; we can just grab all of it. also note that in each iteration of the loop, you can grab data from the current record under the cursor object using cursor.value.foo. ...
... the cursor object using cursor.value.foo. ...
...And 2 more matches
IDBCursorWithValue.value - Web APIs
ith cursor.value. the cursor does not require us to select the data based on a key; we can just grab all of it. also note that in each iteration of the loop, you can grab data from the current record under the cursor object using cursor.value.foo. ...
...on a key; we can just grab all of it. also note that in each iteration of the loop, you can grab data from the current record under the cursor object using cursor.value.foo. ...
... the cursor object using cursor.value.foo. ...
...And 2 more matches
IDBCursorWithValue - Web APIs
the object store. the cursor does not require us to select the data based on a key; we can just grab all of it. also note that in each iteration of the loop, you can grab data from the current record under the cursor object using cursor.value.foo. ...
...on a key; we can just grab all of it. also note that in each iteration of the loop, you can grab data from the current record under the cursor object using cursor.value.foo. ...
... the cursor object using cursor.value.foo. ...
...And 2 more matches
IDBDatabase: close event - Web APIs
pen, for example, if the underlying storage is removed or if the user clears the database in the browser's history preferences. note that it is not fired if the database connection is closed normally using idbdatabase.close(). ...
...wser's history preferences. note that it is not fired if the database connection is closed normally using idbdatabase.close(). ...
... interface event event handler property onerror examples this example opens a database and
listens for the close event: // open the database const dbopenrequest = window.indexeddb.open('todo
list', 4); dbopenrequest.onupgradeneeded = (event) => { const db = event.target.result; // create an objectstore for this database const objectstore = db.createobjectstore('todo
list', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: fals...
...And 2 more matches
IDBDatabase: error event - Web APIs
the error event is fired on idbdatabase when a request returns an error and the event bubbles up to the connection object. ...
... bubbles yes cancelable no interface event event handler property onerror examples this example opens a database and tries to add a record,
listening for the error event for the add() operation (this will occur if, for example, a record with the given tasktitle already exists): // open the database const dbopenrequest = window.indexeddb.open('todo
list', 4); dbopenrequest.onupgradeneeded = (event) => { const db = event.target.result; // create an objectstore for this database const objectstore = db.createobjectstore('todo
list', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false...
...que: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = (event) => { const newitem = { tasktitle: 'my task', hours: 10, minutes: 10, day: 10, month: 'january', year: 2020 }; const db = dbopenrequest.result; db.addevent
listener('error', () => { console.log(`error adding new item: ${newitem.tasktitle}`); }); // open a read/write db transaction, ready for adding the data const transaction = db.transaction(['todo
list'], 'readwrite'); const objectstore = transaction.objectstore('todo
list'); const objectstorerequest = objectstore.add(newitem); }; the same example, using the onerror property instead of ad...
...And 2 more matches
IDBObjectStore - Web APIs
idbobjectstore.keypath read only the key path of this object store. ...
...ple this example shows a variety of different uses of object stores, from updating the data structure with idbobjectstore.createindex inside an onupgradeneeded function, to adding a new item to our object store with idbobjectstore.add. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todo
list", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in db. db = dbopenrequest.result; }; // this event handles the event whereby a new version of // the database needs to be created either one has not // been created before, or a new version number has been // submitted via the window.indexeddb.
...ther one has not // been created before, or a new version number has been // submitted via the window.indexeddb.open line above dbopenrequest.onupgradeneeded = function(event) { var db = event.target.result; db.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; // create an objectstore for this database var objectstore = db.createobjectstore("todo
list", { keypath: "tasktitle" }); // define what data items the objectstore will contain objectstore.createindex("hours", "hours", { unique: false }); objectstore.createindex("minutes", "minutes", { unique: false }); objectstore.createindex("day", "day", { unique: false }); objectstore.createindex("month", "month", { unique: false }); objectstore.createindex("year", "year", { unique: fal...
...And 2 more matches
IDBOpenDBRequest: upgradeneeded event - Web APIs
o open a database with a version number higher than its current version. bubbles no cancelable no interface event event handler onupgradeneeded examples this example opens a database and handles the upgradeneeded event by making any necessary updates to the object store. ...
...umber higher than its current version. bubbles no cancelable no interface event event handler onupgradeneeded examples this example opens a database and handles the upgradeneeded event by making any necessary updates to the object store. ...
...s the upgradeneeded event by making any necessary updates to the object store. ...
...And 2 more matches
IDBOpenDBRequest - Web APIs
12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">idbopendbrequest</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties also inherits methods from its parents idbrequest and eventtarget. methods no methods, but inherits methods from its parents idbrequest and eventtarget. events
listen to these events using addevent
listener() or by assigning an event
listener to the oneventname property of this interface. blocked fired when an open connection to a database is blocking a versionchange transaction on the same database. also available via the onblocked property. upgradeneeded fired when an attempt was made to open a database with a version number higher than its current ve...
...t version. also available via the onupgradeneeded property. example in the following example you can see the onupgradeneeded handler being used to update the database structure if a database with a higher version number is loaded. for a full working example, see our to-do notifications app (view example live.) var db; // let us open our database var dbopenrequest = window.indexeddb.open("todo
list", 4); // these event handlers act on the database being opened. dbopenrequest.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db // variable. this is used a lot below db = dbopenrequest.result; // ru...
...ng opened. dbopenrequest.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db // variable. ...
...And 2 more matches
IDBTransaction: error event - Web APIs
the error event is fired on idbtransaction when a request returns an error and the event bubbles up to the transaction object. ...
... bubbles yes cancelable no interface event event handler property onerror examples this example opens a database and tries to add a record,
listening for the error event for the add() operation (this will occur if, for example, a record with the given tasktitle already exists): // open the database const dbopenrequest = window.indexeddb.open('todo
list', 4); dbopenrequest.onupgradeneeded = (event) => { const db = event.target.result; // create an objectstore for this database const objectstore = db.createobjectstore('todo
list', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false...
...utes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = (event) => { const db = dbopenrequest.result; // open a read/write db transaction, ready for adding the data const transaction = db.transaction(['todo
list'], 'readwrite'); transaction.addevent
listener('error', () => { console.log(`error adding new item: ${newitem.tasktitle}`); }); const objectstore = transaction.objectstore('todo
list'); const newitem = { tasktitle: 'my task', hours: 10, minutes: 10, day: 10, month: 'january', year: 2020 }; const objectstorerequest = objectstore.add(newitem); }; the same example, using the onerror...
...And 2 more matches
IDBTransaction - Web APIs
ful transaction. this property is null if the transaction is not finished, is finished and successfully committed, or was aborted with theidbtransaction.abort() function. idbtransaction.mode read only the mode for isolating access to data in the object stores that are in the scope of the transaction. the default value is readonly. idbtransaction.objectstorenames read only returns a domstring
list of the names of idbobjectstore objects associated with the transaction. methods inherits from: eventtarget idbtransaction.abort() rolls back all the changes to objects in the database associated with this transaction. if this transaction has been aborted or completed, this method fires an error event. idbtransaction.objectstore() returns an idbobjectstore object representing an object st...
...ransaction. idbtransaction.commit() for an active transaction, commits the transaction. note that this doesn't normally have to be called — a transaction will automatically commit when all outstanding requests have been satisfied and no new requests have been made. commit() can be used to start the commit process without waiting for events from outstanding requests to be dispatched. events
listen to these events using addevent
listener() or by assigning an event
listener to the oneventname property of this interface. abort fired when an indexeddb transaction is aborted. also available via the onabort property. complete fired when a transaction successfully completes. also available via the oncomplete property. error fired when a request returns an error and the event bubbles up...
...pet, we open a read/write transaction on our database and add some data to an object store. note also the functions attached to transaction event handlers to report on the outcome of the transaction opening in the event of success or failure. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todo
list", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db // variable. this is used a lot below db = dbopenrequest.result; // add the data to the database adddata(); }; function adddata() { // create a new object to insert into the idb var newitem = [ { tasktitle: "walk dog", hour...
...And 2 more matches
MessagePort - Web APIs
the messageport interface of the channel messaging api represents one of the two ports of a messagechannel, allowing messages to be sent from one port and
listening out for them arriving at the other. note: this feature is available in web workers. methods inherits methods from its parent, eventtarget postmessage() sends a message from the port, and optionally, transfers ownership of objects to other browsing contexts. ...
...nt from one port and
listening out for them arriving at the other. note: this feature is available in web workers. methods inherits methods from its parent, eventtarget postmessage() sends a message from the port, and optionally, transfers ownership of objects to other browsing contexts. start() starts the sending of messages queued on the port (only needed when using eventtarget.addevent
listener; it is implied when using messageport.onmessage.) close() disconnects the port, so it is no longer active. event handlers inherits event handlers from its parent, eventtarget onmessage an event
listener called when messageevent of type message is fired on the port—that is, when the port receives a message. ...
... events message fired when a messageport object receives a message. also available via the onmessage property. messageerror fired when a messageport object receives a message that can't be deserialized. ...
...And 2 more matches
Online and offline events - Web APIs
the <body> of each page when the browser switches between online and offline mode. additionally, the events bubble up from document.body, to document, ending at window. both events are non-cancellable (you can't prevent the user from coming online, or going offline). firefox 41 fires these events when the os reports a change in network connectivity on windows, linux, and os x. you can register
listeners for these events in a few familiar ways: using addevent
listener on the window, document, or document.body by setting the .ononline or .onoffline properties on document or document.body to a javascript function object. (note: using window.ononline or window.onoffline will not work for compatibility reasons.) by specifying ononline="..." or onoffline="..." attributes on the <body> tag in ...
...ies on document or document.body to a javascript function object. (note: using window.ononline or window.onoffline will not work for compatibility reasons.) by specifying ononline="..." or onoffline="..." attributes on the <body> tag in the html markup. ...
...using window.ononline or window.onoffline will not work for compatibility reasons.) by specifying ononline="..." or onoffline="..." attributes on the <body> tag in the html markup. example there's a simple test case that you can run to verify that the events are working (does not work in chrome due to attaching the event
listener to document.body). ...
...And 2 more matches
PaymentResponse: payerdetailchange event - Web APIs
valid, appropriate error messages should be configured and the retry() method should be called on the paymentresponse to ask the user to update the invalid entries. bubbles no cancelable no interface paymentrequestupdateevent event handler property onpayerdetailchange examples in the example below, onpayerdetailchange is used to set up a
listener for the payerdetailchange event in order to validate the information entered by the user, requesting that any mistakes be corrected // options for paymentrequest(), indicating that shipping address, // payer email address, name, and phone number all be collected. const options = { requestshipping: true, requestpayeremail: true, requestpayername: true, requestpayerphone: true, }; con...
...ername)); oldpayername = payername; } if (oldpayeremail !== payeremail) { promisestovalidate.push(validateemail(payeremail)); oldpayeremail = payeremail; } if (oldpayerphone !== payerphone) { promisestovalidate.push(validatephone(payerphone)); oldpayerphone = payerphone; } // as each validation promise resolves, add the results of the // validation to the errors
list const errors = await promise.all(promisestovalidate).then(results => results.reduce((errors, result), object.assign(errors, result)) ); // if we found any errors, wait for them to be corrected if (object.getownpropertynames(errors).length) { await response.retry(errors); } else { // we have a good payment; send the data to the server await fetch("/pay-for-things/", { ...
...} specifications specification status comment payment request apithe definition of 'payerdetailchange event' in that specification. candidate recommendation ...
...And 2 more matches
RTCRtpTransceiver.setCodecPreferences() - Web APIs
the specified set of codecs and configurations will be used for all future connections including this transceiver until this method is called again. when preparing to open an rtcpeerconnection, you can change the codec parameters from the user agent's default configuration by calling setcodecparameters() before calling either rtcpeerconnection.createoffer() or createanswer(). a guide to codecs supported by webrtc—and each codec's positive and negative characteristics—can be found in codecs used by webrtc. ...
...parameters for one of the transceiver's supported codecs. if codecs is empty, the codec configurations are all returned to the user agent's defaults. note: any codecs not included in codecs will not be considered during the process of negotiating a connection. this lets you prevent the use of codecs you don't wish to use. ...
... are all returned to the user agent's defaults. note: any codecs not included in codecs will not be considered during the process of negotiating a connection. this lets you prevent the use of codecs you don't wish to use. return value undefined exceptions invalidaccesserror the codecs
list includes one or more codecs which are not supported by the transceiver. usage notes getting a
list of supported codecs you can only include in the codecs
list codecs which the transceiver actually supports. that means that either the associated rtcrtpsender or the rtcrtpreceiver needs to support every codec in the
list. if any unsupported codecs are
listed, the browser will throw an invalidaccesserror exception when you call this method. a good approach to setting codec preferences is to fir...
...And 2 more matches
ReadableStream.ReadableStream() - Web APIs
on is stopped, the stream is closed using readablestreamdefaultcontroller.close(), and another function is run, which reads the data back out of the stream. ...
...blestreamdefaultcontroller.close(), and another function is run, which reads the data back out of the stream. ...
...nd another function is run, which reads the data back out of the stream. ...
...And 2 more matches
ReadableStreamDefaultController.close() - Web APIs
on is stopped, the stream is closed using readablestreamdefaultcontroller.close(), and another function is run, which reads the data back out of the stream. ...
...blestreamdefaultcontroller.close(), and another function is run, which reads the data back out of the stream. ...
...nd another function is run, which reads the data back out of the stream. ...
...And 2 more matches
ReadableStreamDefaultController.enqueue() - Web APIs
on is stopped, the stream is closed using readablestreamdefaultcontroller.close(), and another function is run, which reads the data back out of the stream. ...
...blestreamdefaultcontroller.close(), and another function is run, which reads the data back out of the stream. ...
...nd another function is run, which reads the data back out of the stream. ...
...And 2 more matches
ReadableStreamDefaultController - Web APIs
on is stopped, the stream is closed using readablestreamdefaultcontroller.close(), and another function is run, which reads the data back out of the stream. ...
...blestreamdefaultcontroller.close(), and another function is run, which reads the data back out of the stream. ...
...nd another function is run, which reads the data back out of the stream. ...
...And 2 more matches
Using the Resource Timing API - Web APIs
spectively), until the response has ended (responseend). this timing data provides a detailed profile of the resource loading phases and this data can be used to help identify performance bottlenecks. ...
... the message body, after removing any applied content-codings. the following example demonstrates using these three properties. function display_size_data(){ // check for support of the performanceresourcetiming.*size properties and print their values // if supported. ...
...odings. the following example demonstrates using these three properties. function display_size_data(){ // check for support of the performanceresourcetiming.*size properties and print their values // if supported. if (performance === undefined) { console.log("= display size data: performance not supported"); return; } var
list = performance.getentriesbytype("resource"); if (
list === undefined) { console.log("= display size data: performance.getentriesbytype() is not supported"); return; } // for each "resource", display its *size property values console.log("= display size data"); for (var i=0; i <
list.length; i++) { console.log("== resource[" + i + "] - " +
list[i].name); if ("decodedbodysize" in
list[i]) console.log("... decodedbodysize...
...And 2 more matches
SVGAnimatedPathData - Web APIs
the svganimatedpathdata interface supports elements which have a 'd' attribute which holds svg path data, and supports the ability to animate that attribute. interface overview also implement none methods none properties svgpathseg
list animatednormalizedpathseg
list svgpathseg
list animatedpathseg
list svgpathseg
list normalizedpathseg
list svgpathseg
list pathseg
list normative document svg 1.1 (2nd edition) properties this interface also inherits properties from its parent, svgpathelement. ...
...ist pathseg
list normative document svg 1.1 (2nd edition) properties this interface also inherits properties from its parent, svgpathelement. name type description animatednormalizedpathseg
list svgpathseg
list provides access to the current animated contents of the 'd' attribute in a form where all path data commands are expressed in terms of the following subset of svgpathseg types: svg_pathseg_moveto_abs (m), svg_pathseg_lineto_abs (l), svg_pathseg_curveto_cubic_abs (c) and svg_pathseg_closepath (z). ...
...normalizedpathseg
list svgpathseg
list provides access to the current animated contents of the 'd' attribute in a form where all path data commands are expressed in terms of the following subset of svgpathseg types: svg_pathseg_moveto_abs (m), svg_pathseg_lineto_abs (l), svg_pathseg_curveto_cubic_abs (c) and svg_pathseg_closepath (z). animatedpathseg
list svgpathseg
list provides access to the current animated contents of the 'd' attribute in a form which matches one-for-one with svg's syntax. if the given attribute or property is being animated, contains the current animated value of the attribute or property, and both the object itself and its contents are read only. ...
...And 2 more matches
Using the Screen Capture API - Web APIs
straints are applied in any way until after the content to capture has been selected. the contraints alter what you see in the resulting stream. for example, if you specify a width constraint for the video, it's applied by scaling the video after the user selects the area to share. it doesn't establish a restriction on the size of the source itself. note: constraints never cause changes to the
list of sources available for capture by the screen sharing api. this ensures that web applications can't force the user to share specific content by restricting the source
list until only one item is left. while display capture is in effect, the machine which is sharing screen contents will display some form of indicator so the user is aware that sharing is taking place. note: for privacy and sec...
...capture of screen imagery. the object displaymediaoptions contains the mediastreamconstraints to pass into getdisplaymedia(); here, the cursor property is set to always, indicating that the mouse cursor should always be included in the captured media. note: some properties are not widely implemented and might not be used by the engine. cursor, for example, has limited support. finally, event
listeners are established to detect user clicks on the start and stop buttons. const videoelem = document.getelementbyid("video"); const logelem = document.getelementbyid("log"); const startelem = document.getelementbyid("start"); const stopelem = document.getelementbyid("stop"); // options for getdisplaymedia() var displaymediaoptions = { video: { cursor: "always" }, audio: false }; // ...
...established to detect user clicks on the start and stop buttons. const videoelem = document.getelementbyid("video"); const logelem = document.getelementbyid("log"); const startelem = document.getelementbyid("start"); const stopelem = document.getelementbyid("stop"); // options for getdisplaymedia() var displaymediaoptions = { video: { cursor: "always" }, audio: false }; // set event
listeners for the start and stop buttons startelem.addevent
listener("click", function(evt) { startcapture(); }, false); stopelem.addevent
listener("click", function(evt) { stopcapture(); }, false); logging content to make logging of errors and other issues easy, this example overrides certain console methods to output their messages to the <pre> block whose id is log. console.log = msg => logel...
...And 2 more matches
SpeechRecognition.grammars - Web APIs
the grammars property of the speechrecognition interface returns and sets a collection of speechgrammar objects that represent the grammars that will be understood by the current speechrecognition. syntax var mygrammars = myspeechrecognition.grammars; myspeechrecognition.grammars = myspeechgrammar
list; value a speechgrammar
list containing the speechgrammar objects that represent your grammar for your app. examples this code is excerpted from our speech color changer example. var grammar = '#jsgf v1.0; grammar colors; public <color> = aqua | azure | beige | bisque | black | blue | brown | chocolate | coral | crimson | cyan | fuchsia | ghostwhite | gold | goldenrod | gray | green | indigo | ivory | khaki | lavender | lime | linen | magenta | maroon | moccasin | navy | olive | ...
... specifications specification status comment web speech apithe definition of 'grammars' in that specification. dr...
... specifications specification status comment web speech apithe definition of 'grammars' in that specification. draft ...
...And 2 more matches
SpeechSynthesis.onvoiceschanged - Web APIs
the onvoiceschanged property of the speechsynthesis interface represents an event handler that will run when the
list of speechsynthesisvoice objects that would be returned by the speechsynthesis.getvoices() method has changed (when the voiceschanged event fires.) this may occur when speech synthesis is being done on the server-side and the voices
list is being determined asynchronously, or when client-side voices are installed/uninstalled while a speech synthesis application is running. syntax speechsynthesisinstance.onvoiceschanged = function() { ... ...
...thod has changed (when the voiceschanged event fires.) this may occur when speech synthesis is being done on the server-side and the voices
list is being determined asynchronously, or when client-side voices are installed/uninstalled while a speech synthesis application is running. syntax speechsynthesisinstance.onvoiceschanged = function() { ... }; examples this could be used to populate a
list of voices that the user can choose between when the event fires (see our speak easy synthesis demo.) note that firefox doesn't support it at present, and will just return a
list of voices when speechsynthesis.getvoices() is fired. with chrome however, you have to wait for the event to fire before populating the
list, hence the bottom if statement seen below. var voices = []; function populatevo...
... voices that the user can choose between when the event fires (see our speak easy synthesis demo.) note that firefox doesn't support it at present, and will just return a
list of voices when speechsynthesis.getvoices() is fired. with chrome however, you have to wait for the event to fire before populating the
list, hence the bottom if statement seen below. ...
...And 2 more matches
SpeechSynthesis - Web APIs
n utterances. speechsynthesis.speaking read only a boolean that returns true if an utterance is currently in the process of being spoken — even if speechsynthesis is in a paused state. methods speechsynthesis also inherits methods from its parent interface, eventtarget. speechsynthesis.cancel() removes all utterances from the utterance queue. speechsynthesis.getvoices() returns a
list of speechsynthesisvoice objects representing all the available voices on the current device. speechsynthesis.pause() puts the speechsynthesis object into a paused state. speechsynthesis.resume() puts the speechsynthesis object into a non-paused state: resumes it if it was already paused. speechsynthesis.speak() adds an utterance to the utterance queue; it will be spoken when any other utter...
...he available voices on the current device. speechsynthesis.pause() puts the speechsynthesis object into a paused state. speechsynthesis.resume() puts the speechsynthesis object into a non-paused state: resumes it if it was already paused. speechsynthesis.speak() adds an utterance to the utterance queue; it will be spoken when any other utterances queued before it have been spoken. events
listen to this event using addevent
listener() or by assigning an event
listener to the oneventname property of this interface. voiceschanged fired when the
list of speechsynthesisvoice objects that would be returned by the speechsynthesis.getvoices() method has changed. also available via the onvoiceschanged property. examples first, a simple example: let utterance = new speechsynthesisuttera...
...lable via the onvoiceschanged property. examples first, a simple example: let utterance = new speechsynthesisutterance("hello world!"); speechsynthesis.speak(utterance); now we'll look at a more fully-fledged example. in our speech synthesiser demo, we first grab a reference to the speechsynthesis controller using window.speechsynthesis. after defining some necessary variables, we retrieve a
list of the voices available using speechsynthesis.getvoices() and populate a select menu with them so the user can choose what voice they want. inside the inputform.onsubmit handler, we stop the form submitting with preventdefault(), create a new speechsynthesisutterance instance containing the text from the text <input>, set the utterance's voice to the voice selected in the <select> element, and ...
...And 2 more matches
TextTrack.mode - Web APIs
change this value to switch modes. safari additionally requires the default boolean attribute to be set to true when implementing your own video player controls in order for the subtitles cues to be shown. syntax var mode = texttrack.mode; texttrack.mode = "disabled" | "hidden" | "showing"; value a domstring which indicates the track's current mode. the text track mode is one of the values
listed below, under text track mode constants. text track mode constants the text track mode—sometimes identified using the idl enum texttrackmode—must be one of the following values: disabled the text track is currently disabled. while the track's presence is exposed in the dom, the user agent is otherwise ignoring it. no cues are active, no events are being fired, and the user agent won't ...
...e track's cues. this is the default value, unless the text track has the default boolean attribute is specified, in which case the default is showing. hidden the text track is currently active but the cues aren't being displayed. if the user agent hasn't tried to obtain the track's cues yet, it will do so soon (thereby populating the track's texttrack.cues property). ...
...r agent hasn't tried to obtain the track's cues yet, it will do so soon (thereby populating the track's texttrack.cues property). the user agent is keeping a
list of the active cues (in the track's activecues property) and events are being fired at the corresponding times, even though the text isn't being displayed. showing the text track is currently enabled and is visible. if the track's cues
list hasn't been obtained yet, it will be soon. the activecues
list is being maintained and events are firing at the appropriate times; the track's text is also being drawn appropriately based on the styling and the track's kind. this is the default value if the text track's default boolean attribute is specified. usage notes the default mode is disabled, unless the default boolean attribute is spe...
...And 2 more matches
WakeLockSentinel - Web APIs
cking the screen. event handlers onrelease fired when the release() method is called or the wake lock is released by the user agent. methods release() releases the wakelocksentinel, returning a promise that is resolved once the sentinel has been successfully released. examples in this example we create an asynchronous function which requests a wakelocksentinel. ...
...l. once acquired we
listen for the onrelease event which can be used to give appropriate ui feedback. the sentinel can be acquired or released via appropriate interactions. ...
... which can be used to give appropriate ui feedback. the sentinel can be acquired or released via appropriate interactions. ...
...And 2 more matches
A simple RTCDataChannel sample - Web APIs
the parts of the code that do the heavy lifting. the webrtc api makes heavy use of promises. they make it very easy to chain the steps of the connection process together; if you haven't already read up on this functionality of ecmascript 2015, you should read up on them. similarly, this example uses arrow functions to simplify syntax. starting up when the script is run, we set up an load event
listener, so that once the page is fully loaded, our startup() function is called. function startup() { connectbutton = document.getelementbyid('connectbutton'); disconnectbutton = document.getelementbyid('disconnectbutton'); sendbutton = document.getelementbyid('sendbutton'); messageinputbox = document.getelementbyid('message'); receivebox = document.getelementbyid('receivebox'); // set...
...o that once the page is fully loaded, our startup() function is called. function startup() { connectbutton = document.getelementbyid('connectbutton'); disconnectbutton = document.getelementbyid('disconnectbutton'); sendbutton = document.getelementbyid('sendbutton'); messageinputbox = document.getelementbyid('message'); receivebox = document.getelementbyid('receivebox'); // set event
listeners for user interface widgets connectbutton.addevent
listener('click', connectpeers, false); disconnectbutton.addevent
listener('click', disconnectpeers, false); sendbutton.addevent
listener('click', sendmessage, false); } this is quite straightforward. we grab references to all the page elements we'll need to access, then set event
listeners on the three buttons. establishing a connectio...
...nnel = localconnection.createdatachannel("sendchannel"); sendchannel.onopen = handlesendchannelstatuschange; sendchannel.onclose = handlesendchannelstatuschange; the first step is to create the "local" end of the connection. this is the peer that will send out the connection request. the next step is to create the rtcdatachannel by calling rtcpeerconnection.createdatachannel() and set up event
listeners to monitor the channel so that we know when it's opened and closed (that is, when the channel is connected or disconnected within that peer connection). it's important to keep in mind that each end of the channel has its own rtcdatachannel object. set up the remote peer remoteconnection = new rtcpeerconnection(); remoteconnection.ondatachannel = receivechannelcallback; the remote end is ...
...And 2 more matches
Taking still photos with WebRTC - Web APIs
the <canvas> element after the page is done loading. photo this will be a reference to the <img> element after the page is done loading. startbutton this will be a reference to the <button> element that's used to trigger capture. we'll get that after the page is done loading. the startup() function the startup() function is run when the page has finished loading, courtesy of window.addevent
listener(). this function's job is to request access to the user's webcam, initialize the output <img> to a default state, and to establish the event
listeners needed to receive each frame of video from the camera and react when the button is clicked to capture an image. getting element references first, we grab references to the major elements we need to be able to access. function startup() { ...
...e callbacks to. the success callback receives a stream object as input. it is the <video> element's source to our new stream. once the stream is linked to the <video> element, we start it playing by calling htmlmediaelement.play(). the error callback is called if opening the stream doesn't work. this will happen for example if there's no compatible camera connected, or the user denied access.
listen for the video to start playing after calling htmlmediaelement.play() on the <video>, there's a (hopefully brief) period of time that elapses before the stream of video begins to flow. to avoid blocking until that happens, we add an event
listener to video for the canplay event, which is delivered when the video playback actually begins. at that point, all the properties in the video object hav...
...lay() on the <video>, there's a (hopefully brief) period of time that elapses before the stream of video begins to flow. to avoid blocking until that happens, we add an event
listener to video for the canplay event, which is delivered when the video playback actually begins. at that point, all the properties in the video object have been configured based on the stream's format. ...
...And 2 more matches
Writing WebSocket servers - Web APIs
the task of creating a custom server tends to scare people; however, it can be straightforward to implement a simple websocket server on your platform of choice. a websocket server can be written in any server-side programming language that is capable of berkeley sockets, such as c(++), python, php, or server-side javascript. this is not a tutorial in any specific language, but serves as a guide to facilitate writing your own server. this article assumes you're already familiar with how http works, and that you have a moderate level of programming experience. ...
...pecialized servers (for load-balancing or other practical reasons), so you will often use a reverse proxy (such as a regular http server) to detect websocket handshakes, pre-process them, and send those clients to a real websocket server. this means that you don't have to bloat your server code with cookie and authentication handlers (for example). ...
...m, and send those clients to a real websocket server. this means that you don't have to bloat your server code with cookie and authentication handlers (for example). the websocket handshake first, the server must
listen for incoming socket connections using a standard tcp socket. depending on your platform, this may be handled for you automatically. for example, let's assume that your server is
listening on example.com, port 8000, and your socket server responds to get requests at example.com/chat. warning: the server may
listen on any port it chooses, but if it chooses any port other than 80 or 443, it may have problems with firewalls and/or proxies. browsers generally require a secure connection for websockets, although they may offer an exception for local devices. the handshake is th...
...And 2 more matches
Using the Web Audio API - Web APIs
to allow the user to control it. depending on the use case, there's a myriad of options, but we'll provide functionality to play/pause the sound, alter the track's volume, and pan it from left to right. controlling sound programmatically from javascript code is covered by browsers' autoplay support policies, as such is likely to be blocked without permission being granted by the user (or a white
list). autoplay policies typically require either explicit permission or a user engagement with the page before scripts can trigger audio to play. these special requirements are in place essentially because unexpected sounds can be annoying and intrusive, and can cause accessibility problems. you can learn more about this in our article autoplay guide for media and web audio apis. since our scripts ...
...seaudiocontext.destination, which handles the situation for you: track.connect(audiocontext.destination); a good way to visualise these nodes is by drawing an audio graph so you can visualize it. this is what our current audio graph looks like: now we can add the play and pause functionality. ...
...is.dataset.playing === 'false') { audioelement.play(); this.dataset.playing = 'true'; } else if (this.dataset.playing === 'true') { audioelement.pause(); this.dataset.playing = 'false'; } }, false); we also need to take into account what to do when the track finishes playing. our htmlmediaelement fires an ended event once it's finished playing, so we can
listen for that and run code accordingly: audioelement.addevent
listener('ended', () => { playbutton.dataset.playing = 'false'; }, false); modifying sound let's delve into some basic modification nodes, to change the sound that we have. this is where the web audio api really starts to come in handy. first of all, let's change the volume. this can be done using a gainnode, which represents how b...
...And 2 more matches
Window.matchMedia() - Web APIs
use this object's properties and events to detect matches and to monitor for changes to those matches over time. ...
...use this object's properties and events to detect matches and to monitor for changes to those matches over time. ...
...use this object's properties and events to detect matches and to monitor for changes to those matches over time. usage notes you can use the returned media query to perform both instantanteous and event-driven checks to see if the document matches the media query. ...
...And 2 more matches
Window - Web APIs
a staticrange object. worker used for creating a web worker. xmlserializer converts a dom tree into xml or html source. properties this interface inherits properties from the eventtarget interface and implements properties from the windoworworkerglobalscope and windoweventhandlers mixins. note that properties which are objects (e.g.,. for overriding the prototype of built-in elements) are
listed in a separate section below. window.closed read only this property indicates whether the current window is closed or not. window.console read only returns a reference to the console object which provides access to the browser's debugging console. window.controllers read only returns the xul controller objects for the current chrome window. window.customelements read only returns...
...etcomputedstyle() gets computed style for the specified element. computed style indicates the computed values of all css properties of the element. window.getdefaultcomputedstyle() gets default computed style for the specified element, ignoring author stylesheets. window.getselection() returns the selection object representing the selected item(s). window.matchmedia() returns a mediaquery
list object representing the specified media query string. window.maximize() fixme: needscontents window.minimize() (top-level xul windows only) minimizes the window. window.moveby() moves the current window by a specified amount. window.moveto() moves the window to the specified coordinates. window.open() opens a new window. window.postmessage() provides a secure means for one window to s...
...nction after the browser has finished other heavy tasks window.setresizable() toggles a user's ability to resize a window. window.sizetocontent() sizes the window according to its content. window.stop() this method stops window loading. window.updatecommands() updates the state of commands of the current chrome window (ui). methods implemented from elsewhere eventtarget.addevent
listener() register an event handler to a specific event type on the window. eventtarget.dispatchevent() used to trigger an event. windoworworkerglobalscope.atob() decodes a string of data which has been encoded using base-64 encoding. windoworworkerglobalscope.btoa() creates a base-64 encoded ascii string from a string of binary data. windoworworkerglobalscope.clearinterval() cancels the rep...
...And 2 more matches
XRInputSourceArray - Web APIs
methods the following methods are available on xrinputsourcearray objects. ...
... methods the following methods are available on xrinputsourcearray objects. ...
...tem. in addition to being able to access the input sources in the
list using standard array notation (that is, with index numbers insize square brackets), methods are available to allow the use of iterators and the foreach() method is also available. properties the following properties are available on xrinputsourcearray objects. length read only the number of xrinputsource objects in the
list. methods the following methods are available on xrinputsourcearray objects. you may also use the features of the symbol type. entries() returns an iterator you can use to walk the
list of key/value pairs in the
list. ...
...And 2 more matches
Using the link role - Accessibility
sible effects on user agents and assistive technology when the link role is added to an element, or such an element becomes visible, the user agent should do the following: expose the element as having a link role in the operating system's accessibility api. fire an accessible link event using the operating system's accessibility api if it supports it. ...
... screen magnifiers may enlarge links. ...
... screen magnifiers may enlarge links. note: opinons may differ on how assistive technology should handle this technique. the information provided above is one of those opinions and therefore not normative. ...
...And 2 more matches
ARIA: textbox role - Accessibility
it's value the id of is either a descendant of the element with dom focus or is a logical descendant as indicated by the aria-owns attribute, it indicates when that element has focus, when it is part of a composite widget such as a combobox. ...
...tbox element refers to a descendant of a popup
listbox that is controlled by the textbox.this attribute must be updated programmatically as the focus changes. aria-autocomplete attribute indicates whether and how the user's input into the field could trigger display of a prediction of the intended value. it supports the following values: inline: predicted text is inserted after the caret.
list: predicted text is presented as a collection of values. both: predicted text is presented as a collection of values, with the text needed to complete one value inserted after the caret. none (default): predicted text is not offered. if
list or both is set, the aria-controls and aria-haspopup attributes should also be included. the value of aria-controls is the id of the element that conta...
...ted text is presented as a collection of values. both: predicted text is presented as a collection of values, with the text needed to complete one value inserted after the caret. none (default): predicted text is not offered. if
list or both is set, the aria-controls and aria-haspopup attributes should also be included. the value of aria-controls is the id of the element that contains the
list of suggested values. additionally, either the textbox or a containing element with role combobox has a value for aria-haspopup that matches the role of the element that contains the
list of suggested values. aria-multiline attribute if aria-multiline="true" is set, the at informs the user that the textbox supports multi-line input, with the expectation that enter or return will create a line...
...And 2 more matches
additive-symbols - CSS: Cascading Style Sheets
ge-src> = <url> | <string><color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color><image-set-option> = [ <image> | <string> ] <resolution><id-selector> = <hash-token><cf-mixing-image> = <percentage>? && <image><cf-final-image> = <image> | <color><linear-gradient()> = linear-gradient( [ <angle> | to <side-or-corner> ]? ...
...color | <deprecated-system-color><image-set-option> = [ <image> | <string> ] <resolution><id-selector> = <hash-token><cf-mixing-image> = <percentage>? && <image><cf-final-image> = <image> | <color><linear-gradient()> = linear-gradient( [ <angle> | to <side-or-corner> ]? , <color-stop-
list> )<repeating-linear-gradient()> = repeating-linear-gradient( [ <angle> | to <side-or-corner> ]? , <color-stop-
list> )<radial-gradient()> = radial-gradient( [ <ending-shape> | <size> ]? [ at <position> ]? , <color-stop-
list> )<repeating-radial-gradient()> = repeating-radial-gradient( [ <ending-shape> | <size> ]? [ at <position> ]? , <color-stop-
list> )<conic-gradient()> = conic-gradient( [ from <angle> ]? [ at <position> ]?, <angular-color-stop-
list> )where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]? )...
...<percentage>#{3} , <alpha-value>? ) | rgba( <number>#{3} , <alpha-value>? )<hsl()> = hsl( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsl( <hue>, <percentage>, <percentage>, <alpha-value>? )<hsla()> = hsla( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsla( <hue>, <percentage>, <percentage>, <alpha-value>? )<side-or-corner> = [ left | right ] | [ top | bottom ]<color-stop-
list> = [ <linear-color-stop> [, <linear-color-hint>]? ]# , <linear-color-stop><ending-shape> = circle | ellipse<size> = closest-side | farthest-side | closest-corner | farthest-corner | <length> | <length-percentage>{2}<position> = [ [ left | center | right ] | [ top | center | bottom ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ]? | [ [ left | rig...
...And 2 more matches
fallback - CSS: Cascading Style Sheets
ion, then its fallback style will be used. if a valid fallback style is not specified, it defaults to decimal. a couple of scenarios where a fallback style will be used are: when the range descriptor is specified for a counter style, the fallback style will be used to represent values that fall outside the range. ...
...tyle is not specified, it defaults to decimal. a couple of scenarios where a fallback style will be used are: when the range descriptor is specified for a counter style, the fallback style will be used to represent values that fall outside the range. when the fixed system is used and there are not enough symbols to cover all the
list items, the fallback style will be used for the rest of the
list items. ...
... when the fixed system is used and there are not enough symbols to cover all the
list items, the fallback style will be used for the rest of the
list items. ...
...And 2 more matches
negative - CSS: Cascading Style Sheets
ge-src> = <url> | <string><color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color><image-set-option> = [ <image> | <string> ] <resolution><id-selector> = <hash-token><cf-mixing-image> = <percentage>? && <image><cf-final-image> = <image> | <color><linear-gradient()> = linear-gradient( [ <angle> | to <side-or-corner> ]? ...
...color | <deprecated-system-color><image-set-option> = [ <image> | <string> ] <resolution><id-selector> = <hash-token><cf-mixing-image> = <percentage>? && <image><cf-final-image> = <image> | <color><linear-gradient()> = linear-gradient( [ <angle> | to <side-or-corner> ]? , <color-stop-
list> )<repeating-linear-gradient()> = repeating-linear-gradient( [ <angle> | to <side-or-corner> ]? , <color-stop-
list> )<radial-gradient()> = radial-gradient( [ <ending-shape> | <size> ]? [ at <position> ]? , <color-stop-
list> )<repeating-radial-gradient()> = repeating-radial-gradient( [ <ending-shape> | <size> ]? [ at <position> ]? , <color-stop-
list> )<conic-gradient()> = conic-gradient( [ from <angle> ]? [ at <position> ]?, <angular-color-stop-
list> )where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]? )...
...<percentage>#{3} , <alpha-value>? ) | rgba( <number>#{3} , <alpha-value>? )<hsl()> = hsl( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsl( <hue>, <percentage>, <percentage>, <alpha-value>? )<hsla()> = hsla( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsla( <hue>, <percentage>, <percentage>, <alpha-value>? )<side-or-corner> = [ left | right ] | [ top | bottom ]<color-stop-
list> = [ <linear-color-stop> [, <linear-color-hint>]? ]# , <linear-color-stop><ending-shape> = circle | ellipse<size> = closest-side | farthest-side | closest-corner | farthest-corner | <length> | <length-percentage>{2}<position> = [ [ left | center | right ] | [ top | center | bottom ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ]? | [ [ left | rig...
...And 2 more matches
prefix - CSS: Cascading Style Sheets
ge-src> = <url> | <string><color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color><image-set-option> = [ <image> | <string> ] <resolution><id-selector> = <hash-token><cf-mixing-image> = <percentage>? && <image><cf-final-image> = <image> | <color><linear-gradient()> = linear-gradient( [ <angle> | to <side-or-corner> ]? ...
...color | <deprecated-system-color><image-set-option> = [ <image> | <string> ] <resolution><id-selector> = <hash-token><cf-mixing-image> = <percentage>? && <image><cf-final-image> = <image> | <color><linear-gradient()> = linear-gradient( [ <angle> | to <side-or-corner> ]? , <color-stop-
list> )<repeating-linear-gradient()> = repeating-linear-gradient( [ <angle> | to <side-or-corner> ]? , <color-stop-
list> )<radial-gradient()> = radial-gradient( [ <ending-shape> | <size> ]? [ at <position> ]? , <color-stop-
list> )<repeating-radial-gradient()> = repeating-radial-gradient( [ <ending-shape> | <size> ]? [ at <position> ]? , <color-stop-
list> )<conic-gradient()> = conic-gradient( [ from <angle> ]? [ at <position> ]?, <angular-color-stop-
list> )where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]? )...
...<percentage>#{3} , <alpha-value>? ) | rgba( <number>#{3} , <alpha-value>? )<hsl()> = hsl( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsl( <hue>, <percentage>, <percentage>, <alpha-value>? )<hsla()> = hsla( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsla( <hue>, <percentage>, <percentage>, <alpha-value>? )<side-or-corner> = [ left | right ] | [ top | bottom ]<color-stop-
list> = [ <linear-color-stop> [, <linear-color-hint>]? ]# , <linear-color-stop><ending-shape> = circle | ellipse<size> = closest-side | farthest-side | closest-corner | farthest-corner | <length> | <length-percentage>{2}<position> = [ [ left | center | right ] | [ top | center | bottom ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ]? | [ [ left | rig...
...And 2 more matches
suffix - CSS: Cascading Style Sheets
ge-src> = <url> | <string><color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color><image-set-option> = [ <image> | <string> ] <resolution><id-selector> = <hash-token><cf-mixing-image> = <percentage>? && <image><cf-final-image> = <image> | <color><linear-gradient()> = linear-gradient( [ <angle> | to <side-or-corner> ]? ...
...color | <deprecated-system-color><image-set-option> = [ <image> | <string> ] <resolution><id-selector> = <hash-token><cf-mixing-image> = <percentage>? && <image><cf-final-image> = <image> | <color><linear-gradient()> = linear-gradient( [ <angle> | to <side-or-corner> ]? , <color-stop-
list> )<repeating-linear-gradient()> = repeating-linear-gradient( [ <angle> | to <side-or-corner> ]? , <color-stop-
list> )<radial-gradient()> = radial-gradient( [ <ending-shape> | <size> ]? [ at <position> ]? , <color-stop-
list> )<repeating-radial-gradient()> = repeating-radial-gradient( [ <ending-shape> | <size> ]? [ at <position> ]? , <color-stop-
list> )<conic-gradient()> = conic-gradient( [ from <angle> ]? [ at <position> ]?, <angular-color-stop-
list> )where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]? )...
...<percentage>#{3} , <alpha-value>? ) | rgba( <number>#{3} , <alpha-value>? )<hsl()> = hsl( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsl( <hue>, <percentage>, <percentage>, <alpha-value>? )<hsla()> = hsla( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsla( <hue>, <percentage>, <percentage>, <alpha-value>? )<side-or-corner> = [ left | right ] | [ top | bottom ]<color-stop-
list> = [ <linear-color-stop> [, <linear-color-hint>]? ]# , <linear-color-stop><ending-shape> = circle | ellipse<size> = closest-side | farthest-side | closest-corner | farthest-corner | <length> | <length-percentage>{2}<position> = [ [ left | center | right ] | [ top | center | bottom ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ]? | [ [ left | rig...
...And 2 more matches
CSS values and units - CSS: Cascading Style Sheets
most of these data types. refer to the page for each value type for more detailed information. textual data types <custom-ident> pre-defined keywords as an <ident> <string> <url> text data types are either <string>, a quoted series of characters, or an <ident>, a "css identifier" which is an unquoted string. a <string> must be quoted with either single or double quotes. ...
...string>, a quoted series of characters, or an <ident>, a "css identifier" which is an unquoted string. a <string> must be quoted with either single or double quotes. css identifiers,
listed in the specifications as <ident> or <custom-ident>, must be unquoted. in the css specifications, values that can be defined by the web developer, like keyframe animations, font-family names, or grid areas are
listed as a <custom-ident>, <string>, or both. ...
...ingle or double quotes. css identifiers,
listed in the specifications as <ident> or <custom-ident>, must be unquoted. in the css specifications, values that can be defined by the web developer, like keyframe animations, font-family names, or grid areas are
listed as a <custom-ident>, <string>, or both. when both quoted and unquoted user defined text values are permitted, the specification will
list <custom-ident> | <string>, meaning quotes are optional, such as is the case with animation names: @keyframe validident { /* keyframes go here */ } @keyframe 'validstring' { /* keyframes go here */ } some text values are not valid if encompassed in quotes. for example, the value of grid-area can be a <custom-ident>, so if we had a grid area named content we would use it without quotes: .ite...
...And 2 more matches
backdrop-filter - CSS: Cascading Style Sheets
20deg); backdrop-filter: invert(70%); backdrop-filter: opacity(20%); backdrop-filter: sepia(90%); backdrop-filter: saturate(80%); /* multiple filters */ backdrop-filter: url(filters.svg#filter) blur(4px) saturate(150%); /* global values */ backdrop-filter: inherit; backdrop-filter: initial; backdrop-filter: unset; syntax values none no filter is applied to the backdrop. ...
...invert(70%); backdrop-filter: opacity(20%); backdrop-filter: sepia(90%); backdrop-filter: saturate(80%); /* multiple filters */ backdrop-filter: url(filters.svg#filter) blur(4px) saturate(150%); /* global values */ backdrop-filter: inherit; backdrop-filter: initial; backdrop-filter: unset; syntax values none no filter is applied to the backdrop. ...
...ues none no filter is applied to the backdrop. <filter-function-
list> a space-separated
list of <filter-function>s or an svg filter that will be applied to the backdrop. ...
...And 2 more matches
<color> - CSS: Cascading Style Sheets
rdinate system (via the #-hexadecimal or the rgb() and rgba() functional notations) using the hsl cylindrical-coordinate system (via the hsl() and hsla() functional notations) note: this article describes the <color> data type in detail. to learn more about using color in html, see applying color to html elements using css. syntax the <color> data type is specified using one of the options
listed below. note: although <color> values are precisely defined, their actual appearance may vary (sometimes significantly) from device to device. this is because most devices are not calibrated, and some browsers do not support output devices' color profiles. color keywords color keywords are case-insensitive identifiers that represent a specific color, such as red, blue, black, or lightseagre...
...agenta darkgray / darkgrey darkslategray / darkslategrey dimgray / dimgrey lightgray / lightgrey lightslategray / lightslategrey gray / grey slategray / slategrey though many keywords have been adapted from x11, their rgb values may differ from the corresponding color on x11 systems since manufacturers sometimes tailor x11 colors to their specific hardware. ...
...they are called the extended color keywords, the x11 colors, or the svg colors. css colors level 4 added the rebeccapurple keyword to honor web pioneer eric meyer. ...
...And 2 more matches
counter() - CSS: Cascading Style Sheets
edefined counter style, or other predefined counter style. ...
...ed counter style. ...
...faults to decimal formal syntax counter( <custom-ident>, <counter-style>? ...
...And 2 more matches
font-variant-alternates - CSS: Cascading Style Sheets
the font-variant-alternates css property controls the usage of alternate glyphs. these alternate glyphs may be referenced by alternative names defined in @font-feature-values. ...
... values ...
...an define names for alternative glyph functions (sty
listic, styleset, character-variant, swash, ornament or annotation), associating the name with opentype parameters. this property allows those human-readable names (defined in @font-feature-values) in the stylesheet. 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. values normal this keyword deactivates alternate glyphs. historical-forms this keyword enables historical forms — glyphs that were common in the past but not today. it corresponds to the opentype value hist. sty
listic() this function enables sty
listic alternates for individual characters. the parameter is a font-specific name mapped to a number.
...And 2 more matches
shape-outside - CSS: Cascading Style Sheets
the float area determines the shape around which inline content (float elements) wrap. values none the float area is unaffected. inline content wraps around the element's margin box, like usual. <shape-box> the float area is computed according to the shape of a float element's edges (as defined by the css box model). this can be margin...
...et the referrer source to the stylesheet's url, and set the origin to the url of the containing document. if this results in network errors such that there is no valid fallback image, the effect is as if the value none had been specified. interpolation when animating between one <basic-shape> and a second, the rules below are applied. the values in the shape functions interpolate as a simple
list. the
list values interpolate as <length>, <percentage>, or calc() where possible. if
list values are not one of those types but are identical (such as finding nonzero in the same
list position in both
lists), those values do interpolate. both shapes must use the same reference box. if both shapes are the same type, that type is ellipse() or circle(), and none of the radii use the closest-side...
...ge-src> = <url> | <string><color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color><image-set-option> = [ <image> | <string> ] <resolution><id-selector> = <hash-token><cf-mixing-image> = <percentage>? && <image><cf-final-image> = <image> | <color><linear-gradient()> = linear-gradient( [ <angle> | to <side-or-corner> ]? ...
...And 2 more matches
word-break - CSS: Cascading Style Sheets
ive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* keyword values */ word-break: normal; word-break: break-all; word-break: keep-all; word-break: break-word; /* deprecated */ /* global values */ word-break: inherit; word-break: initial; word-break: unset; the word-break property is specified as a single keyword chosen from the
list of values below. values normal use the default line break rule. break-all to prevent overflow, word breaks should be inserted between any two characters (excluding chinese/japanese/korean text). keep-all word breaks should not be used for chinese/japanese/korean (cjk) text. non-cjk text behavior is the same as for normal. break-word has the same effect as word-break: normal and overf...
...f putting an entire word on its own line would negate the need for a break). formal definition initial valuenormalapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax normal | break-all | keep-all | break-word examples html <p>1. ...
...is a long and honorificabilitudinitatibus califragi
listicexpialidocious taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu ć°ć¬ć¼ćććŖćć³ććć³åć¢ć¤ć«ć©ć³ćé£åēå½ćØććčØčćÆę¬å½ć«é·ćčØč</p> <p>2. <code>word-break: break-all</code></p> <p class="breakall narrow">this is a long and honorificabilitudinitatibus califragi
listicexpialidocious taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu ć°ć¬ć¼ćććŖćć³ććć³åć¢ć¤ć«ć©ć³ćé£åēå½ćØććčØčćÆę¬å½ć«é·ćčØč</p> <p>3. ...
...And 2 more matches
Getting Started - Developer guides
d compatibility code, no longer needed. if (window.xmlhttprequest) { // mozilla, safari, ie7+ ... httprequest = new xmlhttprequest(); } else if (window.activexobject) { // ie 6 and older httprequest = new activexobject("microsoft.xmlhttp"); } note: for illustration purposes, the above is a somewhat simplified version of the code to be used for creating an xmlhttp instance. for a more rea
listic example, see step 3 of this article. after making a request, you will receive a response back. at this stage, you need to tell the xmlhttp request object which javascript function will handle the response, by setting the onreadystatechange property of the object and naming it after the function to call when the request changes state, like this: httprequest.onreadystatechange = nameofthefuncti...
...this function do? first, the function needs to check the request's state. if the state has the value of xmlhttprequest.done (corresponding to 4), that means that the full server response was received and it's ok for you to continue processing it. if (httprequest.readystate === xmlhttprequest.done) { // everything is good, the response was received. } else { // not ready yet. } the full
list of the readystate values is documented at xmlhttprequest.readystate and is as follows: 0 (uninitialized) or (request not initialized) 1 (loading) or (server connection established) 2 (loaded) or (request received) 3 (interactive) or (processing request) 4 (complete) or (request finished and response is ready) next, check the http response status codes of the http response. the possible c...
...eadystate values is documented at xmlhttprequest.readystate and is as follows: 0 (uninitialized) or (request not initialized) 1 (loading) or (server connection established) 2 (loaded) or (request received) 3 (interactive) or (processing request) 4 (complete) or (request finished and response is ready) next, check the http response status codes of the http response. the possible codes are
listed at the w3c. in the following example, we differentiate between a successful and unsuccessful ajax call by checking for a 200 ok response code. if (httprequest.status === 200) { // perfect! } else { // there was a problem with the request. // for example, the response may have a 404 (not found) // or 500 (internal server error) response code. } after checking the state of the ...
...And 2 more matches
DOM onevent handlers - Developer guides
this page focuses on how the latter work. registering onevent handlers the onevent handlers are properties on certain dom elements to manage how that element reacts to events. elements can be interactive (links, buttons, images, forms, and so forth) or non-interactive (such as the base <body> element). events are actions like: being clicked detecting pressed keys getting focus the onevent handler is usually named with the event it reacts to, like onclick, onkeypress, onfocus, etc. ...
... <button onclick="handleclick()">, or by setting the corresponding property from javascript: document.queryselector("button").onclick = function(event) { … }. an onevent event handler property serves as a placeholder of sorts, to which a single event handler can be assigned. in order to allow multiple handlers to be installed for the same event on a given object, you can call its addevent
listener() method, which manages a
list of handlers for the given event on the object. a handler can then be removed from the object by calling its removeevent
listener() function. when an event occurs that applies to an element, each of its event handlers is called to allow them to handle the event, one after another. you don't need to call them yourself, although you can do so in many cases to easil...
...s set to the dom element on which the handler is registered. for more details, see the this keyword documentation. the return value from the handler determines if the event is canceled. the specific handling of the return value depends on the kind of event; for details, see "the event handler processing algorithm" in the html specification. ...
...And 2 more matches
User input and controls - Developer guides
y use keyboard to navigate web sites and apps, and locking them out of your functionality is a bad idea. the following is a set of recommendations and best practices for using such tools in open web apps. decide what input mechanism you’re using keyboard keyboard input can be controlled by your app. for example if you want to add controls when any key gets pressed, you need to add an event
listener on the window object: window.addevent
listener("keydown", handlekeydown, true); window.addevent
listener("keyup", handlekeyup, true); where handlekeydown and handlekeyup are the functions implementing the controls about the keydown and keyup events. note: have a look at the events reference and keyboardevent guide to find out more about keyboard events. mouse the events occurring when th...
... the functions implementing the controls about the keydown and keyup events. note: have a look at the events reference and keyboardevent guide to find out more about keyboard events. mouse the events occurring when the user interacts with a pointing device such as a mouse are represented by the mouseevent dom interface. common mouse events include click, dblclick, mouseup, and mousedown. the
list of all events using the mouse event interface is provided in the events reference. when the input device is a mouse, you can also control user input through the pointer lock api and implement drag & drop (see below). finger touch when developing web applications meant to be installed on touchscreen devices, it’s a good practice to take into consideration the different capabilities in terms o...
... (see below). finger touch when developing web applications meant to be installed on touchscreen devices, it’s a good practice to take into consideration the different capabilities in terms of screen resolution and user input. touch events can help you implement interactive elements and common interaction gestures on touchscreen devices. ...
...And 2 more matches
<input type="color"> - HTML: Hypertext Markup Language
his interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. value a 7-character domstring specifying a <color> in lower-case hexadecimal notation events change and input supported common attributes autocomplete and
list idl attributes
list and value methods select() value the value of an <input> element of type color is always a domstring which contains a 7-character string specifying an rgb color in hexadecimal format. while you can input the color in either upper- or lower-case, it will be stored in lower-case form. the value is never in any other form, and is never empty. not...
...e two events that can be used to detect changes to the color value: input and change. input is fired on the <input> element every time the color changes. the change event is fired when the user dismisses the color picker. in both cases, you can determine the new value of the element by looking at its value. ...
...r value: input and change. input is fired on the <input> element every time the color changes. the change event is fired when the user dismisses the color picker. in both cases, you can determine the new value of the element by looking at its value. ...
...And 2 more matches
<input type="month"> - HTML: Hypertext Markup Language
th, the screenshot below shows what it looks like in chrome and opera. clicking the down arrow on the right hand side brings up a date picker that lets you select the month and year. the microsoft edge month control looks like this: value a domstring representing a month and year, or empty. events change and input supported common attributes autocomplete,
list, readonly, and step. idl attributes value methods select(), stepdown(), stepup(). value a domstring representing the value of the month and year entered into the input, in the form yyyy-mm (four or more digit year, then a hyphen ("-"), followed by the two-digit month). the format of the month string used by this input type is described in format of a valid local mo...
...="bday-month">what month were you born in?</label> <input id="bday-month" type="month" name="bday-month" value="2017-06"> var monthcontrol = document.queryselector('input[type="month"]'); monthcontrol.value = '1978-06'; additional attributes in addition to the attributes common to <input> elements, month inputs offer the following attributes: attribute description
list the id of the <data
list> element that contains the optional pre-defined autocomplete options max the latest year and month to accept as a valid input min the earliest year and month to accept as a valid input readonly a boolean which, if present, indicates that the input's value can't be edited step a stepping interval to use when incrementing an...
...the optional pre-defined autocomplete options max the latest year and month to accept as a valid input min the earliest year and month to accept as a valid input readonly a boolean which, if present, indicates that the input's value can't be edited step a stepping interval to use when incrementing and decrementing the value of the input field
list the values of the
list attribute is the id of a <data
list> element located in the same document. the <data
list> provides a
list of predefined values to suggest to the user for this input. any values in the
list that are not compatible with the type are not included in the suggested options. the values provided are suggestions, not requirements: users can select from this predefined
list or provi...
...And 2 more matches
<input type="search"> - HTML: Hypertext Markup Language
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. value a domstring representing the value contained in the search field. events change and input supported common attributes autocomplete,
list, maxlength, minlength, pattern, placeholder, required, size. idl attributes value methods select(), setrangetext(), setselectionrange(). value the value attribute contains a domstring representing the value contained in the search field. you can retrieve this using the htmlinputelement.value property in javascript. searchterms = mysearch.value; if no validation ...
...searchterms = mysearch.value; if no validation constraints are in place for the input (see validation for more details), the value can be any text string or an empty string (""). ...
...e; if no validation constraints are in place for the input (see validation for more details), the value can be any text string or an empty string (""). ...
...And 2 more matches
Access-Control-Allow-Headers - HTTP
s can be used during the actual request. this header is required if the request has an access-control-request-headers header. header type response header forbidden header name no syntax access-control-allow-headers: <header-name>[, <header-name>]* access-control-allow-headers: * directives <header-name> the name of a supported request header. ...
...
list any number of headers, separated by commas. * (wildcard) the value "*" only counts as a special wildcard value for requests without credentials (requests without http cookies or http authentication information). in requests with credentials, it is treated as the literal header name "*" without special semantics. note that the authorization header can't be wildcarded and always needs to be
listed explicitly. examples a custom header here's an example of what an access-control-allow-headers header might look like. it indicates that in addition to the cors-safe
listed request headers, a custom header named x-custom-header is supported by cors requests to the server. access-control-allow-headers: x-custom-header multiple headers this example shows access-control-allow-headers when it...
... access-control-allow-headers: accept example preflight request let's look at an example of a preflight request involving access-control-allow-headers. request first, the request. ...
...And 2 more matches
Access-Control-Expose-Headers - HTTP
the access-control-expose-headers response header indicates which headers can be exposed as part of the response by
listing their names. by default, only the 7 cors-safe
listed response headers are exposed: cache-control content-language content-length content-type expires last-modified pragma if you want clients to be able to access other headers, you have to
list them using the access-control-expose-headers header. header type response header forbidden header name no syntax access-control-expose-headers: <header-name>, <header-name>, ... ...
...h content-type expires last-modified pragma if you want clients to be able to access other headers, you have to
list them using the access-control-expose-headers header. header type response header forbidden header name no syntax access-control-expose-headers: <header-name>, <header-name>, ... access-control-expose-headers: * directives <header-name> a
list of exposed headers consisting of zero or more header names other than the cors-safe
listed request headers that the resource might use and can be exposed. * (wildcard) the value "*" only counts as a special wildcard value for requests without credentials (requests without http cookies or http authentication information). in requests with credentials, it is treated as the literal header name "*" ...
... that the resource might use and can be exposed. * (wildcard) the value "*" only counts as a special wildcard value for requests without credentials (requests without http cookies or http authentication information). in requests with credentials, it is treated as the literal header name "*" without special semantics. ...
...And 2 more matches
CSP: script-src - HTTP
or javascript: urls, this is a safer method than using the unsafe-inline expression. 'unsafe-inline' allows the use of inline resources, such as inline <script> elements, javascript: urls, inline event handlers, and inline <style> elements. the single quotes are required. 'none' refers to the empty set; that is, no urls match. the single quotes are required. 'nonce-<base64-value>' an allow-
list for specific inline scripts using a cryptographic nonce (number used once). the server must generate a unique nonce value each time it transmits a policy. it is critical to provide an unguessable nonce, as bypassing a resource’s policy is otherwise trivial. see unsafe inline script for an example. specifying nonce makes a modern browser ignore 'unsafe-inline' which could still be set for older ...
...example. in csp 2.0, this applied only to inline scripts. csp 3.0 allows it in the case of script-src for external scripts. 'strict-dynamic' the strict-dynamic source expression specifies that the trust explicitly given to a script present in the markup, by accompanying it with a nonce or a hash, shall be propagated to all the scripts loaded by that root script. at the same time, any allow-
list or source expressions such as 'self' or 'unsafe-inline' are ignored. see script-src for an example. 'report-sample' requires a sample of the violating code to be included in the violation report. examples violation case given this csp header: content-security-policy: script-src https://example.com/ the following script is blocked and won't be loaded or executed: <script src="https:...
... in the violation report. examples violation case given this csp header: content-security-policy: script-src https://example.com/ the following script is blocked and won't be loaded or executed: <script src="https://not-example.com/js/library.js"></script> note that inline event handlers are blocked as well: <button id="btn" onclick="dosomething()"> you should replace them with addevent
listener calls: document.getelementbyid("btn").addevent
listener('click', dosomething); unsafe inline script note: disallowing inline styles and inline scripts is one of the biggest security wins csp provides. however, if you absolutely have to use it, there are a few mechanisms that will allow them. to allow inline scripts and inline event handlers, 'unsafe-inline', a nonce-source or a hash-sour...
...And 2 more matches
Feature-Policy: layout-animations - HTTP
'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. ...
... 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. ...
... 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. ...
...And 2 more matches
Feature-Policy: legacy-image-formats - HTTP
'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. ...
... 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. ...
... 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. ...
...And 2 more matches
Feature-Policy: oversized-images - HTTP
'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. ...
... 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. ...
... 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. ...
...And 2 more matches
Feature-Policy: sync-xhr - HTTP
'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. ...
... 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. ...
... 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. ...
...And 2 more matches
Feature-Policy: unoptimized-images - HTTP
'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. ...
... 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. ...
... 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. ...
...And 2 more matches
Protocol upgrade mechanism - HTTP
tations can choose not to take advantage of an upgrade even if they support the new protocol, and in practice, this mechanism is used mostly to bootstrap a websockets connection. note also that http/2 explicitly disallows the use of this mechanism; it is specific to http/1.1. upgrading http/1.1 connections the upgrade header field is used by clients to invite the server to switch to one of the
listed protocols, in descending preference order. because upgrade is a hop-by-hop header, it also needs to be
listed in the connection header field. this means that a typical request that includes upgrade would look something like: get /index.html http/1.1 host: www.example.com connection: upgrade upgrade: example/1, foo/2 other headers may be required depending on the requested protocol; for examp...
...her than the upgrade and connection headers, the rest are generally optional or handled for you by the browser and server when they're talking to each other. sec-websocket-extensions specifies one or more protocol-level websocket extensions to ask the server to use. using more than one sec-websocket-extension header in a request is permitted; the result is the same as if you included all of the
listed extensions in one such header. sec-websocket-extensions: extensions extensions a comma-separated
list of extensions to request (or agree to support). these should be selected from the iana websocket extension name registry. extensions which take parameters do so by using semicolon delineation. for example: sec-websocket-extensions: superspeed, colormode; depth=16 sec-websocket-key pro...
...ket-protocol the sec-websocket-protocol header specifies one or more websocket protocols that you wish to use, in order of preference. the first one that is supported by the server will be selected and returned by the server in a sec-websocket-protocol header included in the response. you can use this more than once in the header, as well; the result is the same as if you used a comma-delineated
list of subprotocol identifiers in a single header. sec-websocket-protocol: subprotocols subprotocols a comma-separated
list of subprotocol names, in the order of preference. the subprotocols may be selected from the iana websocket subprotocol name registry or may be a custom name jointly understood by the client and the server. sec-websocket-version request header specifies the websocket pro...
...And 2 more matches
A re-introduction to JavaScript (JS tutorial) - JavaScript
ascript" from this point on. unlike most programming languages, the javascript language has no concept of input or output. it is designed to run as a scripting language in a host environment, and it is up to the host environment to provide mechanisms for communicating with the outside world. the most common host environment is the browser, but javascript interpreters can also be found in a huge
list of other places, including adobe acrobat, adobe photoshop, svg images, yahoo's widget engine, server-side environments such as node.js, nosql databases like the open source apache couchdb, embedded computers, complete desktop environments like gnome (one of the most popular guis for gnu/linux operating systems), and others. overview javascript is a multi-paradigm, dynamic language with types an...
... for free. and to be technically accurate, functions are just a special type of object. so the type diagram looks more like this: number string boolean symbol (new in es2015) object function array date regexp null undefined and there are some built-in error types as well. things are a lot easier if we stick with the first diagram, however, so we'll discuss the types
listed there for now. numbers numbers in javascript are "double-precision 64-bit format ieee 754 values", according to the spec — there's no such thing as an integer in javascript (except bigint), so you have to be a little careful. see this example: console.log(3 / 2); // 1.5, not 1 console.log(math.floor(3 / 2)); // 1 so an apparent integer is in fact implicitly a float. also, wa...
... return sum / arguments.length; } avg(2, 3, 4, 5); // 3.5 this is pretty useful, but it does seem a little verbose. to reduce this code a bit more we can look at substituting the use of the arguments array through rest parameter syntax. in this way, we can pass in any number of arguments into the function while keeping our code minimal. the rest parameter operator is used in function parameter
lists with the format: ...variable and it will include within that variable the entire
list of uncaptured arguments that the function was called with. we will also replace the for loop with a for...of loop to return the values within our variable. function avg(...args) { var sum = 0; for (let value of args) { sum += value; } return sum / args.length; } avg(2, 3, 4, 5); // 3.5 in the ab...
...And 2 more matches
JavaScript data types and data structures - JavaScript
these can be used to build other data structures. wherever possible, comparisons with other languages are drawn. dynamic typing javascript is a loosely typed and dynamic language. ...
...ed is always what is in the string). strings are the common denominator of a lot of apis (input fields, local storage values, xmlhttprequest responses when using responsetext, etc.) and it can be tempting to only work with strings. with conventions, it is possible to represent any data structure in a string. this does not make it a good idea. for instance, with a separator, one could emulate a
list (while a javascript array would be more suitable). unfortunately, when the separator is used in one of the "
list" elements, then, the
list is broken. an escape character can be chosen, etc. all of this requires conventions and creates an unnecessary maintenance burden. use strings for textual data. when representing complex data, parse strings, and use the appropriate abstraction. symbol type ...
...data structures. properties are identified using key values. a key value is either a string or a symbol value. there are two types of object properties which have certain attributes: the data property and the accessor property. note: each property has corresponding attributes. attributes are used internally by the javascript engine, so you cannot directly access them. that's why attributes are
listed in double square brackets, rather than single. see object.defineproperty() to learn more. data property associates a key with a value, and has the following attributes: attributes of a data property attribute type description default value [[value]] any javascript type the value retrieved by a get access of the property. undefined [[writabl...
...And 2 more matches
Working with objects - JavaScript
variable) and property name are case sensitive. you can define a property by assigning it a value. for example, let's create an object named mycar and give it properties named make, model, and year as follows: var mycar = new object(); mycar.make = 'ford'; mycar.model = 'mustang'; mycar.year = 1969; the above example could also be written using an object initializer, which is a comma-delimited
list of zero or more pairs of property names and associated values of an object, enclosed in curly braces ({}): var mycar = { make: 'ford', model: 'mustang', year: 1969 }; unassigned properties of an object are undefined (and not null). mycar.color; // undefined properties of javascript objects can also be accessed or set using a bracket notation (for more details see property accesso...
... object.keys(o) this method returns an array with all the own (not in the prototype chain) enumerable properties' names ("keys") of an object o. object.getownpropertynames(o) this method returns an array containing all own properties' names (enumerable or not)...
...ses all enumerable properties of an object and its prototype chain. object.keys(o) this method returns an array with all the own (not in the prototype chain) enumerable properties' names ("keys") of an object o. object.getownpropertynames(o) this method returns an array containing all own properties' names (enumerable or not) of an object o. ...
...And 2 more matches
this - JavaScript
ple (c2), because an object was returned during construction, the new object that this was bound to simply gets discarded. (this essentially makes the statement "this.a = 37;" dead code. ...
...w object that this was bound to simply gets discarded. (this essentially makes the statement "this.a = 37;" dead code. it's not exactly dead because it gets executed, but it can be eliminated with no outside effects.) as a dom event handler when a function is used as an event handler, its this is set to the element on which the
listener is placed (some browsers do not follow this convention for
listeners added dynamically with methods other than addevent
listener()). ...
...this.a = 37;" dead code. it's not exactly dead because it gets executed, but it can be eliminated with no outside effects.) as a dom event handler when a function is used as an event handler, its this is set to the element on which the
listener is placed (some browsers do not follow this convention for
listeners added dynamically with methods other than addevent
listener()). ...
...And 2 more matches
Digital audio concepts - Web media technologies
nd. the sound for the left and right main channels, as well as all of your surround sound speakers (center, left and right rear, left and right sides, ceiling channels, and so forth) are all standard audio channels. special low frequency enhancement (lfe) channels provide the signal for special speakers designed to produce the low frequency sounds and vibration to create a visceral sensation when
listening to the audio. the lfe channels typically drive subwoofers and similar devices. monophonic audio has one channel, stereo sound has two channels, 5.1 surround sound has 6 channels (five standard and one lfe), and so forth. each audio frame is a data record that contains the samples for all of the channels available in an audio signal. the size of an audio frame is calculated by multiplying th...
...elity is unacceptable or undesirable, a lossless codec is preferred. on the other hand, if some degree of reduction of audio fidelity is okay, a lossy codec can be used. generally, lossy compression results in significantly smaller output than lossless compression methods; also, many lossy codecs are excellent, with the loss in quality and detail being difficult or even impossible for the average
listener to discern. note: while a high-quality lossy compression algorithm's effect on sound quality may be difficult for the average person to detect, certain people have exceptionally good hearing, or are particularly adept at noticing the kinds of changes introduced to music by lossy compression techniques. the majority of audio codecs use some form of lossy compression, because of the better ...
...lling choice, and adequate or excellent audio quality is possible with well-chosen codec configurations. researchers are continuing to devise better ways to analyze and compress audio, so new formats come out periodically that offer various improvements, either in compression ratio or audio fidelity (or both). ...
...And 2 more matches
begin - SVG: Scalable Vector Graphics
each individual value can be one of the following : <offset-value>, <syncbase-value>, <event-value>, <repeat-value>, <accesskey-value>, <wallclock-sync-value> or the keyword indefinite. ...
...each individual value can be one of the following : <offset-value>, <syncbase-value>, <event-value>, <repeat-value>, <accesskey-value>, <wallclock-sync-value> or the keyword indefinite. ...
...each individual value can be one of the following : <offset-value>, <syncbase-value>, <event-value>, <repeat-value>, <accesskey-value>, <wallclock-sync-value> or the keyword indefinite. ...
...And 2 more matches
keyTimes - SVG: Scalable Vector Graphics
the keytimes attribute represents a
list of time values used to control the pacing of the animation. each time in the
list corresponds to a value in the values attribute
list, and defines when the value is used in the animation. each time value in the keytimes
list is specified as a floating point value between 0 and 1 (inclusive), representing a proportional offset into the duration of the animation element. four elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, and <animatetransform> html, body, svg { height: 100%; } <svg viewbox="0 0 120 120" xmlns="http://www.w3.org/2000/svg"> <circle cx="60" cy="10" r="10"> <animate attributename="cx" dur="4s" repeatcount="indefinite" values="60 ; 110 ; 60 ; 10 ; 60" keytimes="0 ; 0.25 ; 0.5 ; 0.75 ; 1"/...
...the key time associated wi...
...ame="cy" dur="4s" repeatcount="indefinite" values="10 ; 60 ; 110 ; 60 ; 10" keytimes="0 ; 0.25 ; 0.5 ; 0.75 ; 1"/> </circle> </svg> usage notes value <number> [ ; <number> ]* ;? default value none animatable no the value of the keytimes attribute is a semicolon-separated
list of values. there must be exactly as many values in the keytimes
list as in the values
list. each successive time value must be greater than or equal to the preceding time value. the keytimes
list semantics depends upon the interpolation mode: for linear and spline animation, the first time value in the
list must be 0, and the last time value in the
list must be 1. the key time associated with each value defines when the value is set; values are interpolated b...
...And 2 more matches
tableValues - SVG: Scalable Vector Graphics
the tablevalues attribute defines a
list of numbers defining a lookup table of values for a for a color component transfer function. four elements are using this attribute: <fefunca>, <fefuncb>, <fefuncg>, and <fefuncr> html, body, svg { height: 100%; } <svg viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <defs> <lineargradient id="gradient" gradientunits="userspaceonuse" x1="0" y1="0" x2="200" y2="0"> <stop offset="0" stop-color="#ff0000" /> <stop offset="0.5" stop-color="#00ff00" /> <stop offset="1" stop-color="#0000ff" /> </lineargradient> </defs> <filter id="componenttransfer1" x="0" y="0" width="100%" height="100%"> <fecomponenttransfer> <fefuncr type="table" tablevalues="0 1"/> <fefuncg type="table" tablevalues="...
... specifications speci...
... specifications specification status comment filter...
...And 2 more matches
Basic shapes - SVG: Scalable Vector Graphics
sition of the center of the ellipse. line the <line> element takes the positions of two points as parameters and draws a straight line between them. <line x1="10" x2="50" y1="110" y2="150"/> x1 the x position of point 1. y1 the y position of point 1. x2 the x position of point 2. y2 the y position of point 2. polyline a <polyline> is a group of connected straight lines. ...
..."/> x1 the x position of point 1. y1 the y position of point 1. x2 the x position of point 2. y2 the y position of point 2. polyline a <polyline> is a group of connected straight lines. since the
list of points can get quite long, all the points are included in one attribute: <polyline points="60, 110 65, 120 70, 115 75, 130 80, 125 85, 140 90, 135 95, 150 100, 145"/> points a
list of points. each number must be separated by a space, comma, eol, or a line feed character. each point must contain two numbers: an x coordinate and a y coordinate. so, the
list (0,0), (1,1), and (2,2) would be written as 0, 0 1, 1 2, 2. polygon a <polygon> is similar to a <polyline>, in that it is composed of straight line segments connecting a
list of points. for polygons though, the path a...
...the drawing then closes the path, so a final straight line would be drawn from (2,2) to (0,0). ...
...And 2 more matches
system/events - Archive of obsolete content
api for working with the application observer service. usage the system/events module provides core (low level) api for working with the application observer service, also known as nsiobserverservice. you can find a
list of events dispatched by the firefox codebase here. 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. event : object an optional object with data and subject attributes. data refers to a string that you would like to pass t...
...-modify-request",
listener); globals functions emit(type, event) send an event to observer service parameters type : string the event type. event : object an optional object with data and subject attributes. data refers to a string that you would like to pass through this event. subject should refer to the actual actor/subject of this event (ie: the object emitting the event). on(type,
listener, strong)
listen to events of a given type parameters type : string the event type name to watch.
listener : function function that will be called when an event is fired, with a single event object as argument. this object has three attributes: type: the event type name subject: the event subject object data: the event data string strong : boolean default is false, a weak referen...
...en an event is fired, with a single event object as argument. this object has three attributes: type: the event type name subject: the event subject object data: the event data string strong : boolean default is false, a weak reference, which means it can be garbage collected at any time if there are no other references to it. determines if we should keep a strong or weak reference to the
listener method. once(type,
listener, strong)
listen only once to a particular event type parameters type : string the event type name to watch.
listener : function function that will be called when an event is fired. strong : boolean default is false, a weak reference, which means it can be garbage collected at any time if there are no other references to it. determines if we should keep a s...
...er, strong)
listen only once to a particular event type parameters type : string the event type name to watch.
listener : function function that will be called when an event is fired. strong : boolean default is false, a weak reference, which means it can be garbage collected at any time if there are no other references to it. determines if we should keep a strong or weak reference to the
listener method. off(type,
listener) stop
listening for an event parameters type : string the event type name to unsubscribe to.
listener : function the function we registered to
listen for events. ...
cfx - Archive of obsolete content
-g config, --use-config=config pass a set of options by referencing a named configuration. -p profiledir, --profiledir=profiledir use an existing profile located in profiledir. profiledir may be specified as a full path or as a path relative to the current directory. see "using --profiledir" for more information. --package-path=pac...
...pi as the value of updatelink. supported options as with cfx run you can point cfx at a different package.json file using the --pkgdir option. you can also embed arguments in the xpi using the --static-args option: if you do this the arguments will be passed to your add-on whenever it is run. --extra-packages=extra_packages extra packages to include, specified as a comma-separated
list of package names. -g config, --use-config=config pass a set of options by referencing a named configuration. --package-path=packagepath extra directories for package search. --pkgdir=pkgdir use an add-on located in pkgdir. pkgdir may be specified as a full path or as a path relative to the current directory. --static-args=static_args pass arguments ...
... a path relative to the current directory. internal options --keydir=keydir supply a different location for signing keys. keydir may be specified as a full path or as a path relative to the current directory. internal commands cfx testcfx this will run a number of tests on the cfx tool, including tests against the documentation. use cfx testcfx -v for the specific
list of tests. this accepts the same options as cfx test. cfx testaddons this will run a number of test add-ons that are packaged with the sdk. this accepts the same options as cfx test. cfx testpkgs this will test all of the available commonjs packages. note that the number of tests run and their success depends on what application they are run with, and which binary is used. this accepts the ...
...ofiles/boogaloo the path must contain at least one "/" (although you may specify just "./dir"). using configurations the --use-config option enables you to specify a set of options as a named configuration in a file, then pass them to cfx by referencing the named set. you define configurations in a file called local.json which should live in the root directory of your sdk. configurations are
listed under a key called "configs". suppose your the following local.json is as follows: { "configs": { "ff40": ["-b", "/usr/bin/firefox-4.0"] } } you can run: cfx test --use-config=ff40 and it would be equivalent to: cfx test -a firefox -b /usr/bin/firefox-4.0 this method of defining configuration options can be used for all of the run, build, and test tools. ...
Implementing the widget - Archive of obsolete content
widget api is deprecated from firefox 29 onwards. please see the ui module for replacements. in particular, for a simple button, try the action button or toggle button apis, and for a more complex widget try the toolbar or sidebar apis. we want the widget to do two things: on a left-click, the widget should activate or deactivate the annotator. on a right-click, the widget should display a
list of all the annotations the user has created. because the widget's click event does not distinguish left and right mouse clicks, we'll use a content script to capture the click events and send the corresponding message back to our add-on. the widget will have two icons: one to display when it's active, one to display when it's inactive. so there are three files we'll need to create: the widget...
..., one to display when it's inactive. so there are three files we'll need to create: the widget's content script and its two icons. inside the data subdirectory create another subdirectory widget. we'll keep the widget's files here. this hierarchy isn't mandatory; you could just keep them all under data. but it seems tidier this way. ...
... and its two icons. inside the data subdirectory create another subdirectory widget. we'll keep the widget's files here. this hierarchy isn't mandatory; you could just keep them all under data. but it seems tidier this way. the widget's content script the widget's content script just
listens for left- and right- mouse clicks and posts the corresponding message to the add-on code: this.addevent
listener('click', function(event) { if(event.button == 0 && event.shiftkey == false) self.port.emit('left-click'); if(event.button == 2 || (event.button == 0 && event.shiftkey == true)) self.port.emit('right-click'); event.preventdefault(); }, true); save this in your data/widget directory as widget.js. the widget's icons you can copy the widget's icons from here: or, if you're ...
...it creates the widget and responds to messages from the widget's content script by toggling its activation state. since we don't have any code to display annotations yet, we just log the right-click events to the console. now from the annotator directory type cfx run. you should see the widget in the add-on bar: left- and right-clicks should p...
Bookmarks - Archive of obsolete content
w folder in the bookmarks menu: var menufolder = bmsvc.bookmarksmenufolder; // bookmarks menu folder var newfolderid = bmsvc.createfolder(menufolder, "folder name here", bmsvc.default_index); this code locates the bookmarks menu's folder, then creates a new folder named "folder name here" in it. specifying default_index as the index at which to insert the new folder places it at the end of the
list. you can easily change this code to insert the new folder into the bookmarks toolbar by changing bookmarksmenufolder to another folder attribute. creating a new bookmark to create a new bookmark, use the nsinavbookmarksservice.insertbookmark() method. the uri for the bookmark needs to be specified using an nsiuri object. var ios = components.classes["@mozilla.org/network/io-service;1"] ...
... the folder containing an item if you need to know what folder contains an item (this can be especially handy after using nsinavbookmarksservice.getbookmarkidsforuri() to find bookmarks for a given uri), you can use the nsinavbookmarksservice.getfolderidforitem() method. ...
...bookmarks and tags to set up an observer to
listen for changes related to bookmarks, you will need to create an nsinavbookmarkobserver object and use the nsinavbookmarksservice.addobserver() and nsinavbookmarksservice.removeobserver() methods. note that this example takes advantage of xpcomutils to generate the nsisupports.queryinterface() method. ...
...something(); }, onitemvisited: function(abookmarkid, avisitid, time) {}, onitemmoved: function(aitemid, aoldparent, aoldindex, anewparent, anewindex) {}, queryinterface: xpcomutils.generateqi([components.interfaces.nsinavbookmarkobserver]) }; // an extension var myextension = { // this function is called when my add-on is loaded onload: function() { bmsvc.addobserver(myext_bookmark
listener, false); }, // this function is called when my add-on is unloaded onunload: function() { bmsvc.removeobserver(myext_bookmark
listener); }, dosomething: function() { alert("did something."); } }; see also nsinavbookmarksservice nsinavbookmarkobserver places using xpcom without chrome - bookmark observer ...
HTML to DOM - Archive of obsolete content
urned, and it is never actually appended to the current page. 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). see using a hidden iframe element to parse html to a window's ...
...main-window").appendchild(frame); // or // document.documentelement.appendchild(frame); // set restrictions as needed frame.webnavigation.allowauth = false; frame.webnavigation.allowimages = false; frame.webnavigation.allowjavascript = false; frame.webnavigation.allowmetaredirects = true; frame.webnavigation.allowplugins = false; frame.webnavigation.allowsubframes = false; //
listen for load frame.addevent
listener("load", function (event) { // the document of the html in the dom var doc = event.originaltarget; // skip blank page or frame if (doc.location.href == "about:blank" || doc.defaultview.frameelement) return; // do something with the dom of doc alert(doc.location.href); // when done remove frame or set location "about:blank" setti...
...let's take a look at the donkeyfire.donkeybrowser_onpageload() handler: donkeybrowser_onpageload: function(...
...s = true; donkeybrowser.webnavigation.allowplugins = false; donkeybrowser.webnavigation.allowsubframes = false; donkeybrowser.addevent
listener("domcontentloaded", function (e) { donkeyfire.donkeybrowser_onpageload(e); }, true); } with that code, we obtain a reference to the iframe element we declared in the .xul file. the most interesting piece of code here is the domcontentloaded event
listener we define for the element. let's take a look at the donkeyfire.donkeybrowser_onpageload() handler: donkeybrowser_onpageload: function(aevent) { var doc = aevent.originaltarget; var url = doc.location.href; if (aevent.originaltarget.nodename == "#document") { // ok, it's a real page, let's do our magic dump("[df] url = "+url+"\n"); var text = doc.evaluate("/html/body/h1",doc,null,xpath...
Creating custom Firefox extensions with the Mozilla build system - Archive of obsolete content
mozilla build system is used. in the simplest case, a component will consist of a single main directory with two subdirectories, public/ and src/. the main directory and each subdirectory must contain a makefile.in (from now on i'll just refer to this file as a makefile although we know that it is actually used to generate the real makefile). this makefile says two things. first of all, it
lists the subdirectories that make up the extension, so the build system knows where to look for additional makefiles. secondly, it instructs the build system to create a new extension, rather than copying the components directly into firefox's binary directory. the main advantage of using an extension is that it is easy to package everything up and install it on another machine. so here's your...
..., you'll see your xpi file in the xpi staging area. you'll also see the "exploded" version of the xpi (i.e. the unzipped directory structure) underneath /mozilla/$(moz_objdir)/dist/bin/extensions. (if something goes wrong, figure out what, fix it and then come back here and add it to this article.) to make sure that the build really finished, launch firefox and check that your extension is
listed when you select tools/extensions. if you are using firefox as your regular browser (and if you're not, why not!?), you might be annoyed by the fact that you have to close regular firefox before running your custom-built version. if so, try setting the moz_no_remote environment variable to "1" before running the development version of firefox. you'll also need to use a different profile for your...
...s tells make to create a single manifest file called chrome.manifest instead of creating separate manifests with goofy names for each package. now launch make again, and you should see a chrome subdirectory appear in your extension (/mozilla/$(moz_objdir)/dist/bin/extensions/myextension@mycompany.com/). note that the chrome directory contains a jar (i.e. zip) file with all the chrome files
listed in jar.mn as well as a complete directory structure mirroring that of the jar file. the directory structure, however, is empty. why? i don't know. don't worry about this, the files in the jar are the ones that are actually used. keeping it complex if you're developing a really complex extension with lots of xpcom components, you'll probably want to divide your code up into smaller...
...make sure that build/ comes last since it can't create the component library until the other makefiles have completed. other topics adding data files to your extensions in some cases, you may wish to include additional files in your extension that don't belong in the chrome/ subdirectory. examples migh...
Appendix B: Install and Uninstall Scripts - Archive of obsolete content
sary files to the profile folder, like the initial db the add-on will use for storage. a few others require cleanup code to be run after the add-on is uninstalled. this appendix covers these cases with simple code that should work for most add-ons. install scripts just like with a regular initialization function, we want a load event handler: // rest of overlay code goes here. window.addevent
listener( "load", function() { xulschoolchrome.browseroverlay.init(); }, false); then all we need is some persistent flag that ensures that the first run code is only run once. the best approach in this case is to use a preference, as explained in the handling preferences section. so, if we were to use fuel, we can do the following in the init function: init : function() { let firstrunpref = "...
...rent times. in this case the user is told that firefox needs to restart in order for the extension to be completely removed. then the user has the option to restart right away, wait to restart whenever is convenient, or even cancel the uninstall operation. the add-on will not be completely removed until the browser is restarted. ...
...e user is told that firefox needs to restart in order for the extension to be completely removed. then the user has the option to restart right away, wait to restart whenever is convenient, or even cancel the uninstall operation. the add-on will not be completely removed until the browser is restarted. so, in order to detect the first stage, you'll need to add an event
listener using the addaddon
listener method. ...
...set a boolean flag that indicates if your add-on is set to be uninstalled or not, and reset it when necessary. the second stage is knowing when the application is actually going to be closed. ...
Custom XUL Elements with XBL - Archive of obsolete content
nd input controls are implemented using xbl and simpler xul elements. as explained earlier, xul is really just boxes, text and images. we'll look into xbl using a modified version of the hello world extension. download the hello world xbl project, build it and test it for a while. you should see a new item in the hello world menu, that opens a binding test window where you can add "persons" to a
list. xbl basics in order to create an xbl binding you'll need 2 files: the xbl file and a css file that binds an element name to your xbl declaration. if you look into the content directory, you'll see both files: person.xml - this is the main binding file. it holds all the code necessary to control the new element we created. we'll look into the code throughout the rest of this section. for now...
... any xul tag. in this case we're adding the "persons" dynamically, so you'll have to look into the js file to see how xshelloperson elements are created and added to the dom just like any other. addperson : function(aevent) { // ... let person = document.createelement("xshelloperson"); // ... person.setattribute("name", name); person.setattribute("greeting", greeting); // ... person
list.appendchild(person); // ... }, this is where the advantage of xbl is obvious: we only need to create a single node and set some attributes. we didn't need to create a whole xul structure that would require around 7 nodes every time a "person" is created. xbl provides the encapsulation we needed to manage these nodes as a unit. as a bonus, you should look into the usage of nsifilepicker to ...
...lone it. but there is one thing you need to know about moving or cloning your node: all internal state in the node will be lost. this means that all your properties and fields will be reset. if you want some value to be preserved after such dom operations, you must set it as an attribute and not an internal value. methods our "person" binding has a single method that removes the item from the
list: <method name="remove"> <parameter name="aevent" /> <body><![cdata[ this.parentnode.removechild(this); ]]></body> </method> as you can see, it's very easy to define a method and the parameters it takes. you can also have a return value using the return keyword, just like on regular js code. the method uses the parent node to remove the person node. simple enough. you can do almos...
...use case is when you want to change the behavior of some methods and properties. you can leave the content alone by not including the content tag, and then just add the methods and properties you wish to override. all you need to do is match the names of the originals. all methods and properties that are not overriden will maintain their original behavior. with inheritance you could take the rich
listbox element and modify it to make a rich item tree, or create a switch button that changes state everytime it's clicked. and all with very little additional code. keep it in mind when creating your custom elements because it can save you lots of time. replacing existing xul elements as seen in the beginning of this section, the actual binding process is determined by a simple css rule that assoc...
Performance best practices in extensions - Archive of obsolete content
ignificant performance benefits, they should be used wisely. loading modules incurs a small cost, so breaking code up to an unnecessary degree can be counter-productive. code should be modularized to the extent that doing so increases clarity, and loading of large or expensive chunks of code fragments can be significantly deferred. defer everything that you can most extensions have a load event
listener in the main overlay that runs their startup functions. do as little as possible here. the browser window is blocked while your add-on's load handler runs, so the more it does, the slower firefox will appear to the user. if there is anything that can be done even a fraction of a second later, you can use an nsitimer or the window.settimeout() method to schedule that work for later. even a sh...
...void writing slow css read the "writing efficient css" guide. remember that any selector in your rule which might match many different nodes is a source of inefficiency during either selector matching or dynamic update processing. this is especially bad for the latter if the selector can dynamically start or stop matching. avoid unqualified ":hover" like the plague. avoid dom mutation event
listeners dom mutation event
listeners are extremely expensive and, once added to a document even briefly, significantly harm its performance. as mutation events are officially deprecated, and there are many alternatives, they should be avoided at all costs. lazily load services the xpcomutils javascript module provides two methods for lazily loading things: definelazygetter() defines a function...
.../o, can cause serious ui responsiveness issues. never use synchronous xmlhttprequests. netutils.jsm provides helpers for asynchronous reading and copying of files. never access a sqlite database synchronously. use the asynchronous api instead. performing sequential, asynchronous operations can often be greatly simplified using promises. ...
...ding and copying of files. never access a sqlite database synchronously. use the asynchronous api instead. performing sequential, asynchronous operations can often be greatly simplified using promises. avoid mouse movement events avoid using mouse event
listeners, including mouseover, mouseout, mouseenter, mouseexit, and especially mousemove. these events happen with high frequency, so their
listeners can trivially create very high cpu overhead. when these events cannot be avoided, computation during the
listeners should be kept to a minimum and real work throttled. the
listeners should be added to the most specific element possible, and removed when not immediately necessary. avoid animated images animated images are much more expensive than generally expected, especially when used in...
Session store API - Archive of obsolete content
d in order to restore its state, and then call gettabvalue() to retrieve the previous setting when the tab is restored. the session store api is implemented using the nsisessionstore interface. knowing when to restore each time firefox is about to restore a tab, an event of type sstabrestoring is sent. ...
...in this example, nsiconsoleservice is used to display a message to the console. this event is sent just before a tab is restored. an event of type sstabrestored fires each time a tab has finished restoring. it's wor...
...ession store system. the session restore process the exact sequence of events that occurs when a session is being restored is: a session state is about to be restored. this can be on startup or in response to undo close tab, since closed tabs are restored as single-tab sessions. new windows are opened as required (one for each window that was saved in the session store), and cookies and the
list of recently closed tabs are restored. after that, the following steps are taken for each tab being restored: either an existing tab is reused or a new tab is created. in the latter case, a tabopen event is sent. the tab's persistent xul attributes (those saved due to calls to persisttabattribute()) and permissions are restored. the sstabrestoring event is sent. the tab is told to load the...
...nts.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. starting in firefox 3.5, notifications are sent after reading session store data and before using it, as well as immediately before writing it back to disk. see the
list in observer notifications. using the session store api in seamonkey there are a number of differences between the session store api in firefox and the api in seamonkey 2.0: the class name is @mozilla.org/suite/sessionstore;1 var ss = components.classes["@mozilla.org/suite/sessionstore;1"] .getservice(components.interfaces.nsisessionstore); when restoring a window, clo...
Signing an XPI - Archive of obsolete content
tem path. you can either set this permanently via control panel->system properties->advanced->environment variables->system variables or do it each time you run the tools from the command-line (preferably using a batch file). windows contains its own version of some of these files (e.g. certutil.exe) in the system directory (\windows\system32\) so ensure the new paths are first in the path search
list. c:\> set path=c:\apps\nss-3.11.4\bin\;c:\apps\nss-3.11.4\lib\;c:\apps\nspr-4.6\lib\;%path% an easier way is to copy everything from your new directories c:\apps\nss-3.11.4\ and c:\apps\nspr-4.6\ including sub directories to the same directory - fx c:\apps\codesigning\ - and then run every command from that. initialize the certificate database decide which folder to create the certificate da...
...\signed> cd .. sign xpi c:\projects\codesigning\> signtool -d . -k mytestcert -p "password" signed/ using certificate directory: . generating signed//meta-inf/manifest.mf file.. --> chrome/fsb.jar --> chrome.manifest --> install.rdf generating zigbert.sf file.. tree "signed/" signed successfully re-package xpi change to the signed/ folder, create a new zip with the meta-inf/zigbert.rsa file
listed first, then add the remaining files. c:\projects\certs\> cd signed c:\projects\codesigning\signed\> zip fsb.xpi meta-inf/zigbert.rsa adding: meta-inf/zigbert.rsa (deflated 35%) c:\projects\codesigning\signed> zip -r -d fsb.xpi * -x meta-inf/zigbert.rsa adding: meta-inf/manifest.mf (deflated 37%) adding: meta-inf/zigbert.sf (deflated 40%) adding: chrome/fsb.jar (deflated 74%) adding...
... menu choose options->advanced->certificates->manage certificates->authorities press the import button. navigate to the folder containing x509.cert and choose it. in the downloading certificate dialog, tick trust this ca to identify software developers. and press the view button if you wish to examine the certificate more closely. press the ok button and you'll see your new certificate in the
list of authorities. 2. attempt to install the signed extension either drag and drop or browse to and download the signed xpi. when the mozilla firefox software installation dialog appears the organisation name of the certificate will appear where firefox usually displays unsigned. image obtaining a valid software developer code-signing certificate warning: currently firefox expects xpi files t...
... ,, c:\projects\codesigning> signtool -l -d . using certificate directory: . object signing certificates --------------------------------------- mytestcert issued by: mytestcert (xpi test) expires: tue mar 14, 2006 code signing (certum) issued by: certum level iii ca (certum level iii ca) expires: tue mar 14, 2006 --------------------------------------- for a
list including ca's, use "signtool -l" now you must export the new key/certificate pair from the mozilla firefox certificate database and into the nss certificate database. the hardest part is locating mozilla's key database. it consists of two files named key3.db and cert8.db. they usually live in the mozilla firefox user profile folder. i found mine in c:\documents and settings\tj\application dat...
Adding preferences to an extension - Archive of obsolete content
ew line to the install.rdf file: <em:optionsurl>chrome://stockwatcher2/content/options.xul</em:optionsurl> this line establishes the url of the xul file that describes the options dialog. please note that if you are using code from this tutorial to add to an existing extension, you must uninstall and reinstall your extension to enable the preferences button for your extension in the add-ons
list. establish the defaults in order to set a default preference for the stock to monitor, we need to add a new folder to our extension's package, called "defaults", which in turn contains another folder called "preferences". inside that, we create a file, defaults.js, that describes the default value of our preferences: pref("extensions.stockwatcher2.symbol", "goog"); the standard for third-p...
...kersymbol to get the stock symbol to watch. we do this because since refreshinformation() is usually called as a callback from setinterval. in such cases this doesn't refer to the right object. see method binding for detailed explanation. once we have the symbol in the local variable symbol, we use that to construct the url and the string to display in the status bar panel. ...
...e since refreshinformation() is usually called as a callback from setinterval. in such cases this doesn't refer to the right object. see method binding for detailed explanation. once we have the symbol in the local variable symbol, we use that to construct the url and the string to display in the status bar panel. ...
...hod binding for detailed explanation. once we have the symbol in the local variable symbol, we use that to construct the url and the string to display in the status bar panel. installing the event
listeners the only thing left to do is to install the event
listeners needed to run the startup() and shutdown() routines automatically when the browser window is loaded and unloaded. window.addevent
listener("load", function(e) { stockwatcher.startup(); }, false); window.addevent
listener("unload", function(e) { stockwatcher.shutdown(); }, false); design the preference dialog now that we've written all the code, we need to build the xul file for the options dialog. <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <prefwindow id="stockwatcher2-prefs" t...
Notes on HTML Reflow - Archive of obsolete content
may have bottom-up impact to the frame hierarchy. resize, when the containing boundary for the frame hierarchy changes. during a resize reflow, the frame can assume that none of the frame's internal state (e.g., a text frame's text) has changed; instead, a top-down change in the layout constraints has occurred. stylechange, when the entire frame hierarchy must be traversed to recover from sty
listic change; for example, a change in the default font size. dirty, when a container frame has consolidated several individual incremental reflows that have been targeted at its child frames. initial, incremental, resize, and style change reflows may each be performed as an immediate "global" reflow from the presentation shell: an initial reflow is performed when the presentation shell is init...
...ed to flow the shell's initial frame hierarchy. incremental reflows are dispatched en masse when the presentation shell's incremental reflow queue is asynchronously serviced. a resize reflow is performed when the presentation shell's dimensions change; e.g., because the user resized the shell's window. a style change reflow is performed when the presentation shell's global sty
listic information is changed; e.g., addition or removal of a style sheet, a change to the shell's default font. a dirty reflow is never performed directly from the presentation shell. instead, a dirty reflow is detected when an incremental reflow reaches its target frame , described below. reflow metrics the reflow metrics object, nshtmlreflowmetrics, is used to propagate informati...
...incremental reflow proceeds recursively through the frame hierarchy. each frame along the incremental reflow path (as specified in the reflow command object) extracts the next frame and dispatches the reflow downward. in order to correctly dispatch the reflow to the child frame, the frame may need to perform some state recovery ; for example, a block frame will traverse its line
list to recover the space occupied by floated frames. at some point, the incremental reflow reaches the target frame , at which point the reflow command's type becomes significant. contentchanged indicates that the content corresponding to the target frame has changed somehow; for example, the text associated with a text frame has been modified. in reality, the only frame that res...
...onding to the target frame has changed somehow; for example, the text associated with a text frame has been modified. in reality, the only frame that responds to this sort of reflow is the block frame. the block frame treats this sort of change as a `full reflow' (i.e., as a resize). this makes me believe that we could probably eliminate this class altogether. stylechanged indicates that the sty
listic information corresponding to the target frame has changed; for example, the font size has increased. this causes the frame to mutate the reflow state's reason to stylechange, which is propagated recursively to the entire subtree beneath the target frame. reflowdirty indicates that container frame has decided to coalesce several incremental reflows targeted at its children into ...
Creating a Firefox sidebar extension - Archive of obsolete content
to firefox are installed with packages ("bundles"). an extension package usually contains a "content" provider, which contains the xul code and application logic. optionally locales and skins can be included. most additions are provided with a default tree structure, although not required it is recommended to use this structure. here the package for the sidebar is created, the files included are
listed below. example 1. package structure emptysidebar \- chrome |- content |- locale | \- en-us \- skin create all folders, except for skin. it is not used for this tutorial. the locale holds the locale, only the en-us locale is created. it is
listed in example 2. the locale includes the name and shortcut keys for the sidebar. example 2. chrome/locale/emptysidebar.dtd <!entity ...
...://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" > <vbox flex="1"> <label id="atest" value="&emptysidebar.title;" /> </vbox> </page> new extensions can be registered in the menus or popups, firefox uses overlays for extending menus. this is an separate xul file that specifies the location of menu items. the sidebar here is added to the view | sidebar menu. the overlay file is
listed in example 4. example 4. chrome/content/firefoxoverlay.xul <?xml version="1.0"?> <!doctype overlay system "chrome://emptysidebar/locale/emptysidebar.dtd"> <overlay id="emptysidebaroverlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <menupopup id="viewsidebarmenu"> <menuitem key="key_openemptysidebar" observes="viewemptysidebar" /> </menupopup> ...
...r.commandkey and openemptysidebar.modifierskey keys from the dtd, remove the <keyset> from the firefoxoverlay.xul file. one must then set the key attribute of the menuitem to "". the extension needs to provide some special manifest files that control how it is installed and where its chrome resources are stored. the first is install.rdf, the install manifest. see install manifests for a complete
listing of the required and optional properties. the install manifest is
listed in example 5. example 5. install.rdf <?xml version="1.0" encoding="utf-8"?> <rdf xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"> <description about="urn:mozilla:install-manifest"> <em:id>emptysidebar@yourdomain.com</em:id> <em:name>emptysidebar extension</e...
...ifest file is chrome.manifest, the chrome manifest file. the chrome manifest creates a lookup for all the resource types used by the extension. the manifest also tells firefox that the extension has an overlay that needs to be merged into the browser. for more information on chrome manifests and the properties they support, see the chrome manifest reference. the manifest used in this extension is
listed in example 6. example 6. chrome.manifest content emptysidebar chrome/content/ locale emptysidebar en-us chrome/locale/ skin emptysidebar classic/1.0 chrome/skin/ overlay chrome://browser/content/browser.xul chrome://emptysidebar/content/firefoxoverlay.xul test while you're developing your sidebar, you will need to test it frequently from firefox. there is a simple way to do this. first, ...
Specifying the appearance - Archive of obsolete content
now that we have defined a panel in which to display an icon, we use css to specify which icon to display. ...
...hich icon to display. ...
... busted), then create a set of css rules that displays the icon corresponding to the current tinderbox state: statusbarpanel#tinderbox-status {
list-style-image: url("chrome://navigator/content/tb-nostatus.png"); } statusbarpanel#tinderbox-status[status="success"] {
list-style-image: url("chrome://navigator/content/tb-success.png"); } statusbarpanel#tinderbox-status[status="testfailed"] {
list-style-image: url("chrome://navigator/content/tb-testfailed.png"); } statusbarpanel#tinderbox-status[status="busted"] {
list-style-image: url("chrome://navigator/content/tb-busted.png"); } mozilla can have multiple sets of stylesheets that govern its appearance, and we don't want to have to add these rules to each set (and have our extension break when a new set gets installed), so we'll put t...
...there is one rule for each possible tinderbox state. make your own icons for the four states or use the following icons: no status , success , test failed and busted . if you restart mozilla now you should see the "no status" icon appear in the ...
Documentation for BiDi Mozilla - Archive of obsolete content
while it was published in 2001 and might not be totally accurate, it does help understanding the internals of the bidi code. overview of bidi processing bidi text is reordered according to the unicode bidi algorithm (uba). ...
...s it is displayed by mozilla. text pasted from the clipboard is treated exactly as if it came from a logical source. form controls: based on bidi options in preferences, the text mode of form controls may be "logical", "visual" or "like containing document". we have also tested behaviour of all controls with dir=rtl and added support where necessary. ...
...e from a logical source. form controls: based on bidi options in preferences, the text mode of form controls may be "logical", "visual" or "like containing document". we have also tested behaviour of all controls with dir=rtl and added support where necessary. some support added for alignment in tables and
lists, and fixes for problems with different combinations of dir and align. ...
... controls: based on bidi options in preferences, the text mode of form controls may be "logical", "visual" or "like containing document". we have also tested behaviour of all controls with dir=rtl and added support where necessary. some support added for alignment in tables and
lists, and fixes for problems with different combinations of dir and align. ...
Style System Overview - Archive of obsolete content
css style rule representation problem: the rule structures use too much memory (a few hundred kilobytes for all our chrome), and require large numbers of allocations to construct. detail: !important declarations cause an extra rule object cssimportantrule to be created since they are in a separate part of the cascade other nsistylerule implementations nshtmlmappedattributes represents sty
listic html attributes turned into a style rule (one instance per unique set of attributes) bodyrule handles marginwidth/marginheight mixes on body and on frame. various rules in nshtmlstylesheet.cpp do other things with presentational color-related attributes and with tables. content nodes (instead of stylesheets) also hold onto cssstyleruleimpl objects that represent their style attributes. the...
... which rules match. has a separate rulesmatching method for pseudo-elements. cssruleprocessor one cssruleprocessor per origin (ua, user, author) css rule processor sorts all the rules in cascade order, and then puts them in rulehash, which remembers order and then hashes by first of id, class, tag, namespace, or unhashed. to match rules, we do lookups in the rulehash's tables, remerge the
lists of rules using stored indices, and then call selectormatchestree to find which selectors really match. matching of class and id selectors is much faster than, say, attribute selectors. (important advice for chrome css authors.) pseudo-elements are hashed in element hash, so for matching pseudo-elements we only need one hashtable lookup. style contexts each style context (nsstylecontext), ...
...ntent reresolvestylecontext calculates differences (repaint, reflow, reframe, etc.) between style old and new style contexts and does appropriate cleanup it uses nsistylecontext::calcstyledifference, which only computes differences for structs that have been requested. (i'll call this the data-struct-based hint mechanism.) caller of nsiframemanager::computestylechangefor processes the change
list, which has been built to avoid duplication. we also have reparentstylecontext, used in a few places (usually during frame construction), but it's broken (has many bugs that reresolvestylecontext used to have). dynamic changes to content: optimizations we optimize attribute changes by storing all the attributes that have an effect on which rules match and only doing a reresolvestylecontext i...
... attribute changes. different hint mechanism (from rule structs, not data structs) could make attributechanged just go straight to a frame-change, instead. bugs due to failure to call nsiframe::didsetstylecontext. style sheet addition and removal handled in pres shell. presshell::reconstructstyledata calls framemanager::computestylechangefor (reresolve) and then processes the frame-change
list. rebuilds rule tree if stylesheet was removed to avoid dangling pointers (and perhaps aliasing that would cause problems). otherwise we'd have to walk rule tree and compare each rule node to every rule in the sheet (o(rules * rule-nodes)). when rebuilding rule tree, we have to clear cached style contexts from xul menus and trees. style rule changes handling of style rule changes is done in...
Helper Apps (and a bit of Save As) - Archive of obsolete content
warning: the content of this article may be out of date. it was last updated in 2002. bird's eye view flow of control uriloader tries to find a content
listener for the mime type in question. when this fails, uriloader asks an nsiexternalhelperappservice to handle the load. the nsexternalhelperappservice looks up the nsimimeinfo for the load and creates an nsihelperapplauncher to manage the load. the nsexternalapphandler (which implements nsihelperapplauncher) uses the nsimimeinfo and an nsihelperapplauncherdialog to decide what to do with the data. the nsexternalapphandler does whatever it decided to do. nsimimeinfo lookup look in built-in
list which the user cannot override (types we handle internally). look in user preferences. ask the os: registry on window...
... gets notifications from necko as the data comes in. ...
... gets notifications from necko as the data comes in. four primary tasks: sets up temporary file and instantiate the nsihelperapplauncherdialog in onstartrequest. puts the data in the file as ondataavailable notifications come in. ...
...ity of the mimeinfo we get. reworking the helper app dialog to save user choices better. gnome integration for unix. future work fix the deficiencies in nsimimeinfo. better support for mailcap syntax. possible kde integration. possibly reflecting the os settings in our helper app preferences (readonly? writable?). have a way for users to override things in the "not overridable" built-in
list. original document information author(s): boris zbarsky last updated date: september 12, 2002 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
JavaScript crypto - Archive of obsolete content
uirement to protect users from malicious web sites. most of these services are available via the dom window object as window.crypto. services are provided to enable: smart card events, generating certificate requests, importing user certs, generating random numbers, logging out of your tokens, and signing text. handling smart card events web sites can make themselves more smartcard friendly by
listening for smartcard insertion and removal events. to enable your document to receive these events, you must first tell the crypto system you are interested by setting window.crypto.enablesmartcardevents to true. you can then register event handlers for these events with the document.addevent
listener() method. two smart card related events are generated: smartcard-insert when smartcards are insert...
...rtcard-insert when smartcards are inserted, and smartcard-remove when smartcards are removed. web sites which use ssl clientauth login could use the following code to refresh the page on token insertions and removals: <!doctype html> <p>... ...
...cards are removed. web sites which use ssl clientauth login could use the following code to refresh the page on token insertions and removals: <!doctype html> <p>... ...
... page on token insertions and removals: <!doctype html> <p>... <script> function onsmartcardchange() { window.location.reload(); } function register() { window.crypto.enablesmartcardevents = true; document.addevent
listener("smartcard-insert", onsmartcardchange, false); document.addevent
listener("smartcard-remove", onsmartcardchange, false); } function deregister() { document.removeevent
listener("smartcard-insert", onsmartcardchange, false); document.removeevent
listener("smartcard-remove", onsmartcardchange, false); } document.body.onload = register; document.body.onunload = deregister; </script> with the above example, your web site will automatically reload anytime a smartcard is inserted or removed. this allows the page to automatically login and logout based on the presence ...
jspage - Archive of obsolete content
||"iframe",d);var b=function(){var g=$try(function(){return c.contentwindow.location.host;});if(!g||g==window.location.host){var h=new window(c.contentwindow); new document(c.contentwindow.document);$extend(h.element.prototype,element.prototype);}e.call(c.contentwindow,c.contentwindow.document);};var a=$try(function(){return c.contentwindow; });((a&&a.document.body)||window.frames[d.id])?b():c.add
listener("load",b);return c;}});var elements=new native({initialize:function(f,b){b=$extend({ddup:true,cash:true},b); f=f||[];if(b.ddup||b.cash){var g={},e=[];for(var c=0,a=f.length;c<a;c++){var d=document.id(f[c],!b.cash);if(b.ddup){if(g[d.uid]){continue;}g[d.uid]=true; }if(d){e.push(d);}}f=e;}return(b.cash)?$extend(f,this):f;}});elements.implement({filter:function(a,b){if(!a){return this;}return new...
...this;},haschild:function(l){l=document.id(l,true);if(!l){return false; }if(browser.engine.webkit&&browser.engine.version<420){return $a(this.getelementsbytagname(l.tagname)).contains(l);}return(this.contains)?(this!=l&&this.contains(l)):!!(this.comparedocumentposition(l)&16); },match:function(l){return(!l||(l==this)||(element.get(this,"tag")==l));}});native.implement([element,window,document],{add
listener:function(o,n){if(o=="unload"){var l=n,m=this; n=function(){m.remove
listener("unload",n);l();};}else{h[this.uid]=this;}if(this.addevent
listener){this.addevent
listener(o,n,false);}else{this.attachevent("on"+o,n); }return this;},remove
listener:function(m,l){if(this.removeevent
listener){this.removeevent
listener(m,l,false);}else{this.detachevent("on"+m,l);}return this; },retrieve:function(m,l){var...
...turn this;},remove
listener:function(m,l){if(this.removeevent
listener){this.removeevent
listener(m,l,false);}else{this.detachevent("on"+m,l);}return this; },retrieve:function(m,l){var o=c(this.uid),n=o[m];if(l!=undefined&&n==undefined){n=o[m]=l;}return $pick(n);},store:function(m,l){var n=c(this.uid);n[m]=l; return this;},eliminate:function(l){var m=c(this.uid);delete m[l];return this;}});window.add
listener("unload",d);})();element.properties=new hash;element.properties.style={set:function(a){this.style.csstext=a; },get:function(){return this.style.csstext;},erase:function(){this.style.csstext="";}};element.properties.tag={get:function(){return this.tagname.tolowercase(); }};element.properties.html=(function(){var c=document.createelement("div");var a={table:[1,"<table>","</table>"],select:[1,"<...
...g)){return this; }h[e].keys.push(g);var f=e,a=element.events.get(e),c=g,i=this;if(a){if(a.onadd){a.onadd.call(this,g);}if(a.condition){c=function(j){if(a.condition.call(this,j)){return g.call(this,j); }return true;};}f=a.base||f;}var d=function(){return g.call(i);};var b=element.nativeevents[f];if(b){if(b==2){d=function(j){j=new event(j,i.getwindow()); if(c.call(i,j)===false){j.stop();}};}this.add
listener(f,d);}h[e].values.push(d);return this;},removeevent:function(c,b){var a=this.retrieve("events");if(!a||!a[c]){return this; }var f=a[c].keys.indexof(b);if(f==-1){return this;}a[c].keys.splice(f,1);var e=a[c].values.splice(f,1)[0];var d=element.events.get(c);if(d){if(d.onremove){d.onremove.call(this,b); }c=d.base||c;}return(element.nativeevents[c])?this.remove
listener(c,e):this;},addevents:func...
Plug-n-Hack Phase1 - Archive of obsolete content
ich specifies the url of the tool manifest. for example: var manifest = {"detail":{"url":"http://localhost:8080/manifest"}}; var evt = new customevent('configuresectool', manifest); it is suggested that browsers wishing to support pnh restrict handling of customevents such that they’re ignored where the event happens outside of user initiated actions. the configuration document should then
listen for a number of other events: configuresectoolstarted - this notifies the document that the browser is processing the configuration; if this event is not received within a reasonable amount of time after the configuresectool event has been fired, you might want to warn the user that pnh does not seem to be supported by this browser (perhaps prompting them to install the appropriate addon). ...
...pnh does not specify how tool commands should be displayed, so other browsers are free to display them in different ways. related links plug-n-hack overview ...
...pnh does not specify how tool commands should be displayed, so other browsers are free to display them in different ways. related links plug-n-hack overview ...
...ttps://developer.mozilla.org/docs/tools/gcli a example of how the zap commands are currently displayed is: note that user specified parameters can be specified for commands, which can either be free text, a static pull down
list of options or a dynamic
list of options obtained from the tool on demand. so if you select the “zap scan” command then you will be prompted to select a site from the
list of sites currently known to zap. pnh does not specify how tool commands should be displayed, so other browsers are free to display them in different ways. related links plug-n-hack overview ...
Mozilla Web Developer Community - Archive of obsolete content
get news from developer.mozilla.org and connect with developers involved in cross-browser, standards-based web development. ...
...archived devedge newsletters are at http://devedge-temp.mozilla.org/community/news/ feeds recent changes rss feed warning: this feed is updated very often. mozilla devel...
...dards communities get involved in grass-roots web standards evangelism efforts through these groups: the web standards project, a grassroots coalition fighting for standards maccaws, making a commercial case for web standards a
list apart, for people who make websites mozilla technology evangelism, get involved with mozilla evangelism you may also find helpful information on the w3c mailing
lists newsletter there is no newsletter planned at this time. ...
...lso find helpful information on the w3c mailing
lists newsletter there is no newsletter planned at this time. archived devedge newsletters are at http://devedge-temp.mozilla.org/community/news/ feeds recent changes rss feed warning: this feed is updated very often. mozilla developer news feed actually, there are no other feeds available for developer.mozilla.org. looking for feed ideas? the
list of old devedge feeds is at http://devedge-temp.mozilla.org/comm.../feed
list.html feedback hendrix mdnproduct feedback bugzilla - report a bug in a mozilla product for questions related to this website (but not technical questions), please send your message to the mdc mailing
list. ...
Anonymous Content - Archive of obsolete content
de. all anonymous nodes' ownerdocument pointers are set to the bound document at the time of generation. in effect the anonymous content exists in its own insulated pocket within the document. using parentnode, anonymous content nodes can refer to their explicit parents, but explicit parents have no knowledge of their anonymous children. the anonymous content is not accessible via the childnodes
list for the bound element, nor is it accessible using firstchild/nextsibling to iterate over the children of the bound element. the anonymous content is accessible only through special methods like getanonymousnodes and getanonymouselementbyattribute. anonymous content introduces the concept of scope to nodes within a document. because anonymous content elements can also have bindings attached that...
... of the bound element are destroyed. attribute forwarding attributes on anonymous content elements can be tied to attributes on the bound element. whenever the attribute is set or removed on the bound element, the corresponding attribute on the anonymous content is also set or removed. on any anonymous content element in a template, an inherits attribute can be used to specify a comma-separated
list of attributes that should be inherited. attributes with namespaces can be defined using a namespace prefix and the attribute name separate by a colon. for example, on the html file upload control, the anonymous textfield can be set up to automatically inherit the value attribute from the bound element. <xbl:binding id="fileuploadcontrol"> <xbl:content> <html:input type="text" xbl:inherits...
...ute name separate by a colon. for example, on the html file upload control, the anonymous textfield can be set up to automatically inherit the value attribute from the bound element. <xbl:binding id="fileuploadcontrol"> <xbl:content> <html:input type="text" xbl:inherits="value"/> <html:input type="button" value="browse..."/> </xbl:content> </xbl:binding> each entry in the inherits
list can either simply
list an attribute (such as value in the example above), or it can specify an = separated pair consisting of the attribute on the anonymous content that should be tied to the attribute on the bound element. the anonymous content attribute is
listed first. the special value xbl:text can be used in an = separated pair, where the prefix defined is the xbl namespace. when specified ...
... the pair it indicates that the attribute on the right-hand side should be stored as text nodes underneath the anonymous element. when used on the right-hand side, it indicates that any raw text nodes that are explicit children of the bound element should be coalesced and the resulting value should be stored as the attribute on the left-hand side. the xbl:text value cannot occur by itself in the
list. it may be used only in an = separated pair. note that the inherits attribute is never cloned when content is generated from a template. insertion points <children> xbl bindings can interleave anonymous content between bound elements and their explicit children. they do so using xbl children tags. any number of children tags may be used in a binding's anonymous content template. the locatio...
Creating XPI Installer Modules - Archive of obsolete content
s (see figure below). jar is a file format based on the zip file format and is used for aggregating multiple files into a single file. these archives are redundant with the subdirectories: mozilla now installs both the compressed and uncompressed versions of the ui, though you can change this when you build mozilla yourself. chrome/ us/ us.jar chatzilla/ chatzilla.jar chrome.rdf chrome
list.txt classic/ classic.jar comm/ comm.jar content-packs/ content-packs.jar embed-sample/ embed-sample.jar en-us/ en-us.jar en-mac/ en-mac.jar en-unix/ en-unix.jar en-win/ en-win.jar help/ help.jar inspector/ inspector.jar installed-chrome.txt messenger/ messenger.jar ... in addition to these jar files, there are also several new rdf files. these new ...
...file one of the most important ingredients of the software package is the contents.rdf file that describes the contents of the package in terms that the chrome registry can make sense of. for a package such as this one with its own content but no special localization or custom skin, the contents.rdf file describes package in terms of its relation to the "root" package of mozilla. ...
... localization or custom skin, the contents.rdf file describes package in terms of its relation to the "root" package of mozilla. ...
... barley/ content/ barley.gif barley.js barley.xul contents.rdf these four files are all you need in your new package. the next step is to zip up the contents of the working directory. using a zip archiver[zip], create a new archive of the content/ subdirectory and name it barley.jar: once this s...
allowevents - Archive of obsolete content
by setting the allowevents attribute to true, this special behavior is disabled, and the events are targeted the same as other elements. ...
...by setting the allowevents attribute to true, this special behavior is disabled, and the events are targeted the same as other elements. ...
...by setting the allowevents attribute to true, this special behavior is disabled, and the events are targeted the same as other elements. ...
...by setting the allowevents attribute to true, this special behavior is disabled, and the events are targeted the same as other elements. for menu, menuseparator, menuitem and treecol elements, as well as menu buttons, and the popup datepicker, mouse events are also retargeted to the element itself. ...
Writing to Files - Archive of obsolete content
ptableio), which was not available in any released version of the platform (pending some fixes). there are alternative xpcom apis you can use, your help in updating this pages to use the supported api is very much welcome! other documentation on files and i/o not using the unavailable nsiscriptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data,
list of file-related error codes. to write to a file, an output stream is used. an output stream is an object which can be used to write bytes, strings and other values to a file. to create an output stream, use nsiscriptableio.newoutputstream(). this method has a number of options to specify text or binary writing, the character set, and whether to append to an existing file or create a new one. to ...
...le object on the desktop called 'myinfo.txt' using nsiscriptableio.getfile(). it doesn't matter whether the file exists or not. nsiscriptableio.newoutputstream() is called to create a new output stream, which will be used to write to the file. in this example, the operations are enclosed in a try-catch block in order to capture any errors that might occur during the process. see file errors for a
list of errors that might occur. the newoutputstream method takes two arguments in this example. the first argument is the file to write to, and the second is a set of flags which control the writing. in this case, the 'text' flag is used which indicates that you will be writing text to the file. when writing text files, characters are writing using a chosen character set, encoded automatically. the d...
...here no new data was written. if this flag is not used, the file is truncated before being written to. the flags are designed such that the most common case that is needed is with no flags set, so usually you will not set these flags. however, here is an example of how they might be used: var stream = io.newoutputstream(file, "text nocreate append"); the flags are specified in a space separated
list as the second argument to the newoutputstream method. in this example, the nocreate flag is used to prevent the creation of new files, and the append flag is used to append to an existing file. writing text files characters are written to a text input stream using a specified character encoding, which defaults to utf-8. this means that a single character will occupy several bytes if it has a valu...
.... if you want to write using a different encoding, you can specify a third argument to nsiscriptableio.newoutputstream() which specifies the encoding. this example opens a file using the utf-16 encoding. var stream = io.newinputstream(file, "text", "utf-16"); this third argument is not needed to write using utf-8. as utf-8 can store all characters, you will usually always use this default. for a
list of supported character encodings, see supported character sets. the files can be written using the writestring method whichever character encoding is used. the difference is handled internally so you don't need to write any other part of the code differently. writing binary data in addition to text, binary values may be written to a file either as bytes or as numbers. a number of methods are avai...
Methods - Archive of obsolete content
« xul reference home acceptdialog additemtoselection addpane addprogress
listener addsession addtab addtabsprogress
listener advance advanceselectedtab appendcustomtoolbar appendgroup appenditem appendnotification blur cancel canceldialog centerwindowonscreen checkadjacentelement clearresults clearselection click close collapsetoolbar contains decrease decreasepage docommand ensureelementisvisible ensureindexisvisible ensureselectedelementisvisible expandtoolbar extra1 extra2 focus getbrowseratindex getbrowserfordocument getbrowserfortab getbrowserindexfordocument getbutton getdefaultsession geteditor getelementsbyattribute getelementsbyattributens getformattedstring gethtmleditor getindexoffirs...
... movetoalertposition onsearchcomplete ontextentered ontextreverted openpopup openpopupatscreen opensubdialog openwindow preferenceforelement reload reloadalltabs reloadtab reloadwithflags removeallitems removeallnotifications removealltabsbut removecurrentnotification removecurrenttab removeitemat removeitemfromselection removenotification removeprogress
listener removesession removetab removetabsprogress
listener removetransientnotifications replacegroup reset rewind scrollbyindex scrollbypixels scrolltoindex select selectall selectitem selectitemrange selecttabatindex setselectionrange showpane showpopup sizeto startediting stop stopediting swapdocshells syncsessions timedselect toggleitemselection ...
...s
listener removetransientnotifications replacegroup reset rewind scrollbyindex scrollbypixels scrolltoindex select selectall selectitem selectitemrange selecttabatindex setselectionrange showpane showpopup sizeto startediting stop stopediting swapdocshells syncsessions timedselect toggleitemselection related dom element methods dom:element.addevent
listener dom:element.appendchild dom:element.comparedocumentposition dom:element.dispatchevent dom:element.getattribute dom:element.getattributenode dom:element.getattributenodens dom:element.getattributens dom:element.getelementsbytagname dom:element.getelementsbytagnamens dom:element.getfeature fixme: brokenlink dom:element.getuserdata dom:element.hasattribute dom:element.h...
...ributens dom:element.hasattributes dom:element.haschildnodes dom:element.insertbefore dom:element.isequalnode dom:element.issamenode dom:element.issupported dom:element.lookupnamespaceuri dom:element.lookupprefix dom:element.normalize dom:element.removeattribute dom:element.removeattributenode dom:element.removeattributens dom:element.removechild dom:element.removeevent
listener dom:element.replacechild dom:element.setattribute dom:element.setattributenode dom:element.setattributenodens dom:element.setattributens dom:element.setuserdata ...
Extensions - Archive of obsolete content
</menubar> this menu is added to the main menu bar just before the tools menu. the insertbefore attribute is set to 'tools-menu' to ensure that the new menu is added at the right place. note that the menu will not appear until it has a <menupopup>. adding a new menuitem you might wish to add a new item to one of the menus. this can be done by overlaying the popup to append the item to. for a
list of the ids of the menus for firefox, see firefox menus. for example, to add an item to the end of the tools menu, use the following: <menupopup id="menu_toolspopup"> <menuitem label="thesaurus"/> </menupopup> note that other extensions may be adding their own items into the same menus. because of this, the new item might not appear at the end of the menu but before a menuitem added by anothe...
...the insertbefore or insertafter attributes to insert it before or after another item specified by an id. for example, the following may be used to insert a command just after the 'select all' command: <popup id="contentareacontextmenu"> <menuitem label="select links" oncommand="thumbnails.selectalllinks();" insertafter="context-selectall"/> </popup> see firefox context menu for a
list of the ids of the items found on the firefox context menu. showing and hiding context menu items to have a menuitem you have added be shown or hidden based on the context, you can use an event handler that
listens for the popupshowing event. for instance, if an image was context clicked, you may wish to hide the menu item you have added if the operation it performed wouldn't apply to images. f...
...ed be shown or hidden based on the context, you can use an event handler that
listens for the popupshowing event. for instance, if an image was context clicked, you may wish to hide the menu item you have added if the operation it performed wouldn't apply to images. function init() { var contextmenu = document.getelementbyid("contentareacontextmenu"); if (contextmenu) contextmenu.addevent
listener("popupshowing", thumbnailsshowhideitems, false); } function thumbnailsshowhideitems(event) { var show = document.getelementbyid("thumbnail-show"); show.hidden = (document.popupnode.localname != "img"); } the init function should be called within the handler for the load event so that the popupshowing event handler is hooked up before it would be opened by the user. in this example, the...
... menu. for more details about hiding and showing items on a context menu, see hiding and showing menu items based on context. determining what element was context clicked for general information about how to determine which element was the target of the context menu, that is, the element that was context clicked, see determining what was context clicked firefox uses its own popupshowing event
listener to adjust the items on the context menu. this allows the menu to have different commands for different types of targets. while the popup is open, the gcontextmenu global variable is set to an object which handles all of the functionality specific to the firefox context menu. specifically, this object is initialized with a set of properties that indiciate the type of object that was the target...
OpenClose - Archive of obsolete content
re: if the menu is already open, or already in the process of being opened. naturally, attempting to open a menu that is already open doesn't have any effect. if the menu is a child of another menu and the parent menu is not open. in this case, the parent menu must be opened first. if you do want to open a submenu, open the parent menu first, and then open the child menu in a popupshown event
listener. see the popupshown event for an example of how to do this. a menu in an unprivileged content window (such as a web page) can only open a popup while its window is focused, and it is in the currently active tab. that means that a document in a background tab cannot open a menu or popup. closing menus menus will close automatically once the user has made a selection from the menu. when an ...
...pen property applies to the menu or button, not to the menupopup. somemenu.open = false; this command will close only a single level of menus, so any parent menus will need to be closed with a similar command if desired. however, any child menus of 'somemenu' in the example will be closed, as 'somemenu' will no longer be open. for instance, let's say that a file menu has a submenu containing a
list of recent files. if both menus are open and the open property on the submenu is set to false, the submenu will close, yet the parent file menu will remain open. on the other hand, if the open property on the file menu is set to false, both menus will close. this technique may be used for both menupopups that use the menu tag, the button tag and the toolbarbutton tag. for menupopups attached to o...
...er hand, if the open property on the file menu is set to false, both menus will close. this technique may be used for both menupopups that use the menu tag, the button tag and the toolbarbutton tag. for menupopups attached to other elements using the popup or context attributes, see closing a popup below. when a menu is closed, the popuphiding event is fired at the menupopup. attaching an event
listener which
listens for the popuphiding event can be used to remove any commands that were adding during the popupshowing event. menus and popups are also closed when the document or window they are contained within is closed, or if the menupopup element is removed from the document. these are situations when the popuphiding or popuphidden events may not fire as the element the events would be fir...
...enpopup(null, "", 60, 50, false, false); an unanchored popup uses the x and y offsets, in this case 60 and 50 as offsets from the edge of the window or frame. this way, a popup can be positioned relative to the window, rather than relative to a specific node. for example, you might wish to open a popup at the current mouse position when the mouse is clicked. here is an example mouse click event
listener: function mouseclicked(event) { var panel = document.getelementbyid("some-panel"); panel.openpopup(null, "", event.clientx, event.clienty, false, false); } the openpopupatscreen method a second method, openpopupatscreen, may be used to open up a popup and place it at a specific screen coordinate. in this case, the popup is not anchored to an element and just appears at a specific loca...
Building Trees - Archive of obsolete content
« previousnext » the most common element to use with a template is the tree. you can use a template with a tree just like any other template. however, since templates are often used with trees—especially with large amounts of data—the template system supports a special builder just for creating trees. rather than generate content for every row in the tree, the results are stored in a
list inside the builder. this means that dom nodes are not constructed for any of the items. this is much more efficient; creating large numbers of dom nodes adds a lot of overhead. the performance advantage is possible since trees only display text. as a result, the builder only has a few pieces of information to keep track of. to use the tree builder, you need to add a flags attribute to the root n...
..., the content builder becomes slower as the amount of data increases. apart from the flags attribute, the template syntax for the tree builder and the content builder are identical. however, the tree builder requires a very specific form to the action body. specifically, the action body should be a single treeitem with its rows and cells. ...
...s mentioned above, any other attributes specified on the tree rows and cells are ignored. since no elements are generated, you won’t be able to retrieve the values for them either. thus, the value attribute may be useful to associate an additional value with a row since it will be easier to retrieve. the src attribute may be used to set an image to appear in a cell. ...
... « previousnext » ...
Multiple Queries - Archive of obsolete content
sed to combine the results from several queries together, or may be used to generate different types of results when recursive iterations. to use multiple queries, place each query element along with its rules inside a queryset element. the queryset element is a bit of a misnomer, it actually only contains one query each. the following is the basic structure of a template with multiple queries: <
listbox datasources="..." ref="..."> <queryset> <query> ... </query> <rule> ... </rule> </queryset> <queryset> <query> ... </query> <rule> ... </rule> </queryset> </
listbox> each queryset holds a query and its set of rules. if there is only rule, the rule element may be omitted as is the case when only one query is used. the results from...
...> </
listbox> each queryset holds a query and its set of rules. if there is only rule, the rule element may be omitted as is the case when only one query is used. the results from the first query are generated first and output generated for it, followed by the results and output for the second query, and so forth for all of the queries. ...
...ges them in the order they appear in the seq. this and other automated sorting done by the template builder is a fairly complicated process that will be discussed in more detail later. multiple queries using the rdf simple syntax you can also use multiple queries with rdf datasources using the simple query syntax. ...
... thus, you will want to use the simple query syntax when possible. if you are only going to be using one query, it doesn't matter, of course. speaking of using a single query, the simple query syntax allows a slight shorthand. you can remove the <rule> element and place the rule's conditions directly on the <template>. there's no performance benefit, but it does save some typing. <hbox id="photos
list" datasources="template-guide-photos3.rdf" ref="http://www.xulplanet.com/rdf/myphotos" xmlns:dc="http://purl.org/dc/elements/1.1/"> <template dc:title="canal"> <button uri="rdf:*" image="rdf:*" label="view" orient="vertical"/> </template> </hbox> this example shows only a single photo since a condition is used to filter out the other two photos. note that in this shorthand, ...
Namespaces - Archive of obsolete content
xml namespaces can be used in xul templates by binding the namespace uri and prefix to the template element. ...
...efix to the template element. ...
...name="napoleon bonaparte" gender="male"/> <person name="cleopatra" gender="female"/> <person name="julius caesar" gender="male"/> <person name="ferdinand magellan" gender="male"/> <person name="laura secord" gender="female"/> </people> <
listbox datasources="people.xml" ref="*" querytype="xml"> <template xmlns:ns="www.example.com/people"> <query expr="ns:person"/> <action> <
listitem uri="?" label="?ns:name"/> </action> </template> </
listbox> once added to the template element the namespaces can then be referenced inside temple rule elements too, this works both in rdf and xml templates. <
listbox datasources="people.xml" ref="*" querytype="xml"> <template xmlns:ns="www.example.com/people"> <query expr="ns:person"/> <rule ns:gender="male"> <label uri=...
...plate> </
listbox> once added to the template element the namespaces can then be referenced inside temple rule elements too, this works both in rdf and xml templates. ...
Toolbar customization events - Archive of obsolete content
none of these events contain any data; if you need details, you'll need to look at the toolbar. beforecustomization this event is delivered when the user starts the toolbar customization process; for example, by right-clicking on a toolbar and choosing "customize". customizationchange this event is delivered when the user makes a change to a toolbar while editing the toolbars, either by dragging an item to the toolbar or by dragging an item out of it. ...
...ing an item to the toolbar or by dragging an item out of it. aftercustomization this event is delivered when the user closes the toolbar customization panel. in all cases, the event.target is the toolbox being customized. you can look at the contents of that element and its children to determine what changes were made. example in this example, we watch for toolbar changes. ...
...ustomization this event is delivered when the user closes the toolbar customization panel. in all cases, the event.target is the toolbox being customized. you can look at the contents of that element and its children to determine what changes were made. example in this example, we watch for toolbar changes. ...
...olbar customization panel. in all cases, the event.target is the toolbox being customized. you can look at the contents of that element and its children to determine what changes were made. example in this example, we watch for toolbar changes. ...
Adding Style Sheets - Archive of obsolete content
r find files dialog example let's modify the find files dialog so that its style comes from a separate style file. first, the modifed lines of findfile.xul: <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <?xml-stylesheet href="findfile.css" type="text/css"?> ... ...
...me://global/skin/" type="text/css"?> <?xml-stylesheet href="findfile.css" type="text/css"?> ... ...
... href="findfile.css" type="text/css"?> ... <spacer class="titlespace"/> <groupbox orient="horizontal"> <caption label="search criteria"/> <menu
list id="searchtype"> <menupopup> <menuitem label="name"/> <menuitem label="size"/> <menuitem label="date modified"/> </menupopup> </menu
list> <spacer class="springspace"/> <menu
list id="searchmode"> <menupopup> <menuitem label="is"/> <menuitem label="is not"/> </menupopup> </menu
list> <spacer class="springspace"/> <menu
list id="find-text" flex="1" editable="true" datasources="file:///mozilla/recents.rdf" ref="http://www.xulplanet.com/rdf/recent/all"/> ... <spacer class="titlespace"/> <hbox...
...in/); the second syntax is preferred because it reduces the number of dependencies within the xul file itself. remove the global style sheet import from findfile.xul and add the import to findfile.css. all elements can be styled using css. you can use selectors to select the element that you wish to have styled. (the selector is the part before the curly brace in a style rule). the following
list summarizes some of the selectors available: button matches all button tags. #special-button matches the element with an id of special-button. .bigbuttons matches all elements with a class of bigbuttons. button.bigbuttons matches all button elements with a class of bigbuttons. toolbar > button matches all buttons that are ...
Creating a Skin - Archive of obsolete content
yle has applied only to the first tab, because it's the selected one. adding toolbar icons it is somewhat difficult to distinguish the buttons on the toolbar from the commands on the menu. we could add some icons to the buttons to make them clearer. mozilla composer provides some icons for open and save buttons, which we'll just use here to save time. ...
...t's the selected one. adding toolbar icons it is somewhat difficult to distinguish the buttons on the toolbar from the commands on the menu. we could add some icons to the buttons to make them clearer. mozilla composer provides some icons for open and save buttons, which we'll just use here to save time. we can set the image for a button using the
list-style-image css property. ...
... some icons to the buttons to make them clearer. mozilla composer provides some icons for open and save buttons, which we'll just use here to save time. we can set the image for a button using the
list-style-image css property. #opensearch {
list-style-image: url("chrome://editor/skin/icons/btn1.gif"); -moz-image-region: rect(48px 16px 64px 0); -moz-box-orient: vertical; } #savesearch {
list-style-image: url("chrome://editor/skin/icons/btn1.gif"); -moz-image-region: rect(80px 16px 96px 0); -moz-box-orient: vertical; } mozilla provides a custom style property -moz-image-region which can be used to make an element use part of an image. you can think of it as a clip region for the image. you set the property to a position and size within an image and the button will display only...
...tes have corresponding css properties. other changes next, we'll make a couple of changes to the buttons along the bottom, again reusing some icons from mozilla to save time. if creating your own skin, you will need to create new icons or copy the icons to new files. if following the example in this section, just copy the files to your new skin and change the urls accordingly. #find-button {
list-style-image: url("chrome://global/skin/checkbox/images/cbox-check.jpg"); font-weight: bold; } #cancel-button {
list-style-image: url("chrome://global/skin/icons/images/close-button.jpg"); } button:hover { color: #000066; } we add some images to the buttons and make the find button have bold text to indicate that it is the default button. the last rule applies to buttons when the mouse...
Document Object Model - Archive of obsolete content
= document.getelementbyid('somebox'); var flex = box.flex; var box2 = document.getelementbyid('anotherbox'); box2.flex = 2; once you have a reference to an element, you can call the properties of that element. for example, to get the hidden property for an element, you can use the syntax element.hidden where 'element' is a reference to the element. you might note that most of the properties
listed in the reference correlate to common attributes on elements. there are differences, of course, for example, while getattribute("hidden") will return the string 'true' for a hidden element, whereas the hidden property returns a boolean true value. in this case, the type conversion is done for you so the property is more convenient. as with each document, there is a different element object for ...
...source, but you may also find text nodes, comment nodes and a few other types in a document tree. in the case of xul, the root element will be the window tag in the xul document. each node in the tree may have children and those children may have child nodes of their own. since the dom is a tree structure, you can navigate through the tree using a variety of properties. ...
... the xul document. each node in the tree may have children and those children may have child nodes of their own. since the dom is a tree structure, you can navigate through the tree using a variety of properties. some common properties are
listed below: firstchild reference to the first child node of an element lastchild reference to the last child node of an element childnodes holds a
list of the children of an element parentnode reference to the parent of an node nextsibling reference to the next sibling in sequence previoussibling reference to the previous sibling in sequence these properties allow you to navigate through a document is various ways. for example, you might get the first child of an element using the firstchild property and then navigate through the chil...
...n sequence previoussibling reference to the previous sibling in sequence these properties allow you to navigate through a document is various ways. for example, you might get the first child of an element using the firstchild property and then navigate through the children using the nextsibling property. or, you might accomplish the same thing by iterating through the items in the childnodes
list. in mozilla, the latter method is more efficient. the following example shows how to iterate over the children of the root node: var childnodes = document.documentelement.childnodes; for (var i = 0; i < childnodes.length; i++) { var child = childnodes[i]; // do something with child } the childnodes variable will hold the children of the document root element. we then use a for loop to ite...
Focus and Selection - Archive of obsolete content
nts to update parts of the interface as the user selects elements. for instance, you might update a total as the user enters values in other fields, or use focus events to validate certain values. don't display an alert during a focus or blur event as this will be distracting for the user and is poor user interface design. you can also add event handlers dynamically using the dom function addevent
listener. you can use it for any element and event type. it takes three parameters, the event type, a function to execute when the event occurs and a boolean indicating whether to capture or not. getting the currently focused element the currently focused element is held by an object called a command dispatcher, of which there is only one for the window. the command dispatcher is responsible for keepi...
...r from a window using the document's commanddispatcher property. from there, you can get the focused element with the dispatcher's focusedelement property. the example below shows this. ...
...nt.getelementbyid("focused").value = focused.tagname; } </script> <hbox> <label control="username" value="user name:"/> <textbox id="username"/> </hbox> <button label="hello"/> <checkbox label="remember this decision"/> <label id="focused" value="-no focus-"/> </window> in this example, a focus event handler is attached the window. we want to use a capturing event handler, so the addevent
listener method needs to be used. it registers a capturing event handler with the window which will call the setfocusedelement method. this method gets the focused element from the command dispatcher and sets a label to its tag name. as the focused element is changed, the label will show the tagname of the element. a few things to note. first, when the textbox is focused, the tag name is 'html:inpu...
...atcher.advancefocus(); in fact, the commanddispatcher simply implements the nsidomxulcommanddispatcher interface. this interface also provides a number of other methods which may be useful. platform specific behaviors mac os x there is a preference called "full keyboard access" (fka). note that xul adheres to this. this means that when the fka preference is off, only textboxes and
lists/trees are focusable with the keyboard, as well as from your code using focus(). handling text changes there are two events that can be used when the user changes the value of a textbox. naturally, these events will only be sent to the textbox that has the focus. the input event is fired whenever the text is modified in the field. the new value will be different than the old value. you may wa...
Manifest Files - Archive of obsolete content
three overlays are also specified, which allow content from different packages to combine together. extensions will make the most use of overlays, since they merge their ui with the browser ui. the file paths for the branding and browser packages use jar urls as the content is packaged up into an archive. a jar archive can be created with a zip utility. for a jar...
...f you wish. this may be done when creating an extension such that all of the parts are in one file. we will do this for the find files dialog. create a file findfile.manifest in the chrome directory. add the following to the file: content findfile file:///findfile/content/ skin findfile classic/1.0 file:///findfile/skin/ locale findfile en-us file:///findfile/locale/ create the new directories
listed above. it doesn't matter where the directories are created, but the file paths in the manifest file should point to the directories. naturally, you will want to use directory paths suitable for your system. if we were distributing the package, we would want to package them up into a jar file, and modify the paths. in this case, we are just creating to demonstrate a manifest file and to prepare ...
...a add-ons site, where users can locate them for installation. while they may be installed from any site, other sites are not configured to allow installations by default. it is also possible to use a install script written in javascript to install files. this allows you to copy files to any location and perform other file management tasks. however, applications installed with a script will not be
listed in the extension manager and there is no automated method to uninstall them. for this reason, the install scripts are not used often. for standalone applications, they can be packaged up using xulrunner. this allows a separate executable file, and the application may be distributed independently of a browser. for more information about creating extensions, see extensions. for more information a...
.... make sure the contents.rdf file is in the right directory and is well-formed. open the contents.rdf file in mozilla to see if it parses as well-formed xml. if not, you will see an error on a yellow background. if you are using a debug build of mozilla, some info will be printed to the terminal when starting up indicating what chrome applications are being checked. check if your application is
listed. the error message "xml parsing error: undefined entity" in your xul file can be caused by an error in the manifest or in the jar file referenced by the manifest. for example, in <!doctype window system "chrome://fireclipse/locale/fireclipse.dtd"> the dtd file must exist and its directory must be correctly addressed in the "locale" manifest or xml parsing will fail. for more information about...
Scrolling Menus - Archive of obsolete content
l appear on each end of the menu. if you move the mouse over the arrows, the menu will scroll up and down. if the available space is large enough, the arrows will not appear. note that the exact behavior of the scrolling will depend on the current theme. this behavior is automatic. you do not have to do anything in order to get scrolling menus. ...
...o get scrolling menus. it will apply to menus on menubars, in popups or menu
lists. it is implemented using an arrowscrollbox element. this element can be used to create a scrolling box with arrows. the arrowscrollbox can be used anywhere a regular box can be used. you don't have to use it in menus. it is always a vertical box and may contain any elements inside it. you could use it to implement a
list when you don't want it to be a drop-down. ...
...s or menu
lists. it is implemented using an arrowscrollbox element. this element can be used to create a scrolling box with arrows. the arrowscrollbox can be used anywhere a regular box can be used. you don't have to use it in menus. it is always a vertical box and may contain any elements inside it. you could use it to implement a
list when you don't want it to be a drop-down. ...
...s element can be used to create a scrolling box with arrows. the arrowscrollbox can be used anywhere a regular box can be used. you don't have to use it in menus. it is always a vertical box and may contain any elements inside it. you could use it to implement a
list when you don't want it to be a drop-down. ...
Styling a Tree - Archive of obsolete content
esired, which in this case is a row. you can also use the following values: ::-moz-tree-cell: a cell. use this to set borders and background colors. ::-moz-tree-cell-text: the text in a cell. use this to set the font and text color. ::-moz-tree-twisty: the appearance of the twisty used to expand and collapse child rows. ::-moz-tree-image: the image for a cell. you can set the image with the
list-style-image property. ::-moz-tree-row: a row. use this to set the background color of a row. ::-moz-tree-indentation: the indentation to the left of rows that are children of other rows. ::-moz-tree-column: a column. ::-moz-tree-line: the lines that are drawn to connect child rows to parent rows. ::-moz-tree-separator: a separator in a tree. ::-moz-tree-progressmeter: content for progressme...
... for properties that are 'readonly', it adds a red border around the row. note that the first rule will apply to any row that is 'readonly' regardless of whether other properties such as 'unread' are set. treechildren::-moz-tree-row(readonly) { border: 1px solid red; } treechildren::-moz-tree-row(readonly, unread) { background-color: rgb(80%, 80%, 80%); } default properties the properties
list for tree elements contain a small number of default properties, which you can also use in a style sheet. you can use these extra properties to set the appearance of containers or selected rows. the following properties are automatically set as needed: checked this property is set cells whose column is type="checkbox" focus this property is set if the tree currently has the focus. selected ...
...es 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. these return information about an individual row, column and cell. 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. the function getcolumnproperties() also supplies the corresponding treecol element for the column. 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 func...
... be used to add an element to the array. we can use the interface nsiatomservice to construct string atoms for the properties. getcellproperties: function(row,col,props){ if ((row %4) == 0){ var aserv=components.classes["@mozilla.org/atom-service;1"]. getservice(components.interfaces.nsiatomservice); props.appendelement(aserv.getatom("makeitblue")); } } the properties
list requires an array of atom objects, which can be thought of as constant strings. we create them using the xpcom interface nsiatomservice and add them to the array using the appendelement() function. here, we create an atom 'makeitblue'. you can call appendelement() again to add additional properties. from gecko 22 your function should return a string containing the property. getcellproperties: f...
Templates - Archive of obsolete content
of course, this assumes that the datasource supplies the appropriate resources. if a particular one is not found, the value of the attribute will be set to an empty string. <button class="rdf:http://www.example.com/rdf#class" uri="rdf:*" label="rdf:http://www.example.com/rdf#name" crop="rdf:http://www.example.com/rdf#crop"/> as you can see, you can dynamically generate
lists of elements with the attributes provided by a separate datasource. the uri attribute is used to specify the element where content generation will begin. content earlier will only be generated once whereas content inside will be generated for each resource. we'll see more about this when we get to creating templates for trees. more examples by adding these features to the container the templat...
...ent where content generation will begin. content earlier will only be generated once whereas content inside will be generated for each resource. we'll see more about this when we get to creating templates for trees. more examples by adding these features to the container the template is in, which in this case is a box, and to the elements inside the template, we can generate various interesting
lists of content from external data. we can of course put more than one element inside a template and add the special rdf references to the attributes on any of the elements. the example below demonstrates this. example 2 : source <vbox datasources="rdf:bookmarks" ref="nc:bookmarksroot" flex="1"> <template> <vbox uri="rdf:*"> <button label="rdf:http://home.netscape.com/nc-rdf#name"/> ...
...roblem though, since other elements such as menus wouldn't be expected to display too many items. it's also possible to use the content builder for trees as well, and a treeitem element and related elements will be created for each row. rules in the image of the earlier example, you may have noticed that the third button is simply a button with hyphens on it. this is a separator in the bookmark
list. in the way that we have been using it, the rdf bookmarks datasource supplies the separators as if they were just regular bookmarks. what we would really like to do is add a small amount of spacing instead of a button for separator resources. that means that we want to have two different types of content be created, one type for regular bookmarks and a second type for separators. we can do this ...
...es apply to which rdf resource. when scanning for which rule applies to the data, each rule element is checked in sequence for a match. that means that the order in which you define rules is important. earlier rules will override later rules. ...
Tree View Details - Archive of obsolete content
this together into a simple example that takes an array and constructs a tree from it. this tree will only support a single parent level with an inner child level, but it could be extended to support additional levels without too much effort. we'll examine it piece by piece. <window onload="init();" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <tree id="element
list" flex="1"> <treecols> <treecol id="element" label="element" primary="true" flex="1"/> </treecols> <treechildren/> </tree> </window> we use a simple tree here with no data in the treechildren. the 'init' function is called when the window is loaded to initialize the tree. it simply sets the custom view by retrieving the tree and setting its 'view' property. we will define 'treeview' n...
...element" primary="true" flex="1"/> </treecols> <treechildren/> </tree> </window> we use a simple tree here with no data in the treechildren. the 'init' function is called when the window is loaded to initialize the tree. it simply sets the custom view by retrieving the tree and setting its 'view' property. we will define 'treeview' next. function init() { document.getelementbyid("element
list").view = treeview; } the custom tree view will need to implement a number of methods, of which the important ones will be examined individually. first we'll define two structures to hold the data for the tree, the first will hold a map between parents and the children they contain, and the second will hold an array of the visible items. remember that a custom view must keep track of which items...
...s we can implement but they don't need to do anything in this example, so we can create functions that do nothing for those. ...
... « previousnext » ...
XUL Reference - Archive of obsolete content
« xul reference « alphabetical
list of all xul elements action arrowscrollbox assign bbox binding bindings box broadcaster broadcasterset button browser checkbox caption clicktoscroll colorpicker column columns commandset command conditions content datepicker deck description dialog dialogheader dropmarker editor grid grippy groupbox hbox iframe image key keyset label
listbox
listcell
listcol
listcols
listhead
listheader
listitem member menu menubar menuitem menu
list menupopup menuseparator notification notificationbox observes overlay page panel param popupset preference preferences prefpane prefwindow progressmeter query queryset radio radiogroup resizer rich
listbox rich
listitem row rows rule scale scri...
...e textnode textbox textbox (firefox autocomplete) textbox (mozilla autocomplete) timepicker titlebar toolbar toolbarbutton toolbargrippy toolbaritem toolbarpalette toolbarseparator toolbarset toolbarspacer toolbarspring toolbox tooltip tree treecell treechildren treecol treecols treeitem treerow treeseparator triple vbox where window wizard wizardpage categorical
list of all xul elements « xul reference « windows window wizard wizardpage titlebar window structure --- menus and popups --- toolbars toolbar toolbarbutton toolbargrippy toolbaritem toolbarpallete toolbarseperator toolbarspring tabs and grouping tab tabbox tabpanel tabpanels tabs controls --- text and images label caption image
list...
...- menus and popups --- toolbars toolbar toolbarbutton toolbargrippy toolbaritem toolbarpallete toolbarseperator toolbarspring tabs and grouping tab tabbox tabpanel tabpanels tabs controls --- text and images label caption image
lists --- trees --- layout --- templates --- scripting --- helper elements other xul
lists dialog overlay page window wizard wizardpage preference preferences prefpane prefwindow browser tabbrowser editor iframe titlebar resizer statusbar statusbarpanel dialogheader notification notificationbox menubar menu menuitem menuseparator menupopup panel tooltip popupset toolbar toolbarbutton toolbargrippy toolbaritem toolbarpalette toolbarseparator tool...
...statusbarpanel dialogheader notification notificationbox menubar menu menuitem menuseparator menupopup panel tooltip popupset toolbar toolbarbutton toolbargrippy toolbaritem toolbarpalette toolbarseparator toolbarset toolbarspacer toolbarspring toolbox tabbox tabs tab tabpanels tabpanel groupbox caption separator spacer button checkbox colorpicker datepicker menu
list progressmeter radio radiogroup scale splitter textbox textbox (firefox autocomplete) textbox (mozilla autocomplete) timepicker description label image
listbox
listitem
listcell
listcol
listcols
listhead
listheader rich
listbox rich
listitem tree treecell treechildren treecol treecols treeitem treerow treeseparator box hbox vbox bbox deck stack grid columns colu...
XUL accessibility guidelines - Archive of obsolete content
bility platform features mozilla community software accessibility - where are we today? intro to accessibility, assistive technologies, and mozilla resources. introduction to web accessibility. overview of web accessibility from webaim. dive into accessibility. downloadable book on web accessibility with tips and character sketches. assistive technology compatibility.
list of popular assistive technologies and their respective compatibility levels with xul. #accessibility. accessibility channel for general discussion around internet accessibility with logger. useful at conferences. apple accessibility. portal to apple accessibility. lars (linux accessibility resource site). portal for general linux accessibility. microsoft accessibility. portal for m...
...d shortcuts you assign do not interfere with those already defined by the base application. refer to the following resources when setting keyboard shortcuts. learn more keyboard shortcuts and accesskeys mozilla keyboard planning faq and cross reference. an excellent guide for determining unused key combinations and cross platform issues. mozilla keyboard shortcuts. a full
list of keyboard shortcuts for the various mozilla applications. mozilla's accesskey faq. a short reference for using the accesskey attribute. context menus the context menu is the small menu activated with a right mouse click on a content area or element (or with shift + f10 or vk_apps on windows and ctrl + click or ctrl + space on a mac). use the oncontextmenu event handler or the conte...
...mouseover, onmousemove, and ondrag can only be activated with the use of the mouse. provide keyboard-accessible alternative access points for this functionality. consider using context menu items or other xul elements along with keyboard shortcuts. scrolling ensure that scrolling is keyboard accessible. many xul elements can be set to scroll using css. other elements, such as arrowscrollbox and
listbox, are made to scroll automatically. as a general rule, elements set to scroll are inaccessible if the user cannot scroll to all the content using the keyboard. the arrowscrollbox, for example, is a non-focusable element and cannot be scrolled using a keyboard. a
listbox, however, can receive focus so its contents can scroll. almost any xul element can be set to scroll by setting a style to "ove...
...oid re-creating functionality that already exists. ensure that custom components are built with accessibility in mind. use css system colors to ensure that new widgets interact well with other widgets and with user-defined colors and themes. learn more accessible custom widgets accessible dhtml building accessible custom components in xul xul accessibility check
list use the following check
list to quickly verify the accessibility of a new xul application, or as a starting point for fixing accessibility problems in an existing one. keyboard access checkpoint pass fail tab order logical tab order is provided. tab order jumps around unexpectedly. trees keyboard functionality is provided for inaccessible features such ...
colorpicker - Archive of obsolete content
isabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. color type: color string the currently selected color. this is modified when the user selects a color. you can assign a string of the form #rrggbb to this property to change the selected color. ...
...date additional state. color type: color string the currently selected color. this is modified when the user selects a color. you can assign a string of the form #rrggbb to this property to change the selected color. overview an onchange attribute is an event
listener to the object for the event change. 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 ...
...gets and sets the value of the disabled attribute. open type: boolean returns true if the popup for a button-type colorpicker is open. set this property to true to open the popup or false to close the popup. tabindex type: integer gets and sets the value of the tabindex attribute. ...
...you may use onclick when you are working with a plain colorpicker and need the currently selected color for example to display in a <textbox>. ...
command - Archive of obsolete content
eave this attribute out entirely. visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. label type: string the label that will appear on the element. if this is left out, no text appears. for an editable menuitem element the value of this attribute is copied to the menu
list.value property upon user selection of the menuitem. oncommand type: script code this event handler is called when the command is activated. this occurs when a user selects a menu item or presses a keyboard shortcut attached to the command. reserved type: string this attribute applies to a command element. setting this attribute to "true" indicates that the command is reserved...
... occurs when a user selects a menu item or presses a keyboard shortcut attached to the command. reserved type: string this attribute applies to a command element. setting this attribute to "true" indicates that the command is reserved for chrome code and is not available for use in the content. this means that, to execute these commands, key events won't be passed to content, and event
listeners registered for them in content will not be executed. currently, the content still receives these key events, even though it can't override them. in future releases, it won't receive them. see bug 1173061 for details. properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, ...
...llowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related xul:
list of commands ...
commandset - Archive of obsolete content
es commandupdater type: boolean if true, the commandset is used for updating commands. typically, this is used to update menu commands such as undo and cut based on when an event occurs. for example, since the cut command is only valid when something is selected, a command updater might be used when the select event occurs. events type: comma-separated
list a comma-separated
list of event names that the command updater will update upon. if this attribute is not specified, or you set it to the value '*', all events are valid. valid events are
listed below, or you can use your own events. you can send a custom event by calling the updatecommands method of the command dispatcher. focus: occurs when the focused element changes. s...
...lement changes. select: occurs when the selected text changed. clipboard: occurs when the clipboard is changed. undo: occurs when the undo buffer is changed. oncommandupdate type: script code this event occurs when a command update occurs. you would use this to update the disabled status of items. targets type: comma-separated
list of element ids a comma-separated
list of element ids that the command updater will update upon. if this attribute is not specified, or you set it to the value '*', all elements are valid. the command update will only occur when the event occurs to one of the specified elements. properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , col...
...llowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
dialog - Archive of obsolete content
uttonlabelextra2 type: string the label to appear on the second extra button. buttonlabelhelp type: string the label to appear on the "help" button. buttonorient type: string the value of the orient attribute for the box containing the buttons. buttonpack type: string the value of the pack attribute for the box containing the buttons. buttons type: comma-separated
list of the values below a comma-separated
list of buttons to appear in the dialog box. the buttons will be placed in suitable locations for the user's platform and basic event handling will be performed automatically. the following values can be used in the
list: accept: the ok button, which will accept the changes when pressed. this button will also be the default button. cancel: the cancel b...
...lues as those for the buttons attribute. inactivetitlebarcolor type: color string specify background color of the window's titlebar when it is inactive (background). moreover this hides separator between titlebar and window contents. this affects only on mac os x. title type: string the text to appear in the title bar of the window. properties buttons type: comma-separated
list of the values below a comma-separated
list of buttons to appear on the dialog box. the buttons will be placed in suitable locations for the user's platform and basic event handling will be performed automatically. the following values can be used in the
list: accept: the ok button, which will accept the changes when pressed. this button will also be the default button. cancel: the cancel b...
...uttonlabelextra2 attribute. defaultbutton type: string normally this attribute should not be set, but if it is, it specifies the default button in the dialog. typically, this means that the button will be activated when the enter key is pressed. this should be set to one of the same values as those for the buttons attribute. ...
... canceldialog() return type: no return value cancels the dialog and closes it, similar to pressing the cancel button. centerwindowonscreen() return ty...
grid - Archive of obsolete content
torial. example <!-- groupbox containing a grid. ...
..."/> <column flex="2"/> </columns> <rows> <row> <label value="user name"/> <textbox id="user"/> </row> <row> <label value="group"/> <menu
list> <menupopup> <menuitem label="accounts"/> <menuitem label="sales" selected="true"/> <menuitem label="support"/> </menupopup> </menu
list> </row> </rows> </grid> </groupbox> attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ...
...llowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
... ...
iframe - Archive of obsolete content
ed in this case, please see displaying web content in an extension without security issues. more information is available in the xul tutorial. ...
...default is false. src type: uri ...
...s the nsidocshell object for the document. webnavigation type: nsiwebnavigation this read-only property contains the nsiwebnavigation object for the document. most of its methods are callable directly on the element itself, such as goback and goforward. it also contains the load constants used by reloadwithflags and loaduriwithflags. ...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related nsiaccessibleprovider ...
label - Archive of obsolete content
control type: element id gets and sets the value of the control attribute. crop type: string gets and sets the value of the crop attribute. disabled type: boolean gets and sets the value of the disabled attribute. value type: string gets and sets the value of the value attribute. ...
... crop type: string gets and sets the value of the crop attribute. disabled type: boolean gets and sets the value of the disabled attribute. value type: string gets and sets the value of the value attribute. for textbox and user editable menu
list elements, the contents, as visible to the user, are read and set using the textbox.value and menu
list.value syntax. ...
... the crop attribute. disabled type: boolean gets and sets the value of the disabled attribute. value type: string gets and sets the value of the value attribute. for textbox and user editable menu
list elements, the contents, as visible to the user, are read and set using the textbox.value and menu
list.value syntax. ...
...these classes should be used instead of changing the style of the element directly since they will fit more naturally with the user's selected theme. header a class used for headings. typically, this will caus...
notificationbox - Archive of obsolete content
persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties currentnotification type: notification element the currently displayed notification element or null. this property is read-only. ...
... position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties currentnotification type: notification element the currently displayed notification element or null. this property is read-only. ...
... allnotifications type: node
list node
list of all notifications. this property is read-only. notificationshidden type: boolean indicating whether the notification area should be hidden. events alertactive type: event fired when a notification element is shown. alertclose type: event fired when a notification element is closed. ...
...if another notification is already present with a higher priority, the new notification will be added behind it. label - label to ap...
toolbaritem - Archive of obsolete content
of toolbarbutton). if you don't need the thing you're placing in the toolbar to be customized then it doesn't need to be in a toolbaritem element. the element is used, for example, to hold the location bar's textbox in firefox. it is also used to group buttons together so they can be added and removed all at once like firefox's unified-back-forward-button. ...
...r's textbox in firefox. it is also used to group buttons together so they can be added and removed all at once like firefox's unified-back-forward-button. ...
...llowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements toolbar, toolbarbutton, toolbargrippy, toolbarpalette, toolbarseparator, toolbarset, toolbarspacer, toolbarspring, toolbox ...
toolbarpalette - Archive of obsolete content
do not add the various spacing items, as those are added automatically. ...
...do not add the various spacing items, as those are added automatically. ...
...llowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements toolbar, toolbarbutton, toolbargrippy, toolbaritem, toolbarseparator, toolbarset, toolbarspacer, toolbarspring, toolbox ...
toolbox - Archive of obsolete content
row. the firefox browser does not have grippies so toolbars cannot be collapsed and expanded. note: gecko 2.0 adds support for external toolbars. these are toolbars that are not children of a toolbox. you can associate an external toolbar with a toolbox for the purpose of managing your toolbars by setting the toolboxid property on the toolbar. the external toolbars associated with a toolbox are
listed in the array of elements provided by the toolbox's externaltoolbars property. more information is available in the xul tutorial. if you'd like to detect when toolbars in a toolbox are changed, see toolbar customization events. properties accessible, customtoolbarcount, externaltoolbars, palette, toolbarset methods appendcustomtoolbar, collapsetoolbar, expandtoolbar examples <?x...
...s type: array of elements an array of external toolbars; that is, toolbar elements that should be considered to be members of this toolbox, even if they are not actually children of the toolbox. palette firefox only type: element the toolbarpalette within the toolbox. toolbarset firefox only type: element the toolbarset within the toolbox. ...
...the method returns the dom element ...
...the method returns the dom element for the created toolbar. collapsetoolbar( toolbar ) not in firefox return type: no return value collapse the given toolbar which should be contained within the toolbox. ...
treecol - Archive of obsolete content
e these styles by default. if targeting firefox for mac os x, be sure to use these styles but include your own checkbox image. however, chrome://global/skin/checkbox/cbox-check.gif is available in seamonkey on mac os x.. treechildren::-moz-tree-checkbox { /* unchecked checkbox treecells. this style must come before treechildren::-moz-tree-checkbox(checked) otherwise it won't take effect. */
list-style-image: none; } treechildren::-moz-tree-checkbox(checked){ /* css for checked cells. cbox-check.gif isn't available in firefox 1, 2, and 3 on mac os x, so you should specify a url to an image in your extension or elsewhere. */
list-style-image: url("chrome://global/skin/checkbox/cbox-check.gif"); } for example: create a css file. copy and paste the code above and link the css...
... column header styling. if you don't set a label for that column either, the header is not displayed at all. ignoreincolumnpicker type: boolean if true, the column does not appear in the column picker. label type: string the label that will appear on the element. if this is left out, no text appears. for an editable menuitem element the value of this attribute is copied to the menu
list.value property upon user selection of the menuitem. primary type: boolean if set to true, the treecol will have indentation and twisties drawn to the left of it to indicate the hierarchy level of the rows. if no column has the primary attribute set to true, the tree may still contain nested rows, although no indication will be given to the user. the attribute also controls whether the ...
...llowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
...this class should be used instead of changing the style of the element directly since it will fit more naturally with the user's selected theme. treecol-image use this class to have an image appear ...
window - Archive of obsolete content
en a window is minimized, the sizemode attribute is not updated. this is done so that if a window is closed while minimized, its persisted sizemode attribute wouldn't be minimized. setting this attribute does not change the window state. use window.maximize(), window.restore(), or window.minimize() to change the window state. to get the window state from javascript code, use window.windowstate.
listen to the sizemodechange event dispatched to the dom window to get notified when the window state changes. title type: string the text to appear in the title bar of the window. width type: string (representing an integer) the preferred width of the element. the value should not include a unit as all values are in pixels. the actual displayed width may be different if the element o...
...llowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
...a filename following the system keyword in a doctype declaration may silently fail to load and...
... snippet to use the html namespace and link. <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:html="http://www.w3.org/1999/xhtml"> <!-- icon from chrome --> <html:link rel="icon" href="chrome://myextension/content/path/to/favicon.png"/> <!-- from a remote site --> <html:link rel="icon" href="http://www.mozilla.org/favicon.ico"/> since firefox 3.6 the above
listed code does not work correctly - it produces the following message: "warning: xul box for box element contained an inline link child, forcing all its children to be wrapped in a block". if this code is placed between window tags it messes up all other controls on the window. if it is placed between box tags, window controls are rendered fine, but still there is this error message. the problem can...
wizard - Archive of obsolete content
r has navigated through so far, meaning that the user would press the back button this many times to go back to the beginning. this property is different than pageindex, because pages are not necessarily navigated in order. title type: string the title that appears at the top of the wizard. this is overridden by the label attribute on the individual pages. ...
... would press the back button this many times to go back to the beginning. this property is different than pageindex, because pages are not necessarily navigated in order. title type: string the title that appears at the top of the wizard. this is overridden by the label attribute on the individual pages. wizardpages type: dom node
list of wizardpage elements this property holds the
list of wizardpage elements in the wizard. ...
...n pageindex, because pages are not necessarily navigated in order. title type: string the title that appears at the top of the wizard. this is overridden by the label attribute on the individual pages. wizardpages type: dom node
list of wizardpage elements this property holds the
list of wizardpage elements in the wizard. ...
...this is equivalent to pressing the next button. the canadvance property must be set to true for the page to be changed. the pageid argument allows you to specify ...
reftest opportunities files - Archive of obsolete content
al ouptut, then that is an obvious reftest opportunity. for example, if some html is in an unexpected place and is supposed to be ignored, then we can match against an html file that is missing that extra mark-up. in other cases, the design of the reference page may take more subtlety. for now, create a bug in the core product, testing component in the bugzilla, if you can point to a file in this
list and can attach the html reference that can be used to compare the output. any assistance or comments here would be appreciated. if you have questions, please post to the mozilla.dev.quality newsgroup on news.mozilla.org (see at google groups). layout bugs that needs a reftest many of the bugzilla bugs in the core product, layout components with the in-testsuite? flag needs one or more reftests. i...
...test/sec051103b http://dbaron.org/css/test/order http://dbaron.org/css/test/inherit http://dbaron.org/css/test/sec060402 http://dbaron.org/css/test/sec060403b http://dbaron.org/css/test/specific http://dbaron.org/css/test/noncss1 http://dbaron.org/css/test/noncss2 http://dbaron.org/css/test/shortbox http://dbaron.org/css/test/shortbox2 http://dbaron.org/css/test/rootbox http://dbaron.org/css/test/
listbox http://dbaron.org/css/test/margtest http://dbaron.org/css/test/shortborder http://dbaron.org/css/test/shortborder2 http://dbaron.org/css/test/sec0805 http://dbaron.org/css/test/dborder http://dbaron.org/css/test/sec090102 http://dbaron.org/css/test/sec090201 http://dbaron.org/css/test/sec090203 http://dbaron.org/css/test/sec090204 http://dbaron.org/css/test/sec090205 http://dbaron.org/css/test...
.../htmlparser/tests/html/pre001.html parser/htmlparser/tests/html/param002.html parser/htmlparser/tests/html/param001.html parser/htmlparser/tests/html/option.html parser/htmlparser/tests/html/obj003.html parser/htmlparser/tests/html/obj002.html parser/htmlparser/tests/html/obj001.html parser/htmlparser/tests/html/nulltest.html parser/htmlparser/tests/html/newlines.html parser/htmlparser/tests/html/
list003.html parser/htmlparser/tests/html/
list002.html parser/htmlparser/tests/html/
list001.html parser/htmlparser/tests/html/layer01.html parser/htmlparser/tests/html/layer003.html parser/htmlparser/tests/html/layer002.html parser/htmlparser/tests/html/layer001.html parser/htmlparser/tests/html/java.html parser/htmlparser/tests/html/insdel02.html parser/htmlparser/tests/html/insdel01.html parser/html...
...s/html/home01.html parser/htmlparser/tests/html/head03.html parser/htmlparser/tests/html/head02.html parser/htmlparser/tests/html/head01.html parser/htmlparser/tests/html/form002.html parser/htmlparser/tests/html/form001.html parser/htmlparser/tests/html/fieldset003.html parser/htmlparser/tests/html/fieldset002.html parser/htmlparser/tests/html/fieldset001.html parser/htmlparser/tests/html/entity_
list.html parser/htmlparser/tests/html/entity_attr
list.html parser/htmlparser/tests/html/entity001.html parser/htmlparser/tests/html/endswithcr.html parser/htmlparser/tests/html/doc002.html parser/htmlparser/tests/html/doc001.html parser/htmlparser/tests/html/del011.html parser/htmlparser/tests/html/del010.html parser/htmlparser/tests/html/del009.html parser/htmlparser/tests/html/del008.html parser/ht...
Adobe Flash - Archive of obsolete content
be scriptable in mach-o browsers (on os x) by version 12. this is currently not the case, but 12 is a sufficiently high version number (current versions are version 6r.79) to allow for some leeway for fixing this down the road. when information about when this problem on mac os x will be addressed becomes available, the constant can be updated to reflect something less arbitrary. a complete code
listing which expands on the above approach can be found in the flashversion.js file used in the samples. performance and flash as is the case with any plug-in content, flash content has the potential to slow down or even completely stall not just the tab it's running in, but the entire browser and even the entire computer it's being used on. avoiding poorly-written or unnecessary flash content is c...
...computer it's being used on. avoiding poorly-written or unnecessary flash content is crucial to ensuring the user has a positive experience on not just your site, but the entire web. as part of mozilla's effort to improve the user experience, a feature was added in firefox 49 that automatically blocks certain flash modules that have little or no user-noticeable impact from being used. these block-
listed modules include various fingerprinting and http_cookie#supercookie modules. in the future, other modules may be blocked as well. and, of course, eventually flash support will be removed from firefox entirely. most of its functions can be reproduced using modern web apis. using the right html the object element or the embed element can be used to invoke plugins in netscape gecko browsers. the ...
...ml element as a handle to the actual flash plugin and invoke the published methods on it. the illustrative code snippet below shows this idea: <object id="myflash" ..... > <param name="movie" value="somefile.swf" /> .... var myflash = document.getelementbyid("myflash").setvariable("myvar", sendtext); a more expanded code example that shows how example 2 was created is shown in this source
listing. fscommands: accessing javascript from flash note: fscommand may not work with flash player versions older than version 8 if the user has installed multiple mozilla based browsers onto the same machine (see bug 32048 and bug 233533). in example 2, a javascript function first obtained a handle to the html that spawned the plugin (the object element or the embed element) and then called a pub...
...> </object> ..... function myflash_dofscommand(command, args) { // handle any callback logic that you may have designed into your flash plugin // the flash animation will supply you with the values for command and args // this is a function that handles any information that the flash animation may pass it // actionscript can communicate with javascript via fscommands! } in the above code
listing, the javascript function handles what flash sends it, and is named the same as the embed element's name attribute, concatenated with "_dofscommand". the source
listing flash-to-js.html shows a source for this example. see macromedia's actionscript dictionary for pointers on invoking fscommands from within the flash animation code. see also macromedia flash developer documentation scriptin...
-ms-filter - Archive of obsolete content
llection of filters applied to an object. warning: not to be confused with the standard filter property, as the two are fundamentally incompatible with each other. important: as of windows internet explorer 9 this feature was deprecated. as of internet explorer 10 this feature was removed and should no longer be used. ...
...refer to the filters and transitions reference for details. examples the following example shows how to use the -ms-filter attribute in internet explorer 8. code example: http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/filter_8.htm -ms-filter: 'progid:dximagetransform.microsoft.motionblur(strength=50), progid:dximagetransf...
... filterfrom.filters.item(0).transition=12; imagefrom.style.visibility = "hidden"; filterto.style.visibility = ""; filterfrom.filters.item(0).play(14); } </script> </body> gradient progid:dximagetransform.microsoft.gradient( <properties> ) where <properties>...
...filter: 'progid:dximagetransform.microsoft.gradient(startcolorstr="#ffffff", endcolorstr="#000000", gradienttype=0)'; background-image: linear-gradient(to bottom, #ffffff 0%, #000000 100%); } result specifications not part of any specification. ...
XForms Input Element - Archive of obsolete content
a types (or types derived from these data types): text field - the default widget when no type is specified or the data is of type xsd:string (xhtml/xul) checkbox - used for xsd:boolean instance data. (xhtml/xul) datepicker - used to represent data of type xsd:date (xhtml/xul) calendar - used to represent data of type xsd:date when appearance attribute also has the value 'full' (xhtml/xul) month
list - used to represent data of type xsd:gmonth (xhtml only) days
list - used to represent data of type xsd:gday (xhtml only) number field - used to represent data of numeric type (fx 3.0 only, xul only) more detail about each of these widgets follows below. text field displaying a text field is the default presentation. xforms inputs are most often used when a form author needs to allow for the inp...
... calendar a form author may notice a xforms input element represented by a calendar widget in the mozilla xforms processor if the control meets the following criteria (xhtml/xul). characteristics the bound instance node is of type xsd:date or a type derived from it appearance attribute also contains the value "full" firefox 2.0 doesn't currently contain any similar xhtml or xul widgets. months
list this widget is similar to a combo box populated with the sequence of the 12 month names that comprise a year. the names are localized (xhtml only). characteristics used when the instance node is of type xsd:gmonth or a type derived from it. the lexical representation for xsd:gmonth is the left and right truncated lexical representation for xsd:date: --mm. for example, the value --01 means the mo...
...cteristics used when the instance node is of type xsd:gmonth or a type derived from it. the lexical representation for xsd:gmonth is the left and right truncated lexical representation for xsd:date: --mm. for example, the value --01 means the month of january. specific handling of attributes incremental - if "true", the bound instance node will be updated when the user selects a value from the
list. if "false" or the incremental attribute is omitted on this element then the bound instance node will be updated when the control loses the focus. days
list this widget is similar to a combo box populated with the sequence of the possible days in a month. in short, the values of 1-31 (xhtml only). characteristics used when the instance node is of type xsd:gday or a type derived from it. the lex...
...it. the lexical representation for xsd:gday is the left truncated lexical representation for xsd:date: ---dd. for example, the value ---03 means the third day of the month. this widget allows the user to omit --- when a value is typed into control (xhtml only). specific handling of attributes incremental - if "true", the bound instance node will be updated when the user selects a value from the
list. if "false" or the incremental attribute is omitted on this element then the bound instance node will be updated when the control loses the focus. number field this widget is similar to a spin button widget. allows the user to only input numerical values (fx 3.0, xul only). characteristics used when the instance node is of type xsd:decimal or a type derived from it. for several of the schema da...
XForms Select Element - Archive of obsolete content
you can visually group these pre-defined items by using the choices (see the spec) element to contain them. note, some representations of the select element do not support visual grouping. attributes ui common appearance - the value of this attribute gives a hint to the xforms processor as to which type of widget(s) to use to represent this control. accesskey - used to specify the keyboard shortcut for focusing this control. single-node binding special selection - isn't currently supported. ...
.... attributes ui common appearance - the value of this attribute gives a hint to the xforms processor as to which type of widget(s) to use to represent this control. accesskey - used to specify the keyboard shortcut for focusing this control. single-node binding special selection - isn't currently supported. this attribute, when set to 'open', allows the user to provide free entry to the
list. possible values are open and closed, default is closed. incremental - supported, default value is true properties selection - see corresponding attribute incremental - see corresponding attribute type restrictions the select element can be bound to a node containing simple content capable of holding a sequence. the data binding restriction to simple content may be relaxed when an items...
...ined from an xforms model. the relaxation happens when the itemset element specifies the item value using a copy (see spec) element. this is because a copy element can be used to add a subtree of nodes underneath the element that the select control is bound to. ...
...using a copy (see spec) element. this is because a copy element can be used to add a subtree of nodes underneath the element that the select control is bound to. representations the xforms select element can be represented by the following widgets for the specified appearance attribute values:
list - default representation (xhtml/xul) check group- used when appearance = 'full' (xhtml/xul)
list displaying a
listbox is the default representation (xhtml/xul). characteristics analogous widgets are <html:select size="5" multiple="true"/> and <xul:
listbox seltype="multiple"/> visual grouping by choices element isn't implemented if incremental attribute value is false, the bound node is updated when the select control is blurred (i.e. loses focus), otherwise it is updated upon item selec...
XForms Select1 Element - Archive of obsolete content
introduction allows the user to choose a single value from a
list of pre-defined values (see the spec). the
list of pre-defined items can be specified by either item (see the spec) or itemset (see the spec) elements. you can visually group these pre-defined items by using the choices (see the spec) element to contain them. note, some representations of the select1 element do not support visual grouping. attributes ui common appearance - the value of this attribute gives a hint to the xforms processor as to which type of widget(s) to use to represent this control. accesskey - used to specify the keyboard shortcut for focusing this control. single-node binding special selection - this attribute, when set to 'open', allows the user to provide free entry to the
list. possible values a...
... when the itemset element specifies the item value using a copy (see spec) element. this is because a copy element can be used to add a subtree of nodes underneath the element that the select1 control is bound to. representations the xforms select1 element can be represented by the following widgets for the specified appearance attribute values: combobox - default representation (xhtml/xul)
listbox - used when appearance = 'compact' (xhtml/xul) radio group - used when appearance = 'full' (xhtml/xul) combobox displaying a combobox is the default representation (xhtml/xul). xhtml widget characteristics analogous widgets is <html:select/> visual grouping by choices element is supported selection="open" is supported if incremental attribute value is false, the bound node is updated ...
...ul). xhtml widget characteristics analogous widgets is <html:select/> visual grouping by choices element is supported selection="open" is supported if incremental attribute value is false, the bound node is updated when the select1 control is blurred (i.e. loses focus), otherwise it is updated upon item selection xul widget characteristics analogous widgets are <html:select/> and <xul:menu
list/> visual grouping by choices element isn't implemented selection="open" attribute isn't supported if incremental attribute value is false, the bound node is updated when the select control is blurred (i.e. loses focus), otherwise it is updated upon item selection
listbox the select1 is represented as
listbox (xhtml/xul). characteristics analogous widgets are <html:select size="5"/> and <x...
... visual grouping by choices element isn't implemented selection="open" attribute isn't supported if incremental attribute value is false, the bound node is updated when the select control is blurred (i.e. loses focus), otherwise it is updated upon item selection
listbox the select1 is represented as
listbox (xhtml/xul). characteristics analogous widgets are <html:select size="5"/> and <xul:
listbox/> visual grouping by choices element isn't implemented selection="open" attribute isn't supported if incremental attribute value is false, the bound node is updated when the select control is blurred (i.e. loses focus), otherwise it is updated upon item selection radio group the select is represented as group of radios (xhtml/xul). characteristics appearance attribute contains the valu...
Mozilla XForms User Interface - Archive of obsolete content
: text field - default representation. used for most data types, especially text data. checkbox - used for boolean instance data datepicker - default representation for date data types. similar to a combobox. consists of a text field for direct input and a dropdown calendar that can also be used to input the date value. calendar - used for date data types when appearance = 'full'. days
list - used when the data has a data type of day. months
list - used when the data has a data type of month. number field - used for numerical data types. secret used for inputting passwords. each character typed by the user is represented by an asterisk on the screen (see the spec). textarea serves to show/change multiline text (see the spec). output serves to show the instance data that the ele...
...ollowing representations: button - default representation. link/clickable text - used when appearance = 'minimal'. submit invokes the submission of the selected instance data to its target destination, which could be local or remote (see the spec). it can have the following representations: button - default representation. link/clickable text - used when appearance = 'minimal'. select
list control. allows the user to choose one or multiple values from a
list of pre-defined values (see the spec). it can have the following representations:
listbox - default representation checkbox group - used when appearance = 'full' select1 combobox control. allows the user to choose a single value from a
list of pre-defined values (see the spec). it can have the following representations: ...
...label specifies the label for the xforms control (see the spec). every form control other than the output element must contain a label element. ...
...ing form control has focus. hint similar to a tooltip (see the spec). the hint is displayed when the mouse moves and pauses over the containing form control. alert this message will be shown when the form control cannot properly bind to instance data or when the instance data value is invalid or out of the specified range of selectable values (see the spec). message used in combination with event
listeners to display a message to the user when the specified event occurs (see the spec). xforms user interface these elements are mainly used to organize and manage the form's markup. they can be bound to instance nodes to define context for the xforms controls that they contain, should any of their child nodes happen to use relative xpath expressions. binding these elements to instance data is also...
Windows Media in Netscape - Archive of obsolete content
rol is supported and available for use. javascript will dynamically write out what browser you are running, and what kind of windows media player technology you may have. example 1: client-side detection scripts browser architecture supports: netscapeplugin windows media player installed: true windows media scriptable: false windows media version: pluginversion a complete source code
listing showing how that detection was done can be found here (devedge-temp). below, some of the salient points are illustrated in a code snippet: if (window.activexobject && navigator.useragent.indexof('windows') != -1) { // ie for windows object instantiation -- use of activexobject } else if(window.geckoactivexobject) { // netscape 7.1 object instantiation --use of geckoactivexobject } else if(...
...hine running the web page. the windows media 9 series sdk doesn't provide a url to use with the codebase attribute for retrieval of the component in ie, and on netscape 7.1 the codebase attribute isn't supported for such retrieval. therefore detecting whether the component was successfully instantiated can help provide users with the right component if a failed instantiation is detected. the code
listing below provides a mechanism to to this. <object id="playerex2" classid="clsid:6bf52a52-394a-11d3-b153-00c04f79faa6" height="200" width="200"> <param name="uimode" value="full" /> <param name="autostart" value="true" /> <param name="url" value="preludesteel.wma" /> </object> <script type="text/javascript"> if(!document.playerex2.versioninfo) { // control not installed -- the ...
... of the control. here's an example of directly instantiating the control programmatically (without an object element) and scripting it: try { var player = null; if (window.activexobject) { player = new activexobject("wmplayer.ocx.7"); } else if(window.geckoactivexobject) { player = new geckoactivexobject("wmplayer.ocx.7"); } } catch(e) { ; } if (player) { player.currentplay
list = player.mediacollection.getbyname('preludesteel'); player.controls.play(); } callbacks from within windows media player to web pages: script for event netscape 7.1 supports ie's <script for="activexcontrol" event="activexcontrolevent"> script elements. no netscape browser prior to netscape 7.1 has supported this non-standard way of writing scripts that handle information sent by a plugin or c...
...ed by the media player in script using script for event. do not use ie only markup or ie only features, such as dhtml behaviors or use msxml in conjunction with the control. examples of usage in netscape 7.1 and ie all these samples consist of one page of markup (and script) that works in both ie and netscape 7.1. no code forking has been used. the min-object-usage.html sample shows a minima
list control manipulated by scripting and html buttons. an object element creates the controls. the embedded-audio-video.html shows both scripting the control and callbacks. closecap-outtakes.html shows the closed captioning workaround and scripting. original document information authors: arun ranganathan, bob clary, ian oeschger last updated date: 30 jun 2003 copyright informa...
Building up a basic demo with PlayCanvas editor - Game development
g plus button located in the top left area of the editor, next to the hierarchy text. when hovering over that button with your mouse the label will say 'add entity' — that's exactly what we want to do. an entity is any object used in the scene — it cna be an object like a box, cylinder or cone, but it can also be a camera, light or sound source. after clicking the button you'll see a dropdown
list containing a lot of various entities to choose from. go ahead and click box — it will be added to the scene. the box is created with the default values — width, height and depth are set to 1, and it is placed in the middle of the scene. you can drag it around or apply new values in the right panel. to add some colors to the scene we need a new material that will be used on the newly cre...
...e scene. the box is created with the default values — width, height and depth are set to 1, and it is placed in the middle of the scene. you can drag it around or apply new values in the right panel. to add some colors to the scene we need a new material that will be used on the newly created box. click on the plus button in the assets tab, and click on the material option in the dropdown
list that appears to create a new material. click on your new material in the assets tab and its entity inspector will appear on the right hand side of the display. now edit the name text field to give it a unique name (we've chosen boxmaterial). a unique name will help us remember what this material is for — we will add more later! to change its color we'll use the diffuse option in the entit...
...box to the left to make some room for the next shape. you can do this by giving it an x position value of -2. adding other shapes involves a very similar process to adding the box. click on the root folder in the hierarchy panel (to make sure that the new shape appears in the root, and not as a child of the box) then click on the big add entity (plus) button and select cylinder from the dropdown
list — it will add a new cylinder shape to the scene. now follow the same steps as we did before when coloring the cube: create a new material using the add asset (plus) button. make sure the new material in the assets panel is selected, to bring up the entity inspector. give the material a new name, along the lines of cylindermaterial. click diffuse, then click the color picker — give it a...
...me passed since the previous frame, we can rotate the box by a different amount around all three axes. save the changes using the save button in the top right of the code editor, then return to the main editor tab. here, follow these steps: be sure you have the box selected on the scene. click on add component, then script in the entity inspector. at the bottom of the screen you can see the
list of scripts available — for now there's only boxanimation.js — clicking it will add the animation script to the box object. the cylinder now we'll do the same steps for cylinder. first: create a new script asset. name it cylinderanimation.js. double click the script icon to launch the code editor. this time instead of rotating the object we will try to scale it. for that we'll need...
Unconventional controls - Game development
input.keyboard.createcursorkeys(); //... if(this.cursors.right.isdown) { // move player right } it works out of the box. the cursors are the four directional arrow keys on the keyboard, and these have exactly the same key codes as the arrow keys on the remote. how do you know the codes for the other remote keys? you can check them by printing the responses out in the console: window.addevent
listener("keydown", function(event) { console.log(event.keycode); }, this); every key pressed on the remote will show its key code in the console. you can also check this handy cheat sheet seen below if you're working with panasonic tvs running firefox os: you can add moving between states, starting a new game, controlling the ship and blowing stuff up, pausing and restarting the game. all tha...
...eycode); }, this); every key pressed on the remote will show its key code in the console. you can also check this handy cheat sheet seen below if you're working with panasonic tvs running firefox os: you can add moving between states, starting a new game, controlling the ship and blowing stuff up, pausing and restarting the game. all that is needed is checking for key presses: window.addevent
listener("keydown", function(event) { switch(event.keycode) { case 8: { // pause the game break; } case 588: { // detonate bomb break; } // ... } }, this); you can see it in action by watching this video. leap motion have you ever thought about controlling a game only with your hands? it's possible with ...
... tag for outputting diagnostic information. we will need a few helper variables for our code to work — one for the purpose of calculating the degrees from radians, two for holding the horizontal and vertical amount of degrees our hand is leaning above the controller, one for the threshold of that lean, and one for the state of our hand's grab status. ...
...e the ship up and down the screen if implemented correctly. proximity api another interesting idea is to use the built-in proximity sensors of your hardware to detect how far an object, for example a hand, is from the given sensor. it could work similar to the doppler effect in terms of manipulating the player's ship on the screen by moving your hand closer or further from the device. an event
listener for device proximity would look like this: window.addevent
listener('deviceproximity', function(event) { var min = event.min; var max = event.max; var proximity = event.value; }); the min and max values are the minimum and the maximum distances respectively between which the sensor can detect the exact proximity value. all three are calculated in centimetres. note: see the devi...
Mouse controls - Game development
« previousnext » this is the 9th step out of 10 of the gamedev canvas tutorial. you can find the source code as it should look after completing this lesson at gamedev-canvas-workshop/lesson9.html. the game itself is actually finished, so let's work on polishing it up. we have already added keyboard controls, but we could easily add mouse controls too. ...
... « previousnext » this is the 9th step out of 10 of the gamedev canvas tutorial. you can find the source code as it should look after completing this lesson at gamedev-canvas-workshop/lesson9.html. the game itself is actually finished, so let's work on polishing it up. we have already added keyboard controls, but we could easily add mouse controls too. ...
...p out of 10 of the gamedev canvas tutorial. you can find the source code as it should look after completing this lesson at gamedev-canvas-workshop/lesson9.html. the game itself is actually finished, so let's work on polishing it up. we have already added keyboard controls, but we could easily add mouse controls too.
listening for mouse movement
listening for mouse movement is even easier than
listening for key presses: all we need is the
listener for the mousemove event. ...
...rkshop/lesson9.html. the game itself is actually finished, so let's work on polishing it up. we have already added keyboard controls, but we could easily add mouse controls too.
listening for mouse movement
listening for mouse movement is even easier than
listening for key presses: all we need is the
listener for the mousemove event. add the following line in the same place as the other event
listeners, just below the keyup event: document.addevent
listener("mousemove", mousemovehandler, false); anchoring the paddle movement to the mouse movement we can update the paddle position based on the pointer coordinates — the following handler function will do exactly that. add the following function to your code, below the previous line you added: function mousemovehandler(e) { var relat...
Plug-in Development Overview - Gecko Plugin API Reference
resource code for this language and character set combination is 040904e4. unix on unix, plug-ins are found according to the section how gecko finds plug-ins. to determine the mime types and file extensions that the plug-in handles, the browser loads each library and calls into the np_getmimedescription entry point. this exported c function should return a string containing the type, extension
list, and type description separated by colons. each mime types should be separated by semicolons. for example: image/xbm:xbm:x bitmap or for 2 mime types: image/xbm:xbm:x bitmap;image/png:png:portable network graphics. this information will then appear in the navigator.mimetypes dom object. npp_getvalue is called after the plug-in is initialized to get the scripting interface while np_getvalue is ca...
...late about:plugins. caution: gecko caches the values returned by these functions and will only call it if the plug-in's timestamp has changed. see bug 125469. mac os x mac os x plug-ins are found according to the section how gecko finds plug-ins. plug-ins are identified by file type nspl. to determine the supported mime types, gecko first checks for registry information in the plugins info.p
list. if nothing is found there, gecko checks for an np_getmimedescription entry point, and will use the information returned by this function. note: the resource method described below is deprecated. plugins should use the info.p
list approach, and only use the following method as a supplement to support older browsers. if neither is present, gecko will check the plugins resources. 'str#' 128 shou...
...is found there, gecko checks for an np_getmimedescription entry point, and will use the information returned by this function. note: the resource method described below is deprecated. plugins should use the info.p
list approach, and only use the following method as a supplement to support older browsers. if neither is present, gecko will check the plugins resources. 'str#' 128 should contain a
list of mime types and file extensions in alternating strings. for example: str 128 mime type string 1 video/quicktime string 2 mov, moov string 3 audio/aiff string 4 aiff string 5 image/jpeg string 6 jpg several other optional strings may contain useful information about the plug-in. plug-ins must support 'str...
...28 mime type string 1 video/quicktime string 2 mov, moov string 3 audio/aiff string 4 aiff string 5 image/jpeg string 6 jpg several other optional strings may contain useful information about the plug-in. plug-ins must support 'str#' 128 but are not required to support any of these others: str#' 127 can contain a
list of mime type descriptions corresponding to the types in 'str#' 128 . for example, this description
list corresponds to the types in the previous example: string 1: "quicktime video", string 4: "aiff audio", and string 5: "jpeg image format." str#' 126: string 1 can contain a descriptive message about the plug-in. this message, which is in html format, is displayed by the browser in its "about...
Attribute selectors - Learn web development
h an attr attribute (whose name is the value in square brackets). [attr=value] a[href="https://example.com"] matches elements with an attr attribute whose value is exactly value — the string inside the quotes. [attr~=value] p[class~="special"] matches elements with an attr attribute whose value is exactly value, or contains value in its (space separated)
list of values. [attr|=value] div[lang|="zh"] matches elements with an attr attribute whose value is exactly value or begins with value immediately followed by a hyphen. in the example below you can see these selectors being used. by using li[class] we can match any selector with a class attribute. this matches all of the
list items except the first one. li[class="a"] mat...
...immediately followed by a hyphen. in the example below you can see these selectors being used. by using li[class] we can match any selector with a class attribute. this matches all of the
list items except the first one. li[class="a"] matches a selector with a class of a, but not a selector with a class of a with another space-separated class as part of the value. it selects the second
list item. li[class~="a"] will match a class of a but also a value that contains the class of a as part of a whitespace-separated
list. it selects the second and third
list items. substring matching selectors these selectors allow for more advanced matching of substrings inside the value of your attribute. for example, if you had classes of box-warning and box-error and wanted to match everythin...
...ass*="box"] matches elements with an attr attribute whose value contains value anywhere within the string. (aside: it may help to note that ^ and $ have long been used as anchors in so-called regular expressions to mean begins with and ends with.) the next example shows usage of these selectors: li[class^="a"] matches any attribute value which starts with a, so matches the first two
list items. li[class$="a"] matches any attribute value that ends with a, so matches the first and third
list item. li[class*="a"] matches any attribute value where a appears anywhere in the string, so it matches all of our
list items. case-sensitivity if you want to match attribute values case-insensitively you can use the value i before the closing bracket. this flag tells the browser to match...
...-insensitively you can use the value i before the closing bracket. this flag tells the browser to match ascii characters case-insensitively. without the flag the values will be matched according to the case-sensitivity of the document language — in html's case it will be case sensitive. in the example below, the first selector will match a value that begins with a — it only matches the first
list item because the other two
list items start with an uppercase a. the second selector uses the case-insensitive flag and so matches all of the
list items. note: there is also a newer value s, which will force case-sensitive matching in contexts where matching is normally case-insensitive, however this is less well supported in browsers and isn't very useful in an html context. next steps no...
How CSS is structured - Learn web development
an altenative, you can also use the interactive editor below. read on and have fun! selectors a selector targets html to apply styles to content. we have already discovered a variety of selectors in the getting started with css tutorial. if css is not applying to content as-expected, your selector may not match the way you think it should match. each css rule starts with a selector—or a
list of selectors—in order to tell the browser which element or elements the rules should apply to. all the examples below are valid selectors, or
lists of selectors. h1 a:link .manythings #onething * .box p .box p:first-child h1, h2, .intro try creating some css rules that use the selectors above. add html to be styled by the selectors. if any of the syntax above is not familiar, try searching md...
...specificity exists. sometimes, css might not apply as you expected because something else in the stylesheet has more specificity. recognizing that more than one rule could apply to an element, is the first step in fixing these kinds of issues. properties and values at its most basic level, css consists of two components: properties: these are human-readable identifiers that indicate which sty
listic features you want to modify. for example, font-size, width, background-color. values: each property is assigned a value. this value indicates how to style the property. the example below highlights a single property and value. the property name is color and the value is blue. when a property is paired with a value, this pairing is called a css declaration. css declarations are found withi...
... highlighting identifies the h1 rule. setting css properties to specific values is the primary way of defining layout and styling for a document. the css engine calculates which declarations apply to every single element of a page. important: css properties and values are case-sensitive. the property and value in each pair is separated by a colon. (:) look up different values of properties
listed below. write css rules that apply styling to different html elements: font-size width background-color color border important: if a property is unknown, or if a value is not valid for a given property, the declaration is processed as invalid. it is completely ignored by the browser's css engine. important: in css (and other web standards), it has been agreed that us spelling is th...
...n isn't something that can be computed in advance and entered as a static value. another example would be the various values for transform, such as rotate(). <div class="box"></div> .box { margin: 30px; width: 100px; height: 100px; background-color: rebeccapurple; transform: rotate(0.8turn) } the output from the above code looks like this: look up different values of properties
listed below. write css rules that apply styling to different html elements: transform background-image, in particular gradient values color, in particular rgb/rgba/hsl/hsla values @rules css @rules (pronounced "at-rules") provide instruction for what css should perform or how it should behave. some @rules are simple with just a keyword and a value. for example, @import imports a stylesheet ...
Web fonts - Learn web development
ext and font fundamentals. objective: to learn how to apply web fonts to a web page, using either a third party service, or by writing your own code. font families recap as we looked at in fundamental text and font styling, the fonts applied to your html can be controlled using the font-family property. this takes one or more font family names, and the browser travels down the
list until it finds a font it has available on the system it is running on: p { font-family: helvetica, "trebuchet ms", verdana, sans-serif; } this system works well, but traditionally web developers' font choices were limited. there are only a handful of fonts that you can guarantee to be available across all common systems — the so-called web-safe fonts. you can use the font stack to specify p...
...on alongside it. when you've chosen the font families, press the [number] families selected bar at the bottom of the page. in the resulting screen, you first need to copy the line of html code shown and paste it into the head of your html file. put it above the existing <link> element, so that the font is imported before you try to use it in your css. you then need to copy the css declarations
listed into your css as appropriate, to apply the custom fonts to your html. note: you can find a completed version at google-font.html and google-font.css, if you need to check your work against ours (see it live). @font-face in more detail let's explore that @font-face syntax generated for you by fontsquirrel. this is what one of the blocks looks like: @font-face { font-family: 'ciclefina';...
... this as anything you like, as long as you use it consistently throughout your css. src: these lines specify the paths to the font files to be imported into your css (the url part), and the format of each font file (the format part). the latter part in each case is optional, but it is useful to declare it because it allows browsers to find a font they can use faster. multiple declarations can be
listed, separated by commas — the browser will search through them and use the first one it can find that it understands — it is therefore best to put newer, better formats like woff2 earlier on, and older, not so good formats like ttf later on. the one exception to this is the eot fonts — they are placed first to fix a couple of bugs in older versions of ie whereby it will try to use the first ...
...this information at the end of the module — see typesetting a community school homepage. ...
How do I start to design my website? - Learn web development
estions. note: there are countless ways to carry out project ideation. we cannot lay them all out here (a whole book wouldn't be enough). what we will present here is a simple method to handle what professionals call project ideation, project planning, and project management. what exactly do i want to accomplish? this is the most important question to answer, since it drives everything else.
list all the goals you want to reach. it can be anything: selling goods to make money, expressing political opinions, meeting new friends, gigging with musicians, collecting cat pictures, or whatever you want. suppose you are a musician. you could wish to: let people hear your music. sell goodies. meet other musicians. talk about your music. teach music through videos. publish photos of your ...
...ling goods to make money, expressing political opinions, meeting new friends, gigging with musicians, collecting cat pictures, or whatever you want. suppose you are a musician. you could wish to: let people hear your music. sell goodies. meet other musicians. talk about your music. teach music through videos. publish photos of your cats. find a new girl/boyfriend. once you have such a
list, you need to prioritize. order the goals from most important to least important: find a new girl/boyfriend. let people hear your music. talk about your music. meet other musicians. sell goodies. teach music through videos. publish photos of your cats. doing this simple exercise—writing goals and sorting them—will help you out when you have decisions to make. (should i implement the...
...new girl/boyfriend. let people hear your music. talk about your music. meet other musicians. sell goodies. teach music through videos. publish photos of your cats. doing this simple exercise—writing goals and sorting them—will help you out when you have decisions to make. (should i implement these features, use these services, create these designs?) so now that you have a prioritized
list of goals, let's move on to the next question. how could a website bring me to my goals? so you have a
list of goals and you feel you need a website to reach those goals. are you sure? let's look back at our example. we have five goals connected to music, one goal related to personal life (finding your significant other), and the completely unrelated cat photos. is it reasonable to build a sing...
...te where people can place orders. second, setting out actionable steps leads to new questions you'll need to answer. usually there turn out to be more questions than we originally thought. (for example, should i learn how to do all this myself, ask someone to do it for me, or use third-party services?) conclusion as you can see, the simple idea "i want to make a website" generates a long to-do
list, which only grows longer as you think about it. soon it may look overwhelming, but don't panic. you don't need to answer all the questions and you don't need to do everything on your
list. what matters is to have a vision of what you want and how to get there. once you have that clear vision, you need to decide how and when to do it. break down big tasks into small, actionable steps. and those sm...
JavaScript basics - Learn web development
velopers to incorporate functionality in sites from other content providers, such as twitter or facebook. third-party frameworks and libraries that you can apply to html to accelerate the work of building sites and applications. it's outside the scope of this article—as a light introduction to javascript—to present the details of how the core javascript language is different from the tools
listed above. you can learn more in mdn's javascript learning area, as well as in other parts of mdn. the section below introduces some aspects of the core language, and offers an opportunity to play with a few browser api features too. have fun! a hello world! example javascript is one of the most popular modern web technologies! as your javascript skills grow, your websites will enter a new dimen...
... myvariable = 3; !(myvariable === 3); "does-not-equal" gives basically the same result with different syntax. here we are testing "is myvariable not equal to 3". this returns false because myvariable is equal to 3: let myvariable = 3; myvariable !== 3; there are a lot more operators to explore, but this is enough for now. see expressions and operators for a complete
list. note: mixing data types can lead to some strange results when performing calculations. be careful that you are referring to your variables correctly, and getting the results you expect. for example, enter '35' + '25' into your console. why don't you get the result you expected? because the quote marks turn the numbers into strings, so you've ended up concatenating strings rather than adding nu...
...3); note: the return statement tells the browser to return the result variable out of the function so it is available to use. this is necessary because variables defined inside functions are only available inside those functions. this is called variable scoping. (read more about variable scoping.) events real interactivity on a website requires events handlers. these are code structures that
listen for activity in the browser, and run code in response. the most obvious example is handling the click event, which is fired by the browser when you click on something with your mouse. to demonstrate this, enter the following into your console, then click on the current webpage: document.queryselector('html').onclick = function() { alert('ouch! stop poking me!'); } there are many ways to a...
...xt. conclusion if you have followed all the instructions in this article, you should end up with a page that looks something like the image below. you can also view our version. if you get stuck, you can compare your work with our finished example code on github. we have just scratched the surface of javascript. if you enjoyed playing, and wish to go further, take advantage of the resources
listed below. ...
Define terms with HTML - Learn web development
html provides several ways to convey description semantics, whether inline or as structured glossaries. in this article, we'll cover how to properly mark up keywords when you're defining them. prerequisites: you need to be familiar with how to create a basic html document. objective: learn how to introduce new keywords and how to build description
lists. when you need a term defined, you probably go straight to a dictionary or glossary. dictionaries and glossaries formally associate keywords with one or more descriptions, as in this case: blue (adjective) of a color like the sky in a sunny day. the clear blue sky of a subtle sadness, melancholy. i'm feeling blue but we're constantly defining keywords informally, as here: firefox is the we...
...tion. </span> you can download it at <a href="http://www.mozilla.org">mozilla.org</a> </p> assistive technology can often use this attribute to find a text alternative to a given term. you can use aria-describedby on any tag enclosing a keyword to be defined (not just the <dfn> element). aria-describedby references the id of the element containing the description. how to build a description
list description
lists are just what they claim to be: a
list of terms and their matching descriptions (e.g., definition
lists, dictionary entries, faqs, and key-value pairs). description
lists are not suitable for marking up dialogue, because conversation does not directly describe the speakers. here are recommendations for marking up dialogue. the terms described go inside <dt> elements. the ma...
...ion
lists, dictionary entries, faqs, and key-value pairs). description
lists are not suitable for marking up dialogue, because conversation does not directly describe the speakers. here are recommendations for marking up dialogue. the terms described go inside <dt> elements. the matching description follows immediately, contained within one or more <dd> elements. enclose the whole description
list with a <dl> element. a simple example here's a simple example describing kinds of food and drink: <dl> <dt>jambalaya</dt> <dd> rice-based entree typically containing chicken, sausage, seafood, and spices </dd> <dt>sukiyaki</dt> <dd> japanese specialty consisting of thinly sliced meat, vegetables, and noodles, cooked in sake and soy sauce </dd> <d...
...italian red wine originating in tuscany </dd> </dl> the basic pattern, as you can see, is to alternate <dt> terms with <dd> descriptions. if two or more terms occur in a row, the following description applies to all of them. if two or more descriptions occur in a row, they all apply to the last given term. improving the visual output here's how a graphical browser displays the foregoing
list: if you want the keywords to stand out better, you could try bolding them. remember, html is not a visual medium; we need css for all visual effects. the css font-weight property is what you need here: dt { font-weight: bold; } this produces the slightly more readable result below: learn more <dfn> <dl> <dt> <dd> how to use the aria-describedby attribute ...
Images in HTML - Learn web development
; width: 98%; } body { margin: 10px; background: #f5f9fa; } var textarea = document.getelementbyid('code'); var reset = document.getelementbyid('reset'); var solution = document.getelementbyid('solution'); var output = document.queryselector('.output'); var code = textarea.value; var userentry = textarea.value; function updatecode() { output.innerhtml = textarea.value; } reset.addevent
listener('click', function() { textarea.value = code; userentry = textarea.value; solutionentry = htmlsolution; solution.value = 'show solution'; updatecode(); }); solution.addevent
listener('click', function() { if(solution.value === 'show solution') { textarea.value = solutionentry; solution.value = 'hide solution'; } else { textarea.value = userentry; solution.value = ...
...rentry; solution.value = 'show solution'; } updatecode(); }); var htmlsolution = '<img src="https://udn.realityripple.com/samples/ec/5a13bd14f6.jpg"\n alt="the head and torso of a dinosaur skeleton; it has a large head with long sharp teeth"\n width="200"\n height="171"\n title="a t-rex on display in the manchester university museum">'; var solutionentry = htmlsolution; textarea.addevent
listener('input', updatecode); window.addevent
listener('load', updatecode); // stop tab key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { var scrollpos = textarea.scr...
...; width: 98%; } body { margin: 10px; background: #f5f9fa; } var textarea = document.getelementbyid('code'); var reset = document.getelementbyid('reset'); var solution = document.getelementbyid('solution'); var output = document.queryselector('.output'); var code = textarea.value; var userentry = textarea.value; function updatecode() { output.innerhtml = textarea.value; } reset.addevent
listener('click', function() { textarea.value = code; userentry = textarea.value; solutionentry = htmlsolution; solution.value = 'show solution'; updatecode(); }); solution.addevent
listener('click', function() { if(solution.value === 'show solution') { textarea.value = solutionentry; solution.value = 'hide solution'; } else { textarea.value = userentry; solution.value = ...
...tion'; } updatecode(); }); var htmlsolution = '<figure>\n <img src="https://udn.realityripple.com/samples/ec/5a13bd14f6.jpg"\n alt="the head and torso of a dinosaur skeleton; it has a large head with long sharp teeth"\n width="200"\n height="171">\n <figcaption>a t-rex on display in the manchester university museum</figcaption>\n</figure>'; var solutionentry = htmlsolution; textarea.addevent
listener('input', updatecode); window.addevent
listener('load', updatecode); // stop tab key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { var scrollpos = textarea.scr...
Responsive images - Learn web development
480w.jpg 480w, elva-fairy-800w.jpg 800w" sizes="(max-width: 600px) 480px, 800px" src="elva-fairy-800w.jpg" alt="elva dressed as a fairy"> the srcset and sizes attributes look complicated, but they're not too hard to understand if you format them as shown above, with a different part of the attribute value on each line. each value contains a comma-separated
list, and each part of those
lists is made up of three sub-parts. let's run through the contents of each now: srcset defines the set of images we will allow the browser to choose between, and what size each image is. each set of image information is separated from the previous one by a comma. for each one, we write: an image filename (elva-fairy-480w.jpg) a space the image's intrinsic width in p...
...s. you may have noticed that the last slot width has no media condition (this is the default that is chosen when none of the media conditions are true). the browser ignores everything after the first matching condition, so be careful how you order the media conditions. so, with these attributes in place, the browser will: look at its device width. work out which media condition in the sizes
list is the first one to be true. look at the slot size given to that media query. load the image referenced in the srcset
list that has the same size as the slot or, if there isn't one, the first image that is bigger than the chosen slot size. and that's it! at this point, if a supporting browser with a viewport width of 480px loads the page, the (max-width: 600px) media condition will be true, a...
...will be displayed. if the viewport width is 800px or more, it'll be the second one. the srcset attributes contain the path to the image to display. just as we saw with <img> above, <source> can take a srcset attribute with multiple images referenced, as well as a sizes attribute. so, you could offer multiple images via a <picture> element, but then also offer multiple resolutions of each one. rea
listically, you probably won't want to do this kind of thing very often. in all cases, you must provide an <img> element, with src and alt, right before </picture>, otherwise no images will appear. this provides a default case that will apply when none of the media conditions return true (you could actually remove the second <source> element in this example), and a fallback for browsers that don't su...
...file types: <picture> <source type="image/svg+xml" srcset="pyramid.svg"> <source type="image/webp" srcset="pyramid.webp"> <img src="pyramid.png" alt="regular pyramid built from four equilateral triangles"> </picture> do not use the media attribute, unless you also need art direction. in a <source> element, you can only refer to images of the type declared in type. use comma-separated
lists with srcset and sizes, as needed. active learning: implementing your own responsive images for this active learning, we're expecting you to be brave and go it alone ... mostly. we want you to implement your own suitable art directed narrow screen/wide screen shot using <picture>, and a resolution switching example that uses srcset. write some simple html to contain your code (use not-respo...
General asynchronous programming concepts - Learn web development
nk of code without returning control to the browser, the browser can appear to be frozen. this is called blocking; the browser is blocked from continuing to handle user input and perform other tasks until the web app returns control of the processor. let's look at a couple of examples that show what we mean by blocking. ...
...essor. let's look at a couple of examples that show what we mean by blocking. ...
... running the example, open your javascript console then click the button — you'll notice that the paragraph does not appear until after the dates have finished being calculated and the console message has been logged. the code runs in the order it appears in the source, and the later operation doesn't run till the earlier operation has finished running. note: the previous example is very unrea
listic. you would never calculate 10 million dates on a real web app! it does, however, serve to give you the basic idea. in our second example, simple-sync-ui-blocking.html (see it live), we simulate something slightly more rea
listic that you might come across on a real page. we block user interactivity with the rendering of the ui. in this example, we have two buttons: a "fill canvas" button th...
...the available <canvas> with 1 million blue circles. a "click me for alert" button that when clicked shows an alert message. function expensiveoperation() { for(let i = 0; i < 1000000; i++) { ctx.fillstyle = 'rgba(0,0,255, 0.2)'; ctx.beginpath(); ctx.arc(random(0, canvas.width), random(0, canvas.height), 10, degtorad(0), degtorad(360), false); ctx.fill() } } fillbtn.addevent
listener('click', expensiveoperation); alertbtn.addevent
listener('click', () => alert('you clicked me!') ); if you click the first button and then quickly click the second one, you'll see that the alert does not appear until the circles have finished being rendered. the first operation blocks the second one until it has finished running. note: ok, in our case, it is ugly and we are faking the bl...
Graceful asynchronous programming with Promises - Learn web development
(unless of course, it takes far too long!), and more interested in being able to respond to it being returned, whenever that is. and of course, it's nice that it doesn't block the rest of the code execution. one of the most common engagements you'll have with promises is with web apis that return a promise. let's consider a hypothetical video chat application. the application has a window with a
list of the user's friends, and clicking on a button next to a user starts a video call to that user. that button's handler calls getusermedia() in order to get access to the user's camera and microphone. since getusermedia() has to ensure that the user has permission to use those devices and ask the user which microphone to use and which camera to use (or whether to be a voice-only call, among other...
...ns: 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. note: you can make further improvements with async/await syntax, which we'll dig into in the next article. at their most basic, promises are similar to event
listeners, but with a few differences: a promise can only succeed or fail once. it cannot succeed or fail twice and it cannot switch from success to failure or vice versa once the operation has completed. if a promise has succeeded or failed and you later add a success/failure callback, the correct callback will be called, even though the event took place earlier. explaining basic promise syntax...
..., we invoke the .then() method of the promise object. the callback inside the .then() block (referred to as the executor) runs only when the promise call completes successfully and returns the response object — in promise-speak, when it has been fulfilled. it is passed the returned response object as a parameter. note: the way that a .then() block works is similar to when you add an event
listener to an object using addevent
listener(). it doesn't run until an event occurs (when the promise fulfills). the most notable difference is that a .then() will only run once for each time it is used, whereas an event
listener could be invoked multiple times. we immediately run the blob() method on this response to ensure that the response body is fully downloaded, and when it is available t...
... all loaded, albeit in a not particularly attractive way! the code we provided here for displaying the items is fairly rudimentary but works as an explainer for now. note: if you get stuck, you can compare your version of the code to ours, to see what it is meant to look like — see it live, and see the source code. note: if you were improving this code, you might want to loop through a
list of items to display, fetching and decoding each one, and then loop through the results inside promise.all(), running a different function to display each one depending on what the type of code was. this would make it work for any number of items, not just three. also, you could determine what the type of file is being fetched without needing an explicit type property. you could, for example, che...
Website security - Learn web development
e vulnerability scanner tools that can help you find out if you've made any obvious mistakes. the rest of this article gives you more details about a few common threats and some of the simple steps you can take to protect your site. note: this is an introductory topic, designed to help you start thinking about website security, but it is not exhaustive. website security threats this section
lists just a few of the most common website threats and how they are mitigated. as you read, note how threats are most successful when the web application either trusts, or is not paranoid enough about the data coming from the browser. cross-site scripting (xss) xss is a term used to describe a class of attacks that allow an attacker to inject client-side scripts through the website into the browser...
...ration rights, access all data on the server, or destroy/modify the data to make it unusable. sql injection types include error-based sql injection, sql injection based on boolean errors, and time-based sql injection. this vulnerability is present if user input that is passed to an underlying sql statement can change the meaning of the statement. for example, the following code is intended to
list all users with a particular name (username) that has been supplied from an html form: statement = "select * from users where name = '" + username + "';" if the user specifies a real name, the statement will work as intended. however, a malicious user could completely change the behavior of this sql statement to the new statement in the following example, by simply specifying the text in bold fo...
...ver. when loaded, this file might be executed on the web server or the client-side (leading to an xss attack). the solution is to sanitize input before using it. command injection. command injection attacks allow a malicious user to execute arbitrary system commands on the host operating system. the solution is to sanitize user input before it might be used in system calls. for a comprehensive
listing of website security threats see category: web security exploits (wikipedia) and category: attack (open web application security project). a few key messages almost all of the security exploits in the previous sections are successful when the web application trusts data from the browser. whatever else you do to improve the security of your website, you should sanitize all user-originating dat...
...t only the user will have, such as a code in an sms sent to their phone). configure your web server to use https and http strict transport security (hsts). https encrypts data sent between your client and server. this ensures that login credentials, cookies, post requests data and header information are not easily available to attackers. keep track of the most popular threats (the current owasp
list is here) and address the most common vulnerabilities first. use vulnerability scanning tools to perform automated security testing on your site. later on, your very successful website may also find bugs by offering a bug bounty like mozilla does here. only store and display data that you need. for example, if your users must store sensitive information like credit card details, only display eno...
Getting started with Ember - Learn web development
ode and npm installed before you can install ember-cli. go here to find out how to install node and npm, if you haven't already got them. now type the following into your terminal to install ember-cli: npm install -g ember-cli this tool provides the ember program in your terminal, which is used to create, build, develop, test, and scaffold your application (run ember --help for a full
list of commands and their options). to create a brand new application, type the following in your terminal. this creates a new directory inside the current directory you are in called todomvc, containing the scaffolding for a new ember app. make sure you navigate to somewhere appropriate in the terminal before you run it. (good suggestions are your "desktop" or "documents" directories, so that ...
...e_modules/todomvc-common/base.css'); app.import('node_modules/todomvc-app-css/index.css'); for more information on what ember-cli-build.js does, and for other ways in which you can customize your build / pipeline, the ember guides have a page on addons and dependencies. finally, find app.css, located at app/styles/app.css, and paste in the following: :focus, .view label:focus, .todo-
list li .toggle:focus + label, .toggle-all:focus + label { /* !important needed because todomvc styles deliberately disable the outline */ outline: #d86f95 solid !important; } this css overrides some of the styles provided by the todomvc-app-css npm package, therefore allowing keyboard focus to be visible. this goes some way towards fixing one of the major accessibility disadvantages of the de...
...e point where we can start build up our sample todomvc app in ember. in the next article we'll look at building up the markup structure of our app, as a group of logical components. ...
...accessibility in react react resources ember getting started with ember ember app structure and componentization ember interactivity: events, classes and state ember interactivity: footer functionality, conditional rendering routing in ember ember resources and troubleshooting vue getting started with vue creating our first vue component rendering a
list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo
list app dynamic behavior in svelte: working with variables and props ...
Ember resources and troubleshooting - Learn web development
prerequisites: at minimum, it is recommended that you are familiar with the core html, css, and javascript languages, and have knowledge of the terminal/command line. a deeper understanding of modern javascript features (such as classes, modules, etc), will be extremely beneficial, as ember makes heavy use of them. objective: to provide further resource links and troubleshooting information. ...
...objective: to provide further resource links and troubleshooting information. further resources ember.js guides tutorial: super rentals ember.js api documentation ember.js discord server — a forum/chat server where you can meet the ember community, ask for help, and help others! general troubleshooting, gotchas, and misconceptions this is nowhere near an extensive
list, but it is a
list of things that came up around the time of writing (latest update, may 2020). how do i debug what's going on in the framework? for framework-specific things, there is the ember-inspector add-on, which allows inspection of: routes & controllers components services promises data (i.e: from a remote api — from ember-data, by default) deprecation information rende...
...s well as customized templates defined elsewhere in the application, unifying loading/error states. more information on everything a route can do is found in the api documentation. ...
...accessibility in react react resources ember getting started with ember ember app structure and componentization ember interactivity: events, classes and state ember interactivity: footer functionality, conditional rendering routing in ember ember resources and troubleshooting vue getting started with vue creating our first vue component rendering a
list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo
list app dynamic behavior in svelte: working with variables and props ...
Getting started with React - Learn web development
e an error. the second statement imports a logo from './logo.svg'. note the use of ./ at the beginning of the path, and the .svg extension at the end — these tell us that the file is local and that it is not a javascript file. indeed, the logo.svg file lives in our source directory. we don't write a path or extension when importing the react module — this is not a local file; instead, it is
listed as a dependency in our package.json file. be careful of this distinction as you work through this lesson! the third statement imports the css related to our app component. note that there is no variable name and no from directive. this particular import syntax is not native to javascript module syntax — it comes from webpack, the tool create-react-app uses to bundle all our javascript files ...
...nt ); } when you save, the app should now greet you with "hello, clarice!". if you return to index.js, edit the value of subject, and save, your text will change. summary this brings us to the end of our initial look at react, including how to install it locally, creating a starter app, and how the basics work. in the next article, we'll start building our first proper application — a todo
list. before we do that, however, let's recap some of the things we’ve learned. in react: components can import modules they need and must export themselves at the bottom of their files. component functions are named with pascalcase. you can read jsx variables by putting them between curly braces, like {so}. some jsx attributes are different than html attributes so that they don't conflict wi...
...html translates to classname in jsx. note that multi-word attributes are camel-cased. props are written just like attributes inside component calls and are passed into components. ...
...accessibility in react react resources ember getting started with ember ember app structure and componentization ember interactivity: events, classes and state ember interactivity: footer functionality, conditional rendering routing in ember ember resources and troubleshooting vue getting started with vue creating our first vue component rendering a
list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo
list app dynamic behavior in svelte: working with variables and props ...
Introduction to automated testing - Learn web development
at the end of the pipe chain, we output our modified prefixed css to the build directory. note that this only works if csslint doesn't find any errors — try removing a curly brace from your css file and re-running gulp to see what output yo...
...oard has a lot of options available on it. for now, make sure you are on the manual tests tab. click start a new manual session. in the next screen, type in the url of a page you want to test (use http://mdn.github.io/learning-area/javascript/building-blocks/events/show-video-box-fixed.html, for example), then choose a browser/os combination you want to test by using the different buttons and
lists. there is a lot of choice, as you'll see! when you click start session, a loading screen will then appear, which spins up a virtual machine running the combination you chose. when loading has finished, you can then start to remotely test the web site running in the chosen browser. from here you can see the layout as it would look in the browser you are testing, move the mouse around and try c...
...ntents: const saucelabs = require('saucelabs'); let myaccount = new saucelabs({ username: "your-sauce-username", password: "your-sauce-api-key" }); myaccount.getaccountdetails(function (err, res) { console.log(res); myaccount.getservicestatus(function (err, res) { // status of the sauce labs services console.log(res); myaccount.getjobs(function (err, jobs) { // get a
list of all your jobs for (let k in jobs) { if ( jobs.hasownproperty( k )) { myaccount.showjob(jobs[k].id, function (err, res) { let str = res.id + ": status: " + res.status; if (res.error) { str += "\033[31m error: " + res.error + " \033[0m"; } console.log(str); }); } } }); }); }); y...
...logs_url: <string> } } */ } advanced: automated tests we'll cover actually running automated browserstack tests in the next article. testingbot getting started with testingbot let's get started with a testingbot trial. create a testingbot trial account. sign in. this should happen automatically after you verify your e-mail address. the basics: manual tests the testingbot dashboard
lists the various options you can choose from. for now, make sure you are on the live web testing tab. enter the url of the page you want to test. choose the browser/os combination you want to test by selecting the combination in the grid. when you click start browser, a loading screen will then appear, which spins up a virtual machine running the combination you chose. when loading has finis...
Handling common HTML and CSS problems - Learn web development
are less likely. for example .audio-player ul a. validation for html, validation involves making sure all your tags are properly closed and nested, you are using a doctype, and you are using tags for their correct purpose. a good strategy is to validate your code regularly. one service that can do this is the w3c markup validation service, which allows you to point to your code, and returns a
list of errors: css has a similar story — you need to check that your property names are spelled correctly, property values are spelled correctly and are valid for the properties they are used on, you are not missing any curly braces, and so on. the w3c has a css validator available too, for this purpose. linters another good option to choose is a so-called linter application, which not only po...
...ed) — download it from the atom page linked above. go to atom's preferences... dialog (e.g. by choosing atom > preferences... on mac, or file > preferences... on windows/linux) and choose the install option in the left hand menu. in the search packages text field, type "lint" and press enter/return to search for linting-related packages. you should see a package called lint at the top of the
list. install this first (using the install button), as other linters rely on it to work. after that, install the linter-csslint plugin for linting css, and the linter-tidy plugin for linting html. after the packages have finished installing, try loading up an html file and a css file: you'll see any issues highlighted with green (for warnings) and red (for errors) circles next to the line numbers, a...
...mplemented using css prefixes. in general, most core html and css functionality (such as basic html elements, css basic colors and text styling) works across most browsers you'll want to support; more problems are uncovered when you start wanting to use newer features such as flexbox, or html5 video/audio, or even more nascent, css grids or -webkit-background-clip: text. once you've identified a
list of potential problem technologies you will be using, it is a good idea to research what browsers they are supported in, and what related techniques are useful. see finding help below. html fallback behaviour some problems can be solved by just taking advantage of the natural way in which html/css work. unrecognised html elements are treated by the browser as anonymous inline elements (effectiv...
...sides) can be done using tools like autoprefixer and postcss. these tools can be used in a variety of ways, for example autoprefixer has an online version that allows you to enter your non-prefixed css on the left, and gives you a prefix-added version on the right. you can choose which browsers you want to make sure you support using the notation outlined in autoprefixer options; also see browsers
list queries, which this is based on, for more detail. as an example, the following query will select the last 2 versions of all major browsers and versions of ie above 9. last 2 versions, ie > 9 autoprefixer can also be used in other, more convenient ways — see autoprefixer usage. for example, you can use it with a task runner/build tool such as gulp or webpack to automatically add prefixes once ...
Strategies for carrying out testing - Learn web development
es for testing, identifying, and fixing problems?" prerequisites: familiarity with the core html, css, and javascript languages; an idea of the high level principles of cross-browser testing. objective: to gain an understanding of the high-level concepts involved in cross-browser testing. gotta test 'em all? when doing cross-browser testing, you need to work out a
list of browsers you will need to test on to start with. there is no way you can test on every combination of browser and device your users might use to view your site — there are just too many, and new ones appear all the time. instead, you should try to make sure your site works on the most important target browsers and devices, and then code defensively to give your site the widest support reach...
...ort stats one helpful measure you can call on to inform your browser testing choices is browser support stats. there are a number of sites that provide such stats, for example: netmarketshare statcounter these are both very north america-centric, and not particularly accurate, but they can give you an idea of broad trends. for example, let's go to netmarketshare. you can see that opera is
listed as having small but visible usage figures, so we should add it to our support chart too as grade c. ie8 is
listed as being significant too, but it is older and no longer capable. opera mini is also significant, but it isn't very capable in terms of running complex javascript at runtime, etc (see opera mini and javascript for more details). we should put this into grade b as well. using analyt...
...droid stock browser (last two versions) on phone/tablet, chrome and firefox for android (last two versions) on phone tablet. accessibility passing common tests. b grade: ie 8 and 9 for windows, opera mini. c grade: opera, other niche modern browsers. what are you going to test? when you've got a new addition to your codebase that needs testing, before you start testing you should write out a
list of testing requirements that need to pass to be accepted. these requirements can be visual or functional — both combine to make a usable web site feature. consider the following example (see the source code, and also the example running live): test criteria for this feature could be written like so: a and b grade: button should be activatable by the user's primary control mechanism, wha...
...t environments provide useful mechanisms for rolling out site changes to only a subset of users, providing a useful mechanism for getting a feature tested by a subset of users without the need for a separate development server. an example is django waffle flags. summary after reading this article you should now have a good idea of what you can do to identify your target audience/target browser
list, and then effectively carry out cross-browser testing on that
list. next we'll turn our attention to the actual code issues your testing might uncover, starting with html and css. previous overview: cross browser testing next in this module introduction to cross-browser testing strategies for carrying out testing handling common html and css problems handling common javascript pr...
Setting up your own test automation environment - Learn web development
he below command in your terminal to execute your test: node index.js the test will be sent to lambdatest, and the output of your test will be reflected on your lambdatest console. if you wish to extract these results for reporting purpose from lambdatest platform then you can do so by using lambdatest restful api. now if you go to your lambdatest automation dashboard, you'll see your test
listed; from here you'll be able to see videos, screenshots, and other such data. you can retrieve network, command, exception, and selenium logs for every test within your test build. you will also find a video recording of your selenium script execution. note: the help button on lambdatest automation dashboard will provide you with an ample amount of information to help you get started with la...
...er name and access key values (and make sure you keep them secure). run your test with the following command: node bstack_google_test the test will be sent to browserstack, and the test result will be returned to your console. this shows the importance of including some kind of result reporting mechanism! now if you go back to the browserstack automation dashboard page, you'll see your test
listed: if you click on the link for your test, you'll get to a new screen where you will be able to see a video recording of the test, and multiple detailed logs of information pertaining to it. note: the resources menu option on the browserstack automation dashboard contains a wealth of useful information on using it to run automated tests. see node js documentation for writing automate test ...
...al user name and access key values (and make sure you keep them secure). run your test with the following command: node sauce_google_test the test will be sent to sauce labs, and the test result will be returned to your console. this shows the importance of including some kind of result reporting mechanism! now if you go to your sauce labs automated test dashboard page, you'll see your test
listed; from here you'll be able to see videos, screenshots, and other such data. note: sauce labs' platform configurator is a useful tool for generating capability objects to feed to your driver instances, based on what browser/os you want to test on. note: for more useful details on testing with sauce labs and selenium, check out getting started with selenium for automated website testing, ...
...ting server. let's look at how to do this. the selenium remote server requires java to run. download the latest jdk for your platform from the java se downloads page. install it when it is downloaded. next, download the latest selenium standalone server — this acts as a proxy between your script and the browser drivers. choose the latest stable version number (i.e. not a beta), and from the
list choose a file starting with "selenium-server-standalone". when this has downloaded, put it in a sensible place, like in your home directory. if you've not already added the location to your path, do so now (see the setting up selenium in node section). run the standalone server by entering the following into a terminal on your server computer java -jar selenium-server-standalone-3.0.0.jar (u...
Accessibility Information for Core Gecko Developers
e. unix accessibility project this document describes the sun accessibility project. join the mozilla accessibility community live chat both end users and developers are invited for discussion on the live irc channel at irc.mozilla.org/#accessibility. since this is a worldwide effort, there is always a good chance to find someone to chat with there, day or night. ...
...ect this document describes the sun accessibility project. join the mozilla accessibility community live chat both end users and developers are invited for discussion on the live irc channel at irc.mozilla.org/#accessibility. since this is a worldwide effort, there is always a good chance to find someone to chat with there, day or night. ...
... join the mozilla accessibility community live chat both end users and developers are invited for discussion on the live irc channel at irc.mozilla.org/#accessibility. since this is a worldwide effort, there is always a good chance to find someone to chat with there, day or night. ...
...s and developers are invited for discussion on the live irc channel at irc.mozilla.org/#accessibility. since this is a worldwide effort, there is always a good chance to find someone to chat with there, day or night. newsgroup and mailing
list we have two discussion
lists, which can be read via a newsgroup reader, as a mailing
list or via google groups. ...
Accessibility information for UI designers and developers
tml. designers are encourage to also not skip levels in designs. see also: heading elements join the mozilla accessibility community live chat both end users and developers are invited for discussion on the live irc channel at irc.mozilla.org/#accessibility. since this is a worldwide effort, there is always a good chance to find someone to chat with there, day or night. ...
...to also not skip levels in designs. see also: heading elements join the mozilla accessibility community live chat both end users and developers are invited for discussion on the live irc channel at irc.mozilla.org/#accessibility. since this is a worldwide effort, there is always a good chance to find someone to chat with there, day or night. ...
...s join the mozilla accessibility community live chat both end users and developers are invited for discussion on the live irc channel at irc.mozilla.org/#accessibility. since this is a worldwide effort, there is always a good chance to find someone to chat with there, day or night. ...
...s and developers are invited for discussion on the live irc channel at irc.mozilla.org/#accessibility. since this is a worldwide effort, there is always a good chance to find someone to chat with there, day or night. newsgroup and mailing
list we have two discussion
lists, which can be read via a newsgroup reader, as a mailing
list or via google groups. ...
Mozillaās UAAG evaluation report
ook to the "techniques" document for real-world implementation examples of each checkpoint. this uaag evaluation report covers nightly builds of the mozilla web browser itself, running on windows 2000, as of february 20, 2002. we are claiming to support html 4, css 2, png, jpg and gif. this evaluation does not cover mailnews or composer. there may be accessibility and customizability features not
listed here. a very good resource is the customizing document. when filing mozilla bugs based on uaag requirements, please use bug 24413 as the uaag meta bug. checkpoint information (same scaled used on w3c's uaag implementation reports pages) rating scale c: complete implementation vg: very good implementation, almost all requirements satisfied g: good implementation, most ...
... as specified in the control panel. mozilla exposes the focus via wm_focus system messages mozilla does not use the system focus drawing routines, because they aren't flexible enough (don't support css) 7.2 respect input configuration conventions. (p1) vg mozilla implements standard keyboard bindings there are a few missing pieces, such as support in xul comboboxes (menu
list) for selecting items by typing alphanumeric keystrokes 7.3 operating environment conventions. (p2) g mozilla uses non-native controls. it does, however, support the look and feel of widgets on various operating systems, when the classic theme is selected (on by default). 7.4 input configuration indications. (p2) g menus indicate accesskey and accelerator configuratio...
...(p2) vg html 4.01: vg css 1: vg css 2: vg dom 1.0: vg guideline 9. provide navigation mechanisms. checkpoint title status notes/plans 9.1 provide content focus. (p1) c provides a content focus 9.2 provide user inte...
... use system colors by default (classic theme) underlines links by default does not have ui to highlight non-link and non-form elements that have event handlers can have user css for user styling of elements with event handlers 10.5 outline view. (p2) p dom inspector provides a type of outline view, although it is not intended for end users page info (ctrl+i) gives
lists of links, media, forms/elements can use a user style sheet to implement an outline bug 127030 has been filed for an outline view. 10.6 provide link information. (p3) g only uses color to indicate whether a link has been visted by default context menu properties provides link information, but does not provide the size of the resource. note that the size might be discove...
Command line options
ly. does not work in firefox 31 on linux mint 17 nor on firefox 48 on windows 7. url opens in a non-private window. -search term search term with your default search engine. firefox and seamonkey 2.1 and later only. -setdefaultbrowser set the application as the default browser. firefox only. -url url open url in a new tab or window, depend on the browser option. -url can be omitted. you may
list multiple urls, separated by spaces. firefox and seamonkey only. firefox www.mozilla.com firefox www.mozilla.com developer.mozilla.org note: when opening multiple urls, firefox always opens them as tabs in a new window. mail/news -addressbook start with address book. thunderbird and seamonkey only. -compose message_options start with mail composer. see syntax rules. thunderbird and seamon...
...layout engine) has a javascript cache, which is not reset on startup, this clears it. -start-debugger-server port firefox only. start the debugger server on port. this will enable another instance of firefox to connect the firefox developer tools to this firefox instance. see the article on remotely debugging firefox desktop. the port argument is optional, and if it is omitted, the server will
listen on port 6000. -venkman start with the javascript debugger, venkman, if installed. xulrunner -app /path/to/application.ini start a new process running the xulrunner application at path/to. also works with firefox version 3 and above. --install-app path/to/myapplication.(xpi|xulapp) installs the xulrunner application at path/to onto the system. applications are installed into the default l...
... this option is only available on x-windows unix platforms. miscellaneous -attach-console write messages for the debugging console into the window which launched the application instead of opening a new window for the debugging messages. only supported on the windows operating system. -console start application with a debugging console. note: windows only. -h or -help or -? print the
list of all available command line options. note that on windows this only works with a redirection such as |more (bug 355889). this option is available only in a command console. -osint tells the application that it is being launched by the os shell. this should not be specified unless the caller provides all of the functionality provided by the os shell when launching the application (bug 384384).
...ning atop the x11/x.org display and window system to be found on linux and other unix-based systems. --class=wm_class set the wm_class resource class of the x11 windows created by the application. --display=display set the x display to use. --g-fatal-warnings make all warnings fatal. --sync make x calls synchronous. ...
Debugging on Windows
dio debugger. debugging release and nightly builds refer to the steps to use the mozilla symbol server and source server. creating a visual c++ project for firefox please refer to the documentation on firefox-source-docs. changing/setting the executable to debug vc++ 6.0: to change or set the executable to debug, go to project > settings..., debug tab and select general from the drop down
list. "executable for debug session:" should show the executable you are debugging. if it is empty or incorrect, use the arrow button and select browse... to locate the executable. command line parameters and environment variables vc++ 6.0: to change or set the command line options, go to project > settings..., debug tab and select general from the drop down
list. "program arguments:" should show th...
...he console output to a file (by adding "> filename.txt" for example, without the quotes). in vc 7 and 8 this option is called project > properties > debugging > command arguments. vc 8 also allows you to set environment variables there. setting breakpoints in dlls which are not yet loaded in memory vc++ 6.0: go to project > settings..., debug tab and select "additional dlls" from the drop down
list. check "locate additional dlls" option. for each dll, click the "new" button which creates a new entry and then hit the "..." buttons which lets you browse to the dll. you will only be able to add one dll at a time. vc++ 7.0 automatically finds additional dlls. customizing the debugger's variable value view you can customize how visual c++ displays classes in the variable view. by default vc++...
...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. ...
...er_*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 { ..snip.. } >debug.evaluatestatement ((nsgenericelement*)0x03f0e710)->
list((file*)0x10311dc0, 1) ...
HTTP logging
the "interesting" part of the browser's behavior (i.e. your bug), which makes the http log much smaller and easier to analyze. launch the browser and get it into whatever state you need to be in just before your bug occurs. open a new tab and type in "about:networking" into the url bar. go to the "logging section" adjust the location of the log file if you don't like the default adjust the
list of modules that you want to log: this
list has the exact same format as the moz_log environment variable (see below). generally the default
list is ok, unless a mozilla developer has told you to modify it. click on start logging. reproduce the bug (i.e. go to the web site that is broken for you and make the bug happen in the browser) make a note of the value of "current log file". click on s...
... that you're having. once you've reproduced the problem, exit firefox and look for the generated log files in your temporary directory. you can type "%temp%" directly into the windows explorer location bar to get there quickly. linux this section offers information on how to capture http logs for firefox running on linux. quit out of firefox if it's running. open a new shell. the commands
listed here assume a bash-compatible shell. copy and paste the following commands into the shell one at a time. make sure to hit enter after each line. export moz_log=timestamp,rotate:200,nshttp:5,cache2:5,nssockettransport:5,nshostresolver:5,cookie:5 export moz_log_file=/tmp/log.txt cd /path/to/firefox ./firefox reproduce the problem you're debugging. when the problem has been reproduced, exi...
...dows startup disk. make the appropriate adjustments if those aren't the case.) reproduce whatever problem it is that you're having. once you've reproduced the problem, exit firefox and look for the generated log files in your temporary directory. you can type "%temp%" directly into the windows explorer location bar to get there quickly. advanced techniques you can adjust some of the settings
listed above to change what http information get logged. limiting the size of the logged data by default there is no limit to the size of log file(s), and they capture the logging throughout the time firefox runs, from start to finish. these files can get quite large (gigabytes)! so we have added a 'rotate:size_in_mb' option to moz_log (we use it in the examples above). if you are using firefox >...
...to avoid any mixture of information. the append module specified is then ignored. use 'sync' if your browser crashes or hangs by default, http logging buffers messages and only periodically writes them to disk (this is more efficient and also makes logging less likely to interfere with race conditions, etc). however, if you are seeing your browser crash (or hang) you should add ",sync" to the
list of logging modules in your moz_log environment variable. this will cause each log message to be immediately written (and fflush()'d), which is likely to give us more information about your crash. logging only http request and response headers there are two ways to do this: replace moz_log=nshttp:5 with moz_log=nshttp:3 in the commands above. there's a handy extension for firefox called htt...
How Mozilla's build system works
t sub-tier of the first tier, and traverses all the directories in that tier. then, it does the same thing for the libs sub-tier and, subsequently, the tools sub-tier. it then moves on to the next tier and continues until no tiers remain. to view information about the tiers, you can execute the following special make targets: command effect make echo-tiers show the final
list of tiers. make echo-dirs show the
list of non-static source directories to iterate over, as determined by the tier
list. make echo-variable-static_dirs show the
list of static source directories to iterate over, as determined by the tier
list. moz.build files moz.build files are how each part of the source tree defines how it is integrated with the build system. th...
...ase. creating new variables whose name is not uppercase (this includes defining functions). moz.build files cannot do the following: import modules. open files. use the print statement or function. reference many of python's built-in or global functions (they are not made available to the execution environment). the most important actions of moz.build files are #1 and #2 from the above
list. these are how the execution of a moz.build file tells the build system what to do. for example, you can assign to the dirs
list to define which directories to traverse into looking for additional moz.build files. the output of the execution of an individual moz.build file is a python dictionary. this dictionary contains the uppercase variables directly assigned to and the special variables indi...
... the depth variable should be set to the relative path from your makefile.in to the top-level mozilla directory. topsrcdir is substituted in by configure and points to the top-level mozilla directory. srcdir is also substituted in by configure and points to the source directory for the current directory. in source tree builds, this will simply point to "." (the current directory). vpath is a
list of directories where make will look for prerequisites (i.e., source files). one other frequently used variable not specific to a particular build target is dirs. dirs is a
list of subdirectories of the current directory to recursively build in. subdirectories are traversed after their parent directories. for example, you could have: dirs = \ public \ resources \ src \ $(null) this ex...
...note the use of lib_prefix and lib_suffix to make this work on all platforms. building jar files jar files are used for packaging chrome files (xul, javascript, and css). for more information on jar packaging, see this document. here, we will only cover how to set up a makefile to package jars. below is an example: depth ...
The Firefox codebase: CSS Guidelines
er automatic sizing or alignment methods. some examples to avoid: absolutely positioned elements hardcoded values such as: vertical-align: -2px; . the reason you should avoid such "hardcoded" values is that, they don't necessarily work for all font-size configurations. avoid setting styles in javascript. it's generally better to set a class and then specify the styles in css. class
list is generally better than classname. there's less chance of overwriting an existing class. only use generic selectors such as :last-child, when it is what you mean semantically. if not, using a semantic class name is more descriptive and usually better. boilerplate make sure each file starts with the standard copyright header (see license boilerplate). before adding more css it is good pract...
...of if you create a focus ring or a border using the box-shadow property: consider using a border or an outline if you want the border/focus ring to stay visible in high-contrast mode. an example of such bug is bug 1516767. another adjustment to be aware of is that gecko removes all the background-image when high contrast mode is enabled. consider using an actual <img> tag (for html documents) or
list-style-image (for xul documents) if rendering the image is important. if you are not using windows, one way to test against those adjustments on other platforms is: going to about:preferences clicking on the "colors..." button in the "fonts & colors" sub-section of the "language and appearance" section under "override the colors specified by the page with your selections above", select the "...
...f firefox uses colors as authored, which is why using pre-defined variables, currentcolor or inheritance is useful to integrate with the system theme with little hassle. if not, as a last resort, using system colors also works for non-default windows themes or linux. in general, the following colors are used: -moz-field: textbox or field background colors, also used as the background color of
listboxes or trees. -moz-fieldtext: textbox or field text colors, also used as the text color of
listboxes or trees. -moz-dialog: window or dialog background color. -moz-dialogtext: window or dialog text color. graytext: used on disabled items as text color. do not use it on text that is not disabled to desemphsize text, because it does not guarantee a sufficient contrast ratio for non-disabled te...
...-yosemite-theme) { privilege css for most common configuration it is better to put the most common configuration (latest version of an os, or default theme for example) outside of the media query. in the following example, -moz-mac-yosemite-theme targets macos 10.10 and higher, so it should be privileged over the styling for macos 10.9. do this: @media (-moz-mac-yosemite-theme: 0) { #places
list { box-shadow: inset -2px 0 0 hsla(0,0%,100%,.2); } } not this: #places
list { box-shadow: inset -2px 0 0 hsla(0,0%,100%,.2); } @media (-moz-mac-yosemite-theme) { #places
list { box-shadow: none; } } theme support firefox comes built-in with 3 themes: default, light and dark. the built-in light/dark themes are a bit special as they load the compacttheme.css stylesheet. in ad...
Index
y 2015 the rust programming language reached its 1.0 stability milestone, and various experiments with writing parts of gecko in rust began. rust code first shipped in august 2016 with the release of firefox 48. it became a requirement for building gecko in february 2017 with firefox 54. ...
...one example is the new tab page, which includes a "top sites" section showing sites you visit that firefox thinks you're likely to want to visit again, as well as potentially some sites that have been pinned to always appear in that space. ...
... firefox, guide, mozilla, protocols there is a lot of useful information about firefox hidden away behind the about: url protocol. the most useful is the url about:config, which displays preferences and settings that can be inspected and changed. 141 index firefox, index, mozilla found 168 pages: 142 linux compatibility matrix the following table
lists the available library versions for the mozilla.org-distributed firefox builds dependencies, and/or to build firefox. 143 multiple firefox profiles beginner, firefox, guide, intro, profiles, qa a profile in firefox is the collection of settings, customizations, add-ons, and other personalizations that a user has made or installed into their copy of firefox. you can find detai...
... this guide will help firefox developers working on front-end code produce code which is as performant as possible—not just on its own, but in terms of its impact on other parts of firefox. always keep in mind the side effects your changes may have, from blocking other tasks to interfering with other user interface elements. 169 privacy privacy, security this document
lists privacy-related documentation. 170 storage access policy: block cookies from trackers privacy, storage access policy, tracking protection firefox includes a new storage access policy that blocks cookies and other site data from third-party tracking resources. this new policy is designed as an alternative to the current policies, which have been available in firefox for many ...
Multiple Firefox profiles
se of firefox and are in final stages of testing. aurora contains experimental features, which are not yet at beta quality. nightly contains the latest code from firefox developers and is the least stable channel. third-party tools in addition to the built-in profile manager and the external profile manager, there are a few third-party tools that make working with multiple profiles easy. ...
...atures, which are not yet at beta quality. nightly contains the latest code from firefox developers and is the least stable channel. third-party tools in addition to the built-in profile manager and the external profile manager, there are a few third-party tools that make working with multiple profiles easy. this
list is by no means exhaustive. please add any helpful tools you discover to the
list! mac os x multifirefox by dave martorana profile management determining the profile while firefox is running to determine the profile of a currently-running firefox instance in windows, macos or linux, type about:profiles into the browser url search bar. the page presents a
list of all of your profiles, each beginning with "profile: " followed by its name. the one being run by this ...
...ry, for each additional profile you want to set. if you would also like to allow multiple instances of firefox to run at the same time, add "-no-remote" after the profile name. mac os x you can find a useful tutorial to set up custom launchers here: managing multiple firefox profiles in osx. do note it's best to follow all steps in the "creating the scripts" section, including the "edit info.p
list" step. leave off the profile name if you want the profile selector to show up every time you launch. setting up multiple profiles for different firefox channels this section will be especially helpful if you are a developer, wanting to work with multiple channels, and each having their separate launcher. windows in windows, the developer and nightly builds get their own directory in the "prog...
...ment methods will remain the same. you will want to, for sure, add the -no-remote part to the end of the command field, so that you could run multiple instances at the same time. mac os x you can find a useful tutorial to set up custom launchers here: managing multiple firefox profiles in osx. do note it's best to follow all steps in the "creating the scripts" section, including the "edit info.p
list" step. also, you'll want to change the path in the do shell script to point to the correct .app file for the firefox channel you want to target. ...
Performance best practices for Firefox front-end engineers
able, so everything stalls until the reflow is complete and the script can be given an answer. flushing layout also means that styles must be flushed to calculate the most up-to-date state of things, so it's a double-whammy. here’s a simple example, cribbed from this blog post by paul rouget: div1.style.margin = "200px"; // line 1 var height1 = div1.clientheight; // line 2 div2.class
list.add("foobar"); // line 3 var height2 = div2.clientheight; // line 4 dosomething(height1, height2); // line 5 at line 1, we’re setting some style information on a dom node that’s going to result in a reflow - but (at just line 1) it’s okay, because that reflow will happen after the style calculation. note line 2 though - we’re asking for the height of some dom node. this me...
...le reflow is no more computationally expensive than an interruptible reflow triggered by the 16ms tick. it is, however, advantageous to strive for reflow to only occur in the one place (the layout step of the 16ms tick) as opposed to multiple times during the 16ms tick (which has a higher probability of running through the 16ms budget). how do i avoid triggering uninterruptible reflow? here's a
list of things that javascript can ask for that can cause uninterruptible reflow, to help you think about the problem. note that some items in the
list may be browser-specific or subject to change, and that an item not occurring explicitly in the
list doesn't mean it doesn't cause reflow. for instance, at time of writing accessing event.rangeoffset triggers reflow in gecko, and does not occur in the e...
...this means that when enumerating properties on dom objects (e.g. elements/nodes, events, windows, etc.) accessing the value of each enumerated property will almost certainly (accidentally) cause uninterruptible reflow, because a lot of dom objects have one or even several properties that do so. if you require size or position information, you have a few options. ...
...cument.createelement() for example), and add each one to the fragment by calling documentfragment.appendchild(). once the fragment is populated, append the fragment to the dom by calling appendchild() on the parent element for the new elements. this example has been cribbed from davidwalsh’s blog post: // create the fragment var frag = document.createdocumentfragment(); // create numerous
list items, add to fragment for(var x = 0; x < 10; x++) { var li = document.createelement("li"); li.innerhtml = "
list item " + x; frag.appendchild(li); } // mass-add the fragment nodes to the
list listnode.appendchild(frag); the above is strictly cheaper than individually adding each node to the dom. the gecko profiler add-on is your friend the gecko profiler is your best friend whe...
Firefox and the "about" protocol
there is a lot of useful information about firefox hidden away behind the about: url protocol. the most useful is the url about:config, which displays preferences and settings that can be inspected and changed. available about: urls depend on your specific firefox version. ...
...onfig displays the configuration and platform used to build firefox about:cache displays information about the memory, disk, and appcache about:checkerboard switches to the checkerboarding measurement page, which allows to detect checkerboarding issues about:config provides a way to inspect and change firefox preferences and settings about:compat
lists overriding site compatability fixes, linked to specific bug issues. about:crashes
lists all crashes, which happened during the runtime of firefox (in case the user enabled the crash reporter) about:credits
lists all contributors to the firefox project about:debugging switches to the developer tools debugging page, which allows you to debug add-ons, tabs and se...
...ozilla special page showing a message from "the book of mozilla" about:networking displays networking information about:newtab start page when opening a new tab about:performance displays memory and performance information about firefox subprocesses/add-ons/tabs about:plugins displays information about installed plugins about:policies
lists out the firefox for enterprise policies about:preferences firefox settings (also available through firefox menu > options) about:privatebrowsing start page when opening a private window about:profiles display and manage firefox profiles about:protections privacy protections report consisting of enhanced tracking protection, firefox monitor and fire...
...hen firefox requires a restart due to an update about:reader indicates a web page has firefox reader view turned on. ...
Firefox UI considerations for web developers
there are a number of places within the firefox user interface where web sites are
listed for the user to choose a destination to visit or a site to manage in some way. one example is the new tab page, which includes a "top sites" section showing sites you visit that firefox thinks you're likely to want to visit again, as well as potentially some sites that have been pinned to always appear in that space. firefox's top sites box in this article, we take a look at how to influence the appearance of your site in firefox user interface elements such as the top sites box. ...
...ludes a "top sites" section showing sites you visit that firefox thinks you're likely to want to visit again, as well as potentially some sites that have been pinned to always appear in that space. firefox's top sites box in this article, we take a look at how to influence the appearance of your site in firefox user interface elements such as the top sites box. top sites the top sites box
lists a user-configurable number of rows of icons serving as quick links to sites the user commonly visits, or that the user has chosen to pin to the top sites
list in order to have quick access to them. each site is represented by an icon and, below it, a name for the site. while both of these can be edited by the user, you may wish to ensure that your site provides a good icon to use in places like...
... have quick access to them. each site is represented by an icon and, below it, a name for the site. while both of these can be edited by the user, you may wish to ensure that your site provides a good icon to use in places like this. how an icon is selected the new tab page chooses icons to use for top sites by trying a series of methods until it obtains an icon to use: a global "top sites"
list is checked. this
list is created by a mozilla service called tippy top. the data store provided by tippy top includes an optimized icon for each of the sites in the
list; if the site is on this
list, that icon is used. if tippy top doesn't include the site, firefox looks in its places data store for icons specified in the page's <head> element; if an svg icon is available, that icon is sel...
...ly 96 pixels, it is used. otherwise, the smallest image larger than 96 pixels wide is selected. if no high-resolution icon is found, a screenshot is taken of the site; this screenshot is then scaled and cropped to fit in the space allotted to the icon. if the site also has a favicon, it may be overlaid in the corner of the image. the selected image is then presented within the top sites
list. rich icons the high resolution icons—also known as rich icons—are specified by setting the rel attribute to one of: apple-touch-icon apple-touch-icon-precomposed fluid-icon the size of each icon is taken from the size attribute specified on the <link>, if it's provided. apple-touch-icon and apple-touch-icon-precomposed icons with no size attribute are assumed to be the standard clas...
Firefox
jects work. project documentation get detailed information about the internals of firefox and its build system, so you can find your way around in the code. developer guide our developer guide provides details on how to get and compile the firefox source code, how to find your way around, and how to contribute to the project. contents experimental features in firefoxthis page
lists features that are in nightly versions of firefox along with information on how to activate them, if necessary.firefox and the "about" protocolthere is a lot of useful information about firefox hidden away behind the about: url protocol. the most useful is the url about:config, which displays preferences and settings that can be inspected and changed.firefox ui considerations for web developersth...
...to activate them, if necessary.firefox and the "about" protocolthere is a lot of useful information about firefox hidden away behind the about: url protocol. ...
...ace where web sites are
listed for the user to choose a destination to visit or a site to manage in some way. one example is the new tab page, which includes a "top sites" section showing sites you visit that firefox thinks you're likely to want to visit again, as well as potentially some sites that have been pinned to always appear in that space. linux compatibility matrixthe following table
lists the available library versions for the mozilla.org-distributed firefox builds dependencies, and/or to build firefox.multiple firefox profilesa profile in firefox is the collection of settings, customizations, add-ons, and other personalizations that a user has made or installed into their copy of firefox. you can find details about profiles on mozilla's end-user support site.performance best pra...
...ance best practices for firefox front-end engineersthis guide will help firefox developers working on front-end code produce code which is as performant as possible—not just on its own, but in terms of its impact on other parts of firefox. always keep in mind the side effects your changes may have, from blocking other tasks, to interfering with other user interface elements.privacythis document
lists privacy-related documentation.security best practices for firefox front-end engineersthis article will help firefox developers understand the security controls in place and avoid common pitfalls when developing front-end code for firefox.site identity buttonthe site identity button is a feature in firefox that gives users more information about the sites they visit. firefox profiles if yo...
How Mozilla determines MIME Types
ext/plain will be used, otherwise application/octet-stream. externalhelperappservice (located at uriloader/exthandler/nsexternalhelperappservice.cpp) the file->mime type mapping works like this: on beos, the operating system is asked for the type of the file (not quite yet, bug 217723) on macos, the type and creator code will be used to lookup the type of the file from the os a hardcoded
list of extensions is checked (containing currently 13 entries, nsexternalhelperappservice.cpp line 463 (this is done for speed – it is faster to find data in the hardcoded
list than asking the os or looking in preferences) if the extension is not
listed there, it becomes interesting. firstly, the operating system is asked for a mime type. (on unix, this means checking mime.types.) if that fails, ...
...done for speed – it is faster to find data in the hardcoded
list than asking the os or looking in preferences) if the extension is not
listed there, it becomes interesting. firstly, the operating system is asked for a mime type. (on unix, this means checking mime.types.) if that fails, a user-supplied helper app is searched for by extension, and the specified mime type will be used. (i.e. the
list in edit/preferences/helper applications) if that failed, a
list of "extra" mime types is searched for an extension match. see line 507 for the complete
list. if that also failed, the
list of loaded plugins is checked for a plugin that can handle this extension, and is asked for the mime type if no plugin is registered, the ext-to-type-mapping xpcom category is searched for the extension. this a...
...hat related issue are the helper applications. when loading an uri with a type that mozilla can not handle, a helper app dialog shows up, and the displayed information comes from these sources: ask the os for a handler of the given <extension, mime type> pair. note that the extension here comes from the content-disposition header if present, and from the url itself otherwise. this is where the
listed "default application" comes from. the "data source" (that is, the
list of helper applications) is searched for an entry with the mime type of the uri. the data source is the mimetypes.rdf file in the profile directory. if this fails, the data source is searched via the extension (content-disposition as above). if one of these lookups succeed, this is where the application in the "open with" fi...
... the data source is the mimetypes.rdf file in the profile directory. if this fails, the data source is searched via the extension (content-disposition as above). if one of these lookups succeed, this is where the application in the "open with" field comes from, and also where the description of the type comes from. if this also failed, the extras are searched again, and will supply the extension-
list and a description of the mime type. related information document loading - from load start to finding a handler original document information author(s): christian biesinger last updated date: march 7, 2005 copyright information: copyright (c) christian biesinger ...
Add-on Manager
the callback may well only be called after the api function returns. for example: components.utils.import("resource://gre/modules/addonmanager.jsm"); addonmanager.getalladdons(function(aaddons) { // here aaddons is an array of addon objects }); // this code will execute before the code inside the callback notifications about changes to installed add-ons are dispatched to any registered addon
listeners. they must be registered through the addaddon
listener() method. installing new add-ons new add-ons can be installed by using the getinstallforfile() or getinstallforurl() methods on the addonmanager object. these will pass an addoninstall instance to the callback, which can then be used to install the add-on: components.utils.import("resource://gre/modules/addonmanager.jsm"); addonmanage...
...any available update is returned as an ad...
... instance to the callback, which can then be used to install the add-on: components.utils.import("resource://gre/modules/addonmanager.jsm"); addonmanager.getinstallforurl("http://www.foo.com/test.xpi", function(ainstall) { // ainstall is an instance of addoninstall ainstall.install(); }, "application/x-xpinstall"); the progress of addoninstalls can be monitored using an install
listener. a
listener can be registered either for a specific install using the add
listener() method or for all installs using the addinstall
listener() method. finding updates add-ons can be checked for updates using the findupdates() method. it must be passed an update
listener to receive information about compatibility information and new update information. any available update is returned as an addoninstall w...
...the getstartupchanges() method lets you find out which add-ons were installed, removed, updated, enabled, or disabled at application startup. ...
Dict.jsm
fox 19 and above, you may also pass a json string to initialize the dictionary: var somejson = '{key1: "foo", key2: {}}'; var newdict = new dict(somejson); note: any string you pass will be assumed to be json. method overview dict copy(); boolean del(string akey); object get(string akey, [optional] object adefault); boolean has(string akey); array
listitems(); array
listkeys(); array
listvalues(); void set(string akey, object avalue); string tojson(); string tostring(); properties attribute type description count number the number of items in the dictionary. items iterator returns an iterator over all of the items in the dictionary; each item...
...eturned for keys that aren't found. return value the value of the specified key, or undefined if no matching key was found. has() determines whether or not the specified key exists in the dictionary. boolean has( string akey ); parameters akey the key for which to determine existence in the dictionary. return value true if the specified key is in the dictionary, otherwise false.
listitems() returns an array of the key/value pairs in the dictionary. note: the order in which items are returned is arbitrary. array
listitems(); parameters none. return value an array of the key/value pairs in the dictionary.
listkeys() returns an array of the keys in the dictionary. note: the order in which items are returned is arbitrary. array
listkeys(); parameters none. return ...
... return value an array of the values in the dictionary. set() sets the value for a given key, adding a new key to the dictionary if necessary. ...
... return value an array of the values in the dictionary. set() sets the value for a given key, adding a new key to the dictionary if necessary. void set( string akey, object avalue ); parameters akey the key whose value is to be set. avalue the value to assign to the given key. ...
WebChannel.jsm
ginorpermission); 2nd argument is a valid origin that should be part of requests for this channel. webchannel(string webchannelid, string originorpermission); 2nd argument is a permission for which the permission manager will be checked to determine if the request is allowed. note that in addition to the permission manager check, the request must be made over https. method overview
listen(function callback); stop
listening(); send(object message, eventtarget target); attributes id string webchannel id methods
listen() registers the callback for messages on this channel. registers the channel itself with the webchannelbroker. parameters callback callback function containing function(id, message, sendercontext) parameters.
... channel. registers the channel itself with the webchannelbroker. parameters callback callback function containing function(id, message, sendercontext) parameters. id - webchannel id of the incoming messages message - incoming message object sendercontext - incoming message context - this should be treated as an opaque object and passed to the .send() method stop
listening() resets the callback for messages on this channel. removes the channel from the webchannelbroker. parameters none send() sends messages over the webchannel id using the "webchannelmessagetocontent" event. parameters message the message object that will be sent sendercontext the sendercontext parameter passed to the .
listen method. examples setting up a webc...
...g the "webchannelmessagetocontent" event. parameters message the message object that will be sent sendercontext the sendercontext parameter passed to the .
listen method. ...
...code and a webpage chrome code let channel = new webchannel(webchannelid, services.io.newuri("https://mozilla.org", null, null)); // receive messages channel.
listen(function (webchannelid, message, sendercontext) { // send messages channel.send({ data: { greeting: true } }, sendercontext); }); webpage code receive messages from an existing webchannel in content code window.addevent
listener("webchannelmessagetocontent", function(e) { // receive messages console.log(e.detail); }, true); send messages to an existing webchannel in chrome code window.dispatchevent(new window.customevent("webchannelmessagetochrome", { detail: { id: webchannelid, message: { something: true } } })); ...
XPCOMUtils.jsm
these utility methods requires four key steps: import xpcomutils.jsm, as explained previously. declare the class (or multiple classes) implementing the component(s). create an array of component constructors. define the nsgetfactory() or nsgetmodule() entry point. pseudocode this section provides some pseudocode that demonstrates how to put together a javascript class based on the steps
listed above. constructor the constructor is a simple method that handles any required initialization tasks. function mycomponent() { // initialize the component here } class declaration declare the class prototype, using a form similar to this. mycomponent.prototype = { // properties required for xpcom registration: classdescription: "unique text description", classid: compone...
...ementation... }; note: the ability to register the component in a category only on specific applications by adding the apps field to a category entry was added in gecko 2. notice that the queryinterface() method implemented by the component simply calls the generateqi() method provided by the xpcomutils code module. create an array of component constructors you need to create an array that
lists the constructors for each component. this array can of course have just one entry: var components = [mycomponent]; here, we're calling the array components. create the nsgetfactory() or nsgetmodule() entry point finally, you need to implement the nsgetmodule() entry point so gecko can start up your component: // "components" is the array created in the previous section if ("generatensgetfa...
...an exception with the message "in generateci, don't use a component for generating classinfo" if classinfo parameter is an xpcom component. generateqi() generates a queryinterface() function implementation. you need to assign the returned function to the queryinterface property of a javascript object. when the generated method is invoked on that object, it checks to see if the specified iid is
listed in the array specified by the interfaces parameter; if it is, this (that is, the object itself) is returned. otherwise, null is returned. function generateqi( interfaces ); parameters interfaces an array of interfaces implemented by the component. return value a queryinterface() function implementation. remarks when you implement an interface that inherits from another one, you sh...
... specified by the interfaces parameter; if it is, this (that is, the object itself) is returned. otherwise, null is returned. function generateqi( interfaces ); parameters interfaces an array of interfaces implemented by the component. return value a queryinterface() function implementation. remarks when you implement an interface that inherits from another one, you should generally
list all the base interfaces explicitly, except for nsisupports. for example, if your component implements nsistreamconverter: mycomponent.prototype = { queryinterface: xpcomutils.generateqi([ components.interfaces.nsirequestobserver, components.interfaces.nsistream
listener, components.interfaces.nsistreamconverter, ]), // ...methods... } importrelative() imports a javascript co...
Localizing with Mozilla Translator
products as groups of localization files with a common root directory (for instance, you may have a product for thunderbird, other for seamonkey, other for dom, other for toolkit, etc.) you update your repository copy using your favorite repository tool, and then update the product(s) in mt. this will remove obsolete strings and files from the internal database of mt, and will present you with a
list of new and updated strings. if you are starting a new localization, all strings will be marked as new or updated.mt puts a fuzzy flag on each flag and saves it in its database. all this means is that the strings have yet to be translated. you can save your work in progress and reopen it to continue working by selecting view fuzzy from the edit menu. after translating those strings (if using the...
...ome recipes that may be useful at a certain moment for mt users, but that, due to its temporary nature, don't fit in the user manual. migrating contents when the directory structure changes overall, if you are a ''good'' mt user and you do things like: checking "keep original" flags for strings not needing translation, instead of just leaving the translation empty struggling to get empty
lists when running "untranslated strings" and "view fuzzy" if you are up to date in localization regularly running qa checks and trying to minimize them. you will always do better if you can export a partial glossary and reimport it as needed. see the following example. let's assume you have a firefox product in mt with the directory layout present in language packs, as you probably would need fo...
...ial glossary (because they are not components), and platform neutral itself can't be selected either, since it is not a component, but a platform. for these few files, you will have to export them individually and reimport them. if you are a ''not so good'' mt user, however, you can just create a new product (or several ones; see next recipe to know why), run file -> update on them (you'll get a
list of all the strings) and then run edit -> autotranslate. most of the strings will be automatically filled, although if you do this you should review them, because for en-us strings with several possible translations, mt will choose one of them, which could not be the one you want. from cvs to mercurial in mt so, you have a firefox product in mt with a platform neutral and, inside it, several d...
... directory structure in what had been designed for five jars, and the ''patch'' consisted of providing a ''read from dir instead of jar'' and ''put everything inside platform neutral''. that has worked well (ok, more or less) :-) as long as you could instruct mt to use just one ''root'' l10n directory, but this is no longer the case with mercurial. mt could be changed for a mt product to have a
list of ''root'' directories instead of just one, and maybe someday it will do, but it will probably won't happen before seamonkey 1.1.x dies (and seamonkey 2.0 finally conquers the web, if i may add). ;-) enough chatting, what's next? anyway, we need to work around the full-fledged repository problem. these are your options: create one product for each ''root'' directories. this means browser...
Localizing without a specialized tool
example that can be viewed quickly in your ui, we'll start by translating a dtd file named searchbar.dtd that contains the string "manage search engines...". (strings in the dtd files are called "entities".) "manage search engines..." can easily be found in the firefox browser ui by clicking on the drop-down arrow in the search box in the upper-right corner of your browser. at the bottom of the
list of search engines that appears, you'll see, "manage search engines...". to start, make sure you are in /path/to/your/working/directory/l10n-mozilla-1.9.2/x-testing and then, type the command mkdir /browser/chrome/browser now, step back out to the broader directory that contains both your l10n base (l10n-mozilla-1.9.2) and the en-us source code (mozilla-1.9.2). you can do this by typing: cd ../.
....label "search"> save the file. .properties files the property file "search.properties" contains the string "add %s". this string can easily be found in the browser ui by visiting a website that provides a search plugin (like http://developer.mozilla.org/) and clicking on the drop-down arrow in the search box in the upper-right corner of your browser. at the second to bottom of the
list of search engines that appears, you'll see, "add %s", where %s is replaced by the name of the site. again, to start, make sure you are in /path/to/your/working/directory/l10n-mozilla-1.9.2/x-testing now, step back out to the broader directory that contains both your l10n base (l10n-mozilla-1.9.2) and the en-us source code (mozilla-1.9.2). you can do this by typing: cd ../../ where each ".."...
...same path from above (l10n-mozilla-1.9.2/x-testing/browser/chrome/browser) $ edit l10n-mozilla-1.9.2/x-testing/browser/chrome/browser/aboutcerterror.dtd read the top of the file to get any context on how to translate contained in the notes written by the developers or l10n-drivers. localization notes will look like this: <!-- localization notes... --> after the localization notes, you will see a
list of <!entity> strings like the following: <!entity certerror.pagetitle "untrusted connection"> you should go through each entity, translating the value in the parameters (e.g. untrusted connection in the example above), like so (example for polish): <!entity certerror.pagetitle "niezaufane poÅÄ
czenie"> once you have translated all the <!entity> strings in this file, you should save your work ...
...): <!entity certerror.pagetitle "niezaufane poÅÄ
czenie"> once you have translated all the <!entity> strings in this file, you should save your work and open the next .dtd or .properties file. you will need to go through each and every file to in every directory in the x-testing directory. recommended order of localization for recommended order of localization, refer to the localization "phase
list" which provides a very rough guide on where to start and in what order to proceed through translation. the localization phase
lists (firefox 3.5: ff35.phase
list, firefox 3.6: ff36.phase
list). description of phases. land your translated files one by one, making sure it follows the *mozilla-1.9.2* structure. this will familiarize you with our "hg" commands and will get us something that we can i...
Translation phase
r project group. it's up to you and your community to determine which l10n tool will best suit your needs. as you gain more experience, you may want to localize independent of mozilla-developed l10n tools, which we'll also discuss here. projects the mozilla projects and their l10n workflows are divided into these groups: mozilla applications, mozilla websites, and add-ons. below you'll find the
list of all mozilla projects, their associated l10n tools, and links to tutorials outlining their workflows. mozilla applications so you're interested in localizing mozilla applications. each l10n tool follows a different workflow for localizing mozilla application projects. we've linked a brief tutorial to each l10n tool name below. follow the tutorials to help you decide which l10n tool fits your ...
...page to get your own mt client. version 5.26 is the latest version. virtaal an offline, stand-alone version of pootle that is also built on the translate toolkit api. these are the mozilla application projects that are localized using the l10n tools above: firefox the award-winning firefox® web browser has security, speed and new features that will change the way you use the web. see the
list of the most critical strings for localizing in firefox, as well as a guide to understanding how they're organized. thunderbird enjoy safe, fast and easy email, mozilla-style. the thunderbird® email client includes intelligent spam filters, powerful search and customizable views. seamonkey seamonkey® is the all-in-one application formerly known as the "mozilla application suite", containing ...
...t people are doing with mozilla firefox and the open web. in-product pages a set of pages used to interact with and give information to the end-user as part of their first experience with their mozilla applications. if you are creating your own localization, there are a number of mozilla websites that need to be localized before your efforts become an officially released localization. see the
list of localized mozilla websites. you should also read more information on localizing mozilla web projects. add-ons l10n for add-ons is handled by at least two other organizations/services called babelzilla and adofex. they both have created comprehensive programs and l10n tools for localizing any and all third-party add-ons for mozilla applications. visit their websites to learn how to ge...
...ing any and all third-party add-ons for mozilla applications. visit their websites to learn how to get involved. babelzilla adofex tool-independent localization are you a command-line master? do you prefer unicode text editors to any other applications on earth? do you have a pet cat (computer-assisted translation) tool, like omegat? then you may not be interested in using any of the tools
listed above for your localizations. if that is the case, then this section is for you! for localizers who prefer localizing without a specialized tool the workflows for localizing mozilla applications and mozilla websites are essentially the same. this tutorial should provide you with all of the technical information you need to secure and maintain your tool independence. productization productiza...
What every Mozilla translator should know
the mozilla project discusses general planning and schedule questions here. discussions of interest to the general mozilla developer community are at least notified here. ...
...the mozilla project discusses general planning and schedule questions here. discussions of interest to the general mozilla developer community are at least notified here. ...
...the mozilla project discusses general planning and schedule questions here. discussions of interest to the general mozilla developer community are at least notified here. ...
...al mozilla developer community are at least notified here. translate the mozilla web or mozilla.dev.l10n.web, we moved announcements and discussions about the translation of the mozilla web pages to this group. all these groups are pretty low traffic. to keep the track of what's going on, it's also a good idea to read the planet mozilla l10n when you have a problem use the above mailing
lists the person in charge of the mozilla l10n is axel hecht (l10n at mozilla.com), pike on irc another interesting way of getting help is the irc channel #l10n at irc.mozilla.org useful tools the l10n dashboard pontoon narro translate toolkit koala 0.1 mozillatranslator mercurial the hg is organized into several repositories, sometimes called branches. we have the main repository calle...
Mozilla Style System Documentation
seudo-element. this is useful for the pseudo-elements defined in the css specification (:before, :after, :first-line, :first-letter), but few of mozilla's custom pseudo-elements, many of which are hacks for further formatting objects that we create. the pres context forwards these calls to its style set object (stylesetimpl, interface nsistyleset), which does the real work (and also maintains the
lists of stylesheets and owns the rule tree). these methods may all return an existing style context rather than a new one (see stylesetimpl::getcontext), if there is a current style context with the same parent, that matches the same rules (a check that is easy because of the ruletree), and is for the same pseudo-element (or not for a pseudo-element, or a "non-element"). this is more than just siblin...
...cky because the style contexts don't have pointers to their frames, but instead, we have the reverse and is probably the biggest flaw in the design of this part of the system. getting style data from a style context to get style data from a style context, use the getstyledata method to fill in a pointer to a style struct. each of the style structs contains a group of properties. the structs are
listed in, nsstylestruct.hand the many of the values are in nsstyleconsts.h. each of the structs includes either only features that are inherited by default or single properties that are set to the initial value by default (see css26.1.1), which is essential for the ruletree. the fundamental way to get a style struct from a style context looks like this: const nsstyledisplay *display = ns_static_cas...
...tch any rules.) these interfaces nsistylesheet and nsistylerule correspond to the css concepts of style sheets and style rules, except they are more general, and are used by other code that needs to add style information to the document. for the css stylesheets, this process corresponds to css selector matching. ...
...ess corresponds to css selector matching. the output of css selector matching as defined by the css specification is an ordered
list of rules, where the order determines which declarations override other declarations. (in css,declarations are the property-value pairs within style rules. in mozilla, nscssdeclaration objects correspond to css declaration-blocks.) due to the high similarity of these
lists between elements in the content tree, mozilla stores the output of the selector matching process in a lexicographic tree, the rule tree. this double tree (style context tree and rule tree) allows for sharing of style data, which allows the data to take up less memory and allows the data computation to take less time. for example, suppose we had the css stylesheet: /* rule 1 */ doc { display: ...
DMD
g it, you just need to set the environment variable dmd=1 when running. for instance, on osx, you can run something like: dmd=1 /applications/firefox\ nightly.app/contents/macos/firefox you can tell it is working by going to about:memory and looking for "save dmd output". if dmd has been properly enabled, the "save" button won't be grayed out. look at the "trigger" section below to see the full
list of ways to get a dmd report once you have it activated. note that stack information you get will likely be less detailed, due to being unable to symbolicate. you will be able to get function names, but not line numbers. desktop firefox (linux) build build firefox with these options: ac_add_options --enable-dmd if building via try server, modify browser/config/mozconfigs/linux64/common-opt o...
...sage should be minimized first. (linux only) you can send signal 34 to the firefox process, e.g. with the following command. $ killall -34 firefox each one of these steps triggers all the memory reporters and then dmd analyzes the reports, printing commentary like this: dmd[5222] opened /tmp/dmd-1414556492-5222.json.gz for writing dmd[5222] dump 1 { dmd[5222] constructing the heap block
list... dmd[5222] constructing the stack trace table... dmd[5222] constructing the stack frame table... dmd[5222] } in an e10s-enabled build, you'll see separate output for each process. this step can take 10 or more seconds and may make firefox freeze temporarily. if you see the "opened" line, it tells you where the file was saved. it's always in a temp directory, and the filenames are always ...
...nt indicated by the "allocated at" stack trace, that these blocks took up 21,600 bytes, that all 150 blocks had a size of 144 bytes, and that 1,200 of those bytes were "slop" (wasted space caused by the heap allocator rounding up request sizes). it also indicates what percentage of the total heap size and the unreported portion of the heap these blocks represent. within each section, records are
listed from largest to smallest. once-reported and twice-reported stack trace records also have stack traces for the report point(s). for example: reported at { #01: mozilla::dmd::report(void const*) (/home/njn/moz/mi2/memory/replace/dmd/dmd.cpp:1740) 0x7f68652581ca #02: cyclecollectormallocsizeof(void const*) (/home/njn/moz/mi2/xpcom/base/nscyclecollector.cpp:3008) 0x7f6860fdfe02 #03: nspurpl...
.../home/njn/moz/mi2/xpcom/base/nsmemoryinfodumper.cpp:58) 0x7f6860fefe03 } you can tell which memory reporter made the report by the name of the mallocsizeof function near the top of the stack trace. in this case it was the cycle collector's reporter. by default, dmd does not record an allocation stack trace for most blocks, to make it run faster. the decision on whether to record is done probabi
listically, and larger blocks are more likely to have an allocation stack trace recorded. all unreported blocks that lack an allocation stack trace will end up in a single record. for example: unreported { 420,010 blocks in heap block record 2 of 5,495 29,203,408 bytes (27,777,288 requested / 1,426,120 slop) individual block sizes: 2,048 x 3; 1,024 x 103; 512 x 147; 496 x 7; 480 x 31; 464 x 6; ...
Profiling with the Firefox Profiler
s you zoom in on ranges, breadcrumbs are created allowing you to easily navigate back to previously-selected ranges or the entire profile (denoted as "full range"). tip: while zooming out to a previously-selected range deletes the narrower range, the browser back button can be used to restore the narrower range. thread timeline(s) thread/process timelines: below the tracing markers we have a
list of profiled threads. these threads may come from different processes. in this case, we have the 'geckomain [default]' process' main thread, a content process' main thread, and the main thread of the compositor process. each of these timelines is aligned with wall clock time. so, for example, when a thread is blocked, like 'geckomain [tab]', on a thread like 'geckomain [default]', we can see what'...
...alues to debug long startups. if you'd like a coarser resolution, you can also choose a different interval using moz_profiler_startup_interval, which defaults to 1 (unit is millisecond). you can't go below 1 ms but you can use e.g. 10 ms. if the default threads to be profiled are insufficient, you can choose which threads to profile using moz_profiler_startup_filters, which is a comma separated
list. description of all available environment variables may be printed by starting firefox with moz_profiler_help=1 set. if you want to profile firefox for android, you have to set this environment values by --es option of am command to launch firefox. this example is for firefox nightly (package name is org.mozilla.fennec_aurora), and you have to allow storage access on permission settings before...
...ht be a great tool in determining what’s going on in firefox when it’s hung! profiling threads the firefox profiler has rudimentary support for profiling multiple threads. to enable it, check the 'multi-thread' box then enter one or more thread names into the textbox beside it. thread names are the strings passed to the base::thread class at initialization. at present there is no central
list of these thread names, but you can find them by grepping the source. examples: 1 2 if the filter you entered is invalid, no threads will be profiled. you can identify this by hitting analyze (cleopatra will show you an error message). if the filter is left empty, only the main thread is captured (as if you had not enabled multi-thread.) profiler features the profiler supports several features...
...e" will have the layer tree view enabled (but nothing else). this is useful in cases where you want to gain a quick visual understanding of a layer dump without having to take a profile. on b2g, each line of a layer dump in adb logcat output is prefixed with something like i/gecko (30593):. cleopatra doesn't currently understand this prefix, so it needs to be removed before pasting. display
list dump the display
list after each refresh with the texture data. this can be used to debug correctness problems. contribute source is located in tools/profiler. the bugzilla components are core::gecko profile for the profiler backend, and devtools::performance tools (profiler/timeline) for the toolbar button and about:profiling. the (now obsolete) profiler add-on repository can be found her...
Midas
t and objects that are selected. if no text is selected it deletes one character to the right. this is similar to the delete button on the keyboard. fontname a font name this command will set the font face for a selection or at the insertion point if there is no selection. the given string is such as would be used in the "face" attribute of the font tag, i.e., a comma-separated
list of font names. fontsize a number this command will set the fontsize for a selection or at the insertion point if there is no selection. the given number is such as would be used in the "size" attribute of the font tag. forecolor a color code this command will set the text color of the selection or at the insertion point. formatblock h1, h2, h3...
...atted as the given type of heading. hilitecolor a color code this command will set the hilite color of the selection or at the insertion point. it only works with stylewithcss enabled. increasefontsize this command will add a <big> tag around selection or at insertion point. indent indent the block where the caret is located. if the caret is inside a
list, that item becomes a sub-item one level deeper. insertbronreturn true/false selects whether pressing return inside a paragraph creates another paragraph or just inserts a <br> tag. inserthorizontalrule null/string (when string is the line's id) this command will insert a horizontal rule (line) at the insertion point. does it delete the selection? yes! ...
...rtion point. does it delete the selection? yes! inserthtml a string. this command will insert the given html into the <body> in place of the current selection or at the caret location. the given string is the html to insert. insertimage a uri. this command will insert an image (referenced by the given url) at the insertion point. insertordered
list depends on the selection. if the caret is not inside a non-li block, that block becomes the first li and an ol. if the caret is inside a bulleted item, the bulleted item becomes a numbered item. insertunordered
list depends on the selection. if the caret is not inside a non-li block, that block becomes the first li and ul. if the caret is inside a numbered item, the numbered...
...enter center-aligns the current block. justifyfull fully-justifies the current block. justifyleft left-aligns the current block. justifyright right aligns the current block. outdent outdent the block where the caret is located. if the block is not indented prior to calling outdent, nothing will happen. if the caret is in a
list item, the item will bump up a level in the
list or break out of the
list entirely. paste this command will paste the contents of the clipboard at the location of the caret. if there is a selection, it will be deleted prior to the insertion of the clipboard's contents. note: this command won't work without setting a pref or using signed js. user_pref("capability.policy.poli...
PRIOMethods
file descriptor. ...
...riptor. ...
...position the file pointer to the desired place. seek64 same as previous field, except 64-bit. fileinfo get information about an open file. fileinfo64 same as previous field, except 64-bit. writev write from a vector of buffers. connect connect to the specified network address. accept accept a connection from a network peer. bind associate a network address with the file descriptor.
listen prepare to
listen for network connections. shutdown shut down a network connection. recv receive up to the specified number of bytes. send send all the bytes specified. recvfrom receive up to the specified number of bytes and report network source. sendto send bytes to specified network address. poll test the file descriptor to see if it is ready for i/o. acceptread accept and re...
...from a new network file descriptor. transmitfile transmit an entire file to the specified socket. getsockname get network address associated with a file descriptor. getpeername get peer's network address. getsockopt get current setting of specified socket option. setsockopt set value of specified socket option. description you don't need to know the type declaration for each function
listed in the method table unless you are implementing a layer. for information about each function, see the corresponding function description in this document. for example, the write method in priomethods implements the pr_write function. for type definition details, see prio.h. the i/o methods table provides procedural access to the functions of the file descriptor. it is the responsibility of a l...
NSS_3.12.1_release_notes.html
assert from sec_pkcs7encryptlength bug 436430: make nss public headers compilable with no_nspr_10_support defined bug 436577: uninitialized variable in sec_pkcs5createalgorithmid bug 438685: libpkix doesn't try all the issuers in a bridge with multiple certs bug 438876: signtool is still using static libraries. ...
...tlength bug 436430: make nss public headers compilable with no_nspr_10_support defined bug 436577: uninitialized variable in sec_pkcs5createalgorithmid bug 438685: libpkix doesn't try all the issuers in a bridge with multiple certs bug 438876: signtool is still using static libraries. ...
...new and revised documents available since the release of nss 3.11 include the following: build instructions for nss 3.11.4 and above nss shared db compatibility nss 3.12.1 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will ...
... the following: build instructions for nss 3.11.4 and above nss shared db compatibility nss 3.12.1 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.12.1 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions
listed in nss public functions will remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with mozilla.org bugzilla (product nss). ...
NSS 3.12.4 release notes
e build instructions. nss 3.12.4 source is also available on ftp.mozilla.org for secure https download: source tarball: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_12_4_rtm/src/. major changes in nss 3.12.4 nss 3.12.4 is the version that we submitted to nist for fips 140-2 validation. currently nss 3.12.4 is in the "review pending" state in the fips 140-2 pre-validation
list at http://csrc.nist.gov/groups/stm/cmvp/documents/140-1/140inprocess.pdf added crl distribution point support (see cert.h). 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 por...
...ys fail if dp->distpointtype != generalname bug 504456: exploitable heap overflow in nss shell expression (filename globbing) parsing bug 505559: need function to identify the one and only default internal private key slot. bug 505561: need a generic function a la secmod_openuserdb() that can be used on non-softoken modules. ...
..._mksecretkeyrep] when port_newarena fails bug 507482: nss 3.12.3 (and later) doesn't build on aix 5.1 bug 507937: pwdecrypt program problems bug 508259: pk11mode crashed on linux2.4 bug 508467: libpkix ocsp checker should use date argument to obtain the time for cert validity verification bug 510367: fix the utf8 characters in the nickname string for ac raíz certicamara s.a. documentation for a
list of the primary nss documentation pages on developer.mozilla.org, see nss. new and revised documents available since the release of nss 3.12 include the following: build instructions for nss 3.12.4 compatibility nss 3.12.4 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.12.4 shared librari...
...the release of nss 3.12 include the following: build instructions for nss 3.12.4 compatibility nss 3.12.4 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.12.4 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions
listed in nss public functions will remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with mozilla.org bugzilla (product nss). ...
NSS 3.19.3 release notes
bution information the hg tag is nss_3_19_3_rtm. nss 3.19.3 requires nspr 4.10.8 or newer. nss 3.19.3 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_19_3_rtm/src/ new in nss 3.19.3 no new functionality is introduced in this release. this is a patch release to update the
list of root ca certificates. notable changes in nss 3.19.3 the following ca certificates were removed cn = buypass class 3 ca 1 sha1 fingerprint: 61:57:3a:11:df:0e:d8:7e:d5:92:65:22:ea:d0:56:d7:44:b3:23:71 cn = tÜrktrust elektronik sertifika hizmet saÄlayıcısı sha1 fingerprint: 79:98:a3:08:e1:4d:65:85:e6:c2:1e:15:3a:71:9f:ba:5a:d3:4a:d9 cn =...
...a program linked with older nss 3.19...
...a program linked with older nss 3.19 shared libraries will work with nss 3.19.3 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of ...
...sification=components&query_format=advanced&product=nss&target_milestone=3.19.3 compatibility nss 3.19.3 shared libraries are backward compatible with all older nss 3.19 shared libraries. a program linked with older nss 3.19 shared libraries will work with nss 3.19.3 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions
listed in nss public functions will remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with bugzilla.mozilla.org (product nss). ...
NSS 3.28.5 release notes
bution information the hg tag is nss_3_28_5_rtm. nss 3.28.5 requires nspr 4.13.1 or newer. nss 3.28.5 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_28_5_rtm/src/ new in nss 3.28.5 no new functionality is introduced in this release. this is a patch release to update the
list of root ca certificates. it backports the changes that were initially released in nss version 3.30.2. notable changes in nss 3.28.5 the following ca certificates were removed: o = japanese government, ou = applicationca sha-256 fingerprint: 2d:47:43:7d:e1:79:51:21:5a:12:f3:c5:8e:51:c7:29:a5:80:26:ef:1f:cc:0a:5f:b3:d9:dc:01:2f:60:0d:19 cn = wellssecure public root ...
... bug 1349705 - implemented domain name constraints for ca: tubitak kamu sm ssl kok sertifikasi - surum 1. compatibility nss 3.28.5 shared libraries are backward compatible with all older nss 3.x shared libraries. a ...
...um 1 sha-256 fingerprint: 46:ed:c3:68:90:46:d5:3a:45:3f:b3:10:4a:b8:0d:ca:ec:65:8b:26:60:ea:16:29:dd:7e:86:79:90:64:87:16 trust flags: websites technically constrained to: gov.tr, k12.tr, pol.tr, mil.tr, tsk.tr, kep.tr, bel.tr, edu.tr, org.tr the version number of the updated root ca
list has been set to 2.14. (the version numbers 2.12 and 2.13 for the root ca
list have been skipped.) bugs fixed in nss 3.28.5 bug 1350859 - march 2017 batch of root ca changes. bug 1349705 - implemented domain name constraints for ca: tubitak kamu sm ssl kok sertifikasi - surum 1. compatibility nss 3.28.5 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.28.5 sha...
...d domain name constraints for ca: tubitak kamu sm ssl kok sertifikasi - surum 1. compatibility nss 3.28.5 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.28.5 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions
listed in nss public functions will remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with bugzilla.mozilla.org (product nss). ...
NSS 3.30.2 release notes
ribution information the hg tag is nss_3_30_2_rtm. nss 3.30.2 requires nspr 4.14 or newer. nss 3.30.2 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_30_2_rtm/src/ new in nss 3.30.2 no new functionality is introduced in this release. this is a patch release to update the
list of root ca certificates. notable changes in nss 3.30.2 the following ca certificates were removed: o = japanese government, ou = applicationca sha-256 fingerprint: 2d:47:43:7d:e1:79:51:21:5a:12:f3:c5:8e:51:c7:29:a5:80:26:ef:1f:cc:0a:5f:b3:d9:dc:01:2f:60:0d:19 cn = wellssecure public root certificate authority sha-256 fingerprint: a7:12:72:ae:aa:a3:cf:e8:...
...a pro...
...a program linked with older nss 3.x shared libraries will work with nss 3.30.2 share...
...ed domain name constraints for ca: tubitak kamu sm ssl kok sertifikasi - surum 1 compatibility nss 3.30.2 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.30.2 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions
listed in nss public functions will remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with bugzilla.mozilla.org (product nss). ...
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. this makes it clearer, that options can have values other than 0 or 1. note this does not affect abi compatibility, because prbool is a typedef for printn. experimental apis and functionality the functionality and the apis
listed in this section are experimental. any of these apis may be removed from future nss versions. applications must not rely on these apis to be present. if an application is linked at runtime to a later version of nss, which no longer provides any of these apis, the application must handle the scenario gracefully. in order to ease transitions, experimental functions return secfailure and set the s...
...ver receives a new tls clienthello. the application is then able to examine application-chosen content from the session tickets, or helloretryrequest cookie, and decide whether to proceed with the connection. for an initial clienthello, an application can control whether nss sends a helloretryrequest, and include application-chosen content in the cookie. new experimental apis below is a
list of experimental functions, which might not be available in future releases of nss. in sslexp.h experimental: ssl_keyupdate - prompt nss to update traffic keys (tls 1.3 only). experimental: ssl_getextensionsupport - query nss support for a tls extension. experimental: ssl_installextensionhooks - install custom handlers for a tls extension. experimental: ssl_setupantireplay - con...
... session ticket (tls 1.3 server only). removed experimental apis note that experimental apis might get removed from nss without announcing removals in the release notes. this section might be incomplete. the experimental api ssl_usealtserverhellotype has been disabled. bugs fixed in nss 3.35 this bugzilla query returns all the bugs fixed in nss 3.35: https://bugzilla.mozilla.org/bug
list.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.35 compatibility nss 3.35 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.35 shared libraries, without recompiling, or relinking. furthermore, applications that restrict their use of nss ap...
...d&classification=components&query_format=advanced&product=nss&target_milestone=3.35 compatibility nss 3.35 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.35 shared libraries, without recompiling, or relinking. furthermore, applications that restrict their use of nss apis to the functions
listed in nss public functions will remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with bugzilla.mozilla.org (select product 'nss'). ...
PKCS11 FAQ
u use the certificate available on the token? does the certificate need to be imported into nss's internal certificate database? if so, is there a way to get the certificate from an external token into nss's internal certificate database? nss searches all the installed pkcs #11 modules when looking for certificates. once you've installed the module, the module's certificates simply appear in the
list of certificates displayed in the certificate window. what version of pkcs #11 does nss support? nss requires at least pkcs #11 version 2.0, but can support some features of later versions of nss, including nss 2.20. nss does not use all the features of later versions of pkcs #11. what are the expectations in terms of session manipulation? will nss potentially open more than one session at a ti...
...ou identify your token as the default random number generator. if you do, your token must be able to generate random numbers even when it is not logged in. nss uses installed random number generators if pkcs11_mech_random_flag is set in the installer script. for information on how to do this, see using the jar installation manager to install a pkcs #11 cryptographic module. can mozilla provide a
list of all pkcs #11 functions that nss will use? your token should expect to implement all the pkcs #11 functions that make sense for your token. nss continues to evolve, and periodically enhances it's functionality by using a more complete
list of pkcs #11 functions. you should have implementations for all the functions specified in the version of the pkcs #11 spec your token implements. if you do ...
...ion handle? a session handle of 0 is indeed invalid. in the past, nss uses the invalid session handle to mark problems with acquiring or using a session. there have been cases where nss would then use this handle to try to do some operation. pkcs #11 modules should fail with ckr_invalid_session. we are working to remove these cases as we find them. ...
...to the token with c_createobject. nss also does a similiar operation for importing private keys and certificates through pkcs12. the above statement is true for read-write tokens only. when and how does nss generate private keys on the token? as stated above, nss uses c_generatekeypair if the token supports the keygen method. if an rsa key is being generated, the nss application will present a
list of all writable rsa devices asks the user to select which one to use, if a dsa key is being generated, it will present a
list of all the writable dsa devices, if an ec key is being generated, it will present a
list of all writable ec devices. does nss ever use c_copyobject to copy symmetric keys if it needs to reference the same key for different sessions? no. this is never necessary. the pkcs ...
PKCS11 Implement
is section, you should be familiar with the standard specification. general-purpose functions c_initialize the nss calls c_initialize on startup or when it loads a new module. the nss always passes null, as required by the pkcs #11 specification, in the single c_initialize parameter preserved. c_finalize the nss calls c_finalize on shutdown and whenever it unloads a module. c_getfunction
list the nss calls c_getfunction
list on startup or when it loads a new module. the function
list returned should include all the pkcs 2.0 function calls. if you don't implement a function, you should still provide a stub that returns ckr_function_not_supported. c_getinfo the nss calls c_getinfo on startup or when it loads a new module. the version numbers, manufacturer ids, and so on are displayed...
...n startup or when it loads a new module. the version numbers, manufacturer ids, and so on are displayed when the user views the information. the supplied library names are used as the default library names; currently, these names should not include any double quotation marks. (this is more restrictive than pkcs 2.0 and may change in future versions of nss.). slot and token management c_getslot
list the nss calls c_getslot
list on startup or when it loads a new module, requests all the module's slots, and keeps track of the
list from that point on. the slots are expected to remain static: that is, the module never has more slots or fewer slots than the number on the original
list. c_getslotinfo the nss calls c_getslotinfo on startup or when it loads a new module and reads in the informati...
... flag should change to true. the nss uses this combination of flags for its internal token when the key database password is null. these are not standard pkcs #11 semantics; they are intended for nss's internal use only. true true the device has been initialized and requires authentication. the nss checks whether the user is logged on, and if not prompts the user for a pin. c_getmechanism
list the nss calls c_getmechanism
list fairly frequently to identify the mechanisms supported by a token. c_getmechanisminfo the nss currently doesn't call c_getmechanisminfo. this function may be called in the future, so you should implement it anyway. c_inittoken the nss never calls c_inittoken. c_initpin the nss calls c_initpin only in the key generation case, as noted in this document und...
...if they have a read/write value and can't generate a key pair, nss uses its own c_generatekeypair and loads the key with c_createobject. signing tokens just need to support c_sign and possibly c_generatekeypair. in addition to c_sign and c_generatekeypair, signing and decryption tokens should also support c_decrypt and, optionally, c_unwrapkey. multipurpose tokens should support all the functions
listed in table 1.2, except that c_wrapkey and c_unwrapkey are optional. the nss always attempts to use these two functions but uses c_encrypt and c_decrypt instead if c_wrapkey and c_unwrapkey aren't implemented. installation you can install your module in any convenient location on the user's hard disk, but you must tell the user to type the module name and location in the cryptographic modules p...
NSS tools : pk12util
12file|-l p12file|-o p12file] [-d [sql:]directory] [-h tokenname] [-p dbprefix] [-r] [-v] [-k slotpasswordfile|-k slotpassword] [-w p12filepasswordfile|-w p12filepassword] description the pkcs #12 utility, pk12util, enables sharing certificates among any server that supports pkcs#12. the tool can import certificates and keys from pkcs#12 files into security databases, export certificates, and
list certificates and keys. options and arguments options -i p12file import keys and certificates from a pkcs#12 file into a security database. -l p12file
list the keys and certificates in pkcs#12 file. -o p12file export keys and certificates from the security database to a pkcs#12 file. arguments -c keycipher specify the key encryption algorithm. -c certcipher specify the key cert (ov...
...ect the certificate material. pk12util -o p12file -n certname [-c keycipher] [-c certcipher] [-m|--key_len keylen] [-n|--cert_key_len certkeylen] [-d [sql:]directory] [-p dbprefix] [-k slotpasswordfile|-k slotpassword] [-w p12filepasswordfile|-w p12filepassword] for example: # pk12util -o certs.p12 -n server-cert -d sql:/home/my/sharednssdb enter password for pkcs12 file: re-enter password:
listing keys and certificates the information in a .p12 file are not human-readable. the certificates and keys in the file can be printed (
listed) in a human-readable pretty-print format that shows information for every certificate and any public keys in the .p12 file. pk12util -l p12file [-h tokenname] [-r] [-d [sql:]directory] [-p dbprefix] [-k slotpasswordfile|-k slotpassword] [-w p12filepassw...
...se engine while keeping a shared database and working around the access issues. still, nss requires more flexibility to provide a truly shared security database. in 2009, nss introduced a new set of databases that are sqlite databases rather than berkleydb. these new databases provide more accessibility and performance: o cert9.db for certificates o key4.db for keys o pkcs11.txt, which is
listing of all of the pkcs #11 modules contained in a new subdirectory in the security databases directory because the sqlite databases are designed to be shared, these are the shared database type. the shared database type is preferred; the legacy format is included for backward compatibility. by default, the tools (certutil, pk12util, modutil) assume that the given security databases follow th...
... design and how to configure applications to use it. o https://wiki.mozilla.org/nss_shared_db_howto o https://wiki.mozilla.org/nss_shared_db additional resources for information about nss and other tools related to nss (like jss), check out the nss project wiki at [1]http://www.mozilla.org/projects/security/pki/nss/. the nss site relates directly to nss code changes and releases. mailing
lists: https://
lists.mozilla.org/
listinfo/dev-tech-crypto irc: freenode at #dogtag-pki authors the nss tools were written and maintained by developers with netscape, red hat, sun, oracle, mozilla, and google. authors: elio maldonado <emaldona@redhat.com>, deon lackey <dlackey@redhat.com>. license licensed under the mozilla public license, v. 2.0. if a copy of the mpl was not distributed with ...
NSS Tools certutil-tasks
improve coherence of key and certificate nicknames. remove keys "stranded" without a certificate (except for the imminent (????) encryption key for password files). support importing keys from a file. improve hardware token support. ...
... improve coherence of key and certificate nicknames. remove keys "stranded" without a certificate (except for the imminent (????) encryption key for password files). support importing keys from a file. improve hardware token support. ...
... improve coherence of key and certificate nicknames. remove keys "stranded" without a certificate (except for the imminent (????) encryption key for password files). support importing keys from a file. improve hardware token support. ...
... key for password files). support importing keys from a file. improve hardware token support. (bugfix) some certificate extensions cause certutil to crash. (bugfix) certificate entries require a serial number; one should be generated automatically if not provided. (bugfix) null password is given to new key3.db; should prompt user for an initial password. (bugfix)
listing provate keys does not work: requires password authentication. (bugfix)
listing certificate extensions has typos and does not provide much information. ...
NSS Tools pk12util
using the pkcs #12 tool (pk12util) newsgroup: mozilla.dev.tech.crypto the pkcs #12 utility makes sharing of certificates among enterprise server 3.x and any server (netscape products or non-netscape products) that supports pkcs#12 possible. the tool allows you to import certificates and keys from pkcs #12 files into nss or export them and also
list certificates and keys in such files. availability see the release notes for the platforms this tool is available on. synopsis pk12util -i p12file [-h tokenname] [-v] [common-options] or pk12util -o p12file -n certname [-c keycipher] [-c certcipher] [-m | --key_len keylen] [-n | --cert_key_len certkeylen] [common-options] or pk12util -l p12file [-h tokenname] [-r] [common-options] where [common-options] = [-d dir] [-p db...
...three of the options, -i, -o, and -l, should be considered commands of the pk12util invocation. each command takes several options. options may take zero or more arguments. to see a usage string, issue the pkcs12util command without any options. options and arguments options specify an action. option arguments modify an action. the options and arguments for the...
...s. options and arguments options specify an action. option arguments modify an action. the options and arguments for the pk12util command are defined as follows: options -i p12file import a certificate and private key from from the p12file into the database. -o p12file export certificate and private key, specified by the -n option, from the database to the p12 file. -l p12file
list certificate and private key from from the p12file file. arguments -n certname specify the nickname of the cert and private key to export. -d dir specify the database directory into which to import to or export from certificates and keys. if not specified the directory defaults to $home/.netscape (when $home exists in the environment), or to ./.netscape (when $home does not exist in the ...
...o algorithm is specified, the tool defaults to using "pkcs12 v2 pbe with sha1 and 3key triple des-cbc" for private key encryption. for historical export control reasons "pkcs12 v2 pbe with sha1 and 40 bit rc4" is the default for the overall package encryption when not in fips mode and no package encryption when in fips mode. the private key is always protected with strong encryption by default. a
list of ciphers follows. symmetric cbc ciphers for pkcs #5 v2: "des_cbc" "rc2-cbc" "rc5-cbcpad" "des-ede3-cbc" --- default for key encryption "aes-128-cbc" "aes-192-cbc" "aes-256-cbc" "camellia-128-cbc" "camellia-192-cbc" "camellia-256-cbc" pkcs #12 pbe ciphers: "pkcs #12 pbe with sha1 and 128 bit rc4" "pkcs #12 pbe with sha1 and 40 bit rc4" "pkcs #12 pbe with sha1 and triple des cbc"...
NSS tools : pk12util
common-options] ] [ common-options are: [-d [sql:]directory] [-p dbprefix] [-k slotpasswordfile|-k slotpassword] [-w p12filepasswordfile|-w p12filepassword] ] description the pkcs #12 utility, pk12util, enables sharing certificates among any server that supports pkcs#12. the tool can import certificates and keys from pkcs#12 files into security databases, export certificates, and
list certificates and keys. options and arguments options -i p12file import keys and certificates from a pkcs#12 file into a security database. -l p12file
list the keys and certificates in pkcs#12 file. -o p12file export keys and certificates from the security database to a pkcs#12 file. arguments -n certname ...
...certificate material. pk12util -o p12file -n certname [-c keycipher] [-c certcipher] [-m|--key_len keylen] [-n|--cert_key_len certkeylen] [-d [sql:]directory] [-p dbprefix] [-k slotpasswordfile|-k slotpassword] [-w p12filepasswordfile|-w p12filepassword] for example: # pk12util -o certs.p12 -n server-cert -d sql:/home/my/sharednssdb enter password for pkcs12 file: re-enter password:
listing keys and certificates the information in a .p12 file are not human-readable. the certificates and keys in the file can be printed (
listed) in a human-readable pretty-print format that shows information for every certificate and any public keys in the .p12 file. pk12util -l p12file [-h tokenname] [-r] [-d [sql:]directory] [-p dbprefix] [-k slotpasswordfile|-k slotpassword] [-w p1...
...shared database and working around the access issues. still, nss requires more flexibility to provide a truly shared security database. in 2009, nss introduced a new set of databases that are sqlite databases rather than berkleydb. these new databases provide more accessibility and performance: o cert9.db for certificates o key4.db for keys o pkcs11.txt, which is
listing of all of the pkcs #11 modules contained in a new subdirectory in the security databases directory because the sqlite databases are designed to be shared, these are the shared database type. the shared database type is preferred; the legacy format is included for backward compatibility. by default, the tools (certutil, pk12util, modutil) assume that the given security d...
...nfigure applications to use it. o https://wiki.mozilla.org/nss_shared_db_howto o https://wiki.mozilla.org/nss_shared_db additional resources for information about nss and other tools related to nss (like jss), check out the nss project wiki at [1]http://www.mozilla.org/projects/security/pki/nss/. the nss site relates directly to nss code changes and releases. mailing
lists: https://
lists.mozilla.org/
listinfo/dev-tech-crypto irc: freenode at #dogtag-pki authors the nss tools were written and maintained by developers with netscape, red hat, and sun. authors: elio maldonado <emaldona@redhat.com>, deon lackey <dlackey@redhat.com>. copyright (c) 2010, red hat, inc. licensed under the gnu public license version 2. references visible links ...
Scripting Java
f.exists() true js> f.getname() test.txt static methods and fields can be accessed from the class object itself: js> java.lang.math.pi 3.141592653589793 js> java.lang.math.cos(0) 1 in javascript, unlike java, the method by itself is an object and can be evaluated as well as being called. if we just view the method object by itself we can see the various overloaded forms of the method: js> f.
listfiles function
listfiles() {/* java.io.file[]
listfiles() java.io.file[]
listfiles(java.io.filenamefilter) java.io.file[]
listfiles(java.io.filefilter) */} this output shows that the file class defines three overloaded methods
listfiles: one that takes no arguments, another with a filenamefilter argument, and a third with a filefilter argument. all the methods return an array of file objects. be...
...gating a method and are unsure of the parameter or return types. another useful feature for exploratory programming is the ability to see all the methods and fields defined for an object. using the javascript for..in construct, we can print out all these values: js> for (i in f) { print(i) } exists parentfile mkdir tostring wait [44 others] note that not only the methods of the file class are
listed, but also the methods inherited from the base class java.lang.object (like wait). this makes it easier to work with objects in deeply nested inheritance hierarchies since you can see all the methods that are available for that object. rhino provides another convenience by allowing properties of javabeans to be accessed directly by their property names. a javabean property foo is defined by the...
...ontaining the methods that will be called from the java adapter. in practice there's little need to call the javaadapter constructor directly. most of the time the previous syntaxes using the new operator will be sufficient. 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. to facilitate this rhino allows to pass javascript function when such interface is expected. the function is called as the implementation of interface method. 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 implementati...
...s> 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. when calling the function, rhino passes the method's name as the additional argument. function can use it to distinguish on behalf of which method it was called: js> var frame = new packages.javax.swing.jframe(); js> frame.addwindow
listener(function(event, methodname) { if (methodname == "windowclosing") { print("calling system.exit()..."); java.lang.system.exit(0); } }); js> frame.setsize(100, 100); js> frame.visible = true; true js> calling system.exit()... creating java arrays rhino provides no special syntax for creating java arrays. you must use the java.lang.reflect.array class for this purpose. to cre...
Thread Sanitizer
the default way of symbolizing the traces is much slower than using llvm-symbolizer for that purpose: llvm ships with a symbolizer binary that tsan will readily use to immediately output symbolized traces much faster. furthermore, additional debug information is included in traces when llvm-symbolizer is used. to use it, either make sure the llvm-symbolizer binary is in your path ...
..._symbolizer_path=/path/to/llvm-symbolizer" before running the process. if you've built tsan as described above, then you will want to set the variable to $llvm_home/build/bin/llvm-symbolizer. ignoring known races in some cases, races can be confirmed to be benign and fixing them would cause possible performance issues. tsan offers two possibilities to ignore such known races. ...
...me/build/bin/llvm-symbolizer. ignoring known races in some cases, races can be confirmed to be benign and fixing them would cause possible performance issues. tsan offers two possibilities to ignore such known races. compile-time black
listing functions with racy memory access can be flagged, such that the compiler will not instrument them. in our codebase, this is done using the moz_tsan_black
list macro on the function definition. it will expand to the appropriate attributes if the compiler supports them. compile-time black
listing is the preferred way of black
listing, because it does not have a performance impact. still, black
listing should be done very carefully so we won't miss important bugs. runtime suppressions to prevent races from showing up at runtime, tsan also provides a runtim...
...function definition. it will expand to the appropriate attributes if the compiler supports them. compile-time black
listing is the preferred way of black
listing, because it does not have a performance impact. still, black
listing should be done very carefully so we won't miss important bugs. runtime suppressions to prevent races from showing up at runtime, tsan also provides a runtime suppression
list. this
list is a good tool to temporarily hide some traces, especially for debugging purposes. however, unlike compile-time black
listing, runtime suppressions do have a performance impact, especially if the race in question keeps showing up a lot. for more information on how to use the runtime suppression
list, see the tsan wiki. ...
Secure Development Guidelines
bbv: stack overflow example: void foo(char *bar) { char c[12]; strcpy(c, bar); } int main(int argc, char **argv) { foo(argv[1]); } bbv: stack overflow before the stack overflow bbv: stack overflow after the stack overflow bbv: heap overflow dynamic memory malloc() calloc() heapalloc() mmap() not on the stack segment! mo...
...rflow example: void foo(char *bar) { char c[12]; strcpy(c, bar); } int main(int argc, char **argv) { foo(argv[1]); } bbv: stack overflow before the stack overflow bbv: stack overflow after the stack overflow bbv: heap overflow dynamic memory malloc() calloc() heapalloc() mmap() not on the stack segment! most memory allocators use a linked
list or binary tree bbv: off-by-one the array index starts at 0 not at 1 char array[1024]; array[0] = first element! array[1023] = last element! array[1024] = 1 element outside the array! bbv: array indexing issues always ensure that the index is within the bounds of the array never use signed integers as index buf[strlen(buf) - 1] = '\0'; strlen() could return 0; resulting in ...
...ses denial of service since both threads will be waiting forever deadlocks and locking issues example func_a() { lock(locka); lock(lockb); ... do something ... unlock(lockb); unlock(locka); } func_b() { lock(lockb); lock(locka); ... do something ... ...
...ocka); unlock(lockb); } writing secure code: good coding practices banned api
list badly designed apis can often lead to vulnerabilities it’s too easy to use the api inappropriately for example, consider the libc string handling apis strcpy() performs no bounds checking strncpy() doesn’t always 0-terminate strncat() length parameter is very 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 ...
Feed content access API
other feed-related interfaces. nsifeedentry represents a single entry in an rss or atom feed. nsifeedgenerator describes the software that generated an rss or atom feed. nsifeedperson represents a person. contains the person's name, email address, and their home page address. nsifeedprocessor parses rss and atom feeds. nsifeedprogress
listener implemented by the program that wants to parse an rss or atom feed to receive messages during the parsing process. nsifeedresult describes the result of parsing a feed. nsifeedresult
listener implemented by the program that wants to parse an rss or atom feed to receive notification when parsing is complete. nsifeedtextconstruct represents text v...
...s.classes['@mozilla.org/network/io-service;1'] .getservice(components.interfaces.nsiioservice); var uri = ioservice.newuri(feedurl, null, null); if (data.length) { var parser = components.classes["@mozilla.org/feed-processor;1"] .createinstance(components.interfaces.nsifeedprocessor); var
listener = new feedtestresult
listener(); try { parser.
listener =
listener; parser.parsefromstring(data, uri); } catch(e) { alert("error parsing feed."); } } } httprequest = new xmlhttprequest(); httprequest.open("get", feedurl, true); try { httprequest.onload = inforeceived; httprequest.send(null); } ...
...erface lets you parse the feed data from several possible sources; in this case, we're loading a document into a string, then parsing that string using its parsefromstring() method. however, you could also parse it from a file using parsefromstream(), or directly from an url using parseasync(). ...
...ces; in this case, we're loading a document into a string, then parsing that string using its parsefromstring() method. however, you could also parse it from a file using parsefromstream(), or directly from an url using parseasync(). the actual processing of the parsed feed is done by a method called handleresult() on the feedtestresult
listener object. ...
Manipulating bookmarks using Places
w folder in the bookmarks menu: var menufolder = bmsvc.bookmarksmenufolder; // bookmarks menu folder var newfolderid = bmsvc.createfolder(menufolder, "folder name here", bmsvc.default_index); this code locates the bookmarks menu's folder, then creates a new folder named "folder name here" in it. specifying default_index as the index at which to insert the new folder places it at the end of the
list. you can easily change this code to insert the new folder into the bookmarks toolbar by changing bookmarksmenufolder to another folder attribute. creating a new bookmark to create a new bookmark, use the nsinavbookmarksservice.insertbookmark() method. the uri for the bookmark needs to be specified using an nsiuri object. var ios = components.classes["@mozilla.org/network/io-service;1"] ...
... the folder containing an item if you need to know what folder contains an item (this can be especially handy after using nsinavbookmarksservice.getbookmarkidsforuri() to find bookmarks for a given uri), you can use the nsinavbookmarksservice.getfolderidforitem() method. ...
...bookmarks and tags to set up an observer to
listen for changes related to bookmarks, you will need to create an nsinavbookmarkobserver object and use the nsinavbookmarksservice.addobserver() and nsinavbookmarksservice.removeobserver() methods. note that this example takes advantage of xpcomutils to generate the nsisupports.queryinterface() method. ...
...something(); }, onitemvisited: function(abookmarkid, avisitid, time) {}, onitemmoved: function(aitemid, aoldparent, aoldindex, anewparent, anewindex) {}, queryinterface: xpcomutils.generateqi([components.interfaces.nsinavbookmarkobserver]) }; // an extension var myextension = { // this function is called when my add-on is loaded onload: function() { bmsvc.addobserver(myext_bookmark
listener, false); }, // this function is called when my add-on is unloaded onunload: function() { bmsvc.removeobserver(myext_bookmark
listener); }, dosomething: function() { alert("did something."); } }; see also nsinavbookmarksservice nsinavbookmarkobserver places using xpcom without chrome - bookmark observer ...
An Overview of XPCOM
gecko although it is in some ways structurally similar to microsoft com, xpcom is designed to be used principally at the application level. the most important use of xpcom is within gecko, an open source, standards compliant, embeddable web browser and toolkit for creating web browsers and other applications. xpcom is the means of accessing gecko library functionality and...
...he developer can take a couple steps to make this contract even clearer. first, the construction of an object can be encapsulated, and a virtual class provided that defines the dosomethinguseful method. in this way, construction and initialization can be completely hidden from clients of the class. in this "semi-encapsulated" situation, the only part of the class that is exposed is a well-defined
list of callable methods (i.e., the interface). once the class is encapsulated, the only interface the client will see is this: encapsulation of someinterface class someinterface { public: virtual void dosomethinguseful() = 0; }; the implementation can then derive from this class and implement the virtual method. clients of this code can then use a factory design pattern to create the object...
... be an option because of performance overhead and compatibility on many platforms, so xpcom does things differently. exceptions in xpcom c++ exceptions are not supported directly by xpcom. instead all exceptions must be handled within a given component, before crossing interface boundaries. in xpcom, all interface methods should return an nsresult error value (see the xpcom api reference for a
listing of these error codes). these error code results become the "exceptions" that xpcom handles. instead of leveraging c++ rtti, xpcom uses the special queryinterface method that casts the object to the right interface if that interface is supported. every interface is assigned an identifier that gets generated from a tool commonly named "uuidgen". this universally unique identifier (uuid) is a ...
...ides uniform and powerful access to files, directory services which maintain the location of application- and system-specific locations, memory management to ensure everyone uses the same memory allocator, and an event notification system that allows passing of simple messages. the tutorial will show each of these component and services in use, and the xpcom api reference has a complete interface
listing of these areas. xpcom types there are many xpcom declared types and simple macros that we will use in the following samples. most of these types are simple mappings. the most common types are described in the following sections. method types the following are a set of types for ensuring correct calling convention and return type of xpcom methods. ns_imethod method declaration ...
Component Internals
manifests are described in the following section, xpcom registry manifests. xpcom registry manifests xpcom uses special files called manifests to track and persist information about the components to the local system. there are two types of manifests that xpcom uses to track components: component manifests when xpcom first starts up, it looks for the component manifest, which is a file that
lists all registered components, and stores details on exactly what each component can do. xpcom uses the component manifest to determine which components have been overridden. starting with mozilla 1.2, this file is named compreg.dat and exists in the components directory, but there are efforts to move it out of this location to a less application-centric (and thus more user-centric) location. any ge...
...the specific implementations (class ids), which in turn are mapped to more general component identifiers (contract ids). type library manifests another important file that xpcom reads in is the type library manifest file. this file is also located in the components directory and is named xpti.dat. it includes the location and search paths of all type library files on the system. this file also
lists all known interfaces and links to the type library files that define these interface structures. these type library files are at the core of xpcom scriptablity and the binary component architecture of xpcom. type library manifests type library manifests contain the following information: location of all type library files mapping of all known interfaces to type libraries where these struc...
...an onionor a parfait! everybody likes parfaits. xpcom components have at least three layers. from the innermost and moving outward these layers include: the core xpcom object the factory code the module code the core xpcom object is the object that will implement the functionality you need. for example, this is the object that may start a network download and implement interfaces that will
listen to the progress. or the object may provide a new content type handler. whatever it does, this object is at the core of the xpcom component, and the other layers are supporting it, plugging it into the xpcom system. a single library may have many of these core objects. one layer above the core object is the factory code. the factory object provides a basic abstraction of the core xpcom object. ...
...is initial, verbose demonstration of the apis, we will introduce a faster more generic way of implementing the module and factory code using macros, which can make components much easier to create. xpcom glue xpcom contains a lot of stuff. most xpcom interfaces are not frozen and are only meant to be used by the gecko internals and not by clients. xpcom provides many data structures from linked
lists to avl trees. it's tempting to reuse nsvoidarray or another publicly available class instead of writing your own linked
list, but this may prove to be a fatal mistake. the class can change at any time and give you unexpected behavior. xpcom makes for a very open environment. at runtime you can acquire any service or component by merely knowing a cid or contract id along with an iid. at last cou...
Preface
pcom topics individually, as in a reference work. for example, the introduction includes a discussion of components and what they are, and the first chapter - in which you compile the basic code and register it with mozilla - prompts a discussion of the relationship between components and modules, of xpcom interfaces, and of the registration process in general. the top of each chapter provides a
list of the major topics covered. sidebar sections are included to highlight technical details. by the end of the book, if we've done our job, you will have learned how to build a component and you will know something about the framework for these components in gecko, which is xpcom. who should read this book no one. it is badly out of date, and much of what it says is either no longer remotely accu...
...ctionality. a full description of the component in this tutorial can be found in the what we'll be working on section of the tutorial. despite what old documentation says, xpcom should not be used to make npapi plugins scriptable. starting with gecko 1.7.5 (firefox 1.0) a special npapi extension for scriptability is supported, see scripting plugins. organization of the tutorial the following
list provides an overview of the steps that we will take to build an xpcom component called weblock, which provides site blocking functionality to gecko-based browsers. each one of these steps has its own chapter, in which a number of topics associated with the step are discussed. create the generic module code for the component. use c++ macros, special string classes and smart pointers to optimiz...
...ere not fully frozen in prior releases). this book assumes you are using the sdk rather than compiling in a mozilla source tree, though the difference between these two approaches is minimal. details about downloading the sdk, building, and getting programmatic access to gecko components are provided in the appendix to this book, setting up the gecko sdk. ...
...lines of code are placed in separate boxes. additionally, filenames and directories appear in monospaced font. italic variables appear in italic. ...
Mozilla internal string guide
should not be thought of as different types. nsliteral[c]string which should rarely be constructed explicitly but usually through the ""_ns and u""_ns user-defined string literals. nsliteral[c]string is trivially constructible and destructible, and therefore does not emit construction/destruction code when stored in statics, as opposed to the other string classes. the major string classes the
list below describes the main base classes. once you are familiar with them, see the appendix describing what class to use when. nsastring/nsacstring: the abstract base class for all strings. it provides an api for assignment, individual character access, basic manipulation of characters in the string, and string comparison. this class corresponds to the xpidl astring parameter type. nsastring is n...
...stract classes are also sometimes used to store temporary references to objects. you can see both of these uses in common patterns, below. the concrete classes - which classes to use when the concrete classes are for use in code that actually needs to store string data. the most common uses of the concrete classes are as local variables, and members in classes or structs. the following is a
list of the most common concrete classes. once you are familiar with them, see the appendix describing what class to use when. nsstring / nscstring- a null-terminated string whose buffer is allocated on the heap. destroys its buffer when the string object goes away. nsautostring / nsautocstring- derived from nsstring, a string which owns a 64 code unit buffer in the same storage space as the str...
...*) into a class of type nsastring. note that you must null-terminate buffers used by to nsdependentstring. if you don't want to or can't null-terminate the buffer, use nsdependentsubstring. nsprintfcstring- derived from nscstring, this string behaves like an nsautocstring. the constructor takes parameters which allows it to construct a 8-bit string from a printf-style format string and parameter
list. there are also a number of concrete classes that are created as a side-effect of helper routines, etc. you should avoid direct use of these classes. let the string library create the class for you. nssubstringtuple - created via string concatenation nsdependentsubstring - created through substring nspromiseflatstring - created through promiseflatstring() nsliteral[c]string - created thro...
...sequence of appends (excluding appends that convert between utf-16 and utf-8 in either direction) in order to avoid multiple allocations during the sequence of appends. however, the other allocation-avoidance features of xpcom strings interact badly with setcapacity() making it something of a footgun. setcapacity() is appropriate to use before a sequence of multiple operations from the following
list (without operations that are not on the
list between the setcapacity() call and operations from the
list): append() appendascii() appendliteral() appendprintf() appendint() appendfloat() lossyappendutf16toascii() appendasciitoutf16() do not call setcapacity() if the subsequent operations on the string do not meet the criteria above. operations that undo the benefits of setcapacity() i...
IAccessibleTable
nt_table_model_changed event handler. this data is only guaranteed to be valid while the thread notifying the event continues. once the handler has returned, the validity of the data depends on how the server manages the life cycle of its objects. also, note that the server may have different life cycle management strategies for controls depending on whether or not a control manages its children.
lists, trees, and tables can have a large number of children and thus it's possible that the child objects for those controls would only be created as needed. servers should document their life cycle strategy as this will be of interest to assistive technology or script engines accessing data out of process or from other threads. servers only need to save the most recent row and column values associat...
...ttributes() on the cell object. rowindex 0 based row index. return value e_invalidarg if bad [in] passed, [out] value is 0. s_ok. selectcolumn() selects a column and unselects all previously selected columns. hresult selectcolumn( [in] long column ); parameters column 0 based index of the column to be selected. return value e_invalidarg if bad [in] passed. s_ok. selectedchildren() returns a
list of cell indexes currently selected (0 based). [propget] hresult selectedchildren( [in] long maxchildren, [out, size_is(,maxchildren), length_is(, nchildren)] long children, [out] long nchildren ); parameters maxchildren this parameter is ignored. refer to @ref _arrayconsideration "special consideration when using arrays" for more details. children an array of cell indexes of selected cell...
...consideration "special consideration when using arrays" for more details. children an array of cell indexes of selected cells (each index is 0 based), allocated by the server. free it with cotaskmemfree. nchildren the number of cell indexes returned; the size of the returned array. return value s_false if there are none, [out] values are null and 0 respectively. s_ok. selectedcolumns() returns a
list of column indexes currently selected (0 based). [propget] hresult selectedcolumns( [in] long maxcolumns, [out, size_is(,maxcolumns), length_is(, ncolumns)] long columns, [out] long ncolumns ); parameters maxcolumns this parameter is ignored. refer to @ref _arrayconsideration "special consideration when using arrays" for more details. columns an array of column indexes of selected columns ...
...onsideration "special consideration when using arrays" for more details. columns an array of column indexes of selected columns (each index is 0 based), allocated by the server. free it with cotaskmemfree. ncolumns the number of column indexes returned; the size of the returned array. return value s_false if there are none, [out] values are null and 0 respectively. s_ok. selectedrows() returns a
list of row indexes currently selected (0 based). [propget] hresult selectedrows( [in] long maxrows, [out, size_is(,maxrows), length_is(, nrows)] long rows, [out] long nrows ); parameters maxrows this parameter is ignored. refer to @ref _arrayconsideration "special consideration when using arrays" for more details. rows an array of row indexes of selected rows (each index is 0 based), allocate...
IAccessibleTable2
nt_table_model_changed event handler. this data is only guaranteed to be valid while the thread notifying the event continues. once the handler has returned, the validity of the data depends on how the server manages the life cycle of its objects. also, note that the server may have different life cycle management strategies for controls depending on whether or not a control manages its children.
lists, trees, and tables can have a large number of children and thus it's possible that the child objects for those controls would only be created as needed. servers should document their life cycle strategy as this will be of interest to assistive technology or script engines accessing data out of process or from other threads. servers only need to save the most recent row and column values associat...
...in the table are unselected. then the entire column of cells for the specified column is selected. if any of the cells in the selected column span additional columns, the cells in those columns are also selected. hresult selectcolumn( [in] long column ); parameters column 0 based index of the column to be selected. return value e_invalidarg if bad [in] passed. s_ok. selectedcells() returns a
list of accessibles currently selected. [propget] hresult selectedcells( [out, size_is(, nselectedcells,)] iunknown cells, [out] long nselectedcells ); parameters cells pointer to an array of references to selected accessibles. the array is allocated by the server. free it with cotaskmemfree. nselectedcells the number of accessibles returned; the size of the returned array. return value s_false...
...cells,)] iunknown cells, [out] long nselectedcells ); parameters cells pointer to an array of references to selected accessibles. the array is allocated by the server. free it with cotaskmemfree. nselectedcells the number of accessibles returned; the size of the returned array. return value s_false if there are none, [out] values are null and 0 respectively. s_ok. selectedcolumns() returns a
list of column indexes currently selected (0 based). [propget] hresult selectedcolumns( [out, size_is(, ncolumns)] long selectedcolumns, [out] long ncolumns ); parameters selectedcolumns a pointer to an array of column indexes of selected columns (each index is 0 based). the array is allocated by the server. free it with cotaskmemfree. ncolumns the number of column indexes returned; the size of ...
... [out] long ncolumns ); parameters selectedcolumns a pointer to an array of column indexes of selected columns (each index is 0 based). the array is allocated by the server. free it with cotaskmemfree. ncolumns the number of column indexes returned; the size of the returned array. return value s_false if there are none, [out] values are null and 0 respectively. s_ok. selectedrows() returns a
list of row indexes currently selected (0 based). [propget] hresult selectedrows( [out, size_is(, nrows)] long selectedrows, [out] long nrows ); parameters selectedrows an array of row indexes of selected rows (each index is 0 based), allocated by the server. free it with cotaskmemfree. nrows the number of row indexes returned; the size of the returned array. return value s_false if there are n...
imgIEncoder
uality=# -- default: "92" quality of compression, 0-100 (worst-best). quality >= 90 prevents down-sampling of the color channels. methods addimageframe() void addimageframe( [array, size_is(length), const] in pruint8 data, in unsigned long length, in pruint32 width, in pruint32 height, in pruint32 stride, in pruint32 frameformat, in astring frameoptions ); parameters data
list of bytes in the format specified by inputformat. length missing description width width in pixels. height height in pixels. stride the number of bytes per row in the image. normally (width*3) or (width*4), depending on your input format, but some data uses padding at the end of each row, which would be extra. frameformat missing description frameoptions missing description encodeclipboa...
...efile ); parameters aclipboardimage missing description aimagefile missing description endimageencode() void endimageencode(); parameters none. initfromdata() void initfromdata( [array, size_is(length), const] in pruint8 data, in unsigned long length, in pruint32 width, in pruint32 height, in pruint32 stride, in pruint32 inputformat, in astring outputoptions ); parameters data
list of bytes in the format specified by inputformat. length missing description width width in pixels. height height in pixels. stride the number of bytes per row in the image. normally (width*3) or (width*4), depending on your input format, but some data uses padding at the end of each row, which would be extra. inputformat one of input_format_* constants specifying the format of data. outputoptions...
...at specified by inputformat. length missing description width width in pixels. height height in pixels. stride the number of bytes per row in the image. normally (width*3) or (width*4), depending on your input format, but some data uses padding at the end of each row, which would be extra. inputformat one of input_format_* constants specifying the format of data. outputoptions semicolon-delimited
list of name=value pairs that can give options to the output encoder. options are encoder-specific. just give an empty string for default behavior. startimageencode() void startimageencode( in pruint32 width, in pruint32 height, in pruint32 inputformat, in astring outputoptions ); parameters width width in pixels. height height in pixels. inputformat one of input_format_* constants specifyi...
...encoder. options are encoder-specific. just give an empty string for default behavior. startimageencode() void startimageencode( in pruint32 width, in pruint32 height, in pruint32 inputformat, in astring outputoptions ); parameters width width in pixels. height height in pixels. inputformat one of input_format_* constants specifying the format of data. outputoptions semicolon-delimited
list of name=value pairs that can give options to the output encoder. options are encoder-specific. just give an empty string for default behavior. remarks for encoding images which may contain multiple frames, the 1-shot initfromdata() interface is too simp
listic. the alternative is to use startimageencode(), call addimageframe() one or more times, and then finish initialization with endimageencode(...
mozISpellCheckingEngine
nged in gecko 1.7 this interface represents a spell checking engine. the built in hunspell engine has contract id "@mozilla.org/spellchecker/engine;1". extensions can use this interface to check spelling or provide its own spell checker to editors. ...
...2 count); attributes attribute type description copyright wstring a string indicating the copyright of the engine. not currently used. read only. dictionary wstring the name of the current dictionary used by check() and suggest(). this will be either element from the array returned by getdictionary
list() or an empty string if no dictionary is selected. note: setting this value to a value that doesn't match an existing dictionary throws a ns_error_file_not_found exception. when this attribute's value is changed, a "spellcheck-dictionary-update" notification is sent. if the dictionary was set to "no dictionary" (that is, by specifying an empty string), the observer may ...
... checks a word to determine if it's spelled correctly. when this changes, the spell checker sends a "spellcheck-dictionary-update" notification. boolean check( in wstring word ); parameters word a word to check for correct spelling. return value returns true if word is spelled correctly according to the dictionary attribute, and returns false if word is misspelled. getdictionary
list() gets the
list of dictionaries. void getdictionary
list( [array, size_is(count)] out wstring dictionaries, out pruint32 count ); parameters dictionaries a
list of dictionaries supported by this spell checker. the dictionary attribute can be set to one of these. each dictionary name is typically but not always a locale code. count the length of dictionaries. remo...
...dictionary name is typically but not always a locale code. count the length of dictionaries. removedirectory() removes all the dictionaries in the specified directory from the spell checker. void removedirectory( nsifile dir ); parameters dir an nsifile object indicating the directory whose spell checkers are to be removed from the spell checker. suggest() gets a
list of suggestions for a misspelled word. when this changes, the spell checker sends a "spellcheck-dictionary-update" notification. void suggest( in wstring word, [array, size_is(count)] out wstring suggestions, out pruint32 count ); parameters word a word, which is misspelled according to check. suggestions a
list of words suggested instead of word. count ...
nsIAccessibleProvider
mple now it is used by <xul:iframe>, <xul:browser> and <xul:editor>. ...
...l:iframe>, <xul:browser> and <xul:editor>. ...
...d <xul:editor>. ...
...rols constants constant value description xulalert 0x00001001 xulbutton 0x00001002 xulcheckbox 0x00001003 xulcolorpicker 0x00001004 xulcolorpickertile 0x00001005 xulcombobox 0x00001006 xuldropmarker 0x00001007 xulgroupbox 0x00001008 xulimage 0x00001009 xullink 0x0000100a xul
listbox 0x0000100b xul
listcell 0x00001026 xul
listhead 0x00001024 xul
listheader 0x00001025 xul
listitem 0x0000100c xulmenubar 0x0000100d xulmenuitem 0x0000100e xulmenupopup 0x0000100f xulmenuseparator 0x00001010 xulpane 0x00001011 xulprogressmeter 0x00001012 xulscale 0x00001013 xulstatusbar 0x00001014 xulradiobutton 0x00001015 xulradiogroup 0x00001016 xultab 0x00001017 the single tab in a dialog or tabbrowser/editor interf...
nsICommandLine
lag( in astring aflag, in boolean acasesensitive ); parameters aflag the flag name to locate. do not include the initial hyphen. acasesensitive whether to do case-sensitive comparisons. return value the position of the flag in the command line, or -1 if the flag is not found.getargument() gets the value an argument from the array of command-line arguments, given the index into the argument
list. on windows, flags of the form /flag are normalized to -flag. /flag:param are normalized to -flag param. on unix/linux and mac os x, flags of the form --flag are normalized to -flag, and flags of the form --flag=param are normalized to the form -flag param. astring getargument( in long aindex ); parameters aindex the argument to retrieve. this index is 0-based, and does not include the applic...
... the returned value is "-flag [<flagvalue>]". exceptions thrown ns_error_invalid_arg the specified index is out of bounds. handleflag() finds the specified flag, removing it from the array of flags. reports whether or not the specified flag was found. this is useful for boolean flags; that is, flags that don't accept a parameter. ...
...this is useful for processing flags that accept a value. this is, essentially, a helper method that combines findflag() and removearguments() into one operation. ...
...this is useful for processing flags that accept a value. ...
nsIDOMElement
rface represents an element in an html or xml document. ...
... inherits from: nsidomnode last changed in gecko 1.7 method overview domstring getattribute(in domstring name); nsidomattr getattributenode(in domstring name); nsidomattr getattributenodens(in domstring namespaceuri, in domstring localname); domstring getattributens(in domstring namespaceuri, in domstring localname); nsidomnode
list getelementsbytagname(in domstring name); nsidomnode
list getelementsbytagnamens(in domstring namespaceuri, in domstring localname); boolean hasattribute(in domstring name); boolean hasattributens(in domstring namespaceuri, in domstring localname); void removeattribute(in domstring name) nsidomattr removeattributenode(in nsidomattr oldattr) void removeattributens(in domstring namespaceuri, in domstring localname) void setattribute(in domstri...
...name return value a nsidomattr corresponding to the attribute. getattributens() get an attribute value in a given namespace. domstring getattributens( in domstring namespaceuri, in domstring localname ); parameters namespaceuri namespace uri localname attribute name return value a domstring containing the attribute value. getelementsbytagname() get all descendants of a tag name. ...
... in a given namespace. domstring getattributens( in domstring namespaceuri, in domstring localname ); parameters namespaceuri namespace uri localname attribute name return value a domstring containing the attribute value. getelementsbytagname() get all descendants of a tag name. nsidomnode
list getelementsbytagname( in domstring name ); parameters name tag name return value a nsidomnode
list containg all the descendants of this tag name. getelementsbytagnamens() get all descendants of a tag name in a given namespace. nsidomnode
list getelementsbytagnamens( in domstring namespaceuri, in domstring localname ); parameters namespaceuri namespace uri localname tag name return value a nsidomnode
list containg all the descendants of this tag name. hasattribute() check if the element ha...
getFile
bject corresponding for a given standard path location. the individual platform implementation of nsidirectoryserviceprovider maps the symbolic path location passed to this function and returns the appropriate nsifile. nsifile getfile( in string aname, out boolean apersistent ); parameters aname [in] the symbolic name for a file or directory location. ...
...available on all platforms these symbolic names are available on all platforms (although, of course, they may refer to different physical paths on the storage device). ...
...available on all platforms these symbolic names are available on all platforms (although, of course, they may refer to different physical paths on the storage device). ...
...os_temp_dir "tmpd" ns_os_current_working_dir "curworkd" ns_os_desktop_dir "desk" otherwise same as home ns_os_current_process_dir "curprocd" ns_xpcom_current_process_dir "xcurprocd" can be overriden by passing a "bin directory" to ns_initxpcom2(). ns_xpcom_component_dir "comsd" ns_xpcom_component_dir_
list "comsdl" ns_xpcom_component_registry_file "comregf" ns_xpcom_xpti_registry_file "xptiregf" ns_xpcom_library_file "xpcomlib" ns_gre_dir "gred" note: on mac os x, up through firefox 34 this is the contents/macos directory within the application's bundle. starting with firefox 35, this is contents/resources. this ch...
nsIDocShell
separate nsidoccharsetinfo interface. parentcharsetsource print32 indicates the source from which the character set being used was obtained. higher numbers override lower ones. see character set source constants for defined values. note: prior to gecko 12.0, this attribute was part of a separate nsidoccharsetinfo interface. parenturicontent
listener nsiuricontent
listener uri content
listener parent. this is not refcounted and is assumed to be nulled out by the parent when the parent is going away. obsolete since gecko 1.8 prescontext nsprescontext presentation context for the currently loaded document. this may be null. read only. native code only! presshell nsipresshell presentation shell for the curr...
...possible to serialise this in less than 640k characters. atitle gecko currently ignores this parameter. aurl the url associated with the new history entry. for instance, if the user tries to reload the page, then this is the url that will be reloaded. areplace whether to modify the current history entry instead of creating a new one. beginrestore() begin firing webprogress
listener notifications for restoring a page presentation. this method will post an event to complete the simulated load after returning to the event loop. void beginrestore( in nsicontentviewer viewer, in boolean top ); parameters viewer the content viewer whose document we are starting to load. if null, it defaults to the docshell's current content viewer, creating one if necessary. ...
...eters loadinfo the new nsidocshellloadinfo object. violates the xpcom interface guidelines detacheditorfromwindow() disconnects this docshell's editor from its window, and stores the editor data in the open document's session history entry. this should be called only during page transitions. void detacheditorfromwindow(); parameters none. finishrestore() finish firing webprogress
listener notifications and dom events for restoring a page presentation. this should only be called via beginrestore(). void finishrestore(); parameters none. native code only!firepagehidenotification notify the associated content viewer and all child docshells that they are about to be hidden. if isunload is true, then the document is being unloaded as well. void firepagehidenotification( in bool...
...ssion storage object for the supplied domain. historypurged() notification that entries have been removed from the beginning of a nsshistory which has this as its rootdocshell. void historypurged( in long numentries ); parameters numentries the number of entries removed. native code only!internalload loads the given uri. this method is identical to loaduri() except that its parameter
list is broken out instead of being packaged inside of an nsidocshellloadinfo object. void internalload( in nsiuri auri, in nsiuri areferrer, in nsisupports aowner, in pruint32 aflags, in wstring awindowtarget, in string atypehint, in nsiinputstream apostdatastream, in nsiinputstream aheadersstream, in unsigned long aloadflags, in nsishentry ashentry, in boolean firstparty, out...
nsIExternalHelperAppService
oader/external-helper-app-service;1. to access this service, use: var externalhelperappservice = components.classes["@mozilla.org/uriloader/external-helper-app-service;1"] .getservice(components.interfaces.nsiexternalhelperappservice); method overview boolean applydecodingforextension(in autf8string aextension, in acstring aencodingtype); nsistream
listener docontent(in acstring amimecontenttype, in nsirequest arequest, in nsiinterfacerequestor awindowcontext, in boolean aforcesave); methods applydecodingforextension() determines whether or not data whose filename has the specified extension should be decoded from the specified encoding type before being saved or delivered to helper applications. boolean applydecodingforextension( in aut...
...aextension, in acstring aencodingtype ); parameters aextension the filename extension to check. aencodingtype the encoding type to check. return value true if data from urls with the specified extension and encoding should be decoded prior to saving the file or delivering it to a helper application; otherwise false. ...
...tension the filename extension to check. aencodingtype the encoding type to check. return value true if data from urls with the specified extension and encoding should be decoded prior to saving the file or delivering it to a helper application; otherwise false. docontent() binds an external helper application to a stream
listener. the caller should pump data into the returned stream
listener. when the onstoprequest is issued, the stream
listener implementation will launch the helper app with this data. nsistream
listener docontent( in acstring amimecontenttype, in nsirequest arequest, in nsiinterfacerequestor awindowcontext, in boolean aforcesave ); parameters amimecontenttype the content type of the incoming data. arequest the request corresponding to th...
...e incoming data. arequest the request corresponding to the incoming data. awindowcontext use nsiservicemanager.getinterface() to retrieve properties like the dom window or parent window; the service might need this in order to bring up dialogs. aforcesave true to always save this content to disk, regardless of nsimimeinfo and other such influences. return value a nsistream
listener which the caller should pump the data into. ...
nsIFilePicker
this attribute has no effect if private browsing mode is in effect. defaultextension astring the extension for the type of files you want to work with. on some platforms, this is automatically appended to filenames the user enters, if required. specify it without a leading dot, f...
... 0 the file picker dialog was closed by the user hitting 'ok' returncancel 1 the file picker dialog was closed by the user hitting 'cancel' returnreplace 2 the user chose an existing file and acknowledged that they want to overwrite the file filter constants these constants are used to create filters for commonly-used file types. for the most up to date
list see filepicker.properties. constant value description filterall 0x001 corresponds to the *.* filter for file extensions. all files will pass through the filter. filterhtml 0x002 corresponds to the *.html, *.htm, *.shtml and *.xhtml filters for file extensions. filtertext 0x004 corresponds to the *.txt and *.text filter for file extensio...
...o 0x200 corresponds to the *.avi, *.divx, *.flv, *.m4v, *.mkv, *.mov, *.mp4, *.mpeg, *.mpg, *.ogm, *.ogv, *.ogx, *.rm, *.rmvb, *.smil, *.webm, *.wmv and *.xvid filters for file extensions. methods appendfilter() appends a custom file extension filter to the dialog. the filter appended first will be used to display the nsifilepicker dialog, the user may then select another from the
list. void appendfilter( in astring title, in astring filter ); parameters title the title of the filter. filter the filter string. multiple extensions may be included, separated by a semicolon and a space. example some example filter strings: "*.ics" "*.txt; *.doc; *.rtf" appendfilters() appends a
list of file extension filters, from the predefined
list, to the dialog. void ap...
... filtermask a combination of the filters you wish to use. you may or multiple filters together; for example filterall | filterhtml. init() initialize the file picker widget. the file picker is not valid until this method is called. void init( in nsidomwindow parent, in astring title, in short mode ); parameters parent the nsidomwindow parent. ...
nsINavHistoryContainerResultNode
itemid, in boolean arecursive); nsinavhistoryresultnode getchild(in unsigned long aindex); unsigned long getchildindex(in nsinavhistoryresultnode anode); attributes attribute type description childcount unsigned long the number of child nodes; accessing this throws an ns_error_not_available exception of containeropen is false. read only. childrenreadonly boolean false if the node's
list of children can be modified (by adding or removing children, or rearranging them), or true if the user interface should not allow the
list of children to be altered. read-only. this is false for bookmark folder nodes unless the setfolderreadonly() method has been called to specifically make the folder read-only. it's true for non-folder nodes. if this container is a remote container, this flag ma...
...allow descent into this container. when closed, attempting to call getchild() or access childcount results in an error. when you're done reading the container's children, set this to false. for host and day groupings, doing this has no performance cost since the children have already been computed. for queries and bookmark folders, however, being open means they must keep themselves up-to-date by
listening for updates and re-querying as needed. dynamiccontainertype autf8string a string representing the dynamic container api service responsible for this container. accessing this throws an exception if the node isn't a dynamic container. read only. haschildren boolean indicates whether or not the node can have children, and may be used whether the container is open or closed. when the conta...
...y direct children of the container are searched. return value an nsinavhistoryresultnode of a node matching the specified details or null if no match is found. exceptions thrown ns_error_not_available the container is not open. getchild() returns the child node at the specified index. nsinavhistoryresultnode getchild( in unsigned long aindex ); parameters aindex the index into the child
list of the node to fetch. returns the node located at the specified index. exceptions thrown ns_error_not_available the containeropen attribute is currently false, indicating that the node isn't open for access. getchildindex() returns the index of a direct child of this container. unsigned long getchildindex( in nsinavhistoryresultnode anode ); parameters anode the node whose index is to be r...
...d index. exceptions thrown ns_error_not_available the containeropen attribute is currently false, indicating that the node isn't open for access. getchildindex() returns the index of a direct child of this container. unsigned long getchildindex( in nsinavhistoryresultnode anode ); parameters anode the node whose index is to be returned. return value the index of the specified node into the
list of immediate children of the container. exceptions thrown ns_error_not_available the container isn't open (that is, containeropen is false). ns_error_invalid_arg the specified node isn't a direct child of this container. remarks there are a number of untested methods on this interface that are not documented at present, and are disabled in the idl file. see also nsinavhistoryresultnode, nsinav...
nsISmsDatabaseService
ssage(in domstring asender, in domstring abody, in unsigned long long adate); long savesentmessage(in domstring areceiver, in domstring abody, in unsigned long long adate); void getmessage(in long messageid, in long requestid, [optional] in unsigned long long processid); void deletemessage(in long messageid, in long requestid, [optional] in unsigned long long processid); void createmessage
list(in nsidommozsmsfilter filter, in boolean reverse, in long requestid, [optional] in unsigned long long processid); void getnextmessagein
list(in long
listid, in long requestid, [optional] in unsigned long long processid); void clearmessage
list(in long
listid); void markmessageread(in long messageid, in boolean value, in long requestid, [optional] in unsigned long long processid) methods s...
...equest. processid optional a number representing the id of the process. deletemessage() void deletemessage( in long messageid, in long requestid, [optional] in unsigned long long processid ); parameters messageid a number representing the id of the message. requestid a number representing the id of the request. processid optional a number representing the id of the process. createmessage
list() void createmessage
list( in nsidommozsmsfilter filter, in boolean reverse, in long requestid, [optional] in unsigned long long processid ); parameters filter a smsfilter to filter out sms messages from a
list. reverse a boolean indicating whether to reverse the ordering. requestid a number representing the id of the request. processid optional a number representing the id of the proces...
...e
list( in nsidommozsmsfilter filter, in boolean reverse, in long requestid, [optional] in unsigned long long processid ); parameters filter a smsfilter to filter out sms messages from a
list. reverse a boolean indicating whether to reverse the ordering. requestid a number representing the id of the request. processid optional a number representing the id of the process. getnextmessagein
list() void getnextmessagein
list( in long
listid, in long requestid, [optional] in unsigned long long processid ); parameters
listid a number representing the id of the message
list. requestid a number representing the id of the request. processid optional a number representing the id of the process. ...
...essid optional a number representing the id of the process. getnextmessagein
list() void getnextmessagein
list( in long
listid, in long requestid, [optional] in unsigned long long processid ); parameters
listid a number representing the id of the message
list. requestid a number representing the id of the request. processid optional a number representing the id of the process. clearmessage
list() void getnextmessagein
list( in long
listid, ); parameters
listid a number representing the id of the message
list. markmessageread() requires gecko 15.0(firefox 15.0 / thunderbird 15.0 / seamonkey 2.12) void markmessageread( in long messageid, in boolean value, in long requestid, [optional] in unsigned long long processid ); parameters messageid a number representing the...
nsIWifiMonitor
netwerk/wifi/nsiwifimonitor.idlscriptable this interface can be used to be alerted when the
list of available wifi access points changes. 1.0 66 introduced gecko 1.9.1 inherits from: nsisupports last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) this is used, for example, by geolocation to use wifi access points for location detection. implemented by @mozilla.org/wifi/monitor;1 as a service: var wifimonitor = components.classes["@mozilla.org/wifi/monitor;1"] .getservice(components.interfaces.nsiwifimonitor); method overview void startwatching(in nsiwifi
listener a
listener); void stopwatching(in nsiwifi
listener a
listener); methods startwatching() starts
listening for changes to the wifi access point
list. void ...
...onitor;1 as a service: var wifimonitor = components.classes["@mozilla.org/wifi/monitor;1"] .getservice(components.interfaces.nsiwifimonitor); method overview void startwatching(in nsiwifi
listener a
listener); void stopwatching(in nsiwifi
listener a
listener); methods startwatching() starts
listening for changes to the wifi access point
list. void startwatching( in nsiwifi
listener a
listener ); parameters a
listener the nsiwifi
listener object to receive notifications when the wifi access point
list changes. ...
... method overview void startwatching(in nsiwifi
listener a
listener); void stopwatching(in nsiwifi
listener a
listener); methods startwatching() starts
listening for changes to the wifi access point
list. void startwatching( in nsiwifi
listener a
listener ); parameters a
listener the nsiwifi
listener object to receive notifications when the wifi access point
list changes. stopwatching() stops
listening for changes to the wifi access point
list. void stopwatching( in nsiwifi
listener a
listener ); parameters a
listener the nsiwifi
listener object to stop receiving notifications on. ...
...
listener a
listener ); parameters a
listener the nsiwifi
listener object to receive notifications when the wifi access point
list changes. stopwatching() stops
listening for changes to the wifi access point
list. void stopwatching( in nsiwifi
listener a
listener ); parameters a
listener the nsiwifi
listener object to stop receiving notifications on. ...
nsIWinTaskbar
etoverlayiconcontroller(). this method is currently known to crash if used under certain conditions. see bug 744992 for details and to track progress on a fix. implemented by: @mozilla.org/windows-taskbar;1. ...
...r(). this method is currently known to crash if used under certain conditions. see bug 744992 for details and to track progress on a fix. implemented by: @mozilla.org/windows-taskbar;1. ...
...olean returns true if the operating system supports windows 7 or later taskbar features; you can use this instead of in-place operating system version checking. read only. defaultgroupid astring the default application user model id the application registers with the system. this id is used by the taskbar for grouping windows and when associating pinned shortcuts with running instances and jump
lists. read only. for xulrunner applications, the defaultgroupid attribute is configured using application.ini settings, and is of the format "vendor.application.version". for example, if the vendor is configured to "foobar systems", the application's name is "squashweb", and the application's version is 1.0, the defaultgroupid attribute would be "foobar systems.squashweb.1.0". see xul application...
...aultgroupid attribute is configured using application.ini settings, and is of the format "vendor.application.version". for example, if the vendor is configured to "foobar systems", the application's name is "squashweb", and the application's version is 1.0, the defaultgroupid attribute would be "foobar systems.squashweb.1.0". see xul application packaging for additional details. methods createjump
listbuilder() retrieve a taskbar jump
list builder. fails if a jump
list build operation has already been initiated, developers should make use of a single instance of nsijump
listbuilder for building
lists within an application. nsijump
listbuilder createjump
listbuilder(); parameters none. return value an nsijump
listbuilder. createtaskbartabpreview() creates a taskbar tab preview, given an nsidocshell...
nsIXMLHttpRequestEventTarget
content/base/public/nsixmlhttprequest.idlscriptable this interface provides access to the event
listeners used when uploading data using the xmlhttprequest object. 1.0 66 introduced gecko 1.9.1 inherits from: nsidomeventtarget last changed in gecko 5.0 (firefox 5.0 / thunderbird 5.0 / seamonkey 2.2) attributes attribute type description onabort nsidomevent
listener a javascript function object that gets invoked if the operation is canceled by the user. onerror nsidomevent
listener a javascript function object that gets invoked if the operation fails to complete due to an error. ...
...idomeventtarget last changed in gecko 5.0 (firefox 5.0 / thunderbird 5.0 / seamonkey 2.2) attributes attribute type description onabort nsidomevent
listener a javascript function object that gets invoked if the operation is canceled by the user. onerror nsidomevent
listener a javascript function object that gets invoked if the operation fails to complete due to an error. onload nsidomevent
listener a javascript function object that gets invoked when the operation is successfully completed. ...
...ption onabort nsidomevent
listener a javascript function object that gets invoked if the operation is canceled by the user. onerror nsidomevent
listener a javascript function object that gets invoked if the operation fails to complete due to an error. onload nsidomevent
listener a javascript function object that gets invoked when the operation is successfully completed. onloadend nsidomevent
listener a javascript function object that gets invoked when the operation is completed for any reason; it will always follow a an abort, error, or load event. onloadstart nsidomevent
listener a javascript function object that gets invoked exactly once when the operation begins. ...
...object that gets invoked when the operation is successfully completed. onloadend nsidomevent
listener a javascript function object that gets invoked when the operation is completed for any reason; it will always follow a an abort, error, or load event. onloadstart nsidomevent
listener a javascript function object that gets invoked exactly once when the operation begins. onprogress nsidomevent
listener a javascript function object that gets invoked zero or more times, after the loadstart event, but before any abort, error, or load events occur. handling the events when the handler functions for these events are called, they receive as a parameter a progressevent, which implements the nsidomprogressevent interface. see also using xmlhttprequest xmlhttprequest nsixmlhttprequest nsidomprog...
nsIXMLHttpRequestUpload
sixmlhttprequest.idlscriptable this interface provides access to the features needed when uploading data using nsixmlhttprequest. ...
...ccess to the features needed when uploading data using nsixmlhttprequest. ...
...ixmlhttprequest. ...
....1 inherits from: nsidomeventtarget last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) attributes attribute type description onabort nsidomevent
listener onerror nsidomevent
listener onload nsidomevent
listener onloadstart nsidomevent
listener onprogress nsidomevent
listener see also nsixmlhttprequest nsixmlhttprequesteventtarget xmlhttprequest using xmlhttprequest ...
nsIXULTemplateQueryProcessor
uilder creates the query processor, and there is no other means to retrieve it. a template query is the contents inside a <query> element within the template. the actual syntax is opaque to the template builder and defined by a query processor. the query is expected to consist of either text or dom nodes that, when executed by a call to the generateresults() method, will allow the generation of a
list of results. the template builder will supply two variables, the reference variable and the member variable to further indicate what part of the datasource is to be examined in addition to the query itself. the reference is always a placeholder for the starting point and the member is always a placeholder for the end points (the results). the reference point is important when generating output rec...
...der for the starting point and the member is always a placeholder for the end points (the results). the reference point is important when generating output recursively, as the query will be the same for each iteration, however, the reference point will differ. for instance, when examining an xml source, an xml query processor might begin at the node referred by the reference variable and end at a
list of that node's children. some queries may not need the reference variable if the syntax or the form of the data implies the value. for instance, a datasource that holds a table that can only produce one set of results. the reference variable may be specified in a template by setting the "container" attribute on the <template> element to the variable to use. the member variable may be specified in...
...sisupports aquery ); parameters adatasource datasource for the data. aref context reference value used as a starting point. aquery the compiled query returned from query compilation. return value an enumerator of nsixultemplateresult objects as the results. exceptions thrown ns_error_invalid_arg if aquery is invalid. getdatasource() retrieve the datasource to use for the query processor. the
list of datasources in a template is specified using the datasources attribute as a space separated
list of uris. this
list is processed by the builder and supplied to the query processor in the adatasources array as a
list of nsiuri objects or nsidomnode objects. this method may return an object corresponding to these uris and the builder will supply this object to other query processor methods. for ...
...ce asynchronously, it may set the ashoulddelaybuilding returned parameter to true to delay building the template content, and call the builder's rebuild method when the data is available. nsisupports getdatasource( in nsiarray adatasources, in nsidomnode arootnode, in boolean aistrusted, in nsixultemplatebuilder abuilder, out boolean ashoulddelaybuilding ); parameters adatasources the
list of nsiuri objects and/or nsidomnode objects. arootnode the root node the builder is attached to. aistrusted true if the template is in a trusted document. abuilder the template builder. ashoulddelaybuilding whether the builder should wait to build the content or not. return value a datasource object. initializeforbuilding() initialize for query generation. this will be called before the rules ar...
Using nsIDirectoryService
ice implements the nsiproperties interface. this implementation will allow you to get(), set(), define(), and undefine() nsifile. getting a location: most developers need to find where a file or directory is located. with nsdirectoryservice, there are two steps involved. first, you must know what the string key (or property) is that refers to this locations. header files containing known keys are
listed in the known locations section of this document. bear in mind that this
list is not static. components can add and remove locations at their will. second, you must acquire the implementation and call get() passing the known string key. in the example below, prop is a string that references your requested file locations. c++ nscomptr<nsifile> dir; ns_getspecialdirectory(prop, getter_addr...
...n. the new method the new method uses nsidirectoryservice to locate files and directories. be sure to see the documentation on the service itself. this document will focus on how the service is used and how to customize it. briefly, nsidirectoryservice uses "providers" of type nsidirectoryserviceprovider to provide file locations. when the service is asked for a file location, it goes through its
list of providers asking each if it knows the requested location until it finds one that does. once the service finds a location, if the provider says that the location is persistent, the service will cache that location so it is very quick on subsequent calls. different providers can provide certain locations that are relevant to them. for example, in seamonkey, the profile service is a provider for ...
... macintosh, these dlls are the shared libs in the "essential files" directory. you need to include an alias in your application that points to this directory and the resource id of this alias goes into your 'cfrg' resource. on platforms which use path environment variables, you will need to set one of these paths to the /bin directory. ...
...in seamonkey, the profile service is an nsidirectoryserviceprovider and it provides these locations. there are some cases in embedding in which distinct user profiles are not needed; however, prefs and history and such are needed. ...
Gloda examples
nderbird 3 this page provides some examples for using gloda. see creating a gloda message query for more examples. ...
...s, acollection) { }, /* called when our database query completes */ onquerycompleted: function _onquerycompleted(conversation_coll) { try { for (var conv in conversation_coll) { //do something with the conversation here alert(conv.subject); } } catch (e) {} } } glodamessage.conversation.getmessagescollection(a
listener) alternatively if you need to get a conversation based on the subject, you need to do a query (using the same
listener as above). if you search for a message based on subject, use noun_message instead of noun_conversation and modify the
listener accordingly. query=gloda.newquery(gloda.noun_conversation); query.subjectmatches("gloda makes searching easy"); query.getcollection(a
listener) s...
...=gloda.newquery(gloda.noun_conversation); query.subjectmatches("gloda makes searching easy"); query.getcollection(a
listener) search messages by tags searches for all messages having any (or several) of all tags defined in tb let query = gloda.newquery(gloda.noun_message); let tagarray = mailservices.tags.getalltags({}); query.tags(...tagarray); let collection = query.getcollection(my
listener); search messages by daterange searches for all messages within a date range id_q=gloda.newquery(gloda.noun_message); // define a date range form yesterday to now id_q.daterange([new date() - 86400000, new date()]); var my
listener = { /* called when new items are returned by the database query or freshly indexed */ onitemsadded: function _onitemsadded(aitems, acollection) { ...
...instead you need to do two queries, first to get the "identity" object for an email address and then to get the messages. this requires two chained asynchronous calls: //first take...
Mail and RDF
var result = rdf.getliteral(msgcount.tostring()); return result; } } asynchronously notifying rdf when a mail object's data changes and the data is reflected in rdf by notifying all of the observers that rdf has registered with the datasource. in the example of mail folders, each folder datasource first registers itself with the mail session as a nsifolder
listener because it wants information about when a folder changes. each template registers itself as an rdf observer. when a folder's contents or properties change, it tells the mail session to notify the folder
listeners that the data has changed. the folder datasource then translates these property changes into onassert() or onunassert() calls to the observers. the calling chain essentially looks l...
...an rdf observer. when a folder's contents or properties change, it tells the mail session to notify the folder
listeners that the data has changed. the folder datasource then translates these property changes into onassert() or onunassert() calls to the observers. the calling chain essentially looks like this: registration: folder datasource registers itself with the mail session as a folder
listener rdf template registers itself with the datasource as a content observer. notification: folder data changes. folder notifies mail session that it's data changed. mail session notifies folder
listeners that the folder has changed. folder datasource notifies rdf content observers of the changes. content observers update ui. an aside: rational behind the design after reviewing this d...
...ut of the messages and folders themselves. this allows the mail code to be mostly free of rdf. the actual dependancies on rdf are small, so it makes sense to keep rdf out of folders and messages. there should be a non-rdf mechanism for folder change notification. there are times (for example, from javascript/xul) where we want folder notifications that have nothing to do with rdf. ...
...s that have nothing to do with rdf. requring these
listeners to use rdf would be unnecessarily burdening them with an unnecessary api. the folders or the mail session would have to know about every rdf observer on each datasource. this means the folder would have to notify each of those observers. this design allows each datasource to manage its own observers, and lets each mail session manage a
list of folder
listeners without necessarily knowing that some of these
listeners are rdf-related. please comment ! alec flett last modified: thu oct 7 11:33:42 pdt 1999 ...
Adding items to the Folder Pane
t it is necessary to invalidate all its data (because of too many changes, or more commonly because the folder pane's "mode" (aka view) has changed), a "rebuild" occurs. when this happens, the folder pane consults the map-generator for the current mode, and that generator returns the necessary data for the folder pane's display. this data is returned in the form of an array of folder-tree-items. ...
... map-generator for the current mode, and that generator returns the necessary data for the folder pane's display. this data is returned in the form of an array of folder-tree-items.
listening for folder pane rebuilds every time the folder pane rebuilds, it fires a "maprebuild" event, which is the ideal opportunity for extensions to step in and modify the display data. ...
... pane's display. this data is returned in the form of an array of folder-tree-items.
listening for folder pane rebuilds every time the folder pane rebuilds, it fires a "maprebuild" event, which is the ideal opportunity for extensions to step in and modify the display data. ...
...builds every time the folder pane rebuilds, it fires a "maprebuild" event, which is the ideal opportunity for extensions to step in and modify the display data. the following code snippet
listens for that event: let gnumbersext = { load: function gne_load() { window.removeevent
listener("load", gnumbersext.load, false); let tree = document.getelementbyid("foldertree"); tree.addevent
listener("maprebuild", gnumbersext._insert, false); }, _insert: function gne__insert() { // this function is called when a rebuild occurs } }; window.addevent
listener("load", gnumbersext.load, true); the structure of folder-tree-items the folder pane stores its current display data in a property called _rowmap. this property is an array of folder-tree-items. each item in this array satisf...
Building a Thunderbird extension 6: Adding JavaScript
javascript code that inserts the current date into our statusbar widget. the statusbar is usually displayed at the bottom of the thunderbird window. depending on the installed theme the result will look something like this: modify xul elements with javascript save the following javascript code into the content/ folder next to your myhelloworld.xul file and name it overlay.js. ...
...it then uses javascript's date class to get the current date, which it converts into a string that has the format of yyyy.mm.dd. because the month is zero-based we also need to add one to the m...
... //update date every minute function startup() { var mypanel = document.getelementbyid("my-panel"); var date = new date(); var day = date.getday(); var datestring = date.getfullyear() + "." + (date.getmonth()+1) + "." + date.getdate(); mypanel.label = "date: " + datestring; } the first part registers a new event
listener that will be executed automatically when thunderbird loads. the event
listener then calls our startup function which gets our <statusbarpanel>-element with the id my-panel from the document's dom tree. it then uses javascript's date class to get the current date, which it converts into a string that has the format of yyyy.mm.dd. because the month is zero-based we also need to add one to the month. finally the label of our panel is set to "date: " and concatenated with t...
...nally the label of our panel is set to "date: " and concatenated with the date string that contains the formatted date. we use the function window.setinterval to update the date in case thunderbird is left running for more than one day. this allows us to call the startup function repeatedly with an interval of 60000ms (every minute). 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. « previousnext » ...
customDBHeaders Preference
ful attention to the case of the mailnews.customdbheaders preference. because comparisons are case-insensitive, all of the custom headers get set to lowercase when the data gets migrated to the message database. also, it has been brought to my attention that the delimiter has been changed to a space in the latest code. ...
...if the .msf file is rebuilt, all the msghdrs should have the string propert...
...if the .msf file is rebuilt, all the msghdrs should have the string property set correctly. the attaching of the column handler through the o...
...\n"); important be aware that only messages that are added to the .msf database after the customdbheaders pref is set will have the corresponding string property set on the msghdr. if the .msf file is rebuilt, all the msghdrs should have the string property set correctly. the attaching of the column handler through the observerservice object is some pretty new stuff, so i was using the addevent
listener("select"...) stuff as a backup. depending on the release you use one, both, or none of the methods may work. building the extension for this extension, i used a directory tree exactly like this: superfluous/ chrome.manifest install.rdf makefile chrome/ content/ superfluous.js ...
Plug-in Basics - Plugins
hotspots that link to new urls draw into sections on an html page communicate with javascript/dom from native code you can see which plug-ins are installed on your system and have been properly associated with the browser by consulting the installed plug-ins page. go to the help menu, and click help and then about plug-ins. type "about:plugins" in the location bar. the installed plug-ins page
lists each installed plug-in along with its mime type or types, description, file extensions, and the current state (enabled or disabled) of the plug-in for each mime type assigned to it. notice in view-source that this information is simply gathered from the javascript. because plug-ins are platform-specific, you must port them to every operating system and processor platform upon which you want to ...
...er directory /lib64/ --> this is symlinked (or bind mounted) desired proper directory more in https://wiki.debian.org/multiarch/thecaseformultiarch if something wrong, please edit. example fedora 64bit use: /lib/ --> for 32 bit libs /lib64/ --> for 64 bit libs plug-ins within toolkit bundles. to find out which plug-ins are currently installed visit about:plugins. gecko displays a page
listing all installed plug-ins and the mime types they handle, as well as optional descriptive information supplied by the plug-in. on windows, installed plug-ins are automatically configured to handle the mime types that they support. if multiple plug-ins handle the same mime type, the first plug-in registered handles the mime type. for information about the way mime types are assigned, see register...
...d> </object> using custom embed attributes in addition to these standard attributes, you can create private, plug-in-specific attributes and use them in the embed attribute to pass extra information between the html page and the plug-in code. the browser ignores these nonstandard attributes when parsing the html, but it passes all attributes to the plug-in, allowing the plug-in to examine the
list for any private attributes that could modify its behavior. for example, a plug-in that displays video could have private attributes that determine whether to start the plug-in automatically or loop the video automatically on playback, as in the following embed element: <embed src="myavi.avi" width="100" height="125" autostart="true" loop="true"> with this embed element, gecko passes the val...
...v = {"movie.avi", "100", "125", "true", "true"} gecko interprets the attributes as follows: src: load the data file and determine the mime type of the data. width and height: set the area of the page handled by the plug-in to 100 by 125 pixels. autostart and loop: ignore these private attributes and pass them along to the plug-in with the rest of the attributes. the plug-in must scan its
list of attributes to determine whether it should automatically start the video and loop it on playback. note that with an object element, param values are also sent in this array after the attributes, separated by a param entry. plug-in references the mozilla plug-ins project page « previousnext » ...
Plug-in Development Overview - Plugins
resource code for this language and character set combination is 040904e4. unix on unix, plug-ins are found according to the section how gecko finds plug-ins. to determine the mime types and file extensions that the plug-in handles, the browser loads each library and calls into the np_getmimedescription entry point. this exported c function should return a string containing the type, extension
list, and type description separated by colons. each mime types should be separated by semicolons. for example: image/xbm:xbm:x bitmap or for 2 mime types: image/xbm:xbm:x bitmap;image/png:png:portable network graphics. this information will then appear in the navigator.mimetypes dom object. npp_getvalue is called after the plug-in is initialized to get the scripting interface while np_getvalue is ca...
...late about:plugins. caution: gecko caches the values returned by these functions and will only call it if the plug-in's timestamp has changed. see bug 125469. mac os x mac os x plug-ins are found according to the section how gecko finds plug-ins. plug-ins are identified by file type nspl. to determine the supported mime types, gecko first checks for registry information in the plugins info.p
list. if nothing is found there, gecko checks for an np_getmimedescription entry point, and will use the information returned by this function. note: the resource method described below is deprecated. plugins should use the info.p
list approach, and only use the following method as a supplement to support older browsers. if neither is present, gecko will check the plugins resources. 'str#' 128 shou...
...is found there, gecko checks for an np_getmimedescription entry point, and will use the information returned by this function. note: the resource method described below is deprecated. plugins should use the info.p
list approach, and only use the following method as a supplement to support older browsers. if neither is present, gecko will check the plugins resources. 'str#' 128 should contain a
list of mime types and file extensions in alternating strings. for example: str 128 mime type string 1 video/quicktime string 2 mov, moov string 3 audio/aiff string 4 aiff string 5 image/jpeg string 6 jpg several other optional strings may contain useful information about the plug-in. plug-ins must support 'str...
...28 mime type string 1 video/quicktime string 2 mov, moov string 3 audio/aiff string 4 aiff string 5 image/jpeg string 6 jpg several other optional strings may contain useful information about the plug-in. plug-ins must support 'str#' 128 but are not required to support any of these others: str#' 127 can contain a
list of mime type descriptions corresponding to the types in 'str#' 128 . for example, this description
list corresponds to the types in the previous example: string 1: "quicktime video", string 4: "aiff audio", and string 5: "jpeg image format." str#' 126: string 1 can contain a descriptive message about the plug-in. this message, which is in html format, is displayed by the browser in its "about...
Search - Firefox Developer Tools
searching for files to search for a particular file, press control + p (or command + p on a mac) and type the search term. the source pane will display a
list of all matching files as you type. you can use the up and down arrows to move through the
list, and return to open the file you want: searching within a file to search for a particular substring in the file currently loaded into the source pane, press control + f (or command + f on a mac) while the source pane is focused. press return to search. ...
...d into the source pane, press control + f (or command + f on a mac) while the source pane is focused. press return to search. the debugger will display the number of matches in the code and highlight each result: using the outline tab if you are searching for a specific function within the current javascript file, you can use the outline tab in the debugger to find it quickly. ...
... tab if you are searching for a specific function within the current javascript file, you can use the outline tab in the debugger to find it quickly. the outline tab
lists the functions in the current file. the default sort order is by the order in the file but you can simplify the search by click on "sort by name" at the bottom of the tab. you can further simplify the search by filtering the
list. enter text into the text input above the
list to limit the results in the outline. 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 i...
... are searching through a file with dozens of functions, it comes in handy. searching in all files you can also search for a string in all of the files included in the currently opened project. press shift + ctrl + f (windows and linux) or shift + cmd + f (macos) and then enter the string you are trying to find. if the string exists in any of the files in the project, the search will return a
list showing a
list by file and line number. click on any entry in the
list to go directly to the line in the file where the string occurs. ...
DevTools API - Firefox Developer Tools
toolpanel implementation. // in the tooldefintion object, do // build: (window, target) => new mypanel(window, target), function mypanel(window, target) { // the window object that has loaded the url defined in the tooldefinition this.window = window; // the target this toolbox is debugging. this.target = target; // do synchronous initialization here. window.document.body.addevent
listener("click", this.handleclick); } mypanel.prototype = { open: function() { // any asynchronous operations should be done here. return this.dosomethingasynchronous() .then(() => this); }, destroy: function() { // synchronous destruction. this.window.document.body.removeevent
listener("click", this.handleclick); // async destruction. return this.destroysomethin...
... return this.destroysomethingasynchronosly() .then(() => console.log("destroyed")); }, handleclick: function(event) { console.log("clicked", event.originaltarget); }, }; eventemitter eventemitter is an interface many developer tool classes and objects implement and use to notify others about changes in their internal state. when an event is emitted on the eventemitter, the
listeners will be called with the event name as the first argument and the extra arguments are spread as the remaining parameters. note: some components use add-on sdk event module instead of the devtools eventemitter. unfortunately, their api's are a bit different and it's not always evident which one a certain component is using. the main differences between the two modules are that the first para...
...work for unifying the event paradigms is ongoing in bug 952653. methods the following methods are available on objects that have been decorated with the eventemitter interface. emit(eventname, ...extraarguments) emits an event with the given name to this object. parameters: eventname {string} - the name of the event. extraarguments {...any} - extra arguments that are passed to the
listeners. on(eventname,
listener) adds a
listener for the given event. off(eventname,
listener) removes the previously added
listener from the event. once(eventname,
listener) adds a
listener for the event that is removed after it has been emitted once. return value: a promise that is fulfilled with the first extra argument for the event when then event is emitted. if the event ...
... removes the previously added
listener from the event. once(eventname,
listener) adds a
listener for the event that is removed after it has been emitted once. return value: a promise that is fulfilled with the first extra argument for the event when then event is emitted. if the event contains multiple payload arguments, the rest are discarded and can only be received by providing the
listener function to this method. examples here's a few examples using the gdevtools object. let oninit = (eventname, toolbox, netmonitor) => console.log("netmonitor initialized!"); // attach a
listener. gdevtools.on("netmonitor-init", oninit); // remove a
listener. gdevtools.off("netmonitor-init", oninit); // attach a one time
listener. gdevtools.once("netmonitor-init", (eventname, toolbox, ne...
AudioTrack.label - Web APIs
if one is available in the track metadata. otherwise, an empty string ("") is returned. for example, a track whose kind is "commentary" might have a label such as "commentary with director mark markmarkimark and star donna donnalidon". example this example returns an array of track kinds and labels for potential use in a user interface to select audio tracks for a specified media element. ...
... returned. for example, a track whose kind is "commentary" might have a label such as "commentary with director mark markmarkimark and star donna donnalidon". example this example returns an array of track kinds and labels for potential use in a user interface to select audio tracks for a specified media element. the
list is filtered to only allow certain track kinds through. ...
...e, a track whose kind is "commentary" might have a label such as "commentary with director mark markmarkimark and star donna donnalidon". example this example returns an array of track kinds and labels for potential use in a user interface to select audio tracks for a specified media element. the
list is filtered to only allow certain track kinds through. ...
... potential use in a user interface to select audio tracks for a specified media element. the
list is filtered to only allow certain track kinds through. function gettrack
list(el) { var track
list = []; const wantedkinds = [ "main", "alternative", "main-desc", "translation", "commentary" ]; el.audiotracks.foreach(function(track) { if (wantedkinds.includes(track.kind)) { track
list.push({ id: track.id, kind: track.kind, label: track.label }); } }); return track
list; } the resulting track
list contains an array of audio tracks whose kind is one of those in the array wantedkinds, with each entry providing the track's id, kind, and label. specifications specification status comment html living standardthe defi...
AudioTrack.language - Web APIs
audio track, or an empty string ("") if the language is not specified or known, or if the track doesn't contain speech. for example, if the primary language used in the track is united states english, this value would be "en-us". for brazilian portuguese, the value would be "pt-br". ...
...k is united states english, this value would be "en-us". for brazilian portuguese, the value would be "pt-br". example this example locates all of a media element's primary language and translated audio tracks and returns a
list of objects containing each of those tracks' id, kind, and language. this could then be used to build a user interface for selecting the language the user would like to
listen to while watching a movie, for example. ...
...d be "pt-br". example this example locates all of a media element's primary language and translated audio tracks and returns a
list of objects containing each of those tracks' id, kind, and language. this could then be used to build a user interface for selecting the language the user would like to
listen to while watching a movie, for example. ...
...hose tracks' id, kind, and language. this could then be used to build a user interface for selecting the language the user would like to
listen to while watching a movie, for example. function getavailablelanguages(el) { var track
list = []; const wantedkinds = [ "main", "translation" ]; el.audiotracks.foreach(function(track) { if (wantedkinds.includes(track.kind)) { track
list.push({ id: track.id, kind: track.kind, language: track.language }); } }); return track
list; } specifications specification status comment html living standardthe definition of 'audiotrack.language' in that specification. living standard html5the definition of 'audiotrack.language' in that specification. recomm...
Body.json() - Web APIs
uld be anything that can be represented by json — an object, an array, a string, a number... example in our fetch json example (run fetch json live), we create a new request using the request() constructor, then use it to fetch a .json file. ...
......
... is successful, we read and parse the data using json(), then read values out of the resulting objects as you'd expect and insert them into
list items to display our product data. const my
list = document.queryselector('ul'); const myrequest = new request('products.json'); fetch(myrequest) .then(response => response.json()) .then(data => { for (const product of data.products) { let
listitem = document.createelement('li');
listitem.appendchild( document.createelement('strong') ).textcontent = product.name;
listitem.append( ` can be found in ${ product.location }. ...
...oducts.json'); fetch(myrequest) .then(response => response.json()) .then(data => { for (const product of data.products) { let
listitem = document.createelement('li');
listitem.appendchild( document.createelement('strong') ).textcontent = product.name;
listitem.append( ` can be found in ${ product.location }. cost: ` );
listitem.appendchild( document.createelement('strong') ).textcontent = `£${product.price}`; my
list.appendchild(
listitem); } }) .catch(console.error); specifications specification status comment fetchthe definition of 'body.json()' in that specification. living standard initial definition ...
BroadcastChannel: message event - Web APIs
nt is fired on a broadcastchannel object when a message arrives on that channel. bubbles no cancelable no interface messageevent event handler property onmessage examples live example in this example there's a "sender" <iframe> that broadcasts the contents of a <textarea> when the user clicks a button. there are two "receiver" iframes that
listen to the broadcast message and write the result into a <div> element. sender <h1>sender</h1> <label for="message">type a message to broadcast:</label><br/> <textarea id="message" name="message" rows="1" cols="40">hello</textarea> <button id="broadcast-message" type="button">broadcast message</button> body { border: 1px solid black; padding: .5rem; height: 150px; font-famil...
...sans", sans-serif; margin-bottom: 1rem; } textarea { padding: .2rem; } label, br { margin: .5rem 0; } button { vertical-align: top; height: 1.5rem; } const channel = new broadcastchannel('example-channel'); const messagecontrol = document.queryselector('#message'); const broadcastmessagebutton = document.queryselector('#broadcast-message'); broadcastmessagebutton.addevent
listener('click', () => { channel.postmessage(messagecontrol.value); }) receiver 1 <h1>receiver 1</h1> <div id="received"></div> body { border: 1px solid black; padding: .5rem; height: 100px; font-family: "fira sans", sans-serif; } h1 { font: 1.6em "fira sans", sans-serif; margin-bottom: 1rem; } const channel = new broadcastchannel('example-channel'); channel.addev...
...r('click', () => { channel.postmessage(messagecontrol.value); }) receiver 1 <h1>receiver 1</h1> <div id="received"></div> body { border: 1px solid black; padding: .5rem; height: 100px; font-family: "fira sans", sans-serif; } h1 { font: 1.6em "fira sans", sans-serif; margin-bottom: 1rem; } const channel = new broadcastchannel('example-channel'); channel.addevent
listener('message', (event) => { received.textcontent = event.data; }); receiver 2 <h1>receiver 2</h1> <div id="received"></div> body { border: 1px solid black; padding: .5rem; height: 100px; font-family: "fira sans", sans-serif; } h1 { font: 1.6em "fira sans", sans-serif; margin-bottom: 1rem; } const channel = new broadcastchannel('example-channel'); channel.addevent...
...ener('message', (event) => { received.textcontent = event.data; }); receiver 2 <h1>receiver 2</h1> <div id="received"></div> body { border: 1px solid black; padding: .5rem; height: 100px; font-family: "fira sans", sans-serif; } h1 { font: 1.6em "fira sans", sans-serif; margin-bottom: 1rem; } const channel = new broadcastchannel('example-channel'); channel.addevent
listener('message', (event) => { received.textcontent = event.data; }); result specifications specification status html living standard living standard ...
BroadcastChannel: messageerror event - Web APIs
the messageerror event is fired on a broadcastchannel object when a message arrives on the channel that can't be deserialized. ...
... the messageerror event is fired on a broadcastchannel object when a message arrives on the channel that can't be deserialized. ...
...t is fired on a broadcastchannel object when a message arrives on the channel that can't be deserialized. ...
... deserialized. ...
Using the CSS Painting API - Web APIs
three parameters of the paint() function include the drawing context, paint size and properties. to be able to access properties, we include the static inputproperties() method, which provides live access to css properties, including regular properties and custom properties, and returns an array of property names. we'll take a look at inputarguments in the last section. example let's create a
list of items with a background image that rotates between three different colors and three widths. in our css, we provide a different color and a width subtractor for the background box we've created via the --boxcolor and --widthsubtractor custom properties. <ul> <li>item 1</li> <li>item 2</li> <li>item 3</li> <li>item 4</li> <li>item 5</li> <li>item 6</li> <li>item 7...
... // use our custom arguments const hasstroke = args[0].tostring(); // if stroke arg is 'stroke', don't fill if (hasstroke === 'stroke') { ctx.fillstyle = 'transparent'; ctx.strokestyle = colour; } ... } we can pass more than one argument. li { background-image: paint(hollowhighlights, stroke, 10px); } we can also specify that we want a particular type of argument. when we get our
list of argument values, we ask specifically for a <length> unit. static get inputarguments() { return ['*', '<length>']; } in this case, we specifically requested the <length> attribute. the first element in the returned array will be a cssunparsedvalue. the second will be a cssstylevalue. if the custom argument is a css value, for instance a unit, we can invoke typed om cssstylevalue class (and s...
... be a cssstylevalue. if the custom argument is a css value, for instance a unit, we can invoke typed om cssstylevalue class (and sub classes) by using the value type keyword when we retrieve it in the registerpaint() function. let's say we add a second argument with how many pixels wide we want the stroke to be: li { background-image: paint(hollowhighlights, stroke, 10px); } when we get our
list of argument values, we can ask specifically for a <length> unit. static get inputarguments() { return ['*', '<length>']; } now we can access the type and value properties, meaning we can get the number of pixels and a number type right out of the box. (admittedly, ctx.linewidth takes a float as a value rather than a value with length units, but for example's sake...) paint(ctx, size, props, a...
...gisterpaint('hollowhighlights', class { static get inputproperties() { return ['--boxcolor']; } // input arguments that can be passed to the `paint` function static get inputarguments() { return ['*','']; } static get contextoptions() { return {alpha: true}; } paint(ctx, size, props, args) { // ctx -> drawing context // size -> size of the box being painted // props ->
list of custom properties available to the element // args ->
list of arguments set when calling the paint() function in the css // where to start the highlight & dimensions const x = 0; const y = size.height * 0.3; const blockwidth = size.width * 0.33; const blockheight = size.height * 0.85; // the values passed in the paint() function in the css const colour = props.get( '--boxcolo...
CacheStorage.keys() - Web APIs
the keys() method of the cachestorage interface returns a promise that will resolve with an array containing strings corresponding to all of the named cache objects tracked by the cachestorage object in the order they were created. use this method to iterate over a
list of all cache objects. you can access cachestorage through the global caches property. syntax caches.keys().then(function(key
list) { //do something with your key
list }); parameters none. ...
... caches.keys().then(function(key
list) { //do something with your key
list }); parameters none. return value a promise that resolves with an array of the cache names inside the cachestorage object. examples in this code snippet we wait for an activate event, and then run a waituntil() block that clears up any old, unused caches before a new service worker is activated. here we have a white
list containing the names of the caches we want to keep (cachewhite
list). we return the keys of the caches in the cachestorage object using keys(), then check each key to see if it is in the white
list. if not, we delete it using cachestorage.delete(). ...
... and then run a waituntil() block that clears up any old, unused caches before a new service worker is activated. here we have a white
list containing the names of the caches we want to keep (cachewhite
list). we return the keys of the caches in the cachestorage object using keys(), then check each key to see if it is in the white
list. if not, we delete it using cachestorage.delete(). ...
...d, unused caches before a new service worker is activated. here we have a white
list containing the names of the caches we want to keep (cachewhite
list). we return the keys of the caches in the cachestorage object using keys(), then check each key to see if it is in the white
list. if not, we delete it using cachestorage.delete(). then.addevent
listener('activate', function(event) { var cachewhite
list = ['v2']; event.waituntil( caches.keys().then(function(key
list) { return promise.all(key
list.map(function(key) { if (cachewhite
list.indexof(key) === -1) { return caches.delete(key); } }); }) ); }); specifications specification status comment service workersthe definition of 'cachestorage: keys' in that specification. ...
CacheStorage - Web APIs
orage.delete() finds the cache object matching the cachename, and if found, deletes the cache object and returns a promise that resolves to true. if no cache object is found, it resolves to false. cachestorage.keys() returns a promise that will resolve with an array containing strings corresponding to all of the named cache objects tracked by the cachestorage. use this method to iterate over a
list of all the cache objects. examples this code snippet is from the mdn sw-test example (see sw-test running live.) this service worker script waits for an installevent to fire, then runs waituntil to handle the install process for the app. this consists of calling cachestorage.open to create a new cache, then using cache.addall to add a series of assets to it. in the second code block, we wait ...
...ve that. if not, fetch the request from the network, then also open the cache created in the first block and add a clone of the request to it using cache.put (cache.put(event.request, response.clone()).) if this fails (e.g. because the network is down), return a fallback response. finally, return whatever the custom response ended up being equal to, using fetchevent.respondwith. ...
...a fallback response. finally, return whatever the custom response ended up being equal to, using fetchevent.respondwith. ...
...tion(cache) { return cache.addall([ '/sw-test/', '/sw-test/index.html', '/sw-test/style.css', '/sw-test/app.js', '/sw-test/image-
list.js', '/sw-test/star-wars-logo.jpg', '/sw-test/gallery/bountyhunters.jpg', '/sw-test/gallery/mylittlevader.jpg', '/sw-test/gallery/snowtroopers.jpg' ]); }) ); }); self.addevent
listener('fetch', function(event) { event.respondwith(caches.match(event.request).then(function(response) { // caches.match() always resolves // but in case of success response will have value if (response !== undefined) { return response; } else { return fetch(event.request).then(function (response) { // response may be used only once // we need to save c...
Drawing text - Web APIs
measuretext() returns ...
... measuretext() returns a textmetrics object containing the width, in pixels, that the specified text will be when...
... measuretext() returns a textmetrics object containing the width, in pixels, that the specified text will be when drawn in the current text style. the following code snippet shows how...
...); var edit = document.getelementbyid('edit'); var code = textarea.value; function drawcanvas() { ctx.clearrect(0, 0, canvas.width, canvas.height); eval(textarea.value); } reset.addevent
listener('click', function() { textarea.value = code; drawcanvas(); }); edit.addevent
listener('click', function() { textarea.focus(); }) textarea.addevent
listener('input', drawcanvas); window.addevent
listener('load', drawcanvas); advanced text measurements in the case you need to obtain more details about the text, the following method allows you to measure it. measuretext() returns a textmetrics object containing the width, in pixels, that the specified text will be when drawn in the current text style. the following code snippet shows how you can measure a text and get its width. fu...
Pixel manipulation with canvas - Web APIs
for example, to paint the entire image represented by myimagedata to...
... we get the position of the mouse and crop an image of 5 pixels left and a...
... we get the position of the mouse and crop an image of 5 pixels left and above to 5 pixels right and below. then we copy that one over to another canvas and resize the image to the size ...
... var zoomctx = document.getelementbyid('zoom').getcontext('2d'); var smoothbtn = document.getelementbyid('smoothbtn'); var togglesmoothing = function(event) { zoomctx.imagesmoothingenabled = this.checked; zoomctx.mozimagesmoothingenabled = this.checked; zoomctx.webkitimagesmoothingenabled = this.checked; zoomctx.msimagesmoothingenabled = this.checked; }; smoothbtn.addevent
listener('change', togglesmoothing); var zoom = function(event) { var x = event.layerx; var y = event.layery; zoomctx.drawimage(canvas, math.min(math.max(0, x - 5), img.width - 10), math.min(math.max(0, y - 5), img.height - 10), 10, 10, 0, 0, 200, 200); }; canvas.addeventli...
ContentIndex - Web APIs
x interface of the content index api allows developers to register their offline enabled content with the browser. properties there are no properties of this interface. methods contentindex.add registers an item with the content index. contentindex.delete unregisters an item from the currently indexed content. contentindex.getall returns a promise that resolves with an iterable
list of content index entries. examples feature detection and interface access here we get a reference to the serviceworkerregistration, then check for the index property, which gives us access to the content index interface. // reference registration const registration = await navigator.serviceworker.ready; // feature detection if ('index' in registration) { // content index api functionali...
...ature detect content index if (!registration.index) { return; } // register content try { await registration.index.add(data); } catch (e) { console.log('failed to register content: ', e.message); } } retrieving items within the current index the below example shows an asynchronous function that retrieves items within the content index and iterates over each entry, building a
list for the interface. async function createreading
list() { // access our service worker registration const registration = await navigator.serviceworker.ready; // get our index entries const entries = await registration.index.getall(); // create a containing element const reading
listelem = document.createelement('div'); // test for entries if (!array.length) { // if there are...
...index entries const entries = await registration.index.getall(); // create a containing element const reading
listelem = document.createelement('div'); // test for entries if (!array.length) { // if there are no entries, display a message const message = document.createelement('p'); message.innertext = 'you currently have no articles saved for offline reading.' reading
listelem.append(message); } else { // if entries are present, display in a
list of links to the content const
listelem = document.createelement('ul'); for (const entry of entries) { const
listitem = document.createelement('li'); const anchorelem = document.createelement('a'); anchorelem.innertext = entry.title; anchorelem.setattribute('href', entry.url); ...
...em.append(message); } else { // if entries are present, display in a
list of links to the content const
listelem = document.createelement('ul'); for (const entry of entries) { const
listitem = document.createelement('li'); const anchorelem = document.createelement('a'); anchorelem.innertext = entry.title; anchorelem.setattribute('href', entry.url);
listelem.append(
listitem); } reading
listelem.append(
listelem); } } unregistering indexed content below is an asynchronous function, that removes an item from the content index. async function unregistercontent(article) { // reference registration const registration = await navigator.serviceworker.ready; // feature detect content index if (!registration.index) return; ...
Content Index API - Web APIs
ature detect content index if (!registration.index) { return; } // register content try { await registration.index.add(data); } catch (e) { console.log('failed to register content: ', e.message); } } retrieving items within the current index the below example shows an asynchronous function that retrieves items within the content index and iterates over each entry, building a
list for the interface. async function createreading
list() { // access our service worker registration const registration = await navigator.serviceworker.ready; // get our index entries const entries = await registration.index.getall(); // create a containing element const reading
listelem = document.createelement('div'); // test for entries if (!array.length) { // if there are...
...index entries const entries = await registration.index.getall(); // create a containing element const reading
listelem = document.createelement('div'); // test for entries if (!array.length) { // if there are no entries, display a message const message = document.createelement('p'); message.innertext = 'you currently have no articles saved for offline reading.' reading
listelem.append(message); } else { // if entries are present, display in a
list of links to the content const
listelem = document.createelement('ul'); for (const entry of entries) { const
listitem = document.createelement('li'); const anchorelem = document.createelement('a'); anchorelem.innertext = entry.title; anchorelem.setattribute('href', entry.url); ...
...em.append(message); } else { // if entries are present, display in a
list of links to the content const
listelem = document.createelement('ul'); for (const entry of entries) { const
listitem = document.createelement('li'); const anchorelem = document.createelement('a'); anchorelem.innertext = entry.title; anchorelem.setattribute('href', entry.url);
listelem.append(
listitem); } reading
listelem.append(
listelem); } } unregistering indexed content below is an asynchronous function, that removes an item from the content index. async function unregistercontent(article) { // reference registration const registration = await navigator.serviceworker.ready; // feature detect content index if (!registration.index) return; ...
... of the service worker. they are accessible from the workerglobalscope.self property: // service worker script self.registration.index.add(item); self.registration.index.delete(item.id); const contentindexitems = self.registration.index.getall(); contentdelete event when an item is removed from the user agent interface, a contentdelete event is received by the service worker. self.addevent
listener('contentdelete', (event) => { console.log(event.id); // logs content index id, which can then be used to determine what content to delete from your cache }); the contentdelete event is only fired when the deletion happens due to interaction with the browser's built-in user interface. it is not fired when the contentindex.delete method is called. specifications specification...
DataTransfer.clearData() - Web APIs
g operation's drag data for the given type. if data for the given type does not exist, this method does nothing. if this method is called with no arguments or the format is an empty string, the data of all types will be removed. this method does not remove files from the drag operation, so it's possible for there still to be an entry with the type "files" left in the object's datatransfer.types
list if there are any files included in the drag. this method can only be used in the handler for the dragstart event, because that's the only time the drag operation's data store is writeable. syntax datatransfer.cleardata([format]); parameters format optional a string which specifies the type of data to remove. if this parameter is an empty string or is not provided, the data for all type...
...ve the element. ...
... border: 1px solid black; } javascript window.addevent
listener('domcontentloaded', function () { // select html elements var draggable = document.getelementbyid('source'); var dropable = document.getelementbyid('target'); var status = document.getelementbyid('status'); var data = document.getelementbyid('data'); var dropped = false; // register event handlers draggable.addevent
listener('dragstart', dragstarthandler); draggable.addevent
listener('dragend', dragendhandler); dropable.addevent
listener('dragover', dragoverhandler); dropable.addevent
listener('dragleave', dragleavehandler); dropable.addevent
listener('drop', drophandler); function dragstarthandler (event) { status.innerhtml = 'drag in process'; // change target element's border to signify drag ha...
...rhtml = event.datatransfer.getdata('text/plain'); } function dragendhandler (event) { if (!dropped) { status.innerhtml = 'drag canceled'; } data.innerhtml = event.datatransfer.getdata('text/plain') || 'empty'; // change border to signify drag is no longer in process event.currenttarget.style.border = '1px solid black'; if (dropped) { // remove all event
listeners draggable.removeevent
listener('dragstart', dragstarthandler); draggable.removeevent
listener('dragend', dragendhandler); dropable.removeevent
listener('dragover', dragoverhandler); dropable.removeevent
listener('dragleave', dragleavehandler); dropable.removeevent
listener('drop', drophandler); } } function dragoverhandler (event) { status.innerhtml = 'd...
DataTransfer.mozTypesAt() - Web APIs
example this example shows the use of the moztypesat() method in a drop event handler. ...
... example this example shows the use of the moztypesat() method in a drop event handler. ...
... example this example shows the use of the moztypesat() method in a drop event handler. ...
... example this example shows the use of the moztypesat() method in a drop event handler. ...
DataTransfer - Web APIs
standard properties datatransfer.dropeffect gets the type of drag-and-drop operation currently selected or sets the operation to a new type. the value must be none, copy, link or move. datatransfer.effectallowed provides all of the types of operations that are possible. must be one of none, copy, copylink, copymove, link, linkmove, move, all or uninitialized. datatransfer.files contains a
list of all the local files available on the data transfer. if the drag operation doesn't involve dragging files, this property is an empty
list. datatransfer.items read only gives a datatransferitem
list object which is a
list of all of the drag data. datatransfer.types read only an array of strings giving the formats that were set in the dragstart event. gecko properties note: all of the ...
... does not exist, or the data transfer contains no data, this method will have no effect. datatransfer.getdata() retrieves the data for a given type, or an empty string if data for that type does not exist or the data transfer contains no data. datatransfer.setdata() set the data for a given type. if data for the type does not exist, it is added at the end, such that the last item in the types
list will be the new format. if data for the type already exists, the existing data is replaced in the same position. datatransfer.setdragimage() set the image to be used for dragging if a custom one is desired. gecko methods note: all of the methods in this section are gecko-specific. datatransfer.addelement() sets the drag source to the given element. deprecated methods datatransfer...
...1. datatransfer.mozsetdataat() a data transfer may store multiple items, each at a given zero-based index. mozsetdataat() may only be called with an index argument less than mozitemcount in which case an existing item is modified, or equal to mozitemcount in which case a new item is added, and the mozitemcount is incremented by one. removed in firefox 71. ...
...mozitemcount in which case an existing item is modified, or equal to mozitemcount in which case a new item is added, and the mozitemcount is incremented by one. removed in firefox 71. datatransfer.moztypesat() holds a
list of the format types of the data that is stored for an item at the specified index. if the index is not in the range from 0 to the number of items minus one, an empty string
list is returned. removed in firefox 71. examples every method and property
listed in this document has its own reference page and each reference page either directly includes an example of the interface or has a link to an example. specifications specification status comment html living standardthe definition of 'datatransfer' in that specification. living standard ...
DirectoryReaderSync - Web APIs
his interface, readentries(), create the directoryentrysync object. but directoryentrysync (as well as fileentrysync) is not a data type that you can pass between a calling app and web worker thread. it's not a big deal, because you don't really need to have the main app and the worker thread see the same javascript object; you just need them to access the same files. you can do that by passing a
list of filesystem: urls—which are just strings—instead of a
list of entries. you can also use the filesystem: url to look up the entry with resolvelocalfilesystemurl(). that gets you back to a directoryentrysync (as well as fileentrysync) object. example in the following code snippet from html5rocks, we create web workers and pass data from it to the main app. // taking care of the browser-sp...
... window.webkitresolvelocalfilesystemurl; // create web workers var worker = new worker('worker.js'); worker.onmessage = function(e) { var urls = e.data.entries; urls.foreach(function(url, i) { window.resolvelocalfilesystemurl(url, function(fileentry) { // print out file's name. console.log(fileentry.name); }); }); }; worker.postmessage({'cmd': '
list'}); the following is worker.js code that gets the contents of the directory. // taking care of the browser-specific prefixes. self.requestfilesystemsync = self.webkitrequestfilesystemsync || self.requestfilesystemsync; // global for holding the
list of entry file system urls. var paths = []; function getallentries(dirreader) { var entries = dirreader.readentrie...
...i) { // stash this entry's filesystem in url paths.push(entry.tourl()); // if this is a directory, traverse. if (entry.isdirectory) { getallentries(entry.createreader()); } } } // forward the error to main app. ...
...l paths.push(entry.tourl()); // if this is a directory, traverse. if (entry.isdirectory) { getallentries(entry.createreader()); } } } // forward the error to main app. function onerror(e) { postmessage('error: ' + e.tostring()); } self.onmessage = function(e) { var data = e.data; // ignore everything else except our '
list' command. if (!data.cmd || data.cmd != '
list') { return; } try { var fs = requestfilesystemsync(temporary, 1024*1024 /*1mb*/); getallentries(fs.root.createreader()); self.postmessage({entries: paths}); } catch (e) { onerror(e); } }; method overview entrysync readentries () raises (fileexception); method readentries() returns a lost of entries from a specific directory. call this method unt...
Document.createElement() - Web APIs
} } // define the new element custome...
...y created div newdiv.appendchild(newcontent); // add the newly created element and its content into the dom const currentdiv = document.getelementbyid("div1"); document.body.insertbefore(newdiv, currentdiv); } web component example the following example snippet is taken from our expanding-
list-web-component example (see it live also). in this case, our custom element extends the htmlu
listelement, which represents the <ul> element. ...
...t into the dom const currentdiv = document.getelementbyid("div1"); document.body.insertbefore(newdiv, currentdiv); } web component example the following example snippet is taken from our expanding-
list-web-component example (see it live also). in this case, our custom element extends the htmlu
listelement, which represents the <ul> element. // create a class for the element class expanding
list extends htmlu
listelement { constructor() { // always call super first in constructor super(); // constructor definition left out for brevity ... ...
...e it live also). in this case, our custom element extends the htmlu
listelement, which represents the <ul> element. // create a class for the element class expanding
list extends htmlu
listelement { constructor() { // always call super first in constructor super(); // constructor definition left out for brevity ... } } // define the new element customelements.define('expanding-
list', expanding
list, { extends: "ul" }); if we wanted to create an instance of this element programmatically, we'd use a call along the following lines: let expanding
list = document.createelement('ul', { is : 'expanding-
list' }) the new element will be given an is attribute whose value is the custom element's tag name. note: for backwards compatibility with previous versions of the custom elemen...
Document: drag event - Web APIs
</div> </div> <div class="dropzone"></div> <div class="dropzone"></div> <div class="dropzone"></div> css #draggable { width: 200px; height: 20px; text-align: center; background: white; } .dropzone { width: 200px; height: 20px; background: blueviolet; margin-bottom: 10px; padding: 10px; } javascript var dragged; /* events fired on the draggable target */ document.addevent
listener("drag", function(event) { }, false); document.addevent
listener("dragstart", function(event) { // store a ref. on the dragged elem dragged = event.target; // make it half transparent event.target.style.opacity = .5; }, false); document.addevent
listener("dragend", function(event) { // reset the transparency event.target.style.opacity = ""; }, false); /* events fired on the drop ...
... { }, false); document.addevent
listener("dragstart", function(event) { // store a ref. ...
...target; // make it half transparent event.target.style.opacity = .5; }, false); document.addevent
listener("dragend", function(event) { // reset the transparency event.target.style.opacity = ""; }, false); /* events fired on the drop targets */ document.addevent
listener("dragover", function(event) { // prevent default to allow drop event.preventdefault(); }, false); document.addevent
listener("dragenter", function(event) { // highlight potential drop target when the draggable element enters it if (event.target.classname == "dropzone") { event.target.style.background = "purple"; } }, false); document.addevent
listener("dragleave", function(event) { // reset background of potential drop target when the draggable element leaves it if (event.target.classname == "dropzon...
...e draggable element enters it if (event.target.classname == "dropzone") { event.target.style.background = "purple"; } }, false); document.addevent
listener("dragleave", function(event) { // reset background of potential drop target when the draggable element leaves it if (event.target.classname == "dropzone") { event.target.style.background = ""; } }, false); document.addevent
listener("drop", function(event) { // prevent default action (open as link for some elements) event.preventdefault(); // move dragged elem to the selected drop target if (event.target.classname == "dropzone") { event.target.style.background = ""; dragged.parentnode.removechild( dragged ); event.target.appendchild( dragged ); } }, false); specifications specification ...
Document: gotpointercapture event - Web APIs
the gotpointercapture event is fired when an element captures a pointer using setpointercapture(). bubbles no cancelable no interface pointerevent event handler property ongotpointercapture examples this example gets a <p> element and
listens for the gotpointercapture event. it then calls setpointercapture() on the element on a pointerdown event, which will trigger gotpointercapture. ...
... bubbles no cancelable no interface pointerevent event handler property ongotpointercapture examples this example gets a <p> element and
listens for the gotpointercapture event. it then calls setpointercapture() on the element on a pointerdown event, which will trigger gotpointercapture. ...
...handler property ongotpointercapture examples this example gets a <p> element and
listens for the gotpointercapture event. it then calls setpointercapture() on the element on a pointerdown event, which will trigger gotpointercapture. ...
...t.addevent
listener('gotpointercapture', () => { console.log('i\'ve been captured!') }); para.addevent
listener('pointerdown', (event) => { para.setpointercapture(event.pointerid); }); the same example, using the ongotpointercapture event handler property: const para = document.queryselector('p'); document.ongotpointercapture = () => { console.log('i\'ve been captured!') }; para.addevent
listener('pointerdown', (event) => { para.setpointercapture(event.pointerid); }); specifications specification status pointer events obsolete ...
Document: lostpointercapture event - Web APIs
the lostpointercapture event is fired when a captured pointer is released. bubbles no cancelable no interface pointerevent event handler property onlostpointercapture examples this example
listens for the lostpointercapture event, and captures the pointer for an element on pointerdown. when the user subsequently releases the pointer, the lostpointercapture event will be fired. ...
... cancelable no interface pointerevent event handler property onlostpointercapture examples this example
listens for the lostpointercapture event, and captures the pointer for an element on pointerdown. when the user subsequently releases the pointer, the lostpointercapture event will be fired. ...
... onlostpointercapture examples this example
listens for the lostpointercapture event, and captures the pointer for an element on pointerdown. when the user subsequently releases the pointer, the lostpointercapture event will be fired. ...
...ent
listener('lostpointercapture', () => { console.log('i\'ve been released!') }); para.addevent
listener('pointerdown', (event) => { para.setpointercapture(event.pointerid); }); the same example, but using the onlostpointercapture event handler property: const para = document.queryselector('p'); document.onlostpointercapture = () => { console.log('i\'ve been released!') }; para.addevent
listener('pointerdown', (event) => { para.setpointercapture(event.pointerid); }); specifications specification status pointer events obsolete ...
DocumentFragment - Web APIs
unsigned long giving the amount of children that the documentfragment has. methods this interface inherits the methods of its parent, node, and implements those of the parentnode interface. documentfragment.queryselector() returns the first element node within the documentfragment, in document order, that matches the specified selectors. documentfragment.queryselectorall() returns a node
list of all the element nodes within the documentfragment that match the specified selectors. documentfragment.getelementbyid() returns the first element node within the documentfragment, in document order, that matches the specified id. functionally equivalent to document.getelementbyid(). usage notes a common use for documentfragment is to create one, assemble a dom subtree within it, then appe...
...ow and render is triggered instead of potentially one for each node inserted if they were inserted separately. this interface is also of great use with web components: <template> elements contain a documentfragment in their htmltemplateelement.content property. an empty documentfragment can be created using the document.createdocumentfragment() method or the constructor. ...
...tead of potentially one for each node inserted if they were inserted separately. this interface is also of great use with web components: <template> elements contain a documentfragment in their htmltemplateelement.content property. an empty documentfragment can be created using the document.createdocumentfragment() method or the constructor. ...
... node inserted if they were inserted separately. this interface is also of great use with web components: <template> elements contain a documentfragment in their htmltemplateelement.content property. an empty documentfragment can be created using the document.createdocumentfragment() method or the constructor. example html <ul id="
list"></ul> javascript var
list = document.queryselector('#
list') var fruits = ['apple', 'orange', 'banana', 'melon'] var fragment = new documentfragment() fruits.foreach(function (fruit) { var li = document.createelement('li') li.innerhtml = fruit fragment.appendchild(li) })
list.appendchild(fragment) result specifications specification status comment domthe definition of 'documentfragment' in that specification. ...
Element: blur event - Web APIs
html <form id="form"> <input type="te...
... html <form id="form"> <input type="text" placeholder="text input"> <input type="password" placeholder="password"> </form> javascr...
...eryselector('input[type="password"]'); password.addevent
listener('focus', (event) => { event.target.style.background = 'pink'; }); password.addevent
listener('blur', (event) => { event.target.style.background = ''; }); result event delegation there are two ways of implementing event delegation for this event: by using the focusout event, or by setting the usecapture parameter of addevent
listener() to true. ...
...); result event delegation there are two ways of implementing event delegation for this event: by using the focusout event, or by setting the usecapture parameter of addevent
listener() to true. html <form id="form"> <input type="text" placeholder="text input"> <input type="password" placeholder="password"> </form> javascript const form = document.getelementbyid('form'); form.addevent
listener('focus', (event) => { event.target.style.background = 'pink'; }, true); form.addevent
listener('blur', (event) => { event.target.style.background = ''; }, true); result specifications specification status comment ui events working draft added info that this event is composed. document object model (dom) level 3 events specification obsole...
Element.computedStyleMap() - Web APIs
ent interface returns a stylepropertymapreadonly interface which provides a read-only representation of a css declaration block that is an alternative to cssstyledeclaration. syntax var stylepropertymapreadonly = element.computedstylemap() parameters none. return value a stylepropertymapreadonly interface. examples we start with some simple html: a paragraph with a link, and a definition
list to which we will add all the css property / value pairs. <p> <a href="https://example.com">link</a> </p> <dl id="regurgitation"></dl> we add a little bit of css a { --colour: red; color: var(--colour); } we add javascript to grab our link and return back a definition
list of all the css property values using computedstylemap(). // get the element const myelement = document.queryselect...
... <p> <a href="https://example.com">link</a> </p> <dl id="regurgitation"></dl> we add a little bit of css a { --colour: red; color: var(--colour); } we add javascript to grab our link and return back a definition
list of all the css property values using computedstylemap(). ...
...in other browsers you'll just see a link. did you realize how many default css properties a link had? update the 'a' t...
...e map of all the properties and values, adding a <dt> and <dd> for each for (const [prop, val] of allcomputedstyles) { // properties const cssproperty = document.createelement('dt'); cssproperty.appendchild(document.createtextnode(prop)); styles
list.appendchild(cssproperty); // values const cssvalue = document.createelement('dd'); cssvalue.appendchild(document.createtextnode(val)); styles
list.appendchild(cssvalue); } in browsers that support computedstylemap(), you'll see a
list of all the css properties and values. in other browsers you'll just see a link. did you realize how many default css properties a link had? update the 'a' to the 'p', and you'll notice a difference in the margin-top and margin-bottom default computed values. specifications specification sta...
Element: focus event - Web APIs
html <form id="form"> <input type="tex...
... html <form id="form"> <input type="text" placeholder="text input"> <input type="password" placeholder="password"> </form> javascri...
...ueryselector('input[type="password"]'); password.addevent
listener('focus', (event) => { event.target.style.background = 'pink'; }); password.addevent
listener('blur', (event) => { event.target.style.background = ''; }); result event delegation there are two ways of implementing event delegation for this event: by using the focusin event, or by setting the usecapture parameter of addevent
listener() to true. ...
...}); result event delegation there are two ways of implementing event delegation for this event: by using the focusin event, or by setting the usecapture parameter of addevent
listener() to true. html <form id="form"> <input type="text" placeholder="text input"> <input type="password" placeholder="password"> </form> javascript const form = document.getelementbyid('form'); form.addevent
listener('focus', (event) => { event.target.style.background = 'pink'; }, true); form.addevent
listener('blur', (event) => { event.target.style.background = ''; }, true); result specifications specification status comment ui events working draft added info that this event is composed. document object model (dom) level 3 events specification obsole...
Element.getElementsByClassName() - Web APIs
mes. the method getelementsbyclassname() on the document interface works essentially the same way, except it acts on the entire document, starting at the document root. syntax var elements = element.getelementsbyclassname(names); parameters names a domstring containing one or more class names to match on, separated by whitespace. return value an htmlcollection providing a live-updating
list of every element which is a member of every class in names. usage notes as always, the returned collection is live, meaning that it always reflects the current state of the dom tree rooted at the element on which the function was called. as new elements that match names are added to the subtree, they immediately appear in the collection. similarly, if an existing element that doesn't match name...
...however the following code will not work as one might expect because "matches" will change as soon as any "colorbox" class is removed. var matches...
...lts you can use either the item() method on the returned htmlcollection or standard array syntax to examine individual elements in the collection. however the following code will not work as one might expect because "matches" will change as soon as any "colorbox" class is removed. ...
... returned htmlcollection or standard array syntax to examine individual elements in the collection. however the following code will not work as one might expect because "matches" will change as soon as any "colorbox" class is removed. var matches = element.getelementsbyclassname('colorbox'); for (var i=0; i<matches.length; i++) { matches[i].class
list.remove('colorbox'); matches.item(i).class
list.add('hueframe'); } instead, use another method, such as: var matches = element.getelementsbyclassname('colorbox'); while (matches.length > 0) { matches.item(0).class
list.add('hueframe'); matches[0].class
list.remove('colorbox'); } this code finds descendant elements with the "colorbox" class, adds the class "hueframe", by calling item(0), then removes "colorbox" (using array notation). an...
Element.innerHTML - Web APIs
<div class="box"> <div><strong>log:</strong></div> <div class="log"></div> </div> the <div> with the class "box" is just a c...
... <div class="box"> <div><strong>log:</strong></div> <div class="log"></div> </div> the <div> with the class "box" is just a container for layout purposes, presenting the cont...
... <div class="box"> <div><strong>log:</strong></div> <div class="log"></div> </div> the <div> with the class "box" is just a container for layout purposes, presenting the contents with a box around it. the <div> whose clas...
...strong> at <em>" + event.clientx + ", " + event.clienty + "</em>"; log(msg); } then we use this as the event handler for a number of mouse events on the box that contains our log: var boxelem = document.queryselector(".box"); boxelem.addevent
listener("mousedown", logevent); boxelem.addevent
listener("mouseup", logevent); boxelem.addevent
listener("click", logevent); boxelem.addevent
listener("mouseenter", logevent); boxelem.addevent
listener("mouseleave", logevent); html the html is quite simple for our example. <div class="box"> <div><strong>log:</strong></div> <div class="log"></div> </div> the <div> with the class "box" is just a container for layout purposes, presenting the contents with a box around it. the <div> whose class is "log" is the container for the log text ...
Element: mousedown event - Web APIs
t="360"></canvas> css canvas { border: 1px solid black; width: 560px; height: 360px; } javascript // when true, moving the mouse draws on the canvas let isdrawing = false; let x = 0; let y = 0; const mypics = document.getelementbyid('mypics'); const context = mypics.getcontext('2d'); // event.offsetx, event.offsety gives the (x,y) offset from the edge of the canvas. ...
...width: 560px; height: 360px; } javascript // when true, moving the mouse draws on the canvas let isdrawing = false; let x = 0; let y = 0; const mypics = document.getelementbyid('mypics'); const context = mypics.getcontext('2d'); // event.offsetx, event.offsety gives the (x,y) offset from the edge of the canvas. ...
...drawing = false; let x = 0; let y = 0; const mypics = document.getelementbyid('mypics'); const context = mypics.getcontext('2d'); // event.offsetx, event.offsety gives the (x,y) offset from the edge of the canvas. ...
...the (x,y) offset from the edge of the canvas. ...
Element: mousemove event - Web APIs
t="360"></canvas> css canvas { border: 1px solid black; width: 560px; height: 360px; } javascript // when true, moving the mouse draws on the canvas let isdrawing = false; let x = 0; let y = 0; const mypics = document.getelementbyid('mypics'); const context = mypics.getcontext('2d'); // event.offsetx, event.offsety gives the (x,y) offset from the edge of the canvas. ...
...width: 560px; height: 360px; } javascript // when true, moving the mouse draws on the canvas let isdrawing = false; let x = 0; let y = 0; const mypics = document.getelementbyid('mypics'); const context = mypics.getcontext('2d'); // event.offsetx, event.offsety gives the (x,y) offset from the edge of the canvas. ...
...drawing = false; let x = 0; let y = 0; const mypics = document.getelementbyid('mypics'); const context = mypics.getcontext('2d'); // event.offsetx, event.offsety gives the (x,y) offset from the edge of the canvas. ...
...the (x,y) offset from the edge of the canvas. ...
Element: mouseout event - Web APIs
e area of the element. bubbles yes cancelable yes interface mouseevent event handler property onmouseout examples the following examples show the use of the mouseout event. mouseout and mouseleave the following example illustrates the difference between mouseout and mouseleave events. the mouseleave event is added to the <ul> to color the
list purple whenever the mouse exits the <ul>. mouseout is added to the
list to color the targeted element orange when the mouse exits it. when you try this out, you'll find that mouseout is delivered to the individual
list items, while mouseleave goes to the overall
list, courtesy of the hierarchy of the items and the fact that
list items obscure the underlying <ul>. html <ul id="test"> <li>item...
...s it. when you try this out, you'll find that mouseout is delivered to the individual
list items, while mouseleave goes to the overall
list, courtesy of the hierarchy of the items and the fact that
list items obscure the underlying <ul>. ...
...o the individual
list items, while mouseleave goes to the overall
list, courtesy of the hierarchy of the items and the fact that
list items obscure the underlying <ul>. ...
...make the
list purple when the mouse moves off the // <ul> element test.addevent
listener("mouseleave", function( event ) { // highlight the mouseleave target event.target.style.color = "purple"; // reset the color after a short delay settimeout(function() { event.target.style.color = ""; }, 1000); }, false); // briefly make an <li> orange when the mouse moves off of it test.addevent
listener("mouseout", function( event ) { // highlight the mouseout target event.target.style.color = "orange"; // reset the color after a short delay settimeout(function() { event.target.style.color = ""; }, 500); }, false); result specifications specification status ui eventsthe definition of 'mouseout' in that specification. working draft docu...
Element: mouseover event - Web APIs
ace mouseevent event handler property onmouseover examples the following example illustrates the difference between mouseover and mouseenter events. ...
... event handler property onmouseover examples the following example illustrates the difference between mouseover and mouseenter events. ...
... w...
... working draft d...
Element: mouseup event - Web APIs
t="360"></canvas> css canvas { border: 1px solid black; width: 560px; height: 360px; } javascript // when true, moving the mouse draws on the canvas let isdrawing = false; let x = 0; let y = 0; const mypics = document.getelementbyid('mypics'); const context = mypics.getcontext('2d'); // event.offsetx, event.offsety gives the (x,y) offset from the edge of the canvas. ...
...width: 560px; height: 360px; } javascript // when true, moving the mouse draws on the canvas let isdrawing = false; let x = 0; let y = 0; const mypics = document.getelementbyid('mypics'); const context = mypics.getcontext('2d'); // event.offsetx, event.offsety gives the (x,y) offset from the edge of the canvas. ...
...drawing = false; let x = 0; let y = 0; const mypics = document.getelementbyid('mypics'); const context = mypics.getcontext('2d'); // event.offsetx, event.offsety gives the (x,y) offset from the edge of the canvas. ...
...the (x,y) offset from the edge of the canvas. ...
Comparison of Event Targets - Web APIs
. this article should clarify the use of the target properties. there are five targets to consider: property defined in purpose event.target dom event interface the dom element on the lefthand side of the call that triggered this event, eg: element.dispatchevent(event) event.currenttarget dom event interface the eventtarget whose event
listeners are currently being processed. as the event capturing and bubbling occurs, this value changes. event.relatedtarget dom mouseevent interface identifies a secondary target for the event. event.explicitoriginaltarget event.webidl if the event was retargeted for some reason other than an anonymous boundary crossing, this will be set to the target before the retarg...
... min-height: 30px; } .standard { background-color: #99ff99; } .non-standard { background-color: #902d37; } </style> </head> <body> <table> <thead> <tr> <td class="standard">original target dispatching the event <small>event.target</small></td> <td class="standard">target who's event
listener is being processed <small>event.currenttarget</small></td> <td class="standard">identify other element (if any) involved in the event <small>event.relatedtarget</small></td> <td class="non-standard">if there was a retargetting of the event for some reason <small> event.explicitoriginaltarget</small> contains the target before retargetting (never contains anonymous targ...
...for the mouseout event, it holds the node that the mouse moved to. event type event.target event.relatedtarget ...
...for the mouseout event, it holds the node that the mouse moved to. event type event.target event.relatedtarget mouseover the eventtarget which the pointing device ente...
Event.cancelable - Web APIs
most browser-native events that can be canceled are the ones that result from the user interacting with the page. ...
... most browser-native events that can be canceled are the ones that result from the user interacting with the page. ...
...g, scrolling the page, or navigating away from the page, respectively. custom events created by other javascript code control if they can be canceled when they are created. syntax bool = event.cancelable; value the result is a boolean, which is true if the event can be canceled. example for example, browser vendors are proposing that the wheel event can only be canceled the first time the
listener is called — any following wheel events cannot be canceled. function preventscrollwheel(event) { if (typeof event.cancelable !== 'boolean' || event.cancelable) { // the event can be canceled, so we do so. event.preventdefault(); } else { // the event cannot be canceled, so it is not safe // to call preventdefault() on it. console.warn(`the following event couldn't be...
...ed. function preventscrollwheel(event) { if (typeof event.cancelable !== 'boolean' || event.cancelable) { // the event can be canceled, so we do so. event.preventdefault(); } else { // the event cannot be canceled, so it is not safe // to call preventdefault() on it. console.warn(`the following event couldn't be canceled:`); console.dir(event); } } document.addevent
listener('wheel', preventscrollwheel); notes whether an event can be canceled or not is something that's determined when that event is initialized. to cancel an event, call the preventdefault() method on the event. this keeps the implementation from executing the default action that is associated with the event. specifications specification status comment domthe defin...
Event.composedPath() - Web APIs
the composedpath() method of the event interface returns the event’s path which is an array of the objects on which
listeners will be invoked. this does not include nodes in shadow trees if the shadow root was created with its shadowroot.mode closed. syntax var composed = event.composedpath(); parameters none. return value an array of eventtarget objects representing the objects on which an event
listener will be invoked. examples in our composed-composed-path example (see it live), we define two trivial custom elements, <open-shadow> and <closed-shadow>, both of which take the contents of their text attribute and insert them into the element's shadow dom as the text content of a <p> element. the only difference between the two is that their shadow roots are attached with their mode...
...first, the composed property returns true beause the click event is always able to propagate across shadow boundaries. second, y...
...first, the composed property returns true beause the click event is always able to propagate across shadow boundaries. second, you'll notice a difference in the value of composedpath for the two eleme...
... specifications specification status comment domthe definition of 'composedpath()' in that specification. living standard ...
Event.msConvertURL() - Web APIs
retval = dragevent.msconverturl(file, targettype, targeturl); parameters file [in] type: file the file object to be converted. targettype [in] type: domstring one of the following values indicating the desired conversion type: "specified", "base64", or "unchanged". targeturl [in, optional] type: url the target url. return value this method does not return a value. ...
... parameters file [in] type: file the file object to be converted. targettype [in] type: domstring one of the following values indicating the desired conversion type: "specified", "base64", or "unchanged". targeturl [in, optional] type: url the target url. return value this method does not return a value. ...
...] type: domstring one of the following values indicating the desired conversion type: "specified", "base64", or "unchanged". targeturl [in, optional] type: url the target url. return value this method does not return a value. example var blob
list = []; document.getelementbyid("pastezone").addevent
listener('paste', handlepaste, false); function handlepaste(evt) { var file
list = window.clipboarddata.files; // note that window.datatransfer.files is not applicable. if (!file
list) { console.log("file
list is null."); return; } for (var i = 0; i < file
list.length; i++) { var file = file
list[i]; var url = url.createobjecturl(file); if (evt.converturl) { // use standard if available. evt.converturl(file, "...
... for (var i = 0; i < file
list.length; i++) { var file = file
list[i]; var url = url.createobjecturl(file); if (evt.converturl) { // use standard if available. ...
Event.preventDefault() - Web APIs
as noted below, calling preventdefault() for a non-cancelable event, such as one dispatched via eventtarget.dispatchevent(), without specifying cancelable: true has no effect. ...
...a non-cancelable event, such as one dispatched via eventtarget.dispatchevent(), without specifying cancelable: true has no effect. syntax event.preventdefault(); examples blocking default click handling toggling a checkbox is the default action of clicking on a checkbox. ...
...only.</p> <form> <input type="text" id="my-textbox"> </form> </div> css we use a little bit of css for the warning box we'll draw when the user presses an invalid key: .warning { border: 2px solid #f39389; border-radius: 2px; padding: 10px; position: absolute; background-color: #fbd8d4; color: #3b3c40; } javascript and here's the javascript code that does the job. ...
... of css for the warning box we'll draw when the user presses an invalid key: .warning { border: 2px solid #f39389; border-radius: 2px; padding: 10px; position: absolute; background-color: #fbd8d4; color: #3b3c40; } javascript and here's the javascript code that does the job. ...
Event.target - Web APIs
the target property of the event interface is a reference to the object onto which the event was dispatched. it is different from event.currenttarget when the event handler is called during the bubbling or capturing phase of the event. syntax const thetarget = someevent.target; value eventtarget example the event.target property can be used in order to implement event delegation. ...
... living standard dom4the definition of 'event.target' in that specification. obsolete document object model (dom) level 2 events spec...
... living standard dom4the definition of 'event.target' in that specification. obsolete document object model (dom) level 2 events specificationthe def...
... living standard dom4the definition of 'event.target' in that specification. obsolete document object model (dom) level 2 events specificationthe definition of 'event.target' in that specification. obsole...
Event.type - Web APIs
the type read-only property of the event interface returns a string containing the event's type. it is set when the event is constructed and is the name commonly used to refer to the specific event, such as click, load, or error. for a
list of available event types, see the event reference. syntax let eventtype = event.type; value a domstring containing the type of event. example this example logs the event type whenever you press a keyboard key or click a mouse button. ...
...ontaining the type of event. example this example logs the event type whenever you press a keyboard key or click a mouse button. ...
...pe whenever you press a keyboard key or click a mouse button. ...
...p>press any key or click the mouse to get the event type.</p> <p id="log"></p> javascript function geteventtype(event) { const log = document.getelementbyid('log'); log.innertext = event.type + '\n' + log.innertext; } // keyboard events document.addevent
listener('keydown', geteventtype, false); // first document.addevent
listener('keypress', geteventtype, false); // second document.addevent
listener('keyup', geteventtype, false); // third // mouse events document.addevent
listener('mousedown', geteventtype, false); // first document.addevent
listener('mouseup', geteventtype, false); // second document.addevent
listener('click', geteventtype, false); // third result specifications specification status comment domthe definition of 'event.type' in tha...
Using FormData Objects - Web APIs
32" maxlength="64" /><br /> <label>custom file label:</label> <input type="text" name="filelabel" size="12" maxlength="32" /><br /> <label>file to stash:</label> <input type="file" name="file" required /> <input type="submit" value="stash the file!" /> </form> <div></div> then you can send it using code like the following: var form = document.forms.nameditem("fileinfo"); form.addevent
listener('submit', function(ev) { var ooutput = document.queryselector("div"), odata = new formdata(form); odata.append("customfield", "this is some extra data"); var oreq = new xmlhttprequest(); oreq.open("post", "stash.php", true); oreq.onload = function(oevent) { if (oreq.status == 200) { ooutput.innerhtml = "uploaded!"; } else { ooutput.innerhtml = "error " +...
...t is possible to use the third optional parameter to pass a filename inside the content-disposition header that is sent to the server. when no filename is specified (or the parameter isn't supported), the name "blob" is used. using a formdata event a more recent addition to the platform than the formdata object is the formdata event — this is fired on an htmlformelement object after the entry
list representing the form's data is constructed. this happens when the form is submitted, but can also be triggered by the invocation of a formdata() constructor. this allows a formdata object to be quickly obtained in response to a formdata event firing, rather than needing to put it together yourself. typically this is used as shown in our simple formdata event demo — in the javascript we refe...
...ata event firing, rather than needing to put it together yourself. ...
...ormelem.addevent
listener('submit', (e) => { // on form submission, prevent default e.preventdefault(); // construct a formdata object, which fires the formdata event new formdata(formelem); }); when the formdata event fires we can access the formdata object using formdataevent.formdata, then do what we like with it (below we post it to the server using xmlhttprequest). ...
GeolocationCoordinates.longitude - Web APIs
ple think of. it is, instead, the iers reference meridian, which is located 5.3 arcseconds (102 meters / 335 feet) east of the greenwich meridian. this is the same standard used by the global positioning system (gps). examples in this simple example, we fetch the user's location and display the resulting coordinates once they're returned. ...
...ion and display the resulting coordinates once they're returned. javascript the javascript code below creates an event
listener so that when the user clicks on a button, the location information is retrieved and displayed. ...
...when the user clicks the button, we'll fetch and display the location information. upon receiving a click event, we call getcurrentposition() to request the device's current position. this is an asynchronous request, so we provide a callback which receives as in put a geolocationposition object describing the determined po...
...function(position) { let lat = position.coords.latitude; let long = position.coords.longitude; lattext.innertext = lat.tofixed(2); longtext.innertext = long.tofixed(2); }); }); after setting up variables to more conveniently reference the button element and the two elements into which the latitude and logitude will be drawn, the event
listener is established by calling addevent
listener() on the <button> element. when the user clicks the button, we'll fetch and display the location information. upon receiving a click event, we call getcurrentposition() to request the device's current position. this is an asynchronous request, so we provide a callback which receives as in put a geolocationposition object describing the determined position. from the geolocationposition objec...
Audio() - Web APIs
syntax audioobj = new audio(url); parameters url optional an optional domstring containing the url of an audio file to be associated with the new audio element. return value a new htmlaudioelement object, configured to be used for playing back the audio from the file specified by url.the new object's preload property is set to auto and its src property is set to the specified url or null if no url is given. ...
...d to allow playback to begin: check the value of the readystate property. if it's htmlmediaelement.have_future_data, there's enough data available to begin playback and play for at least a short time. if it's htmlmediaelement.have_enough_data, then there's enough data available that, given the current download rate, you should be able to play the audio through to the end without interruption. ...
...gin playback and play for at least a short time. if it's htmlmediaelement.have_enough_data, then there's enough data available that, given the current download rate, you should be able to play the audio through to the end without interruption.
listen for the canplay event. it is sent to the <audio> element when there's enough audio available to begin playback, although interruptions may occur).
listen for the canplaythrough event. it is sent when it's estimated that the audio should be able to play to the end without interruption. ...
...dio through to the end without interruption.
listen for the canplay event. it is sent to the <audio> element when there's enough audio available to begin playback, although interruptions may occur).
listen for the canplaythrough event. it is sent when it's estimated that the audio should be able to play to the end without interruption. the event-based approach is best: myaudioelement.addevent
listener("canplaythrough", event => { /* the audio is now playable; play it if permissions allow */ myaudioelement.play(); }); memory usage and management if all references to an audio element created using the audio() constructor are deleted, the element itself won't be removed from memory by the javascript runtime's garbage collection mechanism if playback is currently underway. instead, the a...
HTMLElement: animationiteration event - Web APIs
an animation-iteration-count of one. ...
...frames slidein { from { transform: translatex(100%) scalex(3); } to { transform: translatex(0) scalex(1); } } js const animation = document.queryselector('p.animation'); const animationeventlog = document.queryselector('.animation-example>.event-log'); const applyanimation = document.queryselector('.animation-example>button.activate'); let iterationcount = 0; animation.addevent
listener('animationstart', () => { animationeventlog.textcontent = `${animationeventlog.textcontent}'animation started' `; }); animation.addevent
listener('animationiteration', () => { iterationcount++; animationeventlog.textcontent = `${animationeventlog.textcontent}'animation iterations: ${iterationcount}' `; }); animation.addevent
listener('animationend', () => { animationeventlog.textconte...
...oneventlog.textcontent}'animation started' `; }); animation.addevent
listener('animationiteration', () => { iterationcount++; animationeventlog.textcontent = `${animationeventlog.textcontent}'animation iterations: ${iterationcount}' `; }); animation.addevent
listener('animationend', () => { animationeventlog.textcontent = `${animationeventlog.textcontent}'animation ended'`; animation.class
list.remove('active'); applyanimation.textcontent = "activate animation"; }); animation.addevent
listener('animationcancel', () => { animationeventlog.textcontent = `${animationeventlog.textcontent}'animation canceled'`; }); applyanimation.addevent
listener('click', () => { animation.class
list.toggle('active'); animationeventlog.textcontent = ''; iterationcount = 0; let active = animation.
...ve('active'); applyanimation.textcontent = "activate animation"; }); animation.addevent
listener('animationcancel', () => { animationeventlog.textcontent = `${animationeventlog.textcontent}'animation canceled'`; }); applyanimation.addevent
listener('click', () => { animation.class
list.toggle('active'); animationeventlog.textcontent = ''; iterationcount = 0; let active = animation.class
list.contains('active'); if (active) { applyanimation.textcontent = "cancel animation"; } else { applyanimation.textcontent = "activate animation"; } }); result specifications specification status comment css animations working draft initial definition ...
HTMLElement: gotpointercapture event - Web APIs
the gotpointercapture event is fired when an element captures a pointer using setpointercapture(). bubbles yes cancelable no interface pointerevent event handler property ongotpointercapture examples this example gets a <p> element and
listens for the gotpointercapture event. it then calls setpointercapture() on the element on a pointerdown event, which will trigger gotpointercapture. ...
... bubbles yes cancelable no interface pointerevent event handler property ongotpointercapture examples this example gets a <p> element and
listens for the gotpointercapture event. it then calls setpointercapture() on the element on a pointerdown event, which will trigger gotpointercapture. ...
...ent handler property ongotpointercapture examples this example gets a <p> element and
listens for the gotpointercapture event. it then calls setpointercapture() on the element on a pointerdown event, which will trigger gotpointercapture. ...
... para.addevent
listener('gotpointercapture', () => { console.log('i\'ve been captured!') }); para.addevent
listener('pointerdown', (event) => { para.setpointercapture(event.pointerid); }); the same example, using the ongotpointercapture event handler property: const para = document.queryselector('p'); para.ongotpointercapture = () => { console.log('i\'ve been captured!') }; para.addevent
listener('pointerdown', (event) => { para.setpointercapture(event.pointerid); }); specifications specification status pointer events obsolete ...
HTMLElement: lostpointercapture event - Web APIs
the lostpointercapture event is fired when a captured pointer is released. bubbles yes cancelable no interface pointerevent event handler property onlostpointercapture examples this example
listens for the lostpointercapture event for an element, and captures the pointer for the element on pointerdown. when the user subsequently releases the pointer, the lostpointercapture event will be fired. ...
...ncelable no interface pointerevent event handler property onlostpointercapture examples this example
listens for the lostpointercapture event for an element, and captures the pointer for the element on pointerdown. when the user subsequently releases the pointer, the lostpointercapture event will be fired. ...
...tercapture examples this example
listens for the lostpointercapture event for an element, and captures the pointer for the element on pointerdown. when the user subsequently releases the pointer, the lostpointercapture event will be fired. ...
...ddevent
listener('lostpointercapture', () => { console.log('i\'ve been released!') }); para.addevent
listener('pointerdown', (event) => { para.setpointercapture(event.pointerid); }); the same example, but using the onlostpointercapture event handler property: const para = document.queryselector('p'); para.onlostpointercapture = () => { console.log('i\'ve been released!') }; para.addevent
listener('pointerdown', (event) => { para.setpointercapture(event.pointerid); }); specifications specification status pointer events obsolete ...
HTMLElement: transitionrun event - Web APIs
the transitionrun event is fired when a css transition is first created, i.e. before any transition-delay has begun. ...
... the transitionrun event is fired when a css transition is first created, i.e. before any transition-delay has begun. ...
... yes cancelable no interface transitionevent event handler property ontransitionrun examples this code adds a
listener to the transitionrun event: el.addevent
listener('transitionrun', () => { console.log('transition is running but hasn\'t necessarily started transitioning yet'); }); the same, but using the ontransitionrun property instead of addevent
listener(): el.ontransitionrun = () => { console.log('transition started running, and will start transitioning when the transition delay has expired'); }; live example in the following example, we have a simple <div> element, styled with a transition that includes a delay: <div class="transition">hover over me</div> <div class="message"></div> .transition { width: 100px; height: 100px; b...
... transition-property: transform, background; transition-duration: 2s; transition-delay: 1s; } .transition:hover { transform: rotate(90deg); background: rgba(255,0,0,0); } to this, we'll add some javascript to indicate where the transitionstart and transitionrun events fire. const el = document.queryselector('.transition'); const message = document.queryselector('.message'); el.addevent
listener('transitionrun', function() { message.textcontent = 'transitionrun fired'; }); el.addevent
listener('transitionstart', function() { message.textcontent = 'transitionstart fired'; }); el.addevent
listener('transitionend', function() { message.textcontent = 'transitionend fired'; }); the difference is that: transitionrun fires when the transition is created (i.e. at the start of a...
HTMLElement: transitionstart event - Web APIs
the transitionstart event is fired when a css transition has actually started, i.e., after any transition-delay has ended. ...
... the transitionstart event is fired when a css transition has actually started, i.e., after any transition-delay has ended. ...
...delay has ended. ...
...erty: transform, background; transition-duration: 2s; transition-delay: 1s; } .transition:hover { transform: rotate(90deg); background: rgba(255,0,0,0); } to this, we'll add some javascript to indicate where the transitionstart and transitionrun events fire. const transition = document.queryselector('.transition'); const message = document.queryselector('.message'); transition.addevent
listener('transitionrun', function() { message.textcontent = 'transitionrun fired'; }); transition.addevent
listener('transitionstart', function() { message.textcontent = 'transitionstart fired'; }); transition.addevent
listener('transitionend', function() { message.textcontent = 'transitionend fired'; }); the difference is that: transitionrun fires when the transition is created (i.e. at...
HTMLFormElement - Web APIs
ethods htmlformelement.requestautocomplete() triggers a native browser interface to assist the user in completing the fields which have an autofill field name value that is not off or on. the form will receive an event once the user has finished with the interface, the event will either be autocomplete when the fields have been filled or autocompleteerror when there was a problem. events
listen to these events using addevent
listener(), or by assigning an event
listener to the oneventname property of this interface. formdata the formdata event fires after the entry
list representing the form's data is constructed. also available via the onformdata property. reset the reset event fires when a form is reset. also available via the onreset property. submit the submit event fires...
...tructed. also available via the onformdata property. reset the reset event fires when a form is reset. also available via the onreset property. submit the submit event fires when a form is submitted. also available via the onsubmit property. usage notes obtaining a form element object to obtain an htmlformelement object, you can use a css selector with queryselector(), or you can get a
list of all of the forms in the document using its forms property. document.forms returns an array of htmlformelement objects
listing each of the forms on the page. you can then use any of the following syntaxes to get an individual form: document.forms[index] returns the form at the specified index into the array of forms. document.forms[id] returns the form whose id is id. document.forms[nam...
...ent objects
listing each of the forms on the page. you can then use any of the following syntaxes to get an individual form: document.forms[index] returns the form at the specified index into the array of forms. document.forms[id] returns the form whose id is id. document.forms[name] returns the form whose name attribute's value is name. accessing the form's elements you can access the
list of the form's data-containing elements by examining the form's elements property. this returns an htmlformcontrolscollection
listing all of the form's user data entry elements, both those which are descendants of the <form> and those which are made members of the form using their form attributes. you can also get the form's element by using its name attribute as a key of the form, but using elem...
...are not using javascript, this will not cause a problem. elements that are considered form controls the elements included by htmlformelement.elements and htmlformelement.length are the following: <button> <fieldset> <input> (with the exception that any whose type is "image" are omitted for historical reasons) <object> <output> <select> <textarea> no other elements are included in the
list returned by elements, which makes it an excellent way to get at the elements most important when processing forms. examples creating a new form element, modifying its attributes, then submitting it: const f = document.createelement("form"); // create a form document.body.appendchild(f); // add it to the document body f.action = "/cgi-bin/some.cgi"; // add action and metho...
HTMLMediaElement.audioTracks - Web APIs
the read-only audiotracks property on htmlmediaelement objects returns an audiotrack
list object
listing all of the audiotrack objects representing the media element's audio tracks. the media element may be either an <audio> element or a <video> element. the returned
list is live; that is, as tracks are added to and removed from the media element, the
list's contents change dynamically. once you have a reference to the
list, you can monitor it for changes to detect when new audio tracks are added or existing ones removed. see event handlers in audiotrack
list to learn more about watching for changes to a media element's track
list. ...
... each track is represented by a audiotrack object which provides information about the track. examples in this example, all of the audio tracks on a given element are muted. ...
... each track is represented by a audiotrack object which provides information about the track. examples in this example, all of the audio tracks on a given element are muted. html the html establishes the element itself. ...
... each track is represented by a audiotrack object which provides information about the track. examples in this example, all of the audio tracks on a given element are muted. html the html establishes the element itself. ...
HTMLMediaElement.play() - Web APIs
nse. for even more in-depth information about autoplay and autoplay blocking, see our article autoplay guide for media and web audio apis. ...
...it tries to play the video, and if successful sets the class name...
...it tries to play the video, and if successful sets the class name of the playbutton element to "playing". if playback fails...
...it tries to play the video, and if successful sets the class name of the playbutton element to "playing". if playback fails to start, the playbutton element's class is cleared, restoring its default appearance. ...
HTMLMediaElement.videoTracks - Web APIs
the read-only videotracks property on htmlmediaelement objects returns a videotrack
list object
listing all of the videotrack objects representing the media element's video tracks. the returned
list is live; that is, as tracks are added to and removed from the media element, the
list's contents change dynamically. once you have a reference to the
list, you can monitor it for changes to detect when new video tracks are added or existing ones removed. see event handlers in videotrack
list to learn more about watching for changes to a media element's track
list. ...
... each track is represented by a videotrack object which provides information about the track. ...
... each track is represented by a videotrack object which provides information about the track. ...
... each track is represented by a videotrack object which provides information about the track. specifications specification status comment html living standardthe definition of 'htmlmediaelement.videotracks' in that specification. ...
HTMLMediaElement - Web APIs
94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlmediaelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface also inherits properties from its ancestors htmlelement, element, node, and eventtarget. htmlmediaelement.audiotracks a audiotrack
list that
lists the audiotrack objects contained in the element. htmlmediaelement.autoplay a boolean that reflects the autoplay html attribute, indicating whether playback should automatically begin as soon as enough media is available to do so without interruption. note: automatically playing audio when the user doesn't expect or desire it is a poor user experience and should be avoided in most...
...) at the moment the buffered property is accessed. htmlmediaelement.controller is a mediacontroller object that represents the media controller assigned to the element, or null if none is assigned. htmlmediaelement.controls is a boolean that reflects the controls html attribute, indicating whether user interface items for controlling the resource should be displayed. htmlmediaelement.controls
list read only returns a domtoken
list that helps the user agent select what controls to show on the media element whenever the user agent shows its own set of controls. the domtoken
list takes one or more of three possible values: nodownload, nofullscreen, and noremoteplayback. htmlmediaelement.crossorigin a domstring indicating the cors setting for this media element. htmlmediaelement.currentsrc ...
...adevices.enumeratedevices(), id-multimedia, or id-communications. htmlmediaelement.src is a domstring that reflects the src html attribute, which contains the url of a media resource to use. htmlmediaelement.srcobject is a mediastream representing the media to play or that has played in the current htmlmediaelement, or null if not assigned. htmlmediaelement.texttracks read only returns the
list of texttrack objects contained in the element. htmlmediaelement.videotracks read only returns the
list of videotrack objects contained in the element. htmlmediaelement.volume is a double indicating the audio volume, from 0.0 (silent) to 1.0 (loudest). event handlers htmlmediaelement.onencrypted sets the eventhandler called when the media is encrypted. htmlmediaelement.onwaitingforkey ...
...resource selection algorithm, the source is simply set to the other element's currentsrc. this is optimized so this element gets access to all of the other element's cached and buffered data; in fact, the two elements share downloaded data, so data downloaded by either element is available to both. events inherits methods from its parent, htmlelement , defined in the globaleventhandlers mixin.
listen to these events using addevent
listener() or by assigning an event
listener to the oneventname property of this interface. abort fired when the resource was not fully loaded, but not as the result of an error. canplay fired when the user agent can play the media, but estimates that not enough data has been loaded to play the media up to its end without having to stop for further buffering ...
HTMLSelectElement.remove() - Web APIs
the htmlselectelement.remove() method removes the element at the specified index from the options collection for this select element. syntax collection.remove(index); parameters index is a long for the index of the htmloptionelement to remove from the collection. if the index is not found the method has no effect. ...
...ndex from the options collection for this select element. syntax collection.remove(index); parameters index is a long for the index of the htmloptionelement to remove from the collection. if the index is not found the method has no effect. ...
...s collection for this select element. syntax collection.remove(index); parameters index is a long for the index of the htmloptionelement to remove from the collection. if the index is not found the method has no effect. ...
...method has no effect. example var sel = document.getelementbyid("existing
list"); sel.remove(1); /* takes the existing following select object: <select id="existing
list" name="existing
list"> <option value="1">option: value 1</option> <option value="2">option: value 2</option> <option value="3">option: value 3</option> </select> and changes it to: <select id="existing
list" name="existing
list"> <option value="1">option: value 1</option> <option value="3">option: value 3</option> </select> */ specifications specification status comment html living standardthe definition of 'htmlselectelement.remove()' in that specification. living standard html5the definition of 'htmlselectelement.remove()' in that specification.
HTMLTrackElement: cuechange event - Web APIs
the cuechange event fires when a texttrack has changed the currently displaying cues. the event is fired at both the texttrack and at the htmltrackelement in which it's being presented, if any. ...
...n a texttrack has changed the currently displaying cues. the event is fired at both the texttrack and at the htmltrackelement in which it's being presented, if any. ...
...ently displaying cues. the event is fired at both the texttrack and at the htmltrackelement in which it's being presented, if any. ...
... cuechange event every time the currently-presented cue is changed. this happens even if the track isn't associated with a media element. if the track is associated with a media element, using the <track> element as a child of the <audio> or <video> element, the cuechange event is also sent to the htmltrackelement. ...
IDBCursor.delete() - Web APIs
ete that entire record using var request = cursor.delete();. the cursor does not require us to select the data based on a key; we can just grab all of it. also note that in each iteration of the loop, you can grab data from the current record under the cursor object using cursor.value.foo. ...
...ursor does not require us to select the data based on a key; we can just grab all of it. also note that in each iteration of the loop, you can grab data from the current record under the cursor object using cursor.value.foo. for a complete working example, see our idbcursor example (view example live.) function deleteresult() {
list.innerhtml = ''; var transaction = db.transaction(['rushalbum
list'], 'readwrite'); var objectstore = transaction.objectstore('rushalbum
list'); objectstore.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { if(cursor.value.albumtitle === 'grace under pressure') { var request = cursor.delete(); request.onsuccess = function() { console.log('deleted that mediocre album from 1984. ev...
...bum
list'); objectstore.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { if(cursor.value.albumtitle === 'grace under pressure') { var request = cursor.delete(); request.onsuccess = function() { console.log('deleted that mediocre album from 1984. ...
...= function(event) { var cursor = event.target.result; if(cursor) { if(cursor.value.albumtitle === 'grace under pressure') { var request = cursor.delete(); request.onsuccess = function() { console.log('deleted that mediocre album from 1984. even power windows is better.'); }; } else { var
listitem = document.createelement('li');
listitem.innerhtml = '<strong>' + cursor.value.albumtitle + '</strong>, ' + cursor.value.year;
list.appendchild(
listitem); } cursor.continue(); } else { console.log('entries displayed.'); } }; }; specifications specification status comment indexed database api 2.0the definition of 'delete()' in that specification. recommendation ...
IDBCursor.update() - Web APIs
the below example using an intermediary updatedata variable. the cursor does not require us to select the data based on a key; we can just grab all of it. also note that in each iteration of the loop, you can grab data from the current record under the cursor object using cursor.value.foo. ...
...sor does not require us to select the data based on a key; we can just grab all of it. also note that in each iteration of the loop, you can grab data from the current record under the cursor object using cursor.value.foo. ...
...l of it. also note that in each iteration of the loop, you can grab data from the current record under the cursor object using cursor.value.foo. ...
...().onsuccess = function(event) { const cursor = event.target.result; if (cursor) { if (cursor.value.albumtitle === 'a farewell to kings') { const updatedata = cursor.value; updatedata.year = 2050; const request = cursor.update(updatedata); request.onsuccess = function() { console.log('a better album year?'); }; }; const
listitem = document.createelement('li');
listitem.innerhtml = '<strong>' + cursor.value.albumtitle + '</strong>, ' + cursor.value.year;
list.appendchild(
listitem); cursor.continue(); } else { console.log('entries displayed.'); } }; }; specifications specification status comment indexed database api 2.0the definition of 'update()' in that spec...
IDBDatabase: versionchange event - Web APIs
the versionchange event is fired when a database structure change (idbopendbrequest.onupgradeneeded event or idbfactory.deletedatabase) was requested. ...
... event handler property onversionchange examples this example opens a database and, on success, adds a
listener to versionchange: // open the database const dbopenrequest = window.indexeddb.open('nonexistent', 4); dbopenrequest.onupgradeneeded = event => { const db = event.target.result; // create an objectstore for this database const objectstore = db.createobjectstore('todo
list', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: fals...
... // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; dbopenrequest.addevent
listener('success', event => { const db = event.target.result; db.addevent
listener('versionchange', event => { console.log('the version of this database has changed'); }); }); the same example, using the onversionchange event handler property: // open the database const dbopenrequest = window.indexeddb.open('nonexistent', 4); dbopenrequest.onupgradeneeded = event => { const db = event.
... { console.log('the version of this database has changed'); }); }); the same example, using the onversionchange event handler property: // open the database const dbopenrequest = window.indexeddb.open('nonexistent', 4); dbopenrequest.onupgradeneeded = event => { const db = event.target.result; // create an objectstore for this database const objectstore = db.createobjectstore('todo
list', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: fals...
IDBIndex.objectStore - Web APIs
contacts database. we then open a basic cursor on the index using idbindex.opencursor. this works the same as opening a cursor directly on an objectstore using idbobjectstore.opencursor except that the returned records are sorted based on the index, not the primary key. ...
...rsor on the index using idbindex.opencursor. this works the same as opening a cursor directly on an objectstore using idbobjectstore.opencursor except that the returned records are sorted based on the index, not the primary key. ...
...name: "contacts
list", keypath: "id", indexnames: domstring
list[7], transaction: idbtransaction, autoincrement: false } finally, we iterate through each record, and insert the data into an html table. ...
...tion: idbtransaction, autoincrement: false } finally, we iterate through each record, and insert the data into an html table. ...
IDBObjectStore.add() - Web APIs
the add() method of the idbobjectstore interface returns an idbrequest object, and, in a separate thread, creates a structured clone of the value, and stores the cloned value in the object store. this is for adding new records to an object store. to determine if the add operation has completed successfully,
listen for the transaction’s complete event in addition to the idbobjectstore.add request’s success event, because the transaction may still fail after the success event fires. in other words, the success event is only triggered when the transaction has been successfully queued. the add method is an insert only method. if a record already exists in the object store with the key parameter as its key, then an error constrainerror event is fired on the returned request object. for upd...
... a read/write transaction on our database and add some data to an object store using add(). 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. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todo
list", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. // this is used a lot below db = dbopenrequest.result; // run the adddata() function to add the data to the database adddata(); }; function adddata() { // create a new object ready to insert into the idb var newit...
...duplicate items not allowed.</li>'; }; // create an object store on the transactio...
...e transaction completing, when everything is done transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error. ...
IDBObjectStore.deleteIndex() - Web APIs
to update the database structure if a database with a higher version number is loaded. idbobjectstore.createindex is used to create new indexes on the object store, after which we delete the unneeded old indexes with deleteindex(). for a full working example, see our to-do notifications app (view example live.) var db; // let us open our database var dbopenrequest = window.indexeddb.open("todo
list", 4); // these two event handlers act on the database being opened successfully, or not dbopenrequest.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. this is used a lot below db = this.result...
...g opened successfully, or not dbopenrequest.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. ...
...r not dbopenrequest.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. ...
...fore, or a new version number has been submitted via the // window.indexeddb.open line above //it is only implemented in recent browsers dbopenrequest.onupgradeneeded = function(event) { var db = this.result; db.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; // create an objectstore for this database var objectstore = db.createobjectstore("todo
list", { keypath: "tasktitle" }); // define what data items the objectstore will contain objectstore.createindex("hours", "hours", { unique: false }); objectstore.createindex("minutes", "minutes", { unique: false }); objectstore.createindex("day", "day", { unique: false }); objectstore.createindex("month", "month", { unique: false }); objectstore.createindex("year", "year", { unique:...
IDBObjectStore.indexNames - Web APIs
the indexnames read-only property of the idbobjectstore interface returns a
list of the names of indexes on objects in this object store. note: this feature is available in web workers. syntax var myindexnames = objectstore.indexnames; value a domstring
list. example in the following code snippet, we open a read/write transaction on our database and add some data to an object store using add(). after the object store has been created, we log objectstore.indexnames to the console. ...
... domstring
list. example in the following code snippet, we open a read/write transaction on our database and add some data to an object store using add(). after the object store has been created, we log objectstore.indexnames to the console. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todo
list", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. // this is used a lot below db = this.result; // run the adddata() function to add the data to the database adddata(); }; function adddata() { // create a new object ready to insert into the idb var newitem = [ { ...
...duplicate items not allowed.</li>'; }; // create an object store on the transacti...
... transaction completing, when everything is done transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error. ...
IDBRequest.error - Web APIs
if the operation failed for reasons unrelated to the database itself. a failure due to disk io errors is such an example. noerror if the request succeeds. versionerror if you try to open a database with a version lower than the one it already has. in addition to the error codes sent to the idbrequest object, asynchronous operations can also raise exceptions. the
list describes problems that could occur when the request is being executed, but you might also encounter other problems when the request is being made. for example, if the the request failed and the result is not available, the invalidstateerror exception is thrown. example the following example requests a given record title, onsuccess gets the associated record from the idbobjectstore (made availa...
...erequest.result), updates one property of the record, and then puts the updated record back into the object store. also included at the bottom is an onerror function that reports what the error was if the request fails. ...
... of the record, and then puts the updated record back into the object store. also included at the bottom is an onerror function that reports what the error was if the request fails. ...
...uts the updated record back into the object store. also included at the bottom is an onerror function that reports what the error was if the request fails. ...
KeyboardEvent - Web APIs
yboard is configured for. this may be the empty string if the browser or device doesn't know the keyboard's locale. note: this does not describe the locale of the data being entered. a user may be using one keyboard layout while typing text in a different language. keyboardevent.location read only returns a number representing the location of the key on the keyboard or other input device. a
list of the constants identifying the locations is shown above in keyboard locations. keyboardevent.metakey read only returns a boolean that is true if the meta key (on mac keyboards, the ā command key; on windows keyboards, the windows key (ā)) was active when the key event was generated. keyboardevent.repeat read only returns a boolean that is true if the key is being held down such that i...
...ependent numeric code identifying the unmodified value of the pressed key; this is usually the same as keycode. warning: this attribute is deprecated; you should use keyboardevent.key instead, if available. events the following events are based on the keyboardevent type. they can be delivered to any object which implements globaleventhandlers, including element, document, and window. in the
list below, each event links to the documentation for the document handler for the event, which applies generally to all of the recipients. keydown a key has been pressed. keyup a key has been released. obsolete events keypress a key that normally produces a character value has been pressed. this event was highly device-dependent and is obsolete. you should not use it. usage notes the...
...ot generate the default action associated with that event. for example, manually firing a key event does not cause that letter to appear in a focused text input. in the case of ui events, this is important for security reasons, as it prevents scripts from simulating user actions that interact with the browser itself. example <!doctype html> <html> <head> <script> 'use strict'; document.addevent
listener('keydown', (event) => { const keyname = event.key; if (keyname === 'control') { // do not alert when only control key is pressed. return; } if (event.ctrlkey) { // even though event.key is not 'control' (e.g., 'a' is pressed), // event.ctrlkey may be true if ctrl key is pressed at the same time. alert(`combination of ctrlkey + ${keyname}`); } else { alert(`...
... if (keyname === 'control') { // do not alert when only control key is pressed. return; } if (event.ctrlkey) { // even though event.key is not 'control' (e.g., 'a' is pressed), // event.ctrlkey may be true if ctrl key is pressed at the same time. alert(`combination of ctrlkey + ${keyname}`); } else { alert(`key pressed ${keyname}`); } }, false); document.addevent
listener('keyup', (event) => { const keyname = event.key; // as the user releases the ctrl key, the key is no longer active, // so event.ctrlkey is false. if (keyname === 'control') { alert('control key was released'); } }, false); </script> </head> <body> </body> </html> specifications specification status comment ui eventsthe definition of 'keyboardeve...
MSCandidateWindowShow - Web APIs
explorer. general info synchronous no bubbles no cancelable no note windows 8.1 and windows 7 imes for certain languages on internet explorer for the desktop might not support this event. on internet explorer in the new windows ui, this event is supported in windows 8.1 imes of all languages. syntax event property object.oncandidatewindowshow = handler; addevent
listener method object.addevent
listener("mscandidatewindowshow", handler, usecapture) parameters pevtobj [in] type: ihtmleventobj pointer to an ihtmleventobj interface for the current event. this event fires after the positioning information of the ime candidate window has been determined. you can obtain the positioning information using the getcandidatewindowclientrect method, and adj...
...ed. you can obtain the positioning information using the getcandidatewindowclientrect method, and adjust your layout as needed to avoid any occlusions with the ime candidate window. web applications need only register for this event once per element (the handler will remain valid for the lifetime of the element). ...
...emain valid for the lifetime of the element). example in ie11, developers can detect the opening of the ime candidate window by
listening to mscandidatewindowshow event, then call getcandidatewindowclientrect() function to find out where the candidate window is and position the suggestion ui away from it: var context = document.getelementbyid("mysearchbox").msgetinputcontext(); context.addevent
listener("mscandidatewindowshow", candidatewindowshowhandler); function candidatewindowshowhandler(e) { var imerect = context.getcandidatewindowclientrect(); var suggestionrect = document.getelementbyid("mysuggestion
list").getboundingclientrect(); // check if the two rects intersect, and position them away from each other. } when the ime candidate window changes position or closes, it fire...
...tewindowshowhandler(e) { var imerect = context.getcandidatewindowclientrect(); var suggestionrect = document.getelementbyid("mysuggestion
list").getboundingclientrect(); // check if the two rects intersect, and position them away from each other. } when the ime candidate window changes position or closes, it fires mscandidatewindowupdate or mscandidatewindowhide events. developers could
listen to them and shift the suggestion ui accordingly. see also microsoft api extensions ime handling guide for gecko ...
MediaRecorder: dataavailable event - Web APIs
ilable event is fired when the mediarecorder delivers media data to your application for its use. bubbles no cancelable no interface blobevent event handler property ondataavailable for details of the all the possible reasons this event may raise, see the documentation for the event handler property: ondataavailable. ...
... is fired when the mediarecorder delivers media data to your application for its use. bubbles no cancelable no interface blobevent event handler property ondataavailable for details of the all the possible reasons this event may raise, see the documentation for the event handler property: ondataavailable. ...
...s use. bubbles no cancelable no interface blobevent event handler property ondataavailable for details of the all the possible reasons this event may raise, see the documentation for the event handler property: ondataavailable. examples using addevent
listener to
listen for dataavailable events: ... ...
... the same, but using the ondataavailable event handler property: ... ...
MessagePort: message event - Web APIs
to a different browsing context, such as another <iframe>, using code like this: const channel = new messagechannel(); const myport = channel.port1; const targetframe = window.top.frames[1]; const targetorigin = 'https://example.org'; const messagecontrol = document.queryselector('#message'); const channelmessagebutton = document.queryselector('#channel-message'); channelmessagebutton.addevent
listener('click', () => { myport.postmessage(messagecontrol.value); }) targetframe.postmessage('init', targetorigin, [channel.port2]); the target can receive the port and start
listening for messages on it using code like this: window.addevent
listener('message', (event) => { const myport = event.ports[0]; myport.addevent
listener('message', (event) => { received.textcontent = ev...
...l.value); }) targetframe.postmessage('init', targetorigin, [channel.port2]); the target can receive the port and start
listening for messages on it using code like this: window.addevent
listener('message', (event) => { const myport = event.ports[0]; myport.addevent
listener('message', (event) => { received.textcontent = event.data; }); myport.start(); }); note that the
listener must call messageport.start() before any messages will be delivered to this port. ...
... messages on it using code like this: window.addevent
listener('message', (event) => { const myport = event.ports[0]; myport.addevent
listener('message', (event) => { received.textcontent = event.data; }); myport.start(); }); note that the
listener must call messageport.start() before any messages will be delivered to this port. ...
... event.ports[0]; myport.addevent
listener('message', (event) => { received.textcontent = event.data; }); myport.start(); }); note that the
listener must call messageport.start() before any messages will be delivered to this port. ...
MessagePort: messageerror event - Web APIs
to a different browsing context, such as another <iframe>, using code like this: const channel = new messagechannel(); const myport = channel.port1; const targetframe = window.top.frames[1]; const targetorigin = 'https://example.org'; const messagecontrol = document.queryselector('#message'); const channelmessagebutton = document.queryselector('#channel-message'); channelmessagebutton.addevent
listener('click', () => { myport.postmessage(messagecontrol.value); }) targetframe.postmessage('init', targetorigin, [channel.port2]); the target can receive the port and start
listening for messages and message errors on it using code like this: window.addevent
listener('message', (event) => { const myport = event.ports[0]; myport.addevent
listener('message', (event) => { receiv...
...ol.value); }) targetframe.postmessage('init', targetorigin, [channel.port2]); the target can receive the port and start
listening for messages and message errors on it using code like this: window.addevent
listener('message', (event) => { const myport = event.ports[0]; myport.addevent
listener('message', (event) => { received.textcontent = event.data; }); myport.addevent
listener('messageerror', (event) => { console.error(event.data); }); myport.start(); }); note that the
listener must call messageport.start() before any messages will be delivered to this port. ...
...rt = event.ports[0]; myport.addevent
listener('message', (event) => { received.textcontent = event.data; }); myport.addevent
listener('messageerror', (event) => { console.error(event.data); }); myport.start(); }); note that the
listener must call messageport.start() before any messages will be delivered to this port. ...
...event.data; }); myport.addevent
listener('messageerror', (event) => { console.error(event.data); }); myport.start(); }); note that the
listener must call messageport.start() before any messages will be delivered to this port. ...
MutationEvent - Web APIs
details in the "dom mutation events replacement: the story so far / existing points of consensus" post to public-webapps). mutation observers are the proposed replacement for mutation events in dom4. they are expected to be included in firefox 14 and chrome 18. the practical reasons to avoid the mutation events are performance issues and cross-browser support. performance adding dom mutation
listeners to a document profoundly degrades the performance of further dom modifications to that document (making them 1.5 - 7 times slower!). moreover, removing the
listeners does not reverse the damage. the performance effect is limited to the documents that have the mutation event
listeners. cross-browser support these events are not implemented consistently across different browsers, for exampl...
...ent some of them correctly in version 9 (for example, domnodeinserted) webkit doesn't support domattrmodified (see webkit bug 8191 and the workaround) "mutation name events", i.e. domelementnamechanged and domattributenamechanged are not supported in firefox (as of version 11), and probably in other browsers as well. ... dottoro documents browser support for mutation events. ...
...y in version 9 (for example, domnodeinserted) webkit doesn't support domattrmodified (see webkit bug 8191 and the workaround) "mutation name events", i.e. domelementnamechanged and domattributenamechanged are not supported in firefox (as of version 11), and probably in other browsers as well. ... dottoro documents browser support for mutation events. ...
...ro documents browser support for mutation events. mutation events
list the following is a
list of all mutation events, as defined in dom level 3 events specification: domattrmodified domattributenamechanged domcharacterdatamodified domelementnamechanged domnodeinserted domnodeinsertedintodocument domnoderemoved domnoderemovedfromdocument domsubtreemodified usage you can register a
listener for mutation events using eventtarget.addevent
listener() as follows: element.addevent
listener("domnodeinserted", function (event) { // ... }, false); the event object is passed to the
listener in a mutationevent (see its definition in the specification) for most events, and mutationnameevent for domattributenamechanged and domelementnamechanged. ...
MutationObserver.MutationObserver() - Web APIs
return value a new mutationobserver object, configured to call the specified callback when dom mutations occur. example this example simply creates a new mutationobserver configured to watch a node and all of its children for additions and removals of elements to the tree, as well as any changes to attributes on any of the elements in the tree. the callback function function callback(mutation
list, observer) { mutation
list.foreach( (mutation) => { switch(mutation.type) { case 'child
list': /* one or more children have been added to and/or removed from the tree. (see mutation.addednodes and mutation.removednodes.) */ break; case 'attributes': /* an attribute value changed on the element in mutation.target. ...
...arget. the attribute name is in mutation.attributename, and its previous value is in mutation.oldvalue. */ break; } }); } the callback() function is invoked when the observer sees changes matching the configuration of the observation request specified when calling observe() to begin watching the dom. ...
...cified when calling observe() to begin watching the dom. the kind of change that took place (either a change to the
list of children, or a change to an attribute) is detected by looking at the mutation.type property. creating and starting the observer this code actually sets up the observation process. const targetnode = document.queryselector("#someelement"); const observeroptions = { child
list: true, attributes: true, // omit (or set to false) to observe only changes to the parent node subtree: true } const observer = new mutationobserver(callback); observer.observe(targetnode, observeroptions); the desired subtree is located by finding an element with the id someelement. a set of options for the observer is also established in the observeroptions record. in it, we specify val...
..., // omit (or set to false) to observe only changes to the parent node subtree: true } const observer = new mutationobserver(callback); observer.observe(targetnode, observeroptions); the desired subtree is located by finding an element with the id someelement. a set of options for the observer is also established in the observeroptions record. in it, we specify values of true for both child
list and attributes, so we get the information we want. then the observer is instantiated, specifying the callback() function. we begin observing the dom nodes of interest by calling observe(), specifying the target node and the options object. from this point until disconnect() is called, callback() will be called each time an element is added to or removed from the dom tree rooted at targetnode, o...
MutationObserver - Web APIs
il and unless observe() is called again. observe() configures the mutationobserver to begin receiving notifications through its callback function when dom changes matching the given options occur. takerecords() removes all pending notifications from the mutationobserver's notification queue and returns them in a new array of mutationrecord objects. ...
...tationrecord objects. mutation observer & customize resize event
listener & demo https://codepen.io/webgeeker/full/yjrzgg/ example the following example was adapted from this blog post. ...
... example the following example was adapted from this blog post. ...
...be observed for mutations const targetnode = document.getelementbyid('some-id'); // options for the observer (which mutations to observe) const config = { attributes: true, child
list: true, subtree: true }; // callback function to execute when mutations are observed const callback = function(mutations
list, observer) { // use traditional 'for loops' for ie 11 for(let mutation of mutations
list) { if (mutation.type === 'child
list') { console.log('a child node has been added or removed.'); } else if (mutation.type === 'attributes') { console.log('the ' + mutation.attributename + ' attribute was modified.'); } } }; // create an observer instance linked to the callback function const observer = new mutationobserver(callback); //...
Using Navigation Timing - Web APIs
age of being able to provide timing information as perceived by the user rather than data that has no correlation to what the user experiences. collecting timing information using the api is as simple as obtaining the performance object using window.performance and looking up what you need within the object returned. ...
...ent time the time at which the navigation whose timing was recorded began (performance.timing.navigationstart), and outputs that information to the screen by inserting it into an element. html <div class="output"> </div> css .output { border: 1px solid #bbb; font: 16px "open sans", "helvetica", "arial", sans-serif; } in tandem with appropriate html and css, the result is: the values
listed are for the <iframe> in which the sample is presented above. for a
list of the available timing values you can look for in performancetiming, see the performancetiming interface's properties section. determining navigation type to put the timing information obtained from performancetiming into the correct perspective, you need to know more about what sort of load operation occurred. in parti...
... was this a navigation or a move forward or backward through history? how many (if any) redirects were required in order to complete the navigation? this information is provided by the performance.navigation property, which returns a performancenavigation object that includes the needed information. let's add this information to the example above. ...
...igation from performance.navigation.redirectcount. this information is output to the screen just like the page load time was previously: by inserting it into the element with class "output". html <div class="output"> </div> css .output { border: 1px solid #bbb; font: 16px "open sans", "helvetica", "arial", sans-serif; } with this code in place, the result looks like this: the values
listed are for the <iframe> in which the sample is presented. ...
PannerNode.orientationX - Web APIs
the orientation of the audio source (that is, the direction in which it's facing), given as (orientationx, orientationy, orientationz). depending on the directionality of the sound (as specified using the attributes coneinnerangle, coneouterangle, and coneoutergain), the orientation of the sound may alter the perceived volume of the sound as it's being played. if the sound is pointing toward the
listener, it will be louder than if the sound is pointed away from the
listener. the audioparam contained by this property is read only; however, you can still change the value of the parameter by assigning a new value to its audioparam.value property. syntax var orientationx = pannernode.orientationx; pannernode.orientationx.value = neworientationx; value an audioparam whose value is the x co...
...p us visualise how the orientation vector affects, we can use the right-hand rule: first, let's start by writing a utility function to figure out our orientation vector. 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. however, normally this would mean the pannernode points to the left of the
listener at 0° rotation – since `x = cos(0) = 1` and `z = sin(0) = 0`. it's more useful to offset the angle by -90°, which means the pannernode will point directly at the
listener at 0° rotation. // this utility converts amount of rotation around the y axis // (i.e. rotation in the 'horizontal plane') to an orientation vector const yrotationtovector = degrees => { // convert degrees to radians...
...` and `z = sin(0) = 0`. it's more useful to offset the angle by -90°, which means the pannernode will point directly at the
listener at 0° rotation. // this utility converts amount of rotation around the y axis // (i.e. rotation in the 'horizontal plane') to an orientation vector const yrotationtovector = degrees => { // convert degrees to radians and offset the angle so 0 points towards the
listener const radians = (degrees - 90) * (math.pi / 180); // using cosine and sine here ensures the output values are always normalised // i.e. they range between -1 and 1 const x = math.cos(radians); const z = math.sin(radians); // we hard-code the y component to 0, as y is the axis of rotation return [x, 0, z]; }; now we can create our audiocontext, an oscillator and a pannernode: ...
...ll decrease gradually panner.coneouterangle = 45; // this value determines the volume of the sound outside of both inner and outer cone // setting it to 0 means there is no sound, so we can clearly hear when we leave the cone // 0 is also the default panner.coneoutergain = 0; // increase the z position to ensure the cone has an effect // (otherwise the sound is located at the same position as the
listener) panner.positionz.setvalueattime(1, context.currenttime); having set up the pannernode, we can now schedule some updates to its y-axis rotation: // calculate the vector for no rotation // this means the sound will play at full volume const [x1, y1, z1] = yrotationtovector(0); // schedule the no-rotation vector immediately panner.orientationx.setvalueattime(x1, context.currenttime); panner.o...
PannerNode.orientationY - Web APIs
the orientation of the audio source (that is, the direction in which it's facing), given as (orientationx, orientationy, orientationz). depending on the directionality of the sound (as specified using the attributes coneinnerangle, coneouterangle, and codeoutergain), the orientation of the sound may alter the perceived volume of the sound as it's being played. if the sound is pointing toward the
listener, it will be louder than if the sound is pointed away from the
listener. the audioparam contained by this property is read only; however, you can still change the value of the parameter by assigning a new value to its audioparam.value property. syntax var orientationy = pannernode.orientationy; pannernode.orientationy.value = neworientationy; value an audioparam whose value is the y co...
...p us visualise how the orientation vector affects, we can use the right-hand rule: first, let's start by writing a utility function to figure out our orientation vector. 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. however, normally this would mean the pannernode points to the left of the
listener at 0° rotation – since `x = cos(0) = 1` and `z = sin(0) = 0`. it's more useful to offset the angle by -90°, which means the pannernode will point directly at the
listener at 0° rotation. // this utility converts amount of rotation around the y axis // (i.e. rotation in the 'horizontal plane') to an orientation vector const yrotationtovector = degrees => { // convert degrees to radians...
...` and `z = sin(0) = 0`. it's more useful to offset the angle by -90°, which means the pannernode will point directly at the
listener at 0° rotation. // this utility converts amount of rotation around the y axis // (i.e. rotation in the 'horizontal plane') to an orientation vector const yrotationtovector = degrees => { // convert degrees to radians and offset the angle so 0 points towards the
listener const radians = (degrees - 90) * (math.pi / 180); // using cosine and sine here ensures the output values are always normalised // i.e. they range between -1 and 1 const x = math.cos(radians); const z = math.sin(radians); // we hard-code the y component to 0, as y is the axis of rotation return [x, 0, z]; }; now we can create our audiocontext, an oscillator and a pannernode: ...
...ll decrease gradually panner.coneouterangle = 45; // this value determines the volume of the sound outside of both inner and outer cone // setting it to 0 means there is no sound, so we can clearly hear when we leave the cone // 0 is also the default panner.coneoutergain = 0; // increase the z position to ensure the cone has an effect // (otherwise the sound is located at the same position as the
listener) panner.positionz.setvalueattime(1, context.currenttime); having set up the pannernode, we can now schedule some updates to its y-axis rotation: // calculate the vector for no rotation // this means the sound will play at full volume const [x1, y1, z1] = yrotationtovector(0); // schedule the no-rotation vector immediately panner.orientationx.setvalueattime(x1, context.currenttime); panner.o...
PannerNode.orientationZ - Web APIs
the orientation of the audio source (that is, the direction in which it's facing), given as (orientationx, orientationy, orientationz). depending on the directionality of the sound (as specified using the attributes coneinnerangle, coneouterangle, and codeoutergain), the orientation of the sound may alter the perceived volume of the sound as it's being played. if the sound is pointing toward the
listener, it will be louder than if the sound is pointed away from the
listener. the audioparam contained by this property is read only; however, you can still change the value of the parameter by assigning a new value to its audioparam.value property. syntax var orientationz = pannernode.orientationz; pannernode.orientationz.value = neworientationz; value an audioparam whose value is the z co...
...p us visualise how the orientation vector affects, we can use the right-hand rule: first, let's start by writing a utility function to figure out our orientation vector. 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. however, normally this would mean the pannernode points to the left of the
listener at 0° rotation – since `x = cos(0) = 1` and `z = sin(0) = 0`. it's more useful to offset the angle by -90°, which means the pannernode will point directly at the
listener at 0° rotation. // this utility converts amount of rotation around the y axis // (i.e. rotation in the 'horizontal plane') to an orientation vector const yrotationtovector = degrees => { // convert degrees to radians...
...` and `z = sin(0) = 0`. it's more useful to offset the angle by -90°, which means the pannernode will point directly at the
listener at 0° rotation. // this utility converts amount of rotation around the y axis // (i.e. rotation in the 'horizontal plane') to an orientation vector const yrotationtovector = degrees => { // convert degrees to radians and offset the angle so 0 points towards the
listener const radians = (degrees - 90) * (math.pi / 180); // using cosine and sine here ensures the output values are always normalised // i.e. they range between -1 and 1 const x = math.cos(radians); const z = math.sin(radians); // we hard-code the y component to 0, as y is the axis of rotation return [x, 0, z]; }; now we can create our audiocontext, an oscillator and a pannernode: ...
...ll decrease gradually panner.coneouterangle = 45; // this value determines the volume of the sound outside of both inner and outer cone // setting it to 0 means there is no sound, so we can clearly hear when we leave the cone // 0 is also the default panner.coneoutergain = 0; // increase the z position to ensure the cone has an effect // (otherwise the sound is located at the same position as the
listener) panner.positionz.setvalueattime(1, context.currenttime); having set up the pannernode, we can now schedule some updates to its y-axis rotation: // calculate the vector for no rotation // this means the sound will play at full volume const [x1, y1, z1] = yrotationtovector(0); // schedule the no-rotation vector immediately panner.orientationx.setvalueattime(x1, context.currenttime); panner.o...
PaymentResponse.retry() - Web APIs
method with a value of "fail" to indicate failure. if the response's data is valid and acceptable, call complete("success") to finalize the payment and proces it. if show() is rejected, the payment request failed, usually because either there's already one being processed, because the user agent doesn't support any of the specified payment methods, or because of a security issue. see the
list of exceptions for show() for further details. call complete("fail") to close the payment request. async function handlepayment() { const payrequest = new paymentrequest(methoddata, details, options); try { let payresponse = await payrequest.show(); while (payresponse has errors) { /* let the user edit the payment information, wait until they submit */ await re...
... fixfield(response, "payerdetailchange", payervalidator); promisestofixthings.push(promise); } await promise.all([response.retry(errors), ...promisestofixthings]); await recursivevalidate(request, response); } function fixfield(requestorresponse, event, validator) { return new promise(resolve => { // browser keeps calling this until promise resolves. ...
...lchange", payervalidator); promisestofixthings.push(promise); } await promise.all([response.retry(errors), ...promisestofixthings]); await recursivevalidate(request, response); } function fixfield(requestorresponse, event, validator) { return new promise(resolve => { // browser keeps calling this until promise resolves. ...
...e, event, validator) { return new promise(resolve => { // browser keeps calling this until promise resolves. requestorresponse.addevent
listener(event, async function
listener(ev) { const promisetovalidate = validator(requestorresponse); ev.updatewith(promisetovalidate); const errors = await promisetovalidate; if (!errors) { // yay! fixed! event.removeevent
listener(event,
listener); resolve(); } }); }); } dopaymentrequest(); specifications specification status comment payment request apithe definition of 'retry()' in that specification. candidate recommendation initial definition. ...
PerformanceEventTiming - Web APIs
auxclick beforeinput click compositionend compositionstart compositionupdate contextmenu dblclick dragend dragenter dragleave dragover dragstart drop input keydown keypress keyup mousedown mouseenter mouseleave mouseout mouseover mouseup pointerover pointerenter pointerdown pointerup pointercancel pointerout pointerleave gotpointercapture lostpointercapture touchstart touchend touchcancel properties performanceeventtiming.processingstart returns the time at which event dispatch started. ...
...eeventtiming.cancelable returns the associated event's cancelable attribute. performanceeventtiming.target returns the associated event's last target, if it is not removed. methods performanceeventtiming.tojson() converts the performanceeventtiming object to json. examples the following example shows how to use the api for all events: const observer = new performanceobserver(function(
list) { const perfentries =
list.getentries().foreach(entry => { // full duration const inputduration = entry.duration; // input delay (before processing event) const inputdelay = entry.processingstart - entry.starttime; // synchronous event processing time (between start and end dispatch). const inputsyncprocessingtime = entry.processingend - entry.
...o directly query the first input delay. // keep track of whether (and when) the page was first hidden, see: // https://github.com/w3c/page-visibility/issues/29 // note: ideally this check would be performed in the document <head> // to avoid cases where the visibility state changes before this code runs. let firsthiddentime = document.visibilitystate === 'hidden' ? 0 : infinity; document.addevent
listener('visibilitychange', (event) => { firsthiddentime = math.min(firsthiddentime, event.timestamp); }, {once: true}); // sends the passed data to an analytics endpoint. this code // uses `/analytics`; you can replace it with your own url. function sendtoanalytics(data) { const body = json.stringify(data); // use `navigator.sendbeacon()` if available, falling back to `fetch()`. (navigator.
... this typically happens when a // page is loaded in a background tab. if (entry.starttime < firsthiddentime) { const fid = entry.processingstart - entry.starttime; // report the fid value to an analytics endpoint. sendtoanalytics({fid}); } } // create a performanceobserver that calls `onfirstinputentry` for each entry. const po = new performanceobserver((entry
list) => { entry
list.getentries().foreach(onfirstinputentry); }); // observe entries of type `first-input`, including buffered entries, // i.e. entries that occurred before calling `observe()` below. po.observe({ type: 'first-input', buffered: true, }); } catch (e) { // do nothing if the browser doesn't support this api. } specifications specification status ...
PerformanceObserver() - Web APIs
ck. the observer callback is invoked when performance entry events are recorded for the entry types that have been registered, via the observe() method. syntax var observer = new performanceobserver(callback); parameters callback a performanceobservercallback callback that will be invoked when observed performance events are recorded. ...
...back that will be invoked when observed performance events are recorded. when the callback is invoked, its first parameter is a
list of performance observer entries and the second parameter is the observer object. return value a new performanceobserver object which will call the specified callback when observed performance events occur. ...
...n observed performance events are recorded. when the callback is invoked, its first parameter is a
list of performance observer entries and the second parameter is the observer object. return value a new performanceobserver object which will call the specified callback when observed performance events occur. ...
... return value a new performanceobserver object which will call the specified callback when observed performance events occur. example var observer = new performanceobserver(function(
list, obj) { var entries =
list.getentries(); for (var i=0; i < entries.length; i++) { // process "mark" and "frame" events } }); observer.observe({entrytypes: ["mark", "frame"]}); function perf_observer(
list, observer) { // process the "measure" event } var observer2 = new performanceobserver(perf_observer); observer2.observe({entrytypes: ["measure"]}); specifications specification status comment performance timeline level 2the definition of 'performanceobserver()' in that specification. candidate recommendation initial definition of performanceobserver() constructo...
PerformanceObserver.observe() - Web APIs
e. may not be used together with the "type" or "buffered" options. type: a single domstring specifying exactly one performance entry type to observe. may not be used together with the entrytypes option. buffered: a boolean flag to indicate whether buffered entries should be queued into the observer's buffer. must be used only with the "type" option. see performanceentry.entrytype for a
list of valid performance entry type names. unrecognized types are ignored, though the browser may output a warning message to the console to help developers debug their code. if no valid types are found, observe() has no effect. examples this example creates and configures two performanceobservers; one watches for "mark" and "frame" events, and the other watches for "measure" events. var observ...
.... unrecognized types are ignored, though the browser may output a warning message to the console to help developers debug their code. if no valid types are found, observe() has no effect. examples this example creates and configures two performanceobservers; one watches for "mark" and "frame" events, and the other watches for "measure" events. ...
...red, though the browser may output a warning message to the console to help developers debug their code. if no valid types are found, observe() has no effect. examples this example creates and configures two performanceobservers; one watches for "mark" and "frame" events, and the other watches for "measure" events. ...
...creates and configures two performanceobservers; one watches for "mark" and "frame" events, and the other watches for "measure" events. var observer = new performanceobserver(function(
list, obj) { var entries =
list.getentries(); for (var i=0; i < entries.length; i++) { // process "mark" and "frame" events } }); observer.observe({entrytypes: ["mark", "frame"]}); function perf_observer(
list, observer) { // process the "measure" event } var observer2 = new performanceobserver(perf_observer); observer2.observe({entrytypes: ["measure"]}); specifications specification status comment performance timeline level 2the definition of 'observe()' in that specification. candidate recommendation initial definition of observe() method. ...
Using Pointer Events - Web APIs
> log: <pre id="log" style="border: 1px solid #ccc;"></pre> setting up the event handlers when the page loads, the startup() function shown below should be called by our <body> element's onload attribute (but in the example we use a button to trigger it, due to limitations of the mdn live example system). function startup() { var el = document.getelementsbytagname("canvas")[0]; el.addevent
listener("pointerdown", handlestart, false); el.addevent
listener("pointerup", handleend, false); el.addevent
listener("pointercancel", handlecancel, false); el.addevent
listener("pointermove", handlemove, false); log("initialized."); } this simply sets up all the event
listeners for our <canvas> element so we can handle the touch events as they occur. tracking new touches we'll keep track of...
... to replace the previous information about the touch point with the current information in the ongoingtouches array. handling the end of a touch when the user lifts a finger off the surface, a pointerup event is sent. we handle this event by calling the handleend() function below. its job is to draw the last line segment for the touch that ended and remove the touch point from the ongoing touch
list. function handleend(evt) { log("pointerup"); var el = document.getelementsbytagname("canvas")[0]; var ctx = el.getcontext("2d"); var color = colorfortouch(evt); var idx = ongoingtouchindexbyid(evt.pointerid); if (idx >= 0) { ctx.linewidth = 4; ctx.fillstyle = color; ctx.beginpath(); ctx.moveto(ongoingtouches[idx].pagex, ongoingtouches[idx].pagey); ctx.lineto(evt.
...the result is that we stop tracking that touch point. handling canceled touches if the user's finger wanders into browser ui, or the touch otherwise needs to be canceled, the pointercancel event is sent, and we call the handlecancel() function below. function handlecancel(evt) { log("pointercancel: id = " + evt.pointerid); var idx = ongoingtouchi...
...ouch otherwise needs to be canceled, the pointercancel event is sent, and we call the handlecancel() function below. function handlecancel(evt) { log("pointercancel: id = " + evt.pointerid); var idx = ongoingtouchindexbyid(evt.pointerid); ongoingtouches.splice(idx, 1); // remove it; we're done } since the idea is to immediately abort the touch, we simply remove it from the ongoing touch
list without drawing a final line segment. convenience functions this example uses two convenience functions that should be looked at briefly to help make the rest of the code more clear. selecting a color for each touch in order to make each touch's drawing look different, the colorfortouch() function is used to pick a color based on the touch's unique identifier. this identifier is an opaque num...
RTCPeerConnection.removeTrack() - Web APIs
if the connection has already been negotiated (signalingstate is set to "stable"), it is marked as needing to be negotiated again; the remote peer won't experience the change until this negotiation occurs. ...
... if the connection has already been negotiated (signalingstate is set to "stable"), it is marked as needing to be negotiated again; the remote peer won't experience the change until this negotiation occurs. ...
...otiationneeded event is sent to the rtcpeerconnection to let the local end know this negotiation must occur. syntax pc.removetrack(sender); parameters mediatrack a rtcrtpsender specifying the sender to remove from the connection. return value undefined. exceptions invalidstateerror the connection is not open. ...
...en. example this example adds a video track to a connection and sets up a
listener on a close button which removes the track when the user clicks the button. var pc, sender; navigator.getusermedia({video: true}, function(stream) { pc = new rtcpeerconnection(); var track = stream.getvideotracks()[0]; sender = pc.addtrack(track, stream); }); document.getelementbyid("closebutton").addevent
listener("click", function(event) { pc.removetrack(sender); pc.close(); }, false); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.removetrack()' in that specification. candidate recommendation initial specification. ...
Range.commonAncestorContainer - Web APIs
rtially select nodes, this is a convenient way to find a node which encloses a range. this property is read-only. to change the ancestor container of a node, consider using the various methods available to set the start and end positions of the range, such as range.setstart() and range.setend(). syntax rangeancestor = range.commonancestorcontainer; example in this example, we create an event
listener to handle pointerup events on a
list. the
listener gets the common ancestors of each piece of selected text, and triggers an animation to highlight them. html <ul> <li>strings <ul> <li>cello</li> <li>violin <ul> <li>first chair</li> <li>second chair</li> </ul> </li> </ul> </li> <li>woodwinds <ul> <li>clarinet</li>...
... <li>woodwinds <ul> <li>clarinet</li> <li>oboe</li> </ul> </li> </ul> css the .highlight class created below uses a set of css @keyframes to animate a fading outline. ...
... living standard no change. ...
... living standard no change. document object model (dom) level 2 traversal and range specificationthe definition of 'range.commonancestorcontainer' in that specification. obsolete initial specifi...
Screen Wake Lock API - Web APIs
ct wake lock active statuselem.textcontent = 'wake lock is active!'; } catch (err) { // if wake lock request fails - usually system related, such as battery statuselem.textcontent = `${err.name}, ${err.message}`; } } releasing wake lock the following example shows how to release the previously acquired wake lock. ...
....textcontent = `${err.name}, ${err.message}`; } } releasing wake lock the following example shows how to release the previously acquired wake lock. wakelock.release() .then(() => { wakelock = null; });
listening for wake lock release this example updates the ui if the wake lock has been released for any reason (such as navigating away from the active window/tab). ...
...k has been released for any reason (such as navigating away from the active window/tab). wakelock.addevent
listener('release', () => { // the wake lock has been released statuselem.textcontent = 'wake lock has been released'; }); reacquiring a wake lock the following code reacquires the wake lock should the visibility of the document change and the wake lock is released. document.addevent
listener('visibilitychange', () => { if (wakelock !== null && document.visibilitystate === 'visible') { wakelock = await navigator.wakelock.request('screen'); } }); putting it all together you can find the complete code on github here. the demo uses a button to acquire a wake lock and also release it, which in turn updates the ui. the ui also updates if the wake lock is released automaticall...
... app is performing long-running downloads, consider using background fetch. if you app is synchronizing data from a remote server, consider using background sync. only active documents can acquire screen wake locks and previously acquired locks are automatically released when document becomes inactive. therefore make sure to re-acquire screen wake lock if necessary when document becomes active (
listen for visibilitychange event). feature policy integration access to screen wake lock api is controlled by feature policy directive screen-wake-lock. refer to using feature policy for reference how to use it. specifications specification status comment screen wake lock api unknown initial definition. ...
SourceBuffer - Web APIs
estamp for the end of the append window. sourcebuffer.appendwindowstart controls the timestamp for the start of the append window. this is a timestamp range that can be used to filter what media data is appended to the sourcebuffer. coded media frames with timestamps within this range will be appended, whereas those outside the range will be filtered out. sourcebuffer.audiotracks read only a
list of the audio tracks currently contained inside the sourcebuffer. sourcebuffer.buffered read only returns the time ranges that are currently buffered in the sourcebuffer. sourcebuffer.mode controls how the order of media segments in the sourcebuffer is handled, in terms of whether they can be appended in any order, or they have to be kept in a strict sequence. sourcebuffer.texttracks read on...
... audio tracks currently contained inside the sourcebuffer. sourcebuffer.buffered read only returns the time ranges that are currently buffered in the sourcebuffer. sourcebuffer.mode controls how the order of media segments in the sourcebuffer is handled, in terms of whether they can be appended in any order, or they have to be kept in a strict sequence. sourcebuffer.texttracks read only a
list of the text tracks currently contained inside the sourcebuffer. sourcebuffer.timestampoffset controls the offset applied to timestamps inside media segments that are subsequently appended to the sourcebuffer. sourcebuffer.trackdefaults specifies the default values to use if kind, label, and/or language information is not available in the initialization segment of the media to be appended to t...
...uage information is not available in the initialization segment of the media to be appended to the sourcebuffer. sourcebuffer.updating read only a boolean indicating whether the sourcebuffer is currently being updated — i.e. whether an sourcebuffer.appendbuffer(), sourcebuffer.appendstream(), or sourcebuffer.remove() operation is currently in progress. sourcebuffer.videotracks read only a
list of the video tracks currently contained inside the sourcebuffer. event handlers sourcebuffer.onabort fired whenever sourcebuffer.appendbuffer() or sourcebuffer.appendstream() is ended by a call to sourcebuffer.abort(). sourcebuffer.updating changes from true to false. sourcebuffer.onerror fired whenever an error occurs during sourcebuffer.appendbuffer() or sourcebuffer.appendstream(). sou...
..._bunny.mp4'; // need to be specific for blink regarding codecs // ./mp4info frag_bunny.mp4 | grep codec var mimecodec = 'video/mp4; codecs="avc1.42e01e, mp4a.40.2"'; if ('mediasource' in window && mediasource.istypesupported(mimecodec)) { var mediasource = new mediasource(); //console.log(mediasource.readystate); // closed video.src = url.createobjecturl(mediasource); mediasource.addevent
listener('sourceopen', sourceopen); } else { console.error('unsupported mime type or codec: ', mimecodec); } function sourceopen (_) { //console.log(this.readystate); // open var mediasource = this; var sourcebuffer = mediasource.addsourcebuffer(mimecodec); fetchab(asseturl, function (buf) { sourcebuffer.addevent
listener('updateend', function (_) { mediasource.endofstream(); ...
SpeechRecognition() - Web APIs
specifications specification status comment web speech apithe definition of 'speechrecognition()' in that specifica...
... specifications specification status comment web speech apithe definition of 'speechrecognition()' in that specification. draft ...
... specifications specification status comment web speech apithe definition of 'speechrecognition()' in that specification. draft ...
... specifications specification status comment web speech apithe definition of 'speechrecognition()' in that specification. draft ...
SpeechRecognition.continuous - Web APIs
specifications specification status comment web speech apithe definition of 'continuous' in that specification. dr...
... specifications specification status comment web speech apithe definition of 'continuous' in that specification. draft ...
... specifications specification status comment web speech apithe definition of 'continuous' in that specification. draft ...
... specifications specification status comment web speech apithe definition of 'continuous' in that specification. draft ...
SpeechRecognition.interimResults - Web APIs
specifications specification status comment web speech apithe definition of 'interimresults' in that specification.
... specifications specification status comment web speech apithe definition of 'interimresults' in that specification. draft ...
... specifications specification status comment web speech apithe definition of 'interimresults' in that specification. draft ...
... specifications specification status comment web speech apithe definition of 'interimresults' in that specification. draft ...
SpeechRecognition.lang - Web APIs
specifications specification status comment web speech apithe definition of 'lang' in that specification. draft ...
... specifications specification status comment web speech apithe definition of 'lang' in that specification. draft ...
... specifications specification status comment web speech apithe definition of 'lang' in that specification. draft ...
... specifications specification status comment web speech apithe definition of 'lang' in that specification. draft ...
SpeechRecognition.maxAlternatives - Web APIs
specifications specification status comment web speech apithe definition of 'maxalternatives' in that specification...
... specifications specification status comment web speech apithe definition of 'maxalternatives' in that specification. draft ...
... specifications specification status comment web speech apithe definition of 'maxalternatives' in that specification. draft ...
... specifications specification status comment web speech apithe definition of 'maxalternatives' in that specification. draft ...
SpeechSynthesis.getVoices() - Web APIs
the getvoices() method of the speechsynthesis interface returns a
list of speechsynthesisvoice objects representing all the available voices on the current device. syntax speechsynthesisinstance.getvoices(); parameters none. return value a
list (array) of speechsynthesisvoice objects. note: the spec wrongly
lists this method as returning as a speechsynthesisvoice
list object, but this was in fact removed from the spec. ...
...eechsynthesisvoice objects representing all the available voices on the current device. syntax speechsynthesisinstance.getvoices(); parameters none. return value a
list (array) of speechsynthesisvoice objects. note: the spec wrongly
lists this method as returning as a speechsynthesisvoice
list object, but this was in fact removed from the spec. ...
... draft initial definition ...
... draft initial definition ...
StylePropertyMapReadOnly.get() - Web APIs
a cssstylevalue object for the first value of the specified property. syntax var declarationblock = stylepropertymapreadonly.get(property) parameters property the name of the property to retrieve the value of. return value a cssstylevalue object. examples let's get just a few properties and values. let's start by creating a link inside a paragraph in our html, and adding a definition
list which we will populate with javascript: <p> <a href="https://example.com">link</a> </p> <dl id="regurgitation"></dl> we add a bit of css, including a custom property and an inhertable property: p { font-weight: bold; } a { --colour: red; color: var(--colour); } we use the element's computedstylemap() to return a stylepropertymapreadonly object. we create an array of properties of i...
... { font-weight: bold; } a { --colour: red; color: var(--colour); } we use the element's computedstylemap() to return a stylepropertymapreadonly object. we create an array of properties of interest and use the stylepropertymapreadonly's get() method to get only those values. ...
... working draft initial definition. ...
... working draft initial definition. ...
StylePropertyMapReadOnly - Web APIs
not. the style map will include all the default and inherted css property values. ...
...tput: p { --somevariable: 1.6em; --someothervariable: translatex(33vw); --anothervariable: 42; line-height: var(--somevariable); } we add javascript to grab our paragraph and return back a definition
list of all the default css property values using computedstylemap(). ...
... working draft initial definition. ...
... working draft initial definition. ...
SubtleCrypto.deriveBits() - Web APIs
hub. ...
...y, publickey) { const sharedsecret = await window.crypto.subtle.derivebits( { name: "ecdh", namedcurve: "p-384", public: publickey }, privatekey, 128 ); const buffer = new uint8array(sharedsecret, 0, 5); const sharedsecretvalue = document.queryselector(".ecdh .derived-bits-value"); sharedsecretvalue.class
list.add("fade-in"); sharedsecretvalue.addevent
listener("animationend", () => { sharedsecretvalue.class
list.remove("fade-in"); }); sharedsecretvalue.textcontent = `${buffer}...[${sharedsecret.bytelength} bytes total]`; } // generate 2 ecdh key pairs: one for alice and one for bob // in more normal usage, they would generate their key pairs // separately and exchange public keys securely const generatealiceskeypair = window.crypto.subtle.g...
... // bob could generate the same secret using his private key and alice's public key. derivesharedsecret(aliceskeypair.privatekey, bobskeypair.publickey); }); }); pbkdf2 in this example we ask the user for a password, then use it to derive some bits using pbkdf2. see the complete code o...
...rypto.getrandomvalues(new uint8array(16)); const derivedbits = await window.crypto.subtle.derivebits( { "name": "pbkdf2", salt: salt, "iterations": 100000, "hash": "sha-256" }, keymaterial, 256 ); const buffer = new uint8array(derivedbits, 0, 5); const derivedbitsvalue = document.queryselector(".pbkdf2 .derived-bits-value"); derivedbitsvalue.class
list.add("fade-in"); derivedbitsvalue.addevent
listener("animationend", () => { derivedbitsvalue.class
list.remove("fade-in"); }); derivedbitsvalue.textcontent = `${buffer}...[${derivedbits.bytelength} bytes total]`; } const derivebitsbutton = document.queryselector(".pbkdf2 .derive-bits-button"); derivebitsbutton.addevent
listener("click", () => { getderivedbits(); }); specifications ...
SubtleCrypto.verify() - Web APIs
.value; let enc = new textencoder(); return enc.encode(message); } /* fetch the encoded message-to-sign and verify it against the stored signature. * if it checks out, set the "valid" class on the signature. * otherwise set the "invalid" class. */ async function verifymessage(publickey) { const signaturevalue = document.queryselector(".rsassa-pkcs1 .signature-value"); signaturevalue.class
list.remove("valid", "invalid"); let encoded = getmessageencoding(); let result = await window.crypto.subtle.verify( "rsassa-pkcs1-v1_5", publickey, signature, encoded ); signaturevalue.class
list.add(result ? "valid" : "invalid"); } rsa-pss this code uses a public key to verify a signature. see the complete code on github. /* fetch the contents of the "message" textbox, an...
...gebox.value; let enc = new textencoder(); return enc.encode(message); } /* fetch the encoded message-to-sign and verify it against the stored signature. * if it checks out, set the "valid" class on the signature. * otherwise set the "invalid" class. */ async function verifymessage(publickey) { const signaturevalue = document.queryselector(".rsa-pss .signature-value"); signaturevalue.class
list.remove("valid", "invalid"); let encoded = getmessageencoding(); let result = await window.crypto.subtle.verify( { name: "rsa-pss", saltlength: 32, }, publickey, signature, encoded ); signaturevalue.class
list.add(result ? "valid" : "invalid"); } ecdsa this code uses a public key to verify a signature. see the complete code on github. /* fetch the conten...
...sagebox.value; let enc = new textencoder(); return enc.encode(message); } /* fetch the encoded message-to-sign and verify it against the stored signature. * if it checks out, set the "valid" class on the signature. * otherwise set the "invalid" class. */ async function verifymessage(publickey) { const signaturevalue = document.queryselector(".ecdsa .signature-value"); signaturevalue.class
list.remove("valid", "invalid"); let encoded = getmessageencoding(); let result = await window.crypto.subtle.verify( { name: "ecdsa", hash: {name: "sha-384"}, }, publickey, signature, encoded ); signaturevalue.class
list.add(result ? "valid" : "invalid"); } hmac this code uses a secret key to verify a signature. see the complete code on github. /* fetch the ...
...messagebox.value; let enc = new textencoder(); return enc.encode(message); } /* fetch the encoded message-to-sign and verify it against the stored signature. * if it checks out, set the "valid" class on the signature. * otherwise set the "invalid" class. */ async function verifymessage(key) { const signaturevalue = document.queryselector(".hmac .signature-value"); signaturevalue.class
list.remove("valid", "invalid"); let encoded = getmessageencoding(); let result = await window.crypto.subtle.verify( "hmac", key, signature, encoded ); signaturevalue.class
list.add(result ? "valid" : "invalid"); } specifications specification status comment web cryptography apithe definition of 'subtlecrypto.verify()' in that specification. ...
TextTrack: cuechange event - Web APIs
the cuechange event fires when a texttrack has changed the currently displaying cues. the event is fired at both the texttrack and at the htmltrackelement in which it's being presented, if any. ...
...e currently displaying cues. the event is fired at both the texttrack and at the htmltrackelement in which it's being presented, if any. ...
...vent is fired at both the texttrack and at the htmltrackelement in which it's being presented, if any. ...
... cuechange event every time the currently-presented cue is changed. this happens even if the track isn't associated with a media element. if the track is associated with a media element, using the <track> element as a child of the <audio> or <video> element, the cuechange event is also sent to the htmltrackelement. ...
getTrackById() - Web APIs
if no match is found, this method returns null. the tracks are searched in their natural order; that is, in the order defined by the media resource itself, or, if the resource doesn't define an order, the relative order in which the tracks are declared by the media resource. ...
...if no match is found, this method returns null. the tracks are searched in their natural order; that is, in the order defined by the media resource itself, or, if the resource doesn't define an order, the relative order in which the tracks are declared by the media resource. ...
...if no match is found, this method returns null. the tracks are searched in their natural order; that is, in the order defined by the media resource itself, or, if the resource doesn't define an order, the relative order in which the tracks are declared by the media resource. ...
... if no match is found, this method returns null. the tracks are searched in their natural order; that is, in the order defined by the media resource itself, or, if the resource doesn't define an order, the relative order in which the tracks are declared by the media resource. specifications specification status comment html living standardthe definition of 'texttrack
list.gettrackbyid()' in that specification. living standard ...
TouchEvent.targetTouches - Web APIs
the targettouches read-only property is a touch
list listing all the touch objects for touch points that are still in contact with the touch surface and whose touchstart event occurred inside the same target element as the current target element. syntax var touches = touchevent.targettouches; return value touches a touch
list listing all the touch objects for touch points that are still in contact with the touch surface and whose touchstart event occurred inside the same target element as the current target element. example this example illustrates the touchevent object's touchevent.targettouches property. ...
...uchevent.targettouches; return value touches a touch
list listing all the touch objects for touch points that are still in contact with the touch surface and whose touchstart event occurred inside the same target element as the current target element. example this example illustrates the touchevent object's touchevent.targettouches property. the touchevent.targettouches property is a touch
list object that includes those tps that are currently touching the surface and started on the element that is the target of the current event. as such, the targettouches
list is a strict subset of the touches
list. ...
... function touches_in_target(ev) { // return true if all of the touches are within the target element; // otherwise return false. ...
... function touches_in_target(ev) { // return true if all of the touches are within the target element; // otherwise return false. ...
VideoTrack.label - Web APIs
specifying the track's human-readable label, if one is available in the track metadata. otherwise, an empty string ("") is returned. for example, a track whose kind is "sign" might have a label such as "a sign-language interpretation.". example this example returns an array of track kinds and labels for potential use in a user interface to select video tracks for a specified media element. ...
...metadata. otherwise, an empty string ("") is returned. for example, a track whose kind is "sign" might have a label such as "a sign-language interpretation.". example this example returns an array of track kinds and labels for potential use in a user interface to select video tracks for a specified media element. the
list is filtered to only allow certain track kinds through. ...
...n empty string ("") is returned. for example, a track whose kind is "sign" might have a label such as "a sign-language interpretation.". example this example returns an array of track kinds and labels for potential use in a user interface to select video tracks for a specified media element. the
list is filtered to only allow certain track kinds through. ...
...f track kinds and labels for potential use in a user interface to select video tracks for a specified media element. the
list is filtered to only allow certain track kinds through. function gettrack
list(el) { var track
list = []; const wantedkinds = [ "main", "alternative", "commentary" ]; el.videotracks.foreach(function(track) { if (wantedkinds.includes(track.kind)) { track
list.push({ id: track.id, kind: track.kind, label: track.label }); } }); return track
list; } the resulting track
list contains an array of video tracks whose kind is one of those in the array wantedkinds, with each entry providing the track's id, kind, and label. specifications specification status comment html living standardthe defi...
getTrackById - Web APIs
if no match is found, this method returns null. the tracks are searched in their natural order; that is, in the order defined by the media resource itself, or, if the resource doesn't define an order, the relative order in which the tracks are declared by the media resource. ...
...if no match is found, this method returns null. the tracks are searched in their natural order; that is, in the order defined by the media resource itself, or, if the resource doesn't define an order, the relative order in which the tracks are declared by the media resource. ...
...if no match is found, this method returns null. the tracks are searched in their natural order; that is, in the order defined by the media resource itself, or, if the resource doesn't define an order, the relative order in which the tracks are declared by the media resource. ...
...if no match is found, this method returns null. the tracks are searched in their natural order; that is, in the order defined by the media resource itself, or, if the resource doesn't define an order, the relative order in which the tracks are declared by the media resource. specifications specification status comment html living standardthe definition of 'videotrack
list.gettrackbyid()' in that specification. living standard ...
A basic 2D WebGL animation example - Web APIs
ertex information let vertexarray; let vertexbuffer; let vertexnumcomponents; let vertexcount; // rendering data shared with the // scalers. ...
...ray_buffer, vertexarray, gl.static_draw); vertexnumcomponents = 2; vertexcount = vertexarray.length/vertexnumcomponents; currentangle = 0.0; rotationrate = 6; animatescene(); } after getting the webgl context, gl, we need to begin by building the shader program. here, we're using code designed to let us add multiple shaders to our program quite easily. the array shaderset contains a
list of objects, each describing one shader function to be compiled into the program. each function has a type (one of gl.vertex_shader or gl.fragment_shader) and an id (the id of the <script> element containing the shader's code). the shader set is passed into the function buildshaderprogram(), which returns the compiled and linked shader program. we'll look at how this works next. once the shader...
...t the data will be set only one time and never modified, but will be used repeatedly. this lets webgl consider any optimizations it can apply that may improve performance based on that information. with the vertex data now provided to webgl, we set vertexnumcomponents to the number of components in each vertex (2, since they're 2d vertexes) and vertexcount to the number of vertexes in the vertex
list. then the current rotation angle (in degrees) is set to 0.0, since we haven't performed any rotation yet, and the rotation speed (in degrees per screen refresh period, typically 60 fps) is set to 6. finally, animatescene() is called to render the first frame and schedule the rendering of the next frame of the animation. compiling and linking the shader program constructing and linking the pro...
...pe); if (shader) { gl.attachshader(program, shader); } }); gl.linkprogram(program) if (!gl.getprogramparameter(program, gl.link_status)) { console.log("error linking shader program:"); console.log(gl.getprograminfolog(program)); } return program; } first, gl.createprogram() is called to create a new, empty, glsl program. then, for each shader in the specified
list of shaders, we call a compileshader() function to compile it, passing into it the id and type of the shader function to build. each of those objects includes, as mentioned before, the id of the <script> element the shader code is found in and the type of shader it is. the compiled shader is attached to the shader program by passing it into gl.attachshader(). we could go a step farther here, act...
Scissor animation - Web APIs
n</button> <canvas>your browser does not seem to support html5 canvas.</canvas> body { text-align : center; } canvas { display : block; width : 280px; height : 210px; margin : auto; padding : 0; border : none; background-color : black; } button { display : block; font-size : inherit; margin : auto; padding : 0.6em; } ;(function(){ "use strict" window.addevent
listener("load", setupanimation, false); // variables to hold the webgl context, and the color and // position of animated squares. var gl, color = getrandomcolor(), position; function setupanimation (evt) { window.removeevent
listener(evt.type, setupanimation, false); if (!(gl = getrenderingcontext())) return; gl.enable(gl.scissor_test); gl.clearcolor(color[0], color[1], color[2], 1.
...r[0], color[1], color[2], 1.0); // unlike the browser window, vertical position in webgl is // measured from bottom to top. in here we set the initial // position of the square to be at the top left corner of the // drawing buffer. ...
..., vertical position in webgl is // measured from bottom to top. in here we set the initial // position of the square to be at the top left corner of the // drawing buffer. ...
... var button = document.queryselector("button"); var timer; function startanimation(evt) { button.removeevent
listener(evt.type, startanimation, false); button.addevent
listener("click", stopanimation, false); document.queryselector("strong").innerhtml = "stop"; timer = setinterval(drawanimation, 17); drawanimation(); } function stopanimation(evt) { button.removeevent
listener(evt.type, stopanimation, false); button.addevent
listener("click", startanimation, false); document.queryselector("strong").innerhtml = "start"; clearinterval(timer); } stopanimation({type: "click"}); } // variables to hold the size and velocity of the square. var size = [60, 60], velocity = 3.0; function drawanimation () { gl.scissor(position[0], position[1], size[0] , si...
Simple color animation - Web APIs
vas> <button id="animation-onoff"> press here to <strong>[verb goes here]</strong> the animation </button> body { text-align : center; } canvas { display : block; width : 280px; height : 210px; margin : auto; padding : 0; border : none; background-color : black; } button { display : inline-block; font-size : inherit; margin : auto; padding : 0.6em; } window.addevent
listener("load", function setupanimation (evt) { "use strict" window.removeevent
listener(evt.type, setupanimation, false); // a variable to hold a timer that drives the animation. var timer; // click event handlers. var button = document.queryselector("#animation-onoff"); var verb = document.queryselector("strong"); function startanimation(evt) { button.removeevent
listener(evt.ty...
..."use strict" window.removeevent
listener(evt.type, setupanimation, false); // a variable to hold a timer that drives the animation. var timer; // click event handlers. var button = document.queryselector("#animation-onoff"); var verb = document.queryselector("strong"); function startanimation(evt) { button.removeevent
listener(evt.type, startanimation, false); button.addevent
listener("click", stopanimation, false); verb.innerhtml="stop"; // setup animation loop by redrawing every second. timer = setinterval(drawanimation, 1000); // give immediate feedback to user after clicking, by // drawing one animation frame. ...
... clearinterval(timer); } // call stopanimation() once to setup the initial event // handlers for canvas and button. ...
...tener("click", stopanimation, false); verb.innerhtml="stop"; // setup animation loop by redrawing every second. timer = setinterval(drawanimation, 1000); // give immediate feedback to user after clicking, by // drawing one animation frame. drawanimation(); } function stopanimation(evt) { button.removeevent
listener(evt.type, stopanimation, false); button.addevent
listener("click", startanimation, false); verb.innerhtml="start"; // stop animation by clearing the timer. clearinterval(timer); } // call stopanimation() once to setup the initial event // handlers for canvas and button. stopanimation({type: "click"}); var gl; function drawanimation () { if (!gl) { var canvas = document.getelementbyid("canvas-view"); gl = canv...
WebSocket - Web APIs
value websocket.connecting 0 websocket.open 1 websocket.closing 2 websocket.closed 3 properties websocket.binarytype the binary data type used by the connection. websocket.bufferedamount read only the number of bytes of queued data. websocket.extensions read only the extensions selected by the server. websocket.onclose an event
listener to be called when the connection is closed. websocket.onerror an event
listener to be called when an error occurs. websocket.onmessage an event
listener to be called when a message is received from the server. websocket.onopen an event
listener to be called when the connection is opened. websocket.protocol read only the sub-protocol selected by the server. websocket.readystate read ...
... close fired when a connection with a websocket is closed. also available via the onclose property error fired when a connection with a websocket has been closed because of an error, such as when some data couldn't be sent. also available via the onerror property. ...
...nnection is opened. websocket.protocol read only the sub-protocol selected by the server. websocket.readystate read only the current state of the connection. websocket.url read only the absolute url of the websocket. methods websocket.close([code[, reason]]) closes the connection. websocket.send(data) enqueues data to be transmitted. events
listen to these events using addevent
listener() or by assigning an event
listener to the oneventname property of this interface. close fired when a connection with a websocket is closed. also available via the onclose property error fired when a connection with a websocket has been closed because of an error, such as when some data couldn't be sent. also available via the onerror property. message fired when data is received th...
...ta couldn't be sent. also available via the onerror property. message fired when data is received through a websocket. also available via the onmessage property. open fired when a connection with a websocket is opened. also available via the onopen property. examples // create websocket connection. const socket = new websocket('ws://localhost:8080'); // connection opened socket.addevent
listener('open', function (event) { socket.send('hello server!'); }); //
listen for messages socket.addevent
listener('message', function (event) { console.log('message from server ', event.data); }); specifications specification status html living standardthe definition of 'websocket' in that specification. living standard ...
Viewpoints and viewers: Simulating cameras in WebXR - Web APIs
pothetical viewer of the scene, whether there's an actual object present in 3d space or not. points of view since the camera is a virtual object which, rather than necessarily representing a physical object in the virtual world, represents a viewer's position and viewing direction, it's useful to think about the kinds of situation that call for the use of a camera. gaming-related situations are
listed separately since they are often a special case specific to gaming, but any of these perspectives might apply to any 3d graphics scene. generalized cameras in general, virtual cameras may or may not be incorporated into physical objects within the scene. indeed, outside the scope of 3d gaming, the odds are far more likely that the camera will not correspond with an object that appears in the s...
...he field of view is an angle defining the length of the arc on the entire viewable area surrounding the camera that should be visible at once. this is an effect of the focal length in a physical camera, so since there is no true camera, altering the fov is a passable substitute. recall that the circumference of a circle is 2π⋅r radians (360°); as such, this is the theoretical maximum fov. rea
listically, though, not only do humans not see anywhere near that much, but viewing devices such as monitors and vr goggles tend to reduce the field of view even further. human eyes typically have a horizontal field of view of around 135° (about 2.356 radians) and a vertical fov of about 180° (π or around 3.142 radians). making the camera's fov smaller reduces the arc that will be included in the ...
...rame(), providing a callback function that renders a frame of animation. when the browser needs you to render the scene, it invokes the callback, providing as input parameters the current time and an xrframe encapsulating the data needed to render the correct frame. this information includes the xrviewerpose describing the position and facing direction of the viewer within the scene as well as a
list of xrview objects, each representing one perspective on the scene. in current webxr implementations, there will never be more than two entries in this
list: one describing the position and viewing angle of the left eye and another doing the same for the right. you can tell which eye a given xrview represents by checking the value of its eye property, which is a string whose value is left or right...
...e image seen by the eye identified by view.eye. with the constraints so established and everything else we need ready, we call a custom function, myrenderscene(), to actually perform the computations and webgl rendering to render the frame. in this case, we're passing in the webgl context, gl, the xrview view, a scenedata object (which contains things like the vertex and fragment shaders, vertex
lists, textures, and so forth), and deltatime, which indicates how much time has passed since the previous frame, so that we know how far to advance the animation. when this function returns, the webgl framebuffer being used by webxr now has in it two copies of the scene, each occupying half the frame: one for the left eye, and one for the right eye. this makes its way through the xr software and dri...
Web Authentication API - Web APIs
m a series of checks to ensure that the registration was complete and not tampered with. these include: verifying that the challenge is the same as the challenge that was sent ensuring that the origin was the origin expected validating that the signature over the clientdatahash and the attestation using the certificate chain for that specific model of the authenticator a complete
list of validation steps can be found in the web authentication api specification. assuming that the checks pan out, the server will store the new public key associated with the user's account for future use -- that is, whenever the user desires to use the public key for authentication. authentication after a user has registered with web authentication, they can subsequently authenticate (a.k.a. - ...
...request, the server performs validation of the response such as: using the public key that was stored during the registration request to validate the signature by the authenticator. ensuring that the challenge that was signed by the authenticator matches the challenge that was generated by the server. checking that the relying party id is the one expected for this service. a full
list of the steps for validating an assertion can be found in the web authentication api specification. assuming the validation is successful, the server will note that the user is now authenticated. this is outside the scope of the web authentication api specification, but one option would be to drop a new cookie for the user session. interfaces credential provides information about an entity...
...0x6f, 0x81, 0x26, 0xe2, 0xa6, 0x01, 0x7d, 0x74, 0x50 ]).buffer }, }; // register / create a new credential navigator.credentials.create(createcredentialdefaultargs) .then((cred) => { console.log("new credential", cred); // normally the credential ids available for an account would come from a server // but we can just copy them from above... ...
...d) => { console.log("new credential", cred); // normally the credential ids available for an account would come from a server // but we can just copy them from above... var id
list = [{ id: cred.rawid, transports: ["usb", "nfc", "ble"], type: "public-key" }]; getcredentialdefaultargs.publickey.allowcredentials = id
list; return navigator.credentials.get(getcredentialdefaultargs); }) .then((assertion) => { console.log("assertion", assertion); }) .catch((err) => { console.log("error", err); }); mozilla demo website and its source code. google demo website and its source code. webauthn.org and its client source code and server source code specifications ...
Window: resize event - Web APIs
the resize event fires when the document view (window) has been resized. bubbles no cancelable no interface uievent event handler property onresize in some earlier browsers it was possible to register resize event handlers on any html element. it is still possible to set onresize attributes or use addevent
listener() to set a handler on any element. however, resize events are only fired on the window object (i.e. returned by document.defaultview). only handlers registered on the window object will receive resize events. there is a proposal to allow all elements to be notified of resize changes. see resize observer to read the draft document, and github issues to read the on-going discussions. examples window size logger the following ...
... obsolete css object model (cssom) view modulethe definition of 'resize' in that ...
... obsolete css object model (cssom) view modulethe definition of 'resize' in that specification. working draft ...
... obsolete css object model (cssom) view modulethe definition of 'resize' in that specification. working draft ...
Window: unload event - Web APIs
isible anymore to the end user ui interactions are ineffective (window.open, alert, confirm, etc.) an error won't stop the unloading workflow please note that the unload event also follows the document tree: parent frame unload will happen before child frame unload (see example below). ...
...stop the unloading workflow please note that the unload event also follows the document tree: parent frame unload will happen before child frame unload (see example below). ...
... specifications ...
... specifications specification status comment ui eventsthe definition of 'unload' in that specification.
WindowClient.focused - Web APIs
the focused read-only property of the windowclient interface is a boolean that indicates whether the current client has focus. syntax var myfocused = windowclient.focused; value a boolean. ...
...cus. syntax var myfocused = windowclient.focused; value a boolean. ...
...ient.focused; value a boolean. ...
...lf.addevent
listener('notificationclick', function(event) { console.log('on notification click: ', event.notification.tag); event.notification.close(); // this looks to see if the current is already open and // focuses if it is event.waituntil(clients.matchall({ type: "window" }).then(function(client
list) { for (var i = 0; i < client
list.length; i++) { var client = client
list[i]; if (client.url == '/' && 'focus' in client) { if(!client.focused) return client.focus(); } } } if (clients.openwindow) return clients.openwindow('/'); })); }); specifications specification status comment service workersthe definition of 'windowclient: focused' in that specification. working draft initial def...
Worker: message event - Web APIs
the message event is fired on a worker object when the worker's parent receives a message from its worker (i.e. when the worker sends a message using dedicatedworkerglobalscope.postmessage()). ...
... is fired on a worker object when the worker's parent receives a message from its worker (i.e. when the worker sends a message using dedicatedworkerglobalscope.postmessage()). ...
...rker (i.e. when the worker sends a message using dedicatedworkerglobalscope.postmessage()). ...
...cancelable no interface messageevent event handler property onmessage examples this code creates a new worker and
listens to messages from it using addevent
listener(): const worker = new worker("static/scripts/worker.js"); worker.addevent
listener('message', (event) => { console.log(`received message from worker: ${event.data}`) }); alternatively, it could
listen using the onmessage event handler property: const worker = new worker("static/scripts/worker.js"); worker.onmessage = (event) => { console.log(`received message from worker: ${event.data}`) }; the worker posts messages using self.postmessage(): // static/scripts/worker.js self.postmessage('i\'m alive!'); specifications specification status html living standard ...
Worker: messageerror event - Web APIs
the messageerror event is fired on a worker object when it receives a message that can't be deserialized. ...
... the messageerror event is fired on a worker object when it receives a message that can't be deserialized. ...
...rker object when it receives a message that can't be deserialized. ...
...no interface messageevent event handler property onmessageerror examples create a worker, and
listen for message and messageerror events using addevent
listener(): // inside main.js const worker = new worker("static/scripts/worker.js"); worker.addevent
listener("message", (event) => { console.error(`received message from worker: ${event}`); }); worker.addevent
listener("messageerror", (event) => { console.error(`error receiving message from worker: ${event}`); }); the same, but using the onmessageerror event handler property: // inside main.js const worker = new worker("static/scripts/worker.js"); worker.onmessage = (event) => { console.error(`received message from worker: ${event}`); }; worker.onmessageerror = (event) => { console.error(`e...
Synchronous and asynchronous requests - Web APIs
rred, an error message is displayed. line 15 actually initiates the request. the callback routine is called whenever the state of the request changes. example: writing a function to read an external file in some cases, you must read many external files. this is a standard function which uses the xmlhttprequest object asynchronously in order to switch the content of the read file to a specified
listener. function xhrsuccess() { this.callback.apply(this, this.arguments); } function xhrerror() { console.error(this.statustext); } function loadfile(url, callback /*, opt_arg1, opt_arg2, ... */) { var xhr = new xmlhttprequest(); xhr.callback = callback; xhr.arguments = array.prototype.slice.call(arguments, 2); xhr.onload = xhrsuccess; xhr.onerror = xhrerror; xhr.
... line 1 declares a function invoked when the xhr operation completes successfully. it, in turn, invokes the callback function specified in the invocation of the loadfile function (in this case, the function showmessage) which has been assigned to a property of the xhr obje...
...when fetch with keepalive isn't available, you can consider using the navigator.sendbeacon() api, which can support these use cases while typically delivering a good ux. the following example shows theoretical analytics code that attempts to submit data to a server by using a synchronous xmlhttprequest in an unload handler. this results in the unloading of the page to be delayed. window.addevent
listener('unload', logdata, false); function logdata() { var client = new xmlhttprequest(); client.open("post", "/log", false); // third parameter indicates sync xhr. :( client.setrequestheader("content-type", "text/plain;charset=utf-8"); client.send(analyticsdata); } using the sendbeacon() method, the data will be transmitted asynchronously to the web server when the user agent has...
...t.send(analyticsdata); } using the sendbeacon() method, the data will be transmitted asynchronously to the web server when the user agent has had an opportunity to do so, without delaying the unload or affecting the performance of the next navigation. the following example shows a theoretical analytics code pattern that submits data to a server by using the sendbeacon() method. window.addevent
listener('unload', logdata, false); function logdata() { navigator.sendbeacon("/log", analyticsdata); } ...
XRInputSource.profiles - Web APIs
each input profile specifies the preferred visual representation and behavior of the input source. ...
...each input profile specifies the preferred visual representation and behavior of the input source. ...
...each input profile specifies the preferred visual representation and behavior of the input source. ...
...each input profile specifies the preferred visual representation and behavior of the input source. ...
XRPermissionDescriptor.requiredFeatures - Web APIs
the xrpermissiondescriptor dictionary's requiredfeatures property should be set prior to calling navigator.permissions.query() to a
list of webxr features which must be supported for the app to work. this ensures that permissions are checked as applicable to ensure that those features are available upon request. ...
...rpermissiondescriptor dictionary's requiredfeatures property should be set prior to calling navigator.permissions.query() to a
list of webxr features which must be supported for the app to work. this ensures that permissions are checked as applicable to ensure that those features are available upon request. syntax xrpermissiondescriptor = { mode: xrsessionmode, requiredfeatures: reqfeature
list, optionalfeatures: optfeature
list }; xrpermissiondescriptor.requiredfeatures = reqfeature
list; reqfeature
list = xrpermissiondescriptor.requiredfeatures; value an array of strings indicating the webxr features which must be available for use by the app or site. ...
..., requiredfeatures: reqfeature
list, optionalfeatures: optfeature
list }; xrpermissiondescriptor.requiredfeatures = reqfeature
list; reqfeature
list = xrpermissiondescriptor.requiredfeatures; value an array of strings indicating the webxr features which must be available for use by the app or site. the permissions check will be performed in such a manner as to verify that all features in the
list are available for use with the user's permission. currently, all features are members of the xrreferencespacetype enumerated type, indicating the reference space types that your app would like permission to use, but can operate without. future editions of webxr may add more recognized features. ...
... xrreferencespacetype description interface bounded-floor similar to the local type, except the user is not expected to move outside a predetermined boundary, given by the boundsgeometry in the returned object. ...
XRSession: selectend event - Web APIs
system or handheld controller with an accelerometer. bubbles yes cancelable no interface xrinputsourceevent event handler property onselectend for details on how the selectstart, select, and selectend events work, and how you should react to them, see primary actions in inputs and input sources. examples the following example uses addevent
listener() to establish handlers for the selection events: selectstart, selectend, and select. this snippet is the core of an event handler to allow the user to grab objects in the scene and move them around. in this case, a single function is used to handle all three events, allowing them to share certain code that's the same regardless of which of the three events is received. only after completing...
...and the current target ray pose transform as inputs. this places the object into its new position in the world and triggers any effects that may arise from doing so (like scheduling an animation of a splash if dropped in water, etc). the selectend event results in a mystoptracking() function being called with the object being dragged and the final target ray pose's transform. ...
...ces the object into its new position in the world and triggers any effects that may arise from doing so (like scheduling an animation of a splash if dropped in water, etc). the selectend event results in a mystoptracking() function being called with the object being dragged and the final target ray pose's transform. ...
...iggers any effects that may arise from doing so (like scheduling an animation of a splash if dropped in water, etc). the selectend event results in a mystoptracking() function being called with the object being dragged and the final target ray pose's transform. ...
XRSession: selectstart event - Web APIs
ystem or handheld controller with an accelerometer. bubbles yes cancelable no interface xrinputsourceevent event handler property onselectstart for details on how the selectstart, select, and selectend events work, and how you should react to them, see primary actions in inputs and input sources. examples the following example uses addevent
listener() to establish handlers for the selection events: selectstart, selectend, and select. this snippet is the core of an event handler to allow the user to grab objects in the scene and move them around. in this case, a single function is used to handle all three events, allowing them to share certain code that's the same regardless of which of the three events is received. only after completing...
...and the current target ray pose transform as inputs. this places the object into its new position in the world and triggers any effects that may arise from doing so (like scheduling an animation of a splash if dropped in water, etc). the selectend event results in a mystoptracking() function being called with the object being dragged and the final target ray pose's transform. ...
...ces the object into its new position in the world and triggers any effects that may arise from doing so (like scheduling an animation of a splash if dropped in water, etc). the selectend event results in a mystoptracking() function being called with the object being dragged and the final target ray pose's transform. ...
...iggers any effects that may arise from doing so (like scheduling an animation of a splash if dropped in water, etc). the selectend event results in a mystoptracking() function being called with the object being dragged and the final target ray pose's transform. ...
XRSession: squeezeend event - Web APIs
andheld controller with an accelerometer. bubbles yes cancelable no interface xrinputsourceevent event handler property onsqueezeend for details on how the squeezestart, squeeze, and squeezeend events work, and how you should react to them, see primary squeeze actions in inputs and input sources. examples the following example uses addevent
listener() to establish handlers for the squeezeion events: squeezestart, squeezeend, and squeeze. this snippet is the core of an event handler to allow the user to grab objects in the scene and move them around. in this case, a single function is used to handle all three events, allowing them to share certain code that's the same regardless of which of the three events is received. only after comple...
...nd the current target ray pose transform as inputs. this places the object into its new position in the world and triggers any effects that may arise from doing so (like scheduling an animation of a splash if dropped in water, etc). the squeezeend event results in a mystoptracking() function being called with the object being dragged and the final target ray pose's transform. ...
...ces the object into its new position in the world and triggers any effects that may arise from doing so (like scheduling an animation of a splash if dropped in water, etc). the squeezeend event results in a mystoptracking() function being called with the object being dragged and the final target ray pose's transform. ...
...riggers any effects that may arise from doing so (like scheduling an animation of a splash if dropped in water, etc). the squeezeend event results in a mystoptracking() function being called with the object being dragged and the final target ray pose's transform. ...
XRSession: squeezestart event - Web APIs
ted using triggers on hand controllers. bubbles yes cancelable no interface xrinputsourceevent event handler property onsqueezestart for details on how the squeezestart, squeeze, and squeezeend events work, and how you should react to them, see primary squeeze actions in inputs and input sources. examples the following example uses addevent
listener() to establish handlers for the squeezeion events: squeezestart, squeezeend, and squeeze. this snippet is the core of an event handler to allow the user to grab objects in the scene and move them around. in this case, a single function is used to handle all three events, allowing them to share certain code that's the same regardless of which of the three events is received. only after comple...
...nd the current target ray pose transform as inputs. this places the object into its new position in the world and triggers any effects that may arise from doing so (like scheduling an animation of a splash if dropped in water, etc). the squeezeend event results in a mystoptracking() function being called with the object being dragged and the final target ray pose's transform. ...
...ces the object into its new position in the world and triggers any effects that may arise from doing so (like scheduling an animation of a splash if dropped in water, etc). the squeezeend event results in a mystoptracking() function being called with the object being dragged and the final target ray pose's transform. ...
...riggers any effects that may arise from doing so (like scheduling an animation of a splash if dropped in water, etc). the squeezeend event results in a mystoptracking() function being called with the object being dragged and the final target ray pose's transform. ...
XRSession: visibilitychange event - Web APIs
ing the event, you can check the value of the session's visibilitystate property to determine the new visibility state. bubbles yes cancelable no interface xrsessionevent event handler property onvisibilitychange when the xrsession receives this event, the visibility state has already been changed. ...
...e property to determine the new visibility state. bubbles yes cancelable no interface xrsessionevent event handler property onvisibilitychange when the xrsession receives this event, the visibility state has already been changed. ...
...ine the new visibility state. bubbles yes cancelable no interface xrsessionevent event handler property onvisibilitychange when the xrsession receives this event, the visibility state has already been changed. ...
...essionevent event handler property onvisibilitychange when the xrsession receives this event, the visibility state has already been changed. ...
Using ARIA: Roles, states, and properties - Accessibility
gridcell link menuitem menuitemcheckbox menuitemradio option progressbar radio scrollbar searchbox separator (when focusable) slider spinbutton switch tab tabpanel textbox treeitem composite roles the techniques below describe each composite role as well as their required and optional child roles. ...
...r radio scrollbar searchbox separator (when focusable) slider spinbutton switch tab tabpanel textbox treeitem composite roles the techniques below describe each composite role as well as their required and optional child roles. ...
... as their required and optional child roles. ...
...eir required and optional child roles. ...
ARIA: Navigation Role - Accessibility
the navigation landmark role is used to identify major groups of links used for navigating through a website or page content. <div role="navigation" aria-label="main"> <!--
list of links to main website locations --> </div> this is a website's main navigation. description the navigation role is a landmark role. landmark roles provide a way to identify the organization and structure of a web page. by classifying and labeling sections of a page, structural information conveyed visually through layout is represented programmatically. ...
...les provide a way to identify the organization and structure of a web page. by classifying and labeling sections of a page, structural information conveyed visually through layout is represented programmatically. screen readers use landmark roles to provide keyboard navigation to important sections of a page. like the html <nav> element, navigation landmarks provide a way to identify groups (e.g.
lists) of links that are intended to be used for website or page content navigation. if a page includes more than one navigation landmark, each should have a unique label. if two or more navigational landmark on a page have the same set of links, use the same label for each. it is preferable to use the html5 <nav> element to define a navigation landmark. if the html5 nav element technique is not bein...
...oter-nav" aria-label="footer"> <!-- content --> </nav> repeated landmarks if a navigation landmark role or <nav> element in a document is repeated in a document, and both landmarks have identical content, use the same label for each landmark. an example of this would be repeating the main navigation at the top and bottom of the page. <header> <nav id="main-nav" aria-label="main"> <!--
list of links to main website locations --> </nav> </header> ... <footer> <nav id="footer-nav" aria-label="main"> <!--
list of links to main website locations --> </nav> </footer> redundant descriptions screen readers will announce the type of role the landmark is. because of this, you do not need to describe what the landmark is in its label. for example, a declaration of role="navigat...
...dundant descriptions screen readers will announce the type of role the landmark is. because of this, you do not need to describe what the landmark is in its label. for example, a declaration of role="navigation" with an of aria-label="primary navigation" may be announced redundantly as, "primary navigation navigation". added benefits certain technologies such as browser extensions can generate
lists of all landmark roles present on a page, allowing non-screen reader users to also quickly identify and navigate to large sections of the document. landmarks browser extension specifications specification status accessible rich internet applications (wai-aria) 1.1the definition of 'aria navigtion role' in that specification. recommendation wai-aria authoring...
Perceivable - Accessibility
hould be provided, for example a script of the movie you are watching. this is for the benefit of hearing-impaired viewers who cannot hear the content. see audio transcripts for transcript information. 1.2.9 provide a transcript for live audio (aaa) for any live audio content being broadcast, a descriptive text should be provided, for example a script of the play or musical you are
listening to. this is for the benefit of hearing-impaired viewers who cannot hear the content. see audio transcripts for transcript information. note: also see the wcag description for guideline 1.2: time-based media: provide alternatives for time-based media. guideline 1.3 — create content that can be presented in different ways this guideline refers to the ability of content to be co...
...h can be picked up by screenreaders, etc. image alt text. content images should have text available that clearly describes the image's contents, which can be programmatically associated with it (e.g., alt text), or otherwise is easy to associate (e.g., describes it and is sat right next to it). this should mean that the full meaning can still be inferred even if you can't see the image.
lists. if the order of
list items is important, use an ordered
list (<ol>). the whole of html: a good basis for accessibility is packed with information about this, but you should particularly refer to good semantics, ui controls, and text alternatives. 1.3.2 meaningful content sequence (a) a sensible, logical reading order should be easy to determine for any content, e...
...may prove inaccessible to people with a disability related to that sense, or a device that does not support that sense. so, for example: "click the round button to continue" the button should be clearly labelled so that it is obvious that it is the button you need to press. if there are multiple buttons, make sure they are all clearly labelled to distinguish their function. "
listen to the audio instructions for guidance" this is obviously problematic—audio will be inaccessible to those with hearing impairments, whereas text can be read, but also spoken by a screenreader if required. "swipe from the right hand side of the screen to reveal the menu" some users might not be able to swipe the screen, either due to disability or because their device does not...
...is related, but covered in a different guideline — 1.4.1. 1.3.4 orientation (aa) added in 2.1 content does not restrict its view and operation to a single display orientation, such as portrait or landscape, unless a specific display orientation is essential. understanding orientation 1.3.5 identify input purpose (aa) added in 2.1 follow the
list of 53 input fields to programmatically identify the purpose of a field. understanding identify input purpose 1.3.6 identify purpose (aaa) added in 2.1 in content implemented using markup languages, the purpose of user interface components, icons, and regions can be programmatically determined. understanding identify purpose note: also see the wcag description for ...
-webkit-box-reflect - CSS: Cascading Style Sheets
ge-src> = <url> | <string><color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color><image-set-option> = [ <image> | <string> ] <resolution><id-selector> = <hash-token><cf-mixing-image> = <percentage>? && <image><cf-final-image> = <image> | <color><linear-gradient()> = linear-gradient( [ <angle> | to <side-or-corner> ]? ...
...color | <deprecated-system-color><image-set-option> = [ <image> | <string> ] <resolution><id-selector> = <hash-token><cf-mixing-image> = <percentage>? && <image><cf-final-image> = <image> | <color><linear-gradient()> = linear-gradient( [ <angle> | to <side-or-corner> ]? , <color-stop-
list> )<repeating-linear-gradient()> = repeating-linear-gradient( [ <angle> | to <side-or-corner> ]? , <color-stop-
list> )<radial-gradient()> = radial-gradient( [ <ending-shape> | <size> ]? [ at <position> ]? , <color-stop-
list> )<repeating-radial-gradient()> = repeating-radial-gradient( [ <ending-shape> | <size> ]? [ at <position> ]? , <color-stop-
list> )<conic-gradient()> = conic-gradient( [ from <angle> ]? [ at <position> ]?, <angular-color-stop-
list> )where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]? )...
...<percentage>#{3} , <alpha-value>? ) | rgba( <number>#{3} , <alpha-value>? )<hsl()> = hsl( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsl( <hue>, <percentage>, <percentage>, <alpha-value>? )<hsla()> = hsla( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsla( <hue>, <percentage>, <percentage>, <alpha-value>? )<side-or-corner> = [ left | right ] | [ top | bottom ]<color-stop-
list> = [ <linear-color-stop> [, <linear-color-hint>]? ]# , <linear-color-stop><ending-shape> = circle | ellipse<size> = closest-side | farthest-side | closest-corner | farthest-corner | <length> | <length-percentage>{2}<position> = [ [ left | center | right ] | [ top | center | bottom ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ]? | [ [ left | rig...
...circle | ellipse<size> = closest-side | farthest-side | closest-corner | farthest-corner | <length> | <length-percentage>{2}<position> = [ [ left | center | right ] | [ top | center | bottom ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ]? | [ [ left | right ] <length-percentage> ] && [ [ top | bottom ] <length-percentage> ] ]<angular-color-stop-
list> = [ <angular-color-stop> [, <angular-color-hint>]? ]# , <angular-color-stop>where <alpha-value> = <number> | <percentage><hue> = <number> | <angle><linear-color-stop> = <color> <color-stop-length>?<linear-color-hint> = <length-percentage><length-percentage> = <length> | <percentage><angular-color-stop> = <color> && <color-stop-angle>?<angular-color-hint> = <angle-percentage>where <color-stop-len...
:nth-child() - CSS: Cascading Style Sheets
the :nth-child() css pseudo-class matches elements based on their position in a group of siblings. /* selects the second <li> element in a
list */ li:nth-child(2) { color: lime; } /* selects every fourth element among any group of siblings */ :nth-child(4n) { color: lime; } syntax the nth-child pseudo-class is specified with a single argument that describes a pattern for matching element indices in a
list of siblings. element indices are 1-based. keyword values odd represents elements whose numeric position in a series of siblings is odd: 1, 3, 5, etc. ...
...ed with a single argument that describes a pattern for matching element indices in a
list of siblings. element indices are 1-based. keyword values odd represents elements whose numeric position in a series of siblings is odd: 1, 3, 5, etc. even represents elements whose numeric position in a series of siblings is even: 2, 4, 6, etc. functional notation <an+b> represents elements in a
list whose indices match those found in a custom pattern of numbers, defined by an+b, where: a is an integer step size, b is an integer offset, n is all positive integers, starting from 0. it can be read as the an+bth element of a
list. ...
... series of siblings is even: 2, 4, 6, etc. functional notation <an+b> represents elements in a
list whose indices match those found in a custom pattern of numbers, defined by an+b, where: a is an integer step size, b is an integer offset, n is all positive integers, starting from 0. it can be read as the an+bth element of a
list. ...
... <an+b> represents elements in a
list whose indices match those found in a custom pattern of numbers, defined by an+b, where: a is an integer step size, b is an integer offset, n is all positive integers, starting from 0. it can be read as the an+bth element of a
list. ...
speak-as - CSS: Cascading Style Sheets
s will be spell-out. if system is cyclic, the effective value of speak-as will be bullets. if system is extends, the value of speak-as will be the same as if speak-as: auto is specified on the extended style. for all other cases, specifying auto has the same effect as specifying speak-as: numbers. bullets a phrase or an audio cue defined by the user agent for representing an unordered
list item will be read out. numbers the numerical value of the counter will be read out in the document language. words the user agent will generate a counter value as normal and read it out as a word in the document language. spell-out the user agent will generate a counter representation as normal and would read it out letter by letter. if the user agent doesn't know how to read out a partiula...
...t to convey information critical to understanding the page's purpose. ...
... candidate recommendation initial definition. ...
... candidate recommendation initial definition. ...
@keyframes - CSS: Cascading Style Sheets
ntermediate steps in a css animation sequence by defining styles for keyframes (or waypoints) along the animation sequence. this gives more control over the intermediate steps of the animation sequence than transitions. syntax @keyframes slidein { from { transform: translatex(0%); } to { transform: translatex(100%); } } values <custom-ident> a name identifying the keyframe
list. this must match the identifier production in css syntax. from a starting offset of 0%. to an ending offset of 100%. <percentage> a percentage of the time through the animation sequence at which the specified keyframe should occur. description javascript can access the @keyframes at-rule with the css object model interface csskeyframesrule. to use keyframes, create a @keyframes rule wit...
...ge of the time through the animation sequence at which the specified keyframe should occur. description javascript can access the @keyframes at-rule with the css object model interface csskeyframesrule. to use keyframes, create a @keyframes rule with a name that is then used by the animation-name property to match an animation to its keyframe declaration. ...
...ss object model interface csskeyframesrule. to use keyframes, create a @keyframes rule with a name that is then used by the animation-name property to match an animation to its keyframe declaration. each @keyframes rule contains a style
list of keyframe selectors, which specify percentages along the animation when the keyframe occurs, and a block containing the styles for that keyframe. you can
list the keyframe percentages in any order; they will be handled in the order they should occur. valid keyframe
lists if a keyframe rule doesn't specify the start or end states of the animation (that is, 0%/from and 100%/to), browsers will use the element's existing styles for the start/end states. this can be used to animate an element from its initial state and back. properties that can't be anim...
...mportant are ignored. @keyframes important1 { from { margin-top: 50px; } 50% { margin-top: 150px !important; } /* ignored */ to { margin-top: 100px; } } @keyframes important2 { from { margin-top: 50px; margin-bottom: 100px; } to { margin-top: 150px !important; /* ignored */ margin-bottom: 50px; } } formal syntax @keyframes <keyframes-name> { <keyframe-block-
list> }where <keyframes-name> = <custom-ident> | <string><keyframe-block-
list> = <keyframe-block>+where <keyframe-block> = <keyframe-selector># { <declaration-
list> }where <keyframe-selector> = from | to | <percentage> examples css animation examples see using css animations for examples. specifications specification status comment css animationsthe definition of '@k...
Using multiple backgrounds - CSS: Cascading Style Sheets
you can apply multiple backgrounds to elements. these are layered atop one another with the first background you provide on top and the last background
listed in the back. only the last background can include a background color. specifying multiple backgrounds is easy: .myclass { background: background1, background 2, ..., backgroundn; } you can do this with both the shorthand background property and the individual properties thereof except for background-color. that is, the following background properties can be specified as a
list, one per background: background, background-attachment, background-clip, background-image, background-origin, background-position, background-repeat, background-size. example in this example, three backgrounds are stacked: the firefox logo, an image of bub...
... ...
... ...
... appear in codepen, click the 'tidy' button in the css section) as you can see here, the firefox logo (
listed first within background-image) is on top, directly above the bubbles graphic, followed by the gradient (
listed last) sitting underneath all previous 'images'. each subsequent sub-property (background-repeat and background-position) applies to the corresponding backgrounds. so the first
listed value for background-repeat applies to the first (frontmost) background, and so forth. ...
Auto-placement in CSS Grid Layout - CSS: Cascading Style Sheets
s="wrapper"> <div>one</div> <div>two</div> <div>three</div> <div>four <br>this cell <br>has extra <br>content. <br>max is auto <br>so the row expands. </div> <div>five</div> </div> .wrapper { display: grid; grid-template-columns: repeat(3, 1fr); grid-gap: 10px; grid-auto-rows: minmax(100px, auto); } you can also pass in a track
listing, this will repeat. the following track
listing will create an initial implicit row track as 100 pixels and a second as 200px. this will continue for as long as content is added to the implicit grid. * {box-sizing: border-box;} .wrapper { border: 2px solid #f76707; border-radius: 5px; background-color: #fff4e6; } .wrapper > div { border: 2px solid #ffa94d; border-radiu...
... way to target them. therefore if you have some unwrapped text for some reason in your grid, be aware that it might show up somewhere unexpected as it will be auto-placed according to the auto-placement rules. use cases for auto-placement auto-placement is useful whenever you have a collection of items. that could be items that do not have a logical order such as a gallery of photos, or product
listing. in that case you might choose to use the dense packing mode to fill in any holes in your grid. in my image gallery example i have some landscape and some portrait images. i have set landscape images – with a class of landscape to span two column tracks. i then use grid-auto-flow: dense to create a densely packed grid. .wrapper { display: grid; grid-template-columns: repeat(auto-fi...
...any holes in your grid. in my image gallery example i have some landscape and some portrait images. i have set landscape images – with a class of landscape to span two column tracks. i then use grid-auto-flow: dense to create a densely packed grid. ...
...ps://udn.realityripple.com/samples/72/ab41das78e.png" alt="placeholder"></li> <li><img src="https://udn.realityripple.com/samples/72/ab41das78e.png" alt="placeholder"></li> <li><img src="https://udn.realityripple.com/samples/72/ab41das78e.png" alt="placeholder"></li> </ul> auto-placement can also help you lay out interface items which do have logical order. an example is the definition
list in this next example. definition
lists are an interesting challenge to style as they are flat, there is nothing wrapping the groups of dt and dd items. in my example i am allowing auto-placement to place the items, however i have classes that start a dt in column 1, and dd in column 2, this ensure that terms go on one side and definitions on the other - no matter how many of each we have. * {b...
CSS Grid Layout and Progressive Enhancement - CSS: Cascading Style Sheets
ainer: * {box-sizing: border-box;} .wrapper { border: 2px solid #f76707; border-radius: 5px; background-color: #fff4e6; max-width: 600px; margin: 0 auto; } .wrapper li { border: 2px solid #ffa94d; border-radius: 5px; background-color: #ffd8a8; padding: 1em; color: #d9480f; } .wrapper ul { overflow: hidden; margin: 0 -10px; padding: 0;
list-style: none; } .wrapper li { float: left; width: calc(33.333333% - 20px); margin: 0 10px 20px 10px; } <div class="wrapper"> <ul> <li class="card"><h2>one</h2> <p>we can use css grid to overwrite older methods.</p> </li> <li class="card"><h2>two</h2> <p>we can use css grid to overwrite older methods.</p> </li> <li cl...
...oated layouts: if additional content is added to any one card, the layout breaks. as a concession for older browsers, i have set a min-height on the items, and hope that my content editors won’t add too much content and make a mess of the layout! i then enhance the layout using grid. i can turn my <ul> into a grid container with three column tracks. however, the width i have assigned to the
list items themselves still applies, and it now makes those items a third of the width of the track: if i reset the width to auto, then this will stop the float behavior happening for older browsers. i need to be able to define the width for older browsers, and remove the width for grid supporting browsers. thanks to css feature queries i can do this, right in my css. feature queries will look ver...
...thers: * {box-sizing: border-box;} .wrapper { border: 2px solid #f76707; border-radius: 5px; background-color: #fff4e6; max-width: 600px; margin: 0 auto; } .wrapper li { border: 2px solid #ffa94d; border-radius: 5px; background-color: #ffd8a8; padding: 1em; color: #d9480f; } .wrapper ul { overflow: hidden; margin: 0 -10px; padding: 0;
list-style: none; } .wrapper li { float: left; width: calc(33.333333% - 20px); margin: 0 10px 20px 10px; } @supports (display: grid) { .wrapper ul { display: grid; grid-template-columns: repeat(3, 1fr); grid-gap: 20px; margin: 0; } .wrapper li { width: auto; min-height: auto; margin: 0; } } <div class="wrapper"> ...
...e item becomes a grid item: * {box-sizing: border-box;} .wrapper { border: 2px solid #f76707; border-radius: 5px; background-color: #fff4e6; max-width: 600px; margin: 0 auto; } .wrapper li { border: 2px solid #ffa94d; border-radius: 5px; background-color: #ffd8a8; padding: 1em; color: #d9480f; } .wrapper ul { margin: 0 -10px; padding: 0;
list-style: none; } .wrapper li { display: inline-block; vertical-align: top; width: calc(33.333333% - 20px); margin: 0 10px 20px 10px; } @supports (display: grid) { .wrapper ul { display: grid; grid-template-columns: repeat(3, 1fr); grid-gap: 20px; margin: 0; } .wrapper li { width: auto; margin: 0; } } <div class="wrap...
Mozilla CSS extensions - CSS: Cascading Style Sheets
once a given property is standardized and implemented without the prefix, the prefixed version is typically dropped after a while. a -moz-animation [prefixed version still accepted] -moz-animation-delay [prefixed version still accepted] -moz-animation-direction [prefixed version still accepted] -moz-animation-duration [prefixed version still accepted] -moz-animatio...
...ted] -moz-transition-property [prefixed version still accepted] -moz-transition-timing-function [prefixed version still accepted] -moz-user-select values global values -moz-initial -moz-appearance button button-arrow-down button-arrow-next button-arrow-previous button-arrow-up button-bevel checkbox checkbox-container checkbox-label checkmenuitem dialog groupbox
listbox menuarrow menucheckbox menuimage menuitem menuitemtext menu
list menu
list-button menu
list-text menu
list-textfield menupopup menuradio menuseparator -moz-mac-unified-toolbar -moz-win-borderless-glass -moz-win-browsertabbar-toolbox -moz-win-communications-toolbox -moz-win-glass -moz-win-media-toolbox -moz-window-button-box -moz-window-button-box-maximized -moz-window-button-c...
...cko 62 -moz-grid-lineobsolete since gecko 62 -moz-groupbox -moz-deckobsolete since gecko 62 -moz-popupobsolete since gecko 62 -moz-stackobsolete since gecko 62 -moz-markerobsolete since gecko 62 empty-cells -moz-show-background (default value in quirks mode) font -moz-button -moz-info -moz-desktop -moz-dialog (also a color) -moz-document -moz-workspace -moz-window -moz-
list -moz-pull-down-menu -moz-field (also a color) font-family -moz-fixed image-rendering -moz-crisp-edges <length> -moz-calc
list-style-type -moz-arabic-indic -moz-bengali -moz-cjk-earthly-branch -moz-cjk-heavenly-stem -moz-devanagari -moz-ethiopic-halehame -moz-ethiopic-halehame-am -moz-ethiopic-halehame-ti-er -moz-ethiopic-halehame-ti-et -moz-ethiopic-numeric ...
...moz-any :-moz-any-link [matches :link and :visited] :-moz-broken ::-moz-canvas ::-moz-color-swatch ::-moz-cell-content :-moz-drag-over f – i :-moz-first-node ::-moz-focus-inner ::-moz-focus-outer :-moz-focusring :-moz-full-screen :-moz-full-screen-ancestor :-moz-handler-blocked :-moz-handler-crashed :-moz-handler-disabled ::-moz-inline-table l :-moz-last-node :-moz-
list-bullet :-moz-
list-number :-moz-loading :-moz-locale-dir(ltr) :-moz-locale-dir(rtl) :-moz-lwtheme :-moz-lwtheme-brighttext :-moz-lwtheme-darktext n – r :-moz-native-anonymous :-moz-only-whitespace ::-moz-page ::-moz-page-sequence ::-moz-pagebreak ::-moz-pagecontent :-moz-placeholderobsolete since gecko 51 ::-moz-placeholderdeprecated since gecko 51 ::-moz-progress-bar ::-m...
WebKit CSS extensions - CSS: Cascading Style Sheets
a -webkit-align-content -webkit-align-items -webkit-align-self -webkit-animation -webkit-animation-delay -webkit-animation-direction -webkit-animation-duration -webkit-animation-fill-mode -webkit-animation-iteration-count -webkit-animation-name -webkit-animation-play-state -webkit-animation-timing-function b -webkit-backface-visibility -webkit-background-clip -web...
...full-screen-transition :-webkit-any() :-webkit-any-link* :-webkit-autofill :-webkit-autofill-strong-password :-webkit-drag :-webkit-full-page-media :-webkit-full-screen* :-webkit-full-screen-ancestor :-webkit-full-screen-document :-webkit-full-screen-controls-hidden * now standard. note: if there is an invalid pseudo-class within in a chain or group of selectors, the whole selector
list is invalid. pseudo-elements for web-compatibility reasons, blink, webkit, and gecko browsers treat all pseudo-elements starting with ::-webkit- as valid. ::-webkit-file-upload-button ::-webkit-inner-spin-button ::-webkit-input-placeholder ::-webkit-media-controls ::-webkit-media-controls-current-time-display ::-webkit-media-controls-enclosure ::-webkit-media-controls-fullscreen-butto...
... media features -webkit-animation -webkit-device-pixel-ratio -webkit-transform-2d -webkit-transform-3d -webkit-transition ...
...t-search-results-button ::-webkit-slider-runnable-track ::-webkit-slider-thumb note: generally, if there is an invalid pseudo-element or pseudo-class within in a chain or group of selectors, the whole selector
list is invalid. if a pseudo-element (but not pseudo-class) has a -webkit- prefix, as of firefox 63, blink, webkit and gecko browsers assume it is valid, not invalidating the selector
list. media features -webkit-animation -webkit-device-pixel-ratio -webkit-transform-2d -webkit-transform-3d -webkit-transition ...
background-image - CSS: Cascading Style Sheets
ge-src> = <url> | <string><color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color><image-set-option> = [ <image> | <string> ] <resolution><id-selector> = <hash-token><cf-mixing-image> = <percentage>? && <image><cf-final-image> = <image> | <color><linear-gradient()> = linear-gradient( [ <angle> | to <side-or-corner> ]? ...
...color | <deprecated-system-color><image-set-option> = [ <image> | <string> ] <resolution><id-selector> = <hash-token><cf-mixing-image> = <percentage>? && <image><cf-final-image> = <image> | <color><linear-gradient()> = linear-gradient( [ <angle> | to <side-or-corner> ]? , <color-stop-
list> )<repeating-linear-gradient()> = repeating-linear-gradient( [ <angle> | to <side-or-corner> ]? , <color-stop-
list> )<radial-gradient()> = radial-gradient( [ <ending-shape> | <size> ]? [ at <position> ]? , <color-stop-
list> )<repeating-radial-gradient()> = repeating-radial-gradient( [ <ending-shape> | <size> ]? [ at <position> ]? , <color-stop-
list> )<conic-gradient()> = conic-gradient( [ from <angle> ]? [ at <position> ]?, <angular-color-stop-
list> )where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]? )...
...<percentage>#{3} , <alpha-value>? ) | rgba( <number>#{3} , <alpha-value>? )<hsl()> = hsl( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsl( <hue>, <percentage>, <percentage>, <alpha-value>? )<hsla()> = hsla( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsla( <hue>, <percentage>, <percentage>, <alpha-value>? )<side-or-corner> = [ left | right ] | [ top | bottom ]<color-stop-
list> = [ <linear-color-stop> [, <linear-color-hint>]? ]# , <linear-color-stop><ending-shape> = circle | ellipse<size> = closest-side | farthest-side | closest-corner | farthest-corner | <length> | <length-percentage>{2}<position> = [ [ left | center | right ] | [ top | center | bottom ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ]? | [ [ left | rig...
...circle | ellipse<size> = closest-side | farthest-side | closest-corner | farthest-corner | <length> | <length-percentage>{2}<position> = [ [ left | center | right ] | [ top | center | bottom ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ]? | [ [ left | right ] <length-percentage> ] && [ [ top | bottom ] <length-percentage> ] ]<angular-color-stop-
list> = [ <angular-color-stop> [, <angular-color-hint>]? ]# , <angular-color-stop>where <alpha-value> = <number> | <percentage><hue> = <number> | <angle><linear-color-stop> = <color> <color-stop-length>?<linear-color-hint> = <length-percentage><length-percentage> = <length> | <percentage><angular-color-stop> = <color> && <color-stop-angle>?<angular-color-hint> = <angle-percentage>where <color-stop-len...
border-image-source - CSS: Cascading Style Sheets
ge-src> = <url> | <string><color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color><image-set-option> = [ <image> | <string> ] <resolution><id-selector> = <hash-token><cf-mixing-image> = <percentage>? && <image><cf-final-image> = <image> | <color><linear-gradient()> = linear-gradient( [ <angle> | to <side-or-corner> ]? ...
...color | <deprecated-system-color><image-set-option> = [ <image> | <string> ] <resolution><id-selector> = <hash-token><cf-mixing-image> = <percentage>? && <image><cf-final-image> = <image> | <color><linear-gradient()> = linear-gradient( [ <angle> | to <side-or-corner> ]? , <color-stop-
list> )<repeating-linear-gradient()> = repeating-linear-gradient( [ <angle> | to <side-or-corner> ]? , <color-stop-
list> )<radial-gradient()> = radial-gradient( [ <ending-shape> | <size> ]? [ at <position> ]? , <color-stop-
list> )<repeating-radial-gradient()> = repeating-radial-gradient( [ <ending-shape> | <size> ]? [ at <position> ]? , <color-stop-
list> )<conic-gradient()> = conic-gradient( [ from <angle> ]? [ at <position> ]?, <angular-color-stop-
list> )where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]? )...
...<percentage>#{3} , <alpha-value>? ) | rgba( <number>#{3} , <alpha-value>? )<hsl()> = hsl( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsl( <hue>, <percentage>, <percentage>, <alpha-value>? )<hsla()> = hsla( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsla( <hue>, <percentage>, <percentage>, <alpha-value>? )<side-or-corner> = [ left | right ] | [ top | bottom ]<color-stop-
list> = [ <linear-color-stop> [, <linear-color-hint>]? ]# , <linear-color-stop><ending-shape> = circle | ellipse<size> = closest-side | farthest-side | closest-corner | farthest-corner | <length> | <length-percentage>{2}<position> = [ [ left | center | right ] | [ top | center | bottom ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ]? | [ [ left | rig...
...circle | ellipse<size> = closest-side | farthest-side | closest-corner | farthest-corner | <length> | <length-percentage>{2}<position> = [ [ left | center | right ] | [ top | center | bottom ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ]? | [ [ left | right ] <length-percentage> ] && [ [ top | bottom ] <length-percentage> ] ]<angular-color-stop-
list> = [ <angular-color-stop> [, <angular-color-hint>]? ]# , <angular-color-stop>where <alpha-value> = <number> | <percentage><hue> = <number> | <angle><linear-color-stop> = <color> <color-stop-length>?<linear-color-hint> = <length-percentage><length-percentage> = <length> | <percentage><angular-color-stop> = <color> && <color-stop-angle>?<angular-color-hint> = <angle-percentage>where <color-stop-len...
filter - CSS: Cascading Style Sheets
if one filter is none, it is replaced with the...
...ction>]* | 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. if one filter is none, it is replaced with the filter functions
list of the other one using the filter function default values, then all filter functions are interpolated according to their specific rules. otherwise, discrete interpolation is used. fun...
...if the parameter for any function is invalid, the function returns none. except where noted, the functions that take a value expressed with a percent sign (as in 34%) also accept the value expressed as decimal (as in 0.34). ...
...tandard-table td { padding: 5px; border: 1px solid rgb(204, 204, 204); text-align: left; vertical-align: top; width:25%; height:auto; } #img3 { height:100%; } formal definition initial valuenoneapplies toall elements; in svg, it applies to container elements excluding the defs element and all graphics elementsinheritednocomputed valueas specifiedanimation typea filter function
list formal syntax none | <filter-function-
list>where <filter-function-
list> = [ <filter-function> | <url> ]+where <filter-function> = <blur()> | <brightness()> | <contrast()> | <drop-shadow()> | <grayscale()> | <hue-rotate()> | <invert()> | <opacity()> | <saturate()> | <sepia()>where <blur()> = blur( <length> )<brightness()> = brightness( <number-percentage> )<contrast()> = contrast( [ <number-perc...
grid-template - CSS: Cascading Style Sheets
re no named grid areas. rows and columns will be implicitly generated; their size will be determined by the grid-auto-rows and grid-auto-columns properties. <'grid-template-rows'> / <'grid-template-columns'> sets grid-template-rows and grid-template-columns to the specified values, and sets grid-template-areas to none. ...
...mplicitly generated; their size will be determined by the grid-auto-rows and grid-auto-columns properties. <'grid-template-rows'> / <'grid-template-columns'> sets grid-template-rows and grid-template-columns to the specified values, and sets grid-template-areas to none. ...
... the specified values, and sets grid-template-areas to none. [ <line-names>? <string> <track-size>? <line-names>? ]+ [ / <explicit-track-
list> ]? sets grid-template-areas to the strings
listed, grid-template-rows to the track sizes following each string (filling in auto for any missing sizes), and splicing in the named lines defined before/after each size, and grid-template-columns to the track
listing specified after the slash (or none, if not specified). note: the repeat() function isn’t allowed in these track
listings, as the tracks are intended to visually line up one-to-one with the rows/columns in the “ascii art”. note: the grid shorthand accepts the same syntax, but also resets the implicit grid properties to their initial values. use grid (as opposed to grid-template) t...
...nd:grid-template-columns: as specified, but with relative lengths converted into absolute lengthsgrid-template-rows: as specified, but with relative lengths converted into absolute lengthsgrid-template-areas: as specifiedanimation typediscrete formal syntax none | [ <'grid-template-rows'> / <'grid-template-columns'> ] | [ <line-names>? <string> <track-size>? <line-names>? ]+ [ / <explicit-track-
list> ]?where <line-names> = '[' <custom-ident>* ']'<track-size> = <track-breadth> | minmax( <inflexible-breadth> , <track-breadth> ) | fit-content( [ <length> | <percentage> ] )<explicit-track-
list> = [ <line-names>? <track-size> ]+ <line-names>?where <track-breadth> = <length-percentage> | <flex> | min-content | max-content | auto<inflexible-breadth> = <length> | <percentage> | min-content | max-con...
mask-border-source - CSS: Cascading Style Sheets
ge-src> = <url> | <string><color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color><image-set-option> = [ <image> | <string> ] <resolution><id-selector> = <hash-token><cf-mixing-image> = <percentage>? && <image><cf-final-image> = <image> | <color><linear-gradient()> = linear-gradient( [ <angle> | to <side-or-corner> ]? ...
...color | <deprecated-system-color><image-set-option> = [ <image> | <string> ] <resolution><id-selector> = <hash-token><cf-mixing-image> = <percentage>? && <image><cf-final-image> = <image> | <color><linear-gradient()> = linear-gradient( [ <angle> | to <side-or-corner> ]? , <color-stop-
list> )<repeating-linear-gradient()> = repeating-linear-gradient( [ <angle> | to <side-or-corner> ]? , <color-stop-
list> )<radial-gradient()> = radial-gradient( [ <ending-shape> | <size> ]? [ at <position> ]? , <color-stop-
list> )<repeating-radial-gradient()> = repeating-radial-gradient( [ <ending-shape> | <size> ]? [ at <position> ]? , <color-stop-
list> )<conic-gradient()> = conic-gradient( [ from <angle> ]? [ at <position> ]?, <angular-color-stop-
list> )where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]? )...
...<percentage>#{3} , <alpha-value>? ) | rgba( <number>#{3} , <alpha-value>? )<hsl()> = hsl( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsl( <hue>, <percentage>, <percentage>, <alpha-value>? )<hsla()> = hsla( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsla( <hue>, <percentage>, <percentage>, <alpha-value>? )<side-or-corner> = [ left | right ] | [ top | bottom ]<color-stop-
list> = [ <linear-color-stop> [, <linear-color-hint>]? ]# , <linear-color-stop><ending-shape> = circle | ellipse<size> = closest-side | farthest-side | closest-corner | farthest-corner | <length> | <length-percentage>{2}<position> = [ [ left | center | right ] | [ top | center | bottom ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ]? | [ [ left | rig...
...circle | ellipse<size> = closest-side | farthest-side | closest-corner | farthest-corner | <length> | <length-percentage>{2}<position> = [ [ left | center | right ] | [ top | center | bottom ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ]? | [ [ left | right ] <length-percentage> ] && [ [ top | bottom ] <length-percentage> ] ]<angular-color-stop-
list> = [ <angular-color-stop> [, <angular-color-hint>]? ]# , <angular-color-stop>where <alpha-value> = <number> | <percentage><hue> = <number> | <angle><linear-color-stop> = <color> <color-stop-length>?<linear-color-hint> = <length-percentage><length-percentage> = <length> | <percentage><angular-color-stop> = <color> && <color-stop-angle>?<angular-color-hint> = <angle-percentage>where <color-stop-len...
mask-image - CSS: Cascading Style Sheets
ge-src> = <url> | <string><color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color><image-set-option> = [ <image> | <string> ] <resolution><id-selector> = <hash-token><cf-mixing-image> = <percentage>? && <image><cf-final-image> = <image> | <color><linear-gradient()> = linear-gradient( [ <angle> | to <side-or-corner> ]? ...
...color | <deprecated-system-color><image-set-option> = [ <image> | <string> ] <resolution><id-selector> = <hash-token><cf-mixing-image> = <percentage>? && <image><cf-final-image> = <image> | <color><linear-gradient()> = linear-gradient( [ <angle> | to <side-or-corner> ]? , <color-stop-
list> )<repeating-linear-gradient()> = repeating-linear-gradient( [ <angle> | to <side-or-corner> ]? , <color-stop-
list> )<radial-gradient()> = radial-gradient( [ <ending-shape> | <size> ]? [ at <position> ]? , <color-stop-
list> )<repeating-radial-gradient()> = repeating-radial-gradient( [ <ending-shape> | <size> ]? [ at <position> ]? , <color-stop-
list> )<conic-gradient()> = conic-gradient( [ from <angle> ]? [ at <position> ]?, <angular-color-stop-
list> )where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]? )...
...<percentage>#{3} , <alpha-value>? ) | rgba( <number>#{3} , <alpha-value>? )<hsl()> = hsl( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsl( <hue>, <percentage>, <percentage>, <alpha-value>? )<hsla()> = hsla( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsla( <hue>, <percentage>, <percentage>, <alpha-value>? )<side-or-corner> = [ left | right ] | [ top | bottom ]<color-stop-
list> = [ <linear-color-stop> [, <linear-color-hint>]? ]# , <linear-color-stop><ending-shape> = circle | ellipse<size> = closest-side | farthest-side | closest-corner | farthest-corner | <length> | <length-percentage>{2}<position> = [ [ left | center | right ] | [ top | center | bottom ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ]? | [ [ left | rig...
...circle | ellipse<size> = closest-side | farthest-side | closest-corner | farthest-corner | <length> | <length-percentage>{2}<position> = [ [ left | center | right ] | [ top | center | bottom ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ]? | [ [ left | right ] <length-percentage> ] && [ [ top | bottom ] <length-percentage> ] ]<angular-color-stop-
list> = [ <angular-color-stop> [, <angular-color-hint>]? ]# , <angular-color-stop>where <alpha-value> = <number> | <percentage><hue> = <number> | <angle><linear-color-stop> = <color> <color-stop-length>?<linear-color-hint> = <length-percentage><length-percentage> = <length> | <percentage><angular-color-stop> = <color> && <color-stop-angle>?<angular-color-hint> = <angle-percentage>where <color-stop-len...
Media buffering, seeking, and time ranges - Developer guides
cument.getelementbyid('my-audio'); var mycanvas = document.getelementbyid('my-canvas'); var context = mycanvas.getcontext('2d'); context.fillstyle = 'lightgray'; context.fillrect(0, 0, mycanvas.width, mycanvas.height); context.fillstyle = 'red'; context.strokestyle = 'white'; var inc = mycanvas.width / myaudio.duration; // display timeranges myaudio.addevent
listener('seeked', function() { for (i = 0; i < myaudio.buffered.length; i++) { var startx = myaudio.buffered.start(i) * inc; var endx = myaudio.buffered.end(i) * inc; var width = endx - startx; context.fillrect(startx, 0, width, mycanvas.height); context.rect(startx, 0, width, mycanvas.height); context.stroke(); } }); } this works b...
... height: 100%; background-color: #777; width: 0; } .progress { margin-top: -20px; height: 20px; position: relative; width: 300px; } #progress-amount { display: block; height: 100%; background-color: #595; width: 0; } and the following javascript provides our functionality: window.onload = function(){ var myaudio = document.getelementbyid('my-audio'); myaudio.addevent
listener('progress', function() { var duration = myaudio.duration; if (duration > 0) { for (var i = 0; i < myaudio.buffered.length; i++) { if (myaudio.buffered.start(myaudio.buffered.length - 1 - i) < myaudio.currenttime) { document.getelementbyid("buffered-amount").style.width = (myaudio.buffered.end(myaudio.buffered.length - 1 - i) / duration) * 100 + "%"; ...
... the timeupdate event is fired 4 times a sec...
... ...
Audio and Video Delivery - Developer guides
for more information, see creating your own custom audio player. other tips for audio/video stopping the download of media while stopping the playback of media is as easy as calling the element's pause() method, the browser keeps downloading...
... function switchstate() { if (myaudio.paused == true) { myaudio.play(); mycontrol.innerhtml = "pause"; } else { myaudio.pause(); mycontrol.innerhtml = "play"; } } function checkkey(e) { if (e.keycode == 32 ) { //spacebar switchstate(); } } mycontrol.addevent
listener('click', function() { switchstate(); }, false); window.addevent
listener( "keypress", checkkey, false ); } you can try this example out here. for more information, see creating your own custom audio player. other tips for audio/video stopping the download of media while stopping the playback of media is as easy as calling the element's pause() method, the browser keeps downloading the media until the media element is disposed of through garbage collection. he...
...tent. this is done by setting the value of the currenttime property on the element; see htmlmediaelement for further details on the element's properties. simply set the value to the time, in seconds, at which you want playback to continue. you can use the element's seekable property to determine the ranges of the media that are currently available for seeking to. this returns a timeranges object
listing the ranges of times that you can seek to. var mediaelement = document.queryselector('#mediaelementid'); mediaelement.seekable.start(0); // returns the starting time (in seconds) mediaelement.seekable.end(0); // returns the ending time (in seconds) mediaelement.currenttime = 122; // seek to 122 seconds mediaelement.played.end(0); // returns the number of seconds the browser has played...
...the most popular libraries allow you to choose a consistent player design over all browsers and provide a fallback for browsers that don't support audio and video n...
Challenge solutions - Developer guides
ections below correspond to the titles of the tutorial sections. why use css colors challenge without looking up a reference, find five more color names that work in your stylesheet. solution css supports common color names like orange, yellow, blue, green, or black. it also supports some more exotic color names like chartreuse, fuschia, or burlywood. ...
...the internal resource defines the font-weight property as bolder; your stylesheet defines the color property as red. cascading and inheritance inherited styles challenge change your stylesheet so that only the red letters are underlined. ...
...color: #ddf; /* pale blue */ font: 200% serif; } .carrot { color: #fa0; /* orange */ } .spinach { color: #080; /* dark green */ } p { color: #00f; /* blue */ } content add an image challenge add a one rule to your stylesheet so that it displays the image at the start of each line. solution add this rule to your stylesheet: p:before{ content: url("yellow-pin.png"); }
lists lower roman numerals challenge add a rule to your stylesheet, to number the oceans using roman numerals from i to v. solution define a rule for
list items to use the lower-roman
list style: li {
list-style: lower-roman; } capital letters challenge change your stylesheet to identify the headings with capital letters in parentheses. solution add a rule to the body element (par...
...} layout default image position fixed image position challenge change your sample document, doc2.html, adding this tag to it near the end, just before </body>: <img id="fixed-pin" src="yellow-pin.png" alt="yellow map pin"> predict where the image will appear in your document. then refresh your browser to see if you were correct. solution the image appears to the right of the second
list. challenge add a rule to your stylesheet that places the image in the top right of your document. solution the following rule achieves the desired result: #fixed-pin { position:fixed; top: 3px; right: 3px; } tables borders on data cells only challenge change the stylesheet to make the table have a green border around only the data cells. solution the following rule puts ...
Mutation events - Developer guides
details in the "dom mutation events replacement: the story so far / existing points of consensus" post to public-webapps). mutation observers are the proposed replacement for mutation events in dom4. they are expected to be included in firefox 14 and chrome 18. the practical reasons to avoid the mutation events are performance issues and cross-browser support. performance adding dom mutation
listeners to a document profoundly degrades the performance of further dom modifications to that document (making them 1.5 - 7 times slower!). moreover, removing the
listeners does not reverse the damage. the performance effect is limited to the documents that have the mutation event
listeners. cross-browser support these events are not implemented consistently across different browsers, for exampl...
...ent some of them correctly in version 9 (for example, domnodeinserted) webkit doesn't support domattrmodified (see webkit bug 8191 and the workaround) "mutation name events", i.e. domelementnamechanged and domattributenamechanged are not supported in firefox (as of version 11), and probably in other browsers as well. ... dottoro documents browser support for mutation events. ...
...y in version 9 (for example, domnodeinserted) webkit doesn't support domattrmodified (see webkit bug 8191 and the workaround) "mutation name events", i.e. domelementnamechanged and domattributenamechanged are not supported in firefox (as of version 11), and probably in other browsers as well. ... dottoro documents browser support for mutation events. ...
... (mutation) { _.foreach(mutation.removednodes, function (removed) { if (isdescendant(element, removed)) { callback(); // allow garbage collection observer.disconnect(); observer = undefined; } }); }); }); observer.observe(document, { child
list: true, subtree: true }); }; usage you can register a
listener for mutation events using element.addevent
listener as follows: element.addevent
listener("domnodeinserted", function (event) { // ... }, false); the event object is passed to the
listener in a mutationevent (see its definition in the specification) for most events, and mutationnameevent for domattributenamechanged and...
Index - Developer guides
make use of specific web technologies and apis. 2 ajax ajax, dom, json, javascript, references, xmlhttprequest asynchronous javascript and xml, while not a technology in itself, is a term coined in 2005 by jesse james garrett, that describes a "new" approach to using a number of existing technologies together 3 community ajax if you know of useful mailing
lists, newsgroups, forums, or other communities related to ajax, please link to them here. 4 getting started ajax, api, advanced, javascript, webmechanics, xmlhttprequest this article guides you through the ajax basics and gives you some simple hands-on examples to get you started. 5 wai aria live regions/api support ajax, accessibility firefox 3 contains impo...
...ontent, events this article demonstrates how to create and dispatch dom events. such events are commonly called synthetic events, as opposed to the events fired by the browser itself. 19 dom onevent handlers beginner, dom, dom beginner, needsbeginnerupdate, needsupdate the web platform provides several ways to be notified of dom events. two common approaches are addevent
listener() and the specific onevent handlers. 20 media events intermediate, media various events are sent when handling media that are embedded in html documents using the <audio> and <video> elements; this section
lists them and provides some helpful information about using them. 21 mouse gesture events advanced, dom gecko 1.9.1 added support for several mozi...
... as images.these articles provide insight into how you can accomplish this. 28 guide to web apis api, guide, landing, web the web includes a wide array of apis that can be used from javascript to build increasingly more powerful and capable applications, running either on the web, locally, or through technology such as node.js, on a server. on this page you'll find a complete
list of all of the apis provided by the full web technology stack. 29 index guide, index found 31 pages: 30 introduction to web development beginner, css, codingscripting, development, html, javascript, web whether you're just getting started with web development, or are just expanding your horizons into new realms of web awesomeness, the links here should hel...
...ion, performance, web when building modern web apps and sites, it's important to make your content perform well. that is, to make it work quickly and efficiently. this lets it work effectively both for users of powerful desktop systems as well as for handheld devices with less power. there are several tools available to check the performance of a website or blog. the most notable tools are
listed below. 37 parsing and serializing xml ajax, add-ons, dom, dom parsing, document, extensions, guide, htmldocument, json, parsing, parsing xml, serializing, serializing xml, xml, xmldocument, xmlhttprequest in this article, we'll look at the objects provided by the web platform to make the common tasks of serializing and parsing xml easy. 38 printing dom, guide...
<a>: The Anchor element - HTML: Hypertext Markup Language
gment urls pieces of media files with media fragments telephone numbers with tel: urls email addresses with mailto: urls while web browsers may not support other url schemes, web sites can with registerprotocolhandler() hreflang hints at the human language of the linked url. no built-in functionality. allowed values are the same as the global lang attribute. ping a space-separated
list of urls. when the link is followed, the browser will send post requests with the body ping to the urls. typically for tracking. referrerpolicy how much of the referrer to send when following the link. see referrer-policy for possible values and their effects. rel the relationship of the linked url as space-separated link types. target where to display the linked url, as the name for a brow...
... type hints at the linked url’s format with a mime type. no built-in functionality. obsolete attributes charsetobsolete since html5 hinted at the character encoding of the linked url. note: this attribute is obsolete and should not be used by authors. use the http content-type header on the linked url. coordsobsolete since html5 used with the shape attribute. a comma-separated
list of coordinates. nameobsolete since html5 was required to define a possible target location in a page. in html 4.01, id and name could both be used on <a>, as long as they had identical values. note: use the global attribute id instead. revobsolete since html5 specified a reverse link; the opposite of the rel attribute. deprecated for being very confusing. shapeobsolete since html5 th...
... background: #fff; border: 1px dashed; } a { display: inline-block; background: #69c; color: #fff; padding: 5px 10px; } javascript var canvas = document.queryselector('canvas'), c = canvas.getcontext('2d'); c.fillstyle = 'hotpink'; function draw(x, y) { if (isdrawing) { c.beginpath(); c.arc(x, y, 10, 0, math.pi*2); c.closepath(); c.fill(); } } canvas.addevent
listener('mousemove', event => draw(event.offsetx, event.offsety) ); canvas.addevent
listener('mousedown', () => isdrawing = true); canvas.addevent
listener('mouseup', () => isdrawing = false); document.queryselector('a').addevent
listener('click', event => event.target.href = canvas.todataurl() ); result security and privacy <a> elements can have consequences for users’ security and privacy...
.... inaccessible, weak link text a sadly common mistake is to only link the words “click here” or “here”: <p> learn more about our products <a href="/products">here</a>. </p> strong link text luckily, this is an easy fix, and it’s actually shorter than the inaccessible version! <p> learn more <a href="/products">about our products</a>. </p> assistive software have shortcuts to
list all links on a page. however, strong link text benefits all users — the “
list all links” shortcut emulates how sighted users quickly scan pages. onclick events anchor elements are often abused as fake buttons by setting their href to # or javascript:void(0) to prevent the page from refreshing, then
listening for their click events . these bogus href values cause unexpected behavior when ...
<details>: The Details disclosure element - HTML: Hypertext Markup Language
by setting/removing its open attribute. by default when closed, the widget is only tall enough to display the disclosure triangle and summary. when open, it expands to display the details contained within. note: unfortunately, at this time there's no built-in way to animate the transition between open and closed. fully standards-compliant implementations automatically apply the css display:
list-item to the <summary> element. you can use this to customize its appearance further. see customizing the disclosure widget for further details. content categories flow content, sectioning root, interactive content, palpable content. permitted content one <summary> element followed by flow content. tag omission none, both the starting and ending tag are mandato...
...ition to the usual events supported by html elements, the <details> element supports the toggle event, which is dispatched to the <details> element whenever its state changes between open and closed. it is sent after the state is changed, although if the state changes multiple times before the browser can dispatch the event, the events are coalesced so that only one is sent. you can use an event
listener for the toggle event to detect when the widget changes state: details.addevent
listener("toggle", event => { if (details.open) { /* the element was toggled open */ } else { /* the element was toggled closed */ } }); examples a simple disclosure example this example shows a <details> element with no provided summary. <details> <p>requires a computer running an operating sys...
...vice is recommended.</p> </details> result customizing the disclosure widget the disclosure triangle itself can be customized, although this is not as broadly supported. there are variations in how browsers support this customization due to experimental implementations as the element was standardized, so we'll have to use multiple approaches for a while. the <summary> element supports the
list-style shorthand property and its longhand properties, such as
list-style-type, to change the disclosure triangle to whatever you choose (usually with
list-style-image). for example, we can remove the disclosure widget icon by setting
list-style: none. chrome doesn't support this yet, however, so we also need to use its non-standard ::-webkit-details-marker pseudo-element to customize the appeara...
...chrome doesn't support this yet, however, so we also need to use its non-standard ::-webkit-details-marker pseudo-element to customize the appearance in that browser. css details { font: 16px "open sans", calibri, sans-serif; width: 620px; } details > summary { padding: 2px 6px; width: 15em; background-color: #ddd; border: none; box-shadow: 3px 3px 4px black; cursor: pointer;
list-style: none; } details > summary::-webkit-details-marker { display: none; } details > p { border-radius: 0 0 10px 10px; background-color: #ddd; padding: 2px 6px; margin: 0; box-shadow: 3px 3px 4px black; } this css creates a look similar to a tabbed interface, where activating the tab expands and opens it to reveal its contents. html <details> <summary>system requirements</sum...
<input type="text"> - HTML: Hypertext Markup Language
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. value a domstring representing the text contained in the text field. events change and input supported common attributes autocomplete,
list, maxlength, minlength, pattern, placeholder, readonly, required and size idl attributes
list, value methods select(), setrangetext() and setselectionrange(). value the value attribute is a domstring that contains the current value of the text entered into the text field. you can retrieve this using the value property in javascript. let thetext = mytextinput.value;...
...roperty in javascript. let thetext = mytextinput.value; if no validation constraints are in place for the input (see validation for more details), the value may be an empty string (""). ...
... thetext = mytextinput.value; if no validation constraints are in place for the input (see validation for more details), the value may be an empty string (""). ...
...the input field whenever it is empty readonly a boolean attribute indicating whether or not the contents of the input should be read-only size a number indicating how many characters wide the input field should be spellcheck controls whether or not to enable spell checking for the input field, or if the default spell checking configuration should be used
list the values of the
list attribute is the id of a <data
list> element located in the same document. the <data
list> provides a
list of predefined values to suggest to the user for this input. any values in the
list that are not compatible with the type are not included in the suggested options. the values provided are suggestions, not requirements: users can select from this predefined
list or provi...
Global attributes - HTML: Hypertext Markup Language
ydown, onkeypress, onkeyup, onload, onloadeddata, onloadedmetadata, onloadstart, onmousedown, onmouseenter, onmouseleave, onmousemove, onmouseout, onmouseover, onmouseup, onmousewheel, onpause, onplay, onplaying, onprogress, onratechange, onreset, onresize, onscroll, onseeked, onseeking, onselect, onshow, onsort, onstalled, onsubmit, onsuspend, ontimeupdate, ontoggle, onvolumechange, onwaiting.
list of global attributes accesskey provides a hint for generating a keyboard shortcut for the current element. this attribute consists of a space-separated
list of characters. the browser should use the first one that exists on the computer keyboard layout. autocapitalize controls whether and how text input is automatically capitalized as it is entered/edited by the user. it can have the follow...
...classes allows css and javascript to select and access specific elements via the class selectors or functions like the method document.getelementsbyclassname(). contenteditable an enumerated attribute indicating if the element should be editable by the user. if so, the browser modifies its widget to allow editing. the attribute must take one of the following value...
...e whatwg html microdata feature. itemid the unique, global identifier of an item. itemprop used to add properties to an item. every html element may have an itemprop attribute specified, where an itemprop consists of a name and value pair. itemref properties that are not descendants of an element with the itemscope attribute can be associated with the item using an itemref. it provides a
list of element ids (not itemids) with additional properties elsewhere in the document. itemscope itemscope (usually) works along with itemtype to specify that the html contained in a block is about a particular item. itemscope creates the item and defines the scope of the itemtype associated with it. itemtype is a valid url of a vocabulary (such as schema.org) that describes the item and its proper...
...ll be active. lang helps define the language of an element: the language that non-editable elements are in, or the language that editable elements should be written in by the user. the attribute contains one “language tag” (made of hyphen-separated “language subtags”) in the format defined in tags for identifying languages (bcp47). xml:lang has priority over it. part a space-separated
list of the part names of the element. part names allows css to select and style specific elements in a shadow tree via the ::part pseudo-element. slot assigns a slot in a shadow dom shadow tree to an element: an element with a slot attribute is assigned to the slot created by the <slot> element whose name attribute's value matches that slot attribute's value. spellcheck an enumerated attribute de...
Feature Policy - HTTP
crophone. allow iframes to use the fullscreen api. block the use of outdated apis like synchronous xhr and document.write(). ensure images are sized properly and are not too big for the viewport. concepts and usage feature policy allows you to control which origins can use which features, both in the top-level page and in embedded frames. ...
...big for the viewport. concepts and usage feature policy allows you to control which origins can use which features, both in the top-level page and in embedded frames. essentially, you write a policy, which is an allowed
list of origins for each feature. for every feature controlled by feature policy, the feature is only enabled in the current document or frame if its origin matches the allowed
list of origins. for each policy-controlled feature, the browser maintains a
list of origins for which the feature is enabled, known as an allow
list. if you do not specify a policy for a feature, then a default allow
list will be used. the default allow
list is specific to each feature. writing a policy a policy is described using a set of individual policy directives. a policy directive is a combina...
... specifying your policy feature policy provides two ways to specify policies to control features: the feature-policy http header. the allow attribute on iframes. the primary difference between the http header and the allow attribute is that the allow attribute only controls features within an iframe. ...
...used. in some cases, you may wish to strictly limit how such functionality is used on a website. there are policy-controlled features to allow functionality to be enabled/disabled for specific origins or frames within a website. where available, the feature integrates with the permissions api, or feature-specific mechanisms to check if the feature is available. the features include (see features
list): accelerometer ambient light sensor autoplay camera encrypted media fullscreen geolocation gyroscope magnetometer microphone midi paymentrequest picture-in-picture usb vr / xr examples using feature policy see feature policy demos for example usage of many policies. specifications specification status comment feature policythe definition of 'feat...
Index - HTTP
reference, security, cross-origin issue, header, origin the access-control-allow-origin response header indicates whether the response can be shared with requesting code from the given origin. 11 access-control-expose-headers cors, http, reference, header the access-control-expose-headers response header indicates which headers can be exposed as part of the response by
listing their names. 12 access-control-max-age cors, http, reference, header the access-control-max-age response header indicates how long the results of a preflight request (that is the information contained in the access-control-allow-methods and access-control-allow-headers headers) can be cached. 13 access-control-request-headers cors, http, reference, header ...
...when the actual request is made. this header is necessary as the preflight request is always an options and doesn't use the same method as the actual request. 15 age caching, http, response, header the age header contains the time in seconds the object has been in a proxy cache. 16 allow entity header, http, http header, reference, header the allow header
lists the set of methods support by a resource. 17 alt-svc draft, http, http header, needscompattable, needscontent, needsexample, reference the alt-svc header is used to
list alternate ways to reach this website. 18 authorization http, http header, reference, request header, header the http authorization request header contains the credentials to authenticate...
...ed in the path of the request. 75 from http, reference, header the from request header contains an internet email address for a human user who controls the requesting user agent. 76 host http, reference, header the host request header specifies the domain name of the server (for virtual hosting), and (optionally) the tcp port number on which the server is
listening. 77 if-match conditional requests, http, http header, reference, request header the if-match http request header makes the request conditional. for get and head methods, the server will send back the requested resource only if it matches one of the
listed etags. for put and other non-safe methods, it will only upload the resource in this case. 78 if-modified-s...
...ttp, http header, reference, request header the if-none-match http request header makes the request conditional. for get and head methods, the server will send back the requested resource, with a 200 status, only if it doesn't have an etag matching the given ones. for other methods, the request will be processed only if the eventually existing resource's etag doesn't match any of the values
listed. 80 if-range condtional requests, http, http header, range requests, reference, request header the if-range http request header makes a range request conditional: if the condition is fulfilled, the range request will be issued and the server sends back a 206 partial content answer with the appropriate body. if the condition is not fulfilled, the full resource is sent back, ...
Expressions and operators - JavaScript
operators javascript has the following types of operators. this section describes the operators and contains information about operator precedence. ...
...d operator for example, x++ or ++x. assignment operators an assignment operator assigns a value to its left operand based on the value of its right operand. the simple assignment operator is equal (=), which assigns the value of its right operand to its left operand. that is, x = y assigns the value of y to x. ...
... subtraction (-), multiplication (*), and division (/). these operators work as they do in most other programming languages when used with floating point numbers (in particular, note that division by zero produces infinity). for example: 1 / 2; // 0.5 1 / 2 == 1.0 / 2.0; // this is true in addition to the standard arithmetic operations (+, -, *, /), javascript provides the arithmetic operators
listed in the following table: arithmetic operators operator description example remainder (%) binary operator. returns the integer remainder of dividing the two operands. 12 % 5 returns 2. increment (++) unary operator. adds one to its operand. if used as a prefix operator (++x), returns the value of its operand after adding one; if used as a postfix op...
...wise shift operators take two operands: the first is a quantity to be shifted, and the second specifies the number of bit positions by which the first operand is to be shifted. the direction of the shift operation is controlled by the operator used. shift operators convert their operands to thirty-two-bit integers and return a result of the same type as the left operand. the shift operators are
listed in the following table. bitwise shift operators operator description example left shift (<<) this operator shifts the first operand the specified number of bits to the left. excess bits shifted off to the left are discarded. zero bits are shifted in from the right. 9<<2 yields 36, because 1001 shifted 2 bits to the left becomes 100100, which is 36. ...
Function.prototype.apply() - JavaScript
arting with ecmascript 5 these arguments can be a generic array-like object instead of an array. see below for browser compatibility information. return value the result of calling the function with the specified this value and arguments. description note: while the syntax of this function is almost identical to that of call(), the fundamental difference is that call() accepts an argument
list, while apply() accepts a single array of arguments. note: when the first argument is undefined or null a similar outcome can be achieved using the array spread syntax. you can assign a different this object when calling an existing function. this refers to the current object (the calling object). with apply, you can write a method once, and then inherit it in another object, without having t...
...ad syntax. you can assign a different this object when calling an existing function. this refers to the current object (the calling object). with apply, you can write a method once, and then inherit it in another object, without having to rewrite the method for the new object. apply is very similar to call(), except for the type of arguments it supports. you use an arguments array instead of a
list of arguments (parameters). with apply, you can also use an array literal, for example, func.apply(this, ['eat', 'bananas']), or an array object, for example, func.apply(this, new array('eat', 'bananas')). you can also use arguments for the argsarray parameter. arguments is a local variable of a function. it can be used for all unspecified arguments of the called object. thus, you do not have to ...
...the apply method. you can use arguments to pass all the arguments to the called object. the called object is then responsible for handling the arguments. since ecmascript 5th edition, you can also use any kind of object which is array-like. in practice, this means it's going to have a length property, and integer ("index") properties in the range (0..length - 1). for example, you could use a node
list, or a custom object like { 'length': 2, '0': 'eat', '1': 'bananas' }. note: many older browsers—including chrome <17 and internet explorer <9—don't accept array-like objects, and will throw an exception. examples using apply to append an array to another you can use push to append an element to an array. and, because push accepts a variable number of arguments, you can also push multipl...
...i+quantum, len))); min = math.min(submin, min); } return min; } let min = minofarray([5, 6, 2, 3, 7]); using apply to chain constructors you can use apply to chain constructors for an object (similar to java). in the following example we will create a global function method called construct, which will enable you to use an array-like object with a constructor instead of an arguments
list. function.prototype.construct = function(aargs) { let onew = object.create(this.prototype); this.apply(onew, aargs); return onew; }; note: the object.create() method used above is relatively new. for alternative methods, please consider one of the following approaches: using object.__proto__: function.prototype.construct = function (aargs) { let onew = {}; onew.__proto__ = this.pr...
Function.prototype.bind() - JavaScript
n object (a term from ecmascript 2015) that wraps the original function object. calling the bound function generally results in the execution of its wrapped function. a bound function has the following internal properties: [[boundtargetfunction]] the wrapped function object [[boundthis]] the value that is always passed as this value when calling the wrapped function. [[boundarguments]] a
list of values whose elements are used as the first arguments to any call to the wrapped function. [[call]] executes code associated with this object. invoked via a function call expression. the arguments to the internal method are a this value and a
list containing the arguments passed to the function by a call expression. when a bound function is called, it calls internal method [[call]] on [[bo...
... the partial implementation creates functions that do not have immutable "poison pill" caller and arg...
...x.bind(module); boundgetx(); // returns 81 partially applied functions the next simplest use of bind() is to make a function with pre-specified initial arguments. these arguments (if any) follow the provided this value and are then inserted at the start of the arguments passed to the target function, followed by whatever arguments are passed bound function at the time it is called. function
list() { return array.prototype.slice.call(arguments); } function addarguments(arg1, arg2) { return arg1 + arg2 } const
list1 =
list(1, 2, 3); // [1, 2, 3] const result1 = addarguments(1, 2); // 3 // create a function with a preset leading argument const leadingthirtyseven
list =
list.bind(null, 37); // create a function with a preset first argument. const addthirtyseven = addarguments.bind(...
...y.prototype.slice.call(arguments); } function addarguments(arg1, arg2) { return arg1 + arg2 } const
list1 =
list(1, 2, 3); // [1, 2, 3] const result1 = addarguments(1, 2); // 3 // create a function with a preset leading argument const leadingthirtyseven
list =
list.bind(null, 37); // create a function with a preset first argument. const addthirtyseven = addarguments.bind(null, 37); const
list2 = leadingthirtyseven
list(); // [37] const
list3 = leadingthirtyseven
list(1, 2, 3); // [37, 1, 2, 3] const result2 = addthirtyseven(5); // 37 + 5 = 42 const result3 = addthirtyseven(5, 10); // 37 + 5 = 42 // (the second argument is ignored) with settimeout() by default within window.settimeout(), the this keyword will be set to the window (or global) object. when working with class met...
Intl.PluralRules() constructor - JavaScript
minimumintegerdigits the minimum number of integer digits to use. possible values are from 1 to 21; the default is 1. minimumfractiondigits the minimum number of fraction digits to use. ...
...tegerdigits the minimum number of integer digits to use. possible values are from 1 to 21; the default is 1. minimumfractiondigits the minimum number of fraction digits to use. ...
... minimumsignificantdigits the minimum number of significant digits to use. possible values are from 1 to 21; the default is 1. maximumsignificantdigits the maximum number of significant digits to use. possible values are from 1 to 21; the default is 21. ...
... minimumsignificantdigits the minimum number of significant digits to use. possible values are from 1 to 21; the default is 1. maximumsignificantdigits the maximum number of significant digits to use. possible values are from 1 to 21; the default is 21. ...
Intl - JavaScript
nsitive functions. constructor properties intl.collator() constructor for collators, which are objects that enable language-sensitive string comparison. intl.datetimeformat() constructor for objects that enable language-sensitive date and time formatting. intl.displaynames() constructor for objects that enable the consistent translation of language, region and script display names. intl.
listformat() constructor for objects that enable language-sensitive
list formatting. intl.locale() constructor for objects that represents a unicode locale identifier. intl.numberformat() constructor for objects that enable language-sensitive number formatting. intl.pluralrules() constructor for objects that enable plural-sensitive formatting and language-specific rules for plurals. intl.relat...
...-sensitive formatting and language-specific rules for plurals. intl.relativetimeformat() constructor for objects that enable language-sensitive relative time formatting. static methods intl.getcanonicallocales() returns canonical locale names. ...
... a single locale may be specified by either an intl.locale object or a string that is a unicode bcp 47 locale identifier. ...
...an date 14 october, 2017 is the hijri date 24 muharram, 1439. other bcp 47 extension tags can be found in the unicode cldr project. finally, an extension using the letter "x" may appear, followed by one or one- to eight-letter or digit tags. this extension allows applications to encode information for their own private use, that will be ignored by all intl operations. locale negotiation the
list of locales specified by the locales argument, after unicode extensions have been removed from them, is interpreted as a prioritized request from the application. the runtime compares it against the locales it has available and picks the best one available. two matching algorithms exist: the "lookup" matcher follows the lookup algorithm specified in bcp 47; the "best fit" matcher lets the runtime ...
handler.construct() - JavaScript
ze the proxy must itself have a [[construct]] internal method (i.e. new target must be valid). the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax const p = new proxy(target, { construct: function(target, arguments
list, newtarget) { } }); parameters the following parameters are passed to the construct() method. this is bound to the handler. target the target object. arguments
list the
list of arguments for the constructor. newtarget the constructor that was originally called, p above. return value the construct method must return an object. description the handler.construct() method is a trap f...
...he new operator. interceptions this trap can intercept these operations: new proxy(...args) reflect.construct() invariants if the following invariants are violated, the proxy will throw a typeerror: the result must be an object. examples trapping the new operator the following code traps the new operator. ...
...these operations: new proxy(...args) reflect.construct() invariants if the following invariants are violated, the proxy will throw a typeerror: the result must be an object. examples trapping the new operator the following code traps the new operator. const p = new proxy(function() {}, { construct: function(target, arguments
list, newtarget) { console.log('called: ' + arguments
list.join(', ')); return { value: arguments
list[0] * 10 }; } }); console.log(new p(1).value); // "called: 1" // 10 the following code violates the invariant. const p = new proxy(function() {}, { construct: function(target, arguments
list, newtarget) { return 1; } }); new p(); // typeerror is thrown the following code improperly initializes the proxy. th...
...lowing code violates the invariant. const p = new proxy(function() {}, { construct: function(target, arguments
list, newtarget) { return 1; } }); new p(); // typeerror is thrown the following code improperly initializes the proxy. the target in proxy initialization must itself be a valid constructor for the new operator. const p = new proxy({}, { construct: function(target, arguments
list, newtarget) { return {}; } }); new p(); // typeerror is thrown, "p" is not a constructor specifications specification ecmascript (ecma-262)the definition of '[[construct]]' in that specification. ...
MathML documentation index - MathML
anguage (mathml) is a dialect of xml for describing mathematical notation and capturing both its structure and content. 2 authoring mathml beginner, mathml, mathml project this page explains how to write mathematics using the mathml language. just like html, mathml is described with tags and attributes. html becomes verbose when your document contains advanced structures like
lists or tables but fortunately there are many generators from simple notations, wysiwyg editors and other content management systems to help writing web pages. 3 examples beginner, example, guide, mathml, needsbeginnerupdate below you'll find some examples you can look at to help you to understand how to use mathml to display increasingly complex mathematical concepts in web cont...
...on, example, guide, html5, mathml, needsbeginnerupdate this page outlines the derivation of the quadratic formula. 5 proving the pythagorean theorem beginner, example, guide, html5 math, math education, mathml, needsbeginnerupdate we will now prove the pythagorean theorem: 6 mathml attribute reference mathml, mathml reference this is an alphabetical
list of mathml attributes. more details for each attribute are available on particular element pages. 7 values guide, mathml, mathml reference several mathml presentation elements have attributes that accept length values used for size or spacing. mathml accepts different units and constants for specifying lengths. 8 mathml documentation index index, mathml fo...
...values guide, mathml, mathml reference several mathml presentation elements have attributes that accept length values used for size or spacing. mathml accepts different units and constants for specifying lengths. 8 mathml documentation index index, mathml found 40 pages: 9 mathml element reference mathml, mathml reference this is an alphabetical
list of mathml presentation elements. 10 <maction> mathml, mathml reference, mathml:element, mathml:enlivening expressions the following example uses the "toggle" actiontype: 11 <math> mathml, mathml reference, mathml:element the top-level element in mathml is <math>. every valid mathml instance must be wrapped in <math> tags. in addition you must not nest a s...
...displayed). the square root accepts only one argument, which leads to the following syntax: <msqrt> base </msqrt>. 30 <mstyle> mathml, mathml reference, mathml:element, mathml:general layout schemata the mathml <mstyle> element is used change the style of its children. it accepts all attributes of all mathml presentation elements with some exceptions and additional attributes
listed below. 31 <msub> mathml, mathml reference, mathml:element, mathml:script and limit schemata the mathml <msub> element is used to attach a subscript to an expression. 32 <msubsup> mathml, mathml reference, mathml:element, mathml:script and limit schemata the mathml <msubsup> element is used to attach both a subscript and a superscript, together, to an ex...
Autoplay guide for media and Web Audio APIs - Web media technologies
that, browsers generally only allow autoplay to occur successfully under specific circumstances. autoplay availability as a general rule, you can assume that media will be allowed to autoplay only if at least one of the following is true: the audio is muted or its volume is set to 0 the user has interacted with the site (by clicking, tapping, pressing keys, etc.) if the site has been white
listed; this may happen either automatically if the browser determines that the user engages with media frequently, or manually through preferences or other user interface features if the autoplay feature policy is used to grant autoplay support to an <iframe> and its document. otherwise, the playback will likely be blocked. the exact situations that result in blocking, and the specifics of how sit...
...ppen either automatically if the browser determines that the user engages with media frequently, or manually through preferences or other user interface features if the autoplay feature policy is used to grant autoplay support to an <iframe> and its document. otherwise, the playback will likely be blocked. the exact situations that result in blocking, and the specifics of how sites become white
listed vary from browser to browser, but the above are good guidelines to go by. for details, see the auto-play policies for google chrome and webkit. note: put another way, playback of any media that includes audio is generally blocked if the playback is programmatically initiated in a tab which has not yet had any user interaction. browsers may additionally choose to block under other circumstanc...
...lag on the media element that tells you if autoplay worked. all you can really do is examine a few values and make an educated guess as to whether or not autoplay worked. a better approach, if you're able to adjust the direction you look at things from, is to instead rely on knowing that playback of the media has successfully started, instead of when it fails to start. you can do this easily, by
listening for the play event to be fired on the media element. the play event is sent both when the media is resumed after being paused and when autoplay occurs. that means that the first time the play event is fired, you know your media is being started for the first time after the page is opened. consider this html for a media element: <video src="myvideo.mp4" autoplay onplay=handlefirstplay(even...
...e video will autoplay but with the audio muted. the user has the option, however, of re-enabling the audio by clicking on the unmute button in the controls. browser configuration options browsers may have preferences that control the way autoplay works, or how autoplay blocking is handled. here, any such preferences that may be of special significance or importance to you as a web developer are
listed. these include any that may aid in testing or debugging as well as any that could be set in a way that you need to be prepared to handle. firefox media.allowed-to-play.enabled a boolean preference which specifies whether or not the htmlmediaelement.allowedtoplay property is exposed to the web. this is currently false by default (except in nightly builds, where it's true by default). if thi...
class - SVG: Scalable Vector Graphics
s to any number of elements, however, multiple class names must be separated by whitespace characters. an element's class name serves two key roles: as a style sheet selector, for when an author assigns style information to a set of elements. for general use by the browser. you can use this class to style svg content using css. ...
...erves two key roles: as a style sheet selector, for when an author assigns style information to a set of elements. for general use by the browser. you can use this class to style svg content using css. usage context categories none value <
list-of-class-names> animatable yes normative document svg 1.1 (2nd edition): the class attribute
list-of-ts <
list-of-ts> (where t is some type.) a
list consists of a separated sequence of values. ...
...ser. you can use this class to style svg content using css. usage context categories none value <
list-of-class-names> animatable yes normative document svg 1.1 (2nd edition): the class attribute
list-of-ts <
list-of-ts> (where t is some type.) a
list consists of a separated sequence of values. unless explicitly described differently,
lists within svg's xml attributes can be either comma-separated (with optional white space before or after the comma), or white space-separated. white space in
lists is defined as one or more of the following consecutive characters: "space" (u+0020), "tab" (u+0009), "line feed" (u+000a), "carriage return" (u+000d), and "form-feed" (u+000c). the following is a template for an ebnf grammar describin...
...n svg's xml attributes can be either comma-separated (with optional white space before or after the comma), or white space-separated. white space in
lists is defined as one or more of the following consecutive characters: "space" (u+0020), "tab" (u+0009), "line feed" (u+000a), "carriage return" (u+000d), and "form-feed" (u+000c). the following is a template for an ebnf grammar describing the <
list-of-ts> syntax:
list-of-ts ::= t | t,
list-of-ts within the svg dom, values of a <
list-of-ts> type are represented by an interface specific for the particular type t. for example, a <
list-of-lengths> is represented in the svg dom using an svglength
list or svganimatedlength
list object. example <html> <body> <svg width="120" height="220" viewport="0 ...
dx - SVG: Scalable Vector Graphics
sed. for <altglyph>, if it contains a single value, dx defines a shift along the x-axis for all alternate glyph. if there are multiple values, dx defines a shift along the x-axis for each individual glyph relative to the preceding glyph. if there are less values than glyphs, the remaining glyphs use a value of 0. if there are more values than glyphs, extra values are ignored. value
list of <length> default value none animatable yes fedropshadow for <fedropshadow>, dx defines the x offset of the droped shadow. the unit used to resolve the value of the attribute is set by the primitiveunits attribute of the <filter> element. value <number> default value 2 animatable yes feoffset for <feoffset>, dx defines...
... yes text for <text>, if it contains a single value, dx defines a shift along the x-axis for all glyphs. if there are multiple values, dx defines a shift along the x-axis for each individual glyph relative to the preceding glyph. if there are less values than glyphs, the remaining glyphs use a value of 0. if there are more values than glyphs, extra values are ignored. ...
...ldn't be used. for <tref>, if it contains a single value, dx defines a shift along the x-axis for all glyphs. if there are multiple values, dx defines a shift along the x-axis for each individual glyph relative to the preceding glyph. if there are less values than glyphes, the remaining glyphes use a value of 0. if there are more values than glyphes, extra values are ignored. value
list of <length> default value none animatable yes tspan for <tspan>, if it contains a single value, dx defines a shift along the x-axis for all alternate glyph. if there are multiple values, dx defines a shift along the x-axis for each individual glyph relative to the preceding glyph. if there are less values than glyphs, the remaining glyphs use a value of 0. if ther...
... tspan for <tspan>, if it contains a single value, dx defines a shift along the x-axis for all alternate glyph. if there are multiple values, dx defines a shift along the x-axis for each individual glyph relative to the preceding glyph. if there are less values than glyphs, the remaining glyphs use a value of 0. if there are more values than glyphs, extra values are ignored. value
list of <length> default value none animatable yes specifications specification status comment filter effects module level 1the definition of 'dx' in that specification. working draft initial definition for <fedropshadow> filter effects module level 1the definition of 'dx' in that specification. working draft definition f...
dy - SVG: Scalable Vector Graphics
. for <altglyph>, if it contains a single value, dy defines a shift along the y-axis for all alternate glyph. if there are multiple values, dy defines a shift along the y-axis for each individual glyph relative to the preceding glyph. if there are less values than glyphes, the remaining glyphes use a value of 0. if there are more values than glyphes, extra values are ignored. value
list of <length> default value none animatable yes fedropshadow for <fedropshadow>, dy defines the y offset of the dropped shadow. the unit used to resolve the value of the attribute is set by the primitiveunits attribute of the <filter> element. value <number> default value 2 animatable yes feoffset for <feoffset>, dy define...
...es text for <text>, if it contains a single value, dy defines a shift along the y-axis for all glyphs. if there are multiple values, dy defines a shift along the y-axis for each individual glyph relative to the preceding glyph. if there are less values than glyphes, the remaining glyphes use a value of 0. if there are more values than glyphes, extra values are ignored. ...
...ldn't be used. for <tref>, if it contains a single value, dy defines a shift along the y-axis for all glyphs. if there are multiple values, dy defines a shift along the y-axis for each individual glyph relative to the preceding glyph. if there are less values than glyphes, the remaining glyphes use a value of 0. if there are more values than glyphes, extra values are ignored. value
list of <length> default value none animatable yes tspan for <tspan>, if it contains a single value, dy defines a shift along the y-axis for all alternate glyph. if there are multiple values, dy defines a shift along the y-axis for each individual glyph relative to the preceding glyph. if there are less values than glyphes, the remaining glyphes use a value of 0. if th...
...span for <tspan>, if it contains a single value, dy defines a shift along the y-axis for all alternate glyph. if there are multiple values, dy defines a shift along the y-axis for each individual glyph relative to the preceding glyph. if there are less values than glyphes, the remaining glyphes use a value of 0. if there are more values than glyphes, extra values are ignored. value
list of <length> default value none animatable yes specifications specification status comment filter effects module level 1the definition of 'dy' in that specification. working draft initial definition for <fedropshadow> filter effects module level 1the definition of 'dy' in that specification. working draft definition f...
gradientTransform - SVG: Scalable Vector Graphics
specifications specification status comment css transforms level 1the definition of 'surfacescale for <fespecularlighting>' in that specification. working draft ...
... s...
... scalable v...
... scalable vector graphics (svg) 2the definition of 'gradienttransformation for <lineargradient>' in that specification. candidate recommendation no change scalable vector graphics (svg) 2the definition of 'gradienttransformation for <radialgradient>' in that specification. ...
requiredExtensions - SVG: Scalable Vector Graphics
determines whether all of the named extensions are supported by the user agent. ...
...determines whether all of the named extensions are supported by the user agent. ...
...determines whether all of the named extensions are supported by the user agent. ...
...determines whether all of the named extensions are supported by the user agent. ...
requiredFeatures - SVG: Scalable Vector Graphics
it determines whether or not all of the named features are supported by the browser; if all of them are supported, the attribute evaluates to true end the element is rendered; otherwise, the attribute evaluates to false and the current element and its children are skipped and thus will not be rendered. this provides a way to design svg that gracefully falls back when features aren't available. if the attribute is not present, then its implicit evaluated value is true. if a null string or empty string value is given to attribute requiredfeatures, the attribute is evaluate to false. ...
... feature strings the following are the feature s...
... x="20" y="27">requiredfeatures supported</text> </g> <g requiredfeatures=""> <rect fill="crimson" x="10" y="10" height="25" width="230" /> <text x="20" y="27">requiredfeatures not supported</text> </g> </svg> usage notes value <
list-of-features> default value true if not defined, false if null or empty string as value animatable no <
list-of-features> this is a
list of feature strings, separated using white space. determines whether all of the named features are supported by the browser. see feature strings below for a
list of allowed values. feature strings the following are the feature strings for the requiredfeatures attribute. these same feature strings apply to the hasfeature method call that is part of the svg dom's supp...
...ture strings apply to the hasfeature method call that is part of the svg dom's support for the domimplementation interface. in some cases the feature strings map directly to a set of attributes, properties or elements, in others they represent some functionality of the browser. note that the format and naming for feature strings changed from svg 1.0 to svg 1.1. the svg 1.0 feature strings are not
listed here but can be found in the svg specification. some browser support svg 1.0 feature strings for compatibility reasons. however, the svg 1.0 feature strings are considered deprecated. http://www.w3.org/tr/svg11/feature#svg at least one of the following feature is supported: http://www.w3.org/tr/svg11/feature#svg-static http://www.w3.org/tr/svg11/feature#svg-animation http://www.w...
x - SVG: Scalable Vector Graphics
100% } <svg viewbox="0 0 300 100" xmlns="http://www.w3.org/2000/svg"> <rect x="20" y="20" width="60" height="60" /> <rect x="120" y="20" width="60" height="60" /> <rect x="220" y="20" width="60" height="60" /> </svg> altglyph warning: as of svg2 <altglyph> is deprecated and shouldn't be used. for <altglyph>, x defines the x-axis coordinate of the alternate glyph. value
list of <length> default value none animatable yes feblend for <feblend>, x defines the minimum x coordinate for the rendering area of the primitive. value <length> | <percentage> default value 0% animatable yes fecolormatrix for <fecolormatrix>, x defines the minimum x coordinate for the rendering area of the primitive. ...
... the exact content text position is influenced by some properties like text-anchor, or direction. if there are multiple values, x defines the x coordinate of each individual glyph from the text. if there are less values than glyphes, the remaining glyphes are placed in the continuity of the last positioned glyph. if there are more values than glyphes, extra values are ignored. ...
... the exact content text position is influenced by some properties like text-anchor, or direction. if there are multiple values, x defines the x coordinate of each individual glyph from the text. if there are less values than glyphes, the remaining glyphes are placed in the continuity of the last positioned glyph. if there are more values than glyphes, extra values are ignored. value
list of (<length> | <percentage>) default value 0 animatable yes tspan for <tspan>, if it contain a single value, x defines the x coordinate on where the content text position must be placed. the content text position is usualy a point on the baseline of the first line of text. the exact content text position is influenced by some properties like text-anchor, or directi...
... the exact content text position is influenced by some properties like text-anchor, or direction. if there are multiple values, x defines the x coordinate of each individual glyph from the text. if there are less values than glyphes, the remaining glyphes are placed in the continuity of the last positioned glyph. if there are more values than glyphes, extra values are ignored. ...
y - SVG: Scalable Vector Graphics
100% } <svg viewbox="0 0 100 300" xmlns="http://www.w3.org/2000/svg"> <rect y="20" x="20" width="60" height="60" /> <rect y="120" x="20" width="60" height="60" /> <rect y="220" x="20" width="60" height="60" /> </svg> altglyph warning: as of svg2 <altglyph> is deprecated and shouldn't be used. for <altglyph>, y defines the y-axis coordinate of the alternate glyph. value
list of <length> default value none animatable yes feblend for <feblend>, y defines the minimum y coordinate for the rendering area of the primitive. value <length> | <percentage> default value 0% animatable yes fecolormatrix for <fecolormatrix>, y defines the minimum y coordinate for the rendering area of the primitive. ...
... the exact content text position is influenced by some properties like text-anchor, or direction. if there are multiple values, y defines the y coordinate of each individual glyph from the text. if there are less values than glyphes, the remaining glyphes are placed in the continuity of the last positioned glyph. if there are more values than glyphes, extra values are ignored. ...
... the exact content text position is influenced by some properties like text-anchor, or direction. if there are multiple values, y defines the y coordinate of each individual glyph from the text. if there are less values than glyphes, the remaining glyphes are placed in the continuity of the last positioned glyph. if there are more values than glyphes, extra values are ignored. value
list of (<length> | <percentage>) default value 0 animatable yes tspan for <tspan>, if it contain a single value, y defines the y coordinate on where the content text position must be placed. the content text position is usualy a point on the baseline of the first line of text. the exact content text position is influenced by some properties like text-anchor, or directi...
... the exact content text position is influenced by some properties like text-anchor, or direction. if there are multiple values, y defines the y coordinate of each individual glyph from the text. if there are less values than glyphes, the remaining glyphes are placed in the continuity of the last positioned glyph. if there are more values than glyphes, extra values are ignored. ...
<altGlyph> - SVG: Scalable Vector Graphics
the <altglyph> svg element allows sophisticated selection of the glyphs used to render its child character data. usage context categoriestext content element, text content child elementpermitted contentany elements or character data attributes x this attribute defines the corresponding absolute x-coordinates for rendering the element. ...
...child elementpermitted contentany elements or character data attributes x this attribute defines the corresponding absolute x-coordinates for rendering the element. value type: <
list-of-coordinates> ; default value: absolute x-coordinate of ancestor <text> or <tspan>; animatable: yes y this attribute defines the corresponding absolute y-coordinates for rendering the element. value type: <
list-of-coordinates> ; default value: absolute y-coordinate of ancestor <text> or <tspan>; animatable: yes dx this attribute indicates a shift along the x-axis on the position of the element. value type: <
list-of-coordinates> ; default value: relative x-coordinate of ancestor <text> or <tspan>; animatable: yes dy this attribute indicates a shift along the x-axis on the position of the element. v...
...tes> ; default value: absolute y-coordinate of ancestor <text> or <tspan>; animatable: yes dx this attribute indicates a shift along the x-axis on the position of the element. value type: <
list-of-coordinates> ; default value: relative x-coordinate of ancestor <text> or <tspan>; animatable: yes dy this attribute indicates a shift along the x-axis on the position of the element. value type: <
list-of-coordinates> ; default value: relative y-coordinate of ancestor <text> or <tspan>; animatable: yes rotate this attribute defines the supplemental rotation that will be applied to the element. ...
...efault value: relative x-coordinate of ancestor <text> or <tspan>; animatable: yes dy this attribute indicates a shift along the x-axis on the position of the element. value type: <
list-of-coordinates> ; default value: relative y-coordinate of ancestor <text> or <tspan>; animatable: yes rotate this attribute defines the supplemental rotation that will be applied to the element. value type: <
list-of-numbers> ; default value: none; animatable: yes (non-additive) glyphref the glyph identifier, the format of which is dependent on the format defined by the format attribute of the given font. value type: <string> ; default value: none; animatable: no format the format of the given font. value type: <string> ; default value: none; animatable: no xlink:href an <iri> reference either to a...
Features restricted to secure contexts - Web security
see here for information on secure contexts support. ...
...see here for information on secure contexts support. ...
...see here for information on secure contexts support. ...
...upported web midi (see midiaccess, for example) 43 not supported not supported not supported web crypto api 60 79 not supported 75 secure context restrictions that vary by browser some browsers may decide to disable certain apis in non-secure contexts or apply other restrictions/security measures, despite the spec not requiring them. this section
lists any such differences existing in browsers. api chrome edge safari firefox application cache restricted to secure contexts planned in chrome 70 deprecation planning started in february 2018 public interest on deprecation webkit bug 182442 restricted to secure contexts in firefox 62 geolocation restricted to secure contexts in 50 re...
Web security
ensuring that your website or open web application is secure is critical. even simple bugs in your code can result in private information being leaked, and bad people are out there trying to find ways to steal data. the web security-oriented articles
listed here provide information that may help you secure your site and its code from attacks and data theft. content security content security policy (csp) content security policy (csp) is an added layer of security that helps to detect and mitigate certain types of attacks, including cross-site scripting (xss) and data injection attacks. these attacks are used for everything from data theft to site defacement to the distribution of malware. connection security transport security layer (tls) the transport layer security (tls) ...
...rely (via https/tls), and for which the potential for communication with contexts that are not secure is limited. many web apis and features are accessible only in a secure context. the primary goal of secure contexts is to prevent man-in-the-middle attackers from accessing powerful apis that could further compromise the victim of an attack. features restricted to secure contexts this reference
lists the web platform features available only in secure contexts. weak signature algorithms the strength of the hash algorithm used in signing a digital certificate is a critical element of the security of the certificate. this article provides some information about signature algorithms known to be weak, so you can avoid them when appropriate. redirection with 301 and 302 response codes to be wr...
...er's browsing history and figure out what sites the user had visited. to mitigate this problem, browsers have limited the amount of information that can be obtained from visited links. ...
...what sites the user had visited. to mitigate this problem, browsers have limited the amount of information that can be obtained from visited links. ...
Using custom elements - Web Components
tylesheet loads. many modern browsers implement an optimization for <style> tags either cloned from a common node or that have identical text, to allow them to share a single backing stylesheet. with this optimization the performance of external and internal styles should be similar. customized built-in elements now let's have a look at another customized built in element example — expanding-
list (see it live also). this turns any unordered
list into an expanding/collapsing menu. first of all, we define our element's class, in the same manner as before: class expanding
list extends htmlu
listelement { constructor() { // always call super first in constructor super(); // write element functionality in here ... } } we will not explain the element functionality in any ...
...so it has all the characteristics of a <ul> element with the functionality we define built on top, rather than being a standalone element. this is what makes it a customized built-in, rather than an autonomous element. ...
... <ul> element with the functionality we define built on top, rather than being a standalone element. this is what makes it a customized built-in, rather than an autonomous element. next, we register the element using the define() method as before, except that this time it also includes an options object that details what element our custom element inherits from: customelements.define('expanding-
list', expanding
list, { extends: "ul" }); using the built-in element in a web document also looks somewhat different: <ul is="expanding-
list"> ... </ul> you use a <ul> element as normal, but specify the name of the custom element inside the is attribute. note: again, you can see the full javascript source code here. using the lifecycle callbacks you can define several different callbacks i...
...as htmlelement and others, and return a different instance from the one just created. if you need a constructor and a mandatory super call, remember to pass along optional arguments and return the result of such a super call operation. class customelement extends htmlelement { constructor(...args) { const self = super(...args); // self functionality written in here // self.addevent
listener(...) // return the right context return self; } } if you don't need to perform any operation in the constructor, you can simply omit it so that its native behavior (see following) will be preserved. constructor(...args) { return super(...args); } transpilers vs. classes please note that es2015 classes cannot reliably be transpiled in babel 6 or typescript targeting legacy brow...
Content Processes - Archive of obsolete content
by the main script running in the add-on process. content scripts differ from scripts that are loaded by the page itself in that they are provided with a messaging api that can be used to send messages back to the add-on script. event emitters the messaging api we use to send json messages between scripts in different processes is based on the use of event emitters. an event emitter maintains a
list of callbacks (or
listeners) for one or more named events. each event emitter has several methods: the method on is used to add a
listener for an event. conversely, the method remove
listener is used to remove a
listener for an event. the method once is a helper function which adds a
listener for an event, and automatically removes it the first time it is called. each event emitter has two associa...
...the other emit function is associated with another event emitter: it was passed as an argument to the constructor of this event emitter, and made into a method. calling this method causes an event to be emitted on the other event emitter. ...
...mitter, and made into a method. calling this method causes an event to be emitted on the other event emitter. suppose we have two event emitters in different processes, and we want them to be able to emit events to each other. in this case, we would replace the emit function passed to the constructor of each emitter with a function that sends a message to the other process. we can then hook up a
listener to be called when this message arrives at the other process, which in turn calls the emit function on the other event emitter. the combination of this function and the corresponding
listener is referred to as a pipe. content workers a content worker is an object that is used to inject content scripts into a content process, and to provide a pipe between each content script and the main add-...
indexed-db - Archive of obsolete content
t linked to any website database. the module cannot be used to interact with a given website database. see bug 778197 and bug 786688. example this example uses the action button api, which is only available from firefox 29 onwards. here's a complete add-on that adds two buttons to the browser: the button labeled "add" adds the title of the current tab to a database, while the button labeled "
list"
lists all the titles in the database. 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. var { indexeddb, idbkeyrange } = require('sdk/indexed-db'); var database = {}; database.onerror = function(e) { console.error(e.value) } function open(version) { var request = indexeddb.open...
...ew array(); trans.oncomplete = function() { cb(items); } var keyrange = idbkeyrange.lowerbound(0); var cursorrequest = store.opencursor(keyrange); cursorrequest.onsuccess = function(e) { var result = e.target.result; if(!!result == false) return; items.push(result.value.name); result.continue(); }; cursorrequest.onerror = database.onerror; }; function
listitems(item
list) { console.log(item
list); } open("1"); var add = require("sdk/ui/button/action").actionbutton({ id: "add", label: "add", icon: "./add.png", onclick: function() { additem(require("sdk/tabs").activetab.title); } }); var
list = require("sdk/ui/button/action").actionbutton({ id: "
list", label: "
list", icon: "./
list.png", onclick: function() { getitems(
list...
... globals properties indexeddb enables you to create, open, and delete databases. see the idbfactory documentation. idbkeyrange defines a range of keys. ...
private-browsing - Archive of obsolete content
same time. ...
...ssions": {"private-browsing": true} if an add-on has not opted in, then the high-level sdk modules will not expose private windows, or objects (such as tabs) that are associated with private windows: the windows module will not
list any private browser windows, generate any events for private browser windows, or let the add-on open any private browser windows the tabs module will not
list any tabs that belong to private browser windows, and the add-on won't receive any events for such tabs any ui components will not be displayed in private browser windows any menus or menu items created using the context-menu will not be shown in context menus that belong to private browser windows the page-mod module will not attach content scripts to documents belonging to priv...
...sometimes it can be useful to cache some data from private windows while they are open, as long as you don't store it after the private browsing windows have been closed. for example, the "downloads" window might want to display all downloads while there are still some private windows open, then clean out all the private data when all private windows have closed. 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. it takes an object as an argument, and returns true only if the object is: a pri...
simple-storage - Archive of obsolete content
ge available to your add-on is limited. currently this limit is about five megabytes (5,242,880 bytes). you can choose to be notified when you go over quota, and you should respond by reducing the amount of data in storage. if the user quits the application while you are over quota, all data stored since the last time you were under quota will not be persisted. you should not let that happen. ...
...rently this limit is about five megabytes (5,242,880 bytes). you can choose to be notified when you go over quota, and you should respond by reducing the amount of data in storage. if the user quits the application while you are over quota, all data stored since the last time you were under quota will not be persisted. you should not let that happen. to
listen for quota notifications, register a
listener for the "overquota" event. it will be called when your storage goes over quota. function myonoverquota
listener() { console.log("uh oh."); } ss.on("overquota", myonoverquota
listener);
listeners can also be removed: ss.remove
listener("overquota", myonoverquota
listener); to find out how much of your quota you're using, check the module's quotausage property. it indicates the percentage of ...
...that you're using 50% of your quota and 1.0 means you're using your entire quota). if your add-on is using more than its quota, this value is greater than 1.0. therefore, when you're notified that you're over quota, you should respond by removing data from the storage space until your quotausage is less than or equal to 1. which particular data you remove is up to you. for example: ss.storage.my
list = [ /* some long array */ ]; ss.on("overquota", function () { while (ss.quotausage > 1) ss.storage.my
list.pop(); }); private browsing if your storage is related to your users' web history, personal information, or other sensitive data, your add-on should respect private browsing. to read about how to opt into private browsing mode and how to use the sdk to avoid storing user data associa...
content/worker - Archive of obsolete content
content scripts specified by this option are loaded before those specified by the contentscript option. optional. contentscript string,array the texts of content scripts to load. content scripts specified by this option are loaded after those specified by the contentscriptfile option. optional. 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. worker worker is composed from the eventemitter trait, therefore instances of worker and their descendants expose all the public properties exposed by eventemitter along with additional public properties that are
listed below. methods postmessage(dat...
...a detach event is fired just before removal. properties port object that allows you to: send customized messages to the worker using the port.emit function receive events from the worker using the port.on function url the url of the content. ...
...on function url the url of the content. tab if this worker is attached to a content document, returns the related tab. events message this event allows the content worker to receive messages from its associated content scripts. calling the self.postmessage() function from a content script will asynchronously emit the message event on the corresponding worker. arguments value : the event
listener is passed the message, which must be a json-serializable value. error this event allows the content worker to react to an uncaught runtime script error that occurs in one of the content scripts. arguments error : the event
listener is passed a single argument which is an error object. detach this event is emitted when the document associated with this worker is unloaded or the worker's ...
preferences/event-target - Archive of obsolete content
listen to changes to the preferences system in firefox. this enables add-ons to
listen to change events to the system-wide settings. these are the same preferences that are exposed to users in the about:config page. preferences/service gives you full access to the preferences system. you can also use the simple-prefs module to access just the preferences for your own add-on and expose them to the user in the add-on manager. globals constructor prefstarget(options) parameters options : object required options: name type branchname string by default this is "", the root. ...
...e-prefs module to access just the preferences for your own add-on and expose them to the user in the add-on manager. globals constructor prefstarget(options) parameters options : object required options: name type branchname string by default this is "", the root. ...
...s") does var target = prefstarget({ branchname: "extensions." + require("sdk/self").preferencesbranch + "." }); target.once("test", function(prefname) { console.log(prefname) // logs "test" console.log(target.prefs[name]) // logs true }); target.once("", function() { console.log(prefname) // logs "test" console.log(target.prefs[name]) // logs true }) // changing a pref which our target
listens to require("sdk/simple-prefs").prefs.test = true; ...
jpm-mobile - Archive of obsolete content
nstall jpm-mobile -g at the command prompt, type: jpm-mobile you should see a screen summarizing the available jpm-mobile commands. note that unlike cfx, jpm-mobile is available in every command prompt you start, as long as you installed it with the -g flag. problems? if you don't see this, ask for help. sdk users and project team members discuss problems and proposals on the project mailing
list. someone else may have had the same problem you do, so try searching the
list. you're welcome to post a question, too. you can also chat with other sdk users in #jetpack on mozilla's irc network. command reference there are currently two jpm commands: jpm-mobile run launch an instance of firefox with your add-on installed. jpm-mobile test runs your add-on's unit tests. ...
...-mobile run this command runs a new instance of firefox with the add-on installed: jpm-mobile run jpm-mobile run accepts the following options: --adb /path/to/adb provides the path to adb. -b --binary binary use the package name of firefox specified in binary. jpm-mobile run -b fennec you can get the package name by following command. $ adb shell pm
list packages | grep org.mozilla package:org.mozilla.firefox $ jpm-mobile run -b firefox # the package name is firefox -v --verbose verbose operation. jpm-mobile test jpm-mobile test see the tutorial on unit testing and the reference documentation for the assert module for more details on this. jpm-mobile test accepts the following options: --adb /path/to/adb ...
...l on unit testing and the reference documentation for the assert module for more details on this. jpm-mobile test accepts the following options: --adb /path/to/adb provides the path to adb. -b --binary binary use the package name of firefox specified in binary. jpm-mobile test -b fennec you can get the package name by following command. $ adb shell pm
list packages | grep org.mozilla package:org.mozilla.firefox $ jpm-mobile run -b firefox # the package name is firefox -v --verbose verbose operation. ...
Creating annotations - Archive of obsolete content
when a mouseenter event is triggered the selector checks whether the element is eligible for annotation. an element is eligible if it, or one of its ancestors in the dom tree, has an attribute named "id". the idea here is to make it more likely that the annotator will be able to identify annotated elements correctly later on. if the page elemen...
...worker); worker.port.on('show', function(data) { console.log(data); }); worker.on('detach', function () { detachworker(this, selectors); }); } }); make sure the name you use to load jquery matches the name of the jquery version you downloaded. the page-mod matches all pages, so each time the user loads a page the page-mod emits the attach event, which will call the
listener function we've assigned to onattach. the handler is passed a worker object. each worker represents a channel of communication between the add-on code and any content scripts running in that particular page context. for a more detailed discussion of the way page-mod uses workers, see the page-mod documentation. in the attach handler we do three things: send the content script a message wit...
...idth: 180px; height: 180px; margin: 10px; padding: 0px; } </style> </head> <body> <textarea rows='10' cols='20' id='annotation-box'> </textarea> </body> </html> save this inside data/editor as annotation-editor.html. annotation editor content script in the corresponding content script we do two things: handle a message from the add-on code by giving the text area focus
listen for the return key and when it is pressed, send the contents of the text area to the add-on. here's the code: var textarea = document.getelementbyid('annotation-box'); textarea.onkeyup = function(event) { if (event.keycode == 13) { self.postmessage(textarea.value); textarea.value = ''; } }; self.on('message', function() { var textarea = document.getelementbyid('annotation-box...
Developing for Firefox Mobile - Archive of obsolete content
with the add-on sdk you can develop add-ons that run on this new version of firefox mobile as well as on the desktop version of firefox. you can use the same code to target both desktop firefox and firefox mobile, and use jpm-mobile instead of the normal jpm. right now not all modules are fully functional, but we're working on adding support for more modules. the tables at the end of this guide
list the modules that are currently supported on firefox mobile. this tutorial explains how to run sdk add-ons on an android device connected via usb to your development machine. we'll use the android debug bridge (adb) to communicate between the add-on sdk and the device. it's possible to use the android emulator to develop add-ons for android without access to a device, but it's slow, so for the...
... android sdk, install the android platform tools next, attach the device to the development machine via usb. now open up a command shell. android platform tools will have installed adb in the "platform-tools" directory under the directory in which you installed the android sdk. make sure the "platform-tools" directory is in your path. then type: adb devices you should see some output like:
list of devices attached 51800f220f01564 device (the long hex string will be different.) if you do, then adb has found your device and you can get started. running add-ons on android you can develop your add-on as normal, as long as you restrict yourself to the supported modules. when you need to run the add-on, first ensure that firefox is not running on the device. then execute jpm-mobile run ...
...t/runner supported test/utils supported ui/button/action not supported ui/button/toggle not supported ui/frame not supported ui/id supported ui/sidebar not supported ui/toolbar not supported util/array supported util/collection supported util/deprecate supported util/
list supported util/match-pattern supported util/object supported util/uuid supported window/utils supported ...
Modifying the Page Hosted by a Tab - Archive of obsolete content
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. to send a message from one side to the other, sender calls port.emit() and receiver
listens using port.on(). in the content script, port is a property of the global self object. in the add-on script, tab.attach() returns a worker object containing the port property you use to send messages to the content script. let's rewrite the example above to pass a message from the add-on to the content script. the content script now needs to look like this: // "self" is a global object ...
... in the content script, port is a property of the global self object. in the add-on script, tab.attach() returns a worker object containing the port property you use to send messages to the content script. let's rewrite the example above to pass a message from the add-on to the content script. ...
...awborder message isn't a built-in message, it's one that this add-on defines in the port.emit() call. injecting css unlike the page-mod api, tab.attach() doesn't enable you to inject css directly into a page. to modify the style of a page, you have to use javascript, as in the example above. learning more to learn more about working with tabs in the sdk, see the open a web page tutorial, the
list open tabs tutorial, and the tabs api reference. to learn more about content scripts, see the content scripts guide. ...
Tutorials - Archive of obsolete content
getting started installation how to install the jpm tool, which you will use for developing add-ons. troubleshooting some pointers for fixing common problems and getting more help. getting started walkthrough of creating a simple add-on with the sdk, using jpm. create user interfaces add a toolbar button attach a button to the firefox add-on toolbar. add a menu item to firefox add items to firefox's main menus. display a popup display a popup dialog implemented with html and javascript. add a context menu item add items to firefox's context menu. ...
...utton to the firefox add-on toolbar. add a menu item to firefox add items to firefox's main menus. display a popup display a popup dialog implemented with html and javascript. add a context menu item add items to firefox's context menu. interact with the browser open a web page open a web page in a new browser tab or window using the tabs module, and access its content.
listen for page load use the tabs module to get notified when new web pages are loaded, and access their content. get the
list of open tabs use the tabs module to iterate through the currently open tabs, and access their content. modify web pages modify web pages based on url create filters for web pages based on their url: whenever a web page whose url matches the filter is load...
...lop, debug, and maintain. create reusable packages containing your modules, so other add-on developers can use them too. unit testing writing and running unit tests using the sdk's test framework. chrome authority get access to the components object, enabling your add-on to load and use any xpcom object. creating event targets enable the objects you define to emit their own events.
listen for load and unload get notifications when your add-on is loaded or unloaded by firefox, and pass arguments into your add-on from the command line. using third-party modules (jpm) install and use additional modules which don't ship with the sdk itself. localization writing localizable code. mobile development develop add-ons for firefox mobile on android. add-on debugger debug your ...
Canvas code snippets - Archive of obsolete content
once the remote page has loaded, the remotepageloaded method fires. this method gets a reference to the iframe's window and draws this window to a canvas object. note that this only works if you are running the page from chrome. if you try running the code as a plain webpage, you will get a 'security error" code: "1000' error. remotecanvas = function() { this.
...remotecanvas.canvas_height = 300; remotecanvas.prototype.load = function() { var windowwidth = window.innerwidth - 25; var iframe; iframe = document.createelement('iframe'); iframe.id = 'test-iframe'; iframe.height = '10px'; iframe.width = windowwidth + 'px'; iframe.style.visibility = 'hidden'; iframe.src = this.url; // here is where the magic happens... ...
...= function() { var windowwidth = window.innerwidth - 25; var iframe; iframe = document.createelement('iframe'); iframe.id = 'test-iframe'; iframe.height = '10px'; iframe.width = windowwidth + 'px'; iframe.style.visibility = 'hidden'; iframe.src = this.url; // here is where the magic happens... ...
Customizing the download progress bar - Archive of obsolete content
css" type="text/css"?> <overlay id="mydownloadoverlay" xmlns="http://www.mozilla.org/keymaster/gat...re.is.only.xul"> </overlay> in jar.mn, make sure that there is an asterisk in front of the entry for myextension.css so that it will be preprocessed. this is required since it contains platform-specific directives, as we will see. ...
...reprocessed. this is required since it contains platform-specific directives, as we will see. the myextension.css file will look something like this: rich
listitem progressmeter { %ifdef xp_win min-height: 17px !important; %else %ifdef xp_macosx -moz-appearance: none !important; background-image: url(chrome://myextension/skin/progress_bg_osx.png) !important; %endif %endif } rich
listitem .progress-bar { %ifdef xp_win -moz-appearance: none !important; background-image: url(chrome://myextension/skin/progress_fd_win.png) !important; %else %ifdef xp_macosx background-image: url(chrome://myextension/skin/progress_fd_osx.gif) !important; %endif %endif } note: this file only supports windows and mac, but it would be straightforward to add support for linux. this...
...now your new progress bar image will only be used for the downloads with your special attribute. ...
Dialogs and Prompts - Archive of obsolete content
be sure to use ondialog* attributes on dialog element instead of putting oncommand on the button with dlgtype, because button's oncommand is executed...
...element object for any of predefined buttons with gdialog.getbutton(dlgtype);, where gdialog is the <dialog> element and dlgtype is one of the six button types
listed above. explicit if you are not satisfied with the layout of predefined buttons in dialog, you can put explicit button elements in your xul file and add a dlgtype attribute to them. valid values for dlgtype are the six button types
listed above. be sure to use ondialog* attributes on dialog element instead of putting oncommand on the button with dlgtype, because button's oncommand is executed only when the button is pressed, and ondialog* handlers are executed for keyboard and other events too. example: <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <dialog xmlns="http://www.mozilla.org...
...per/there.is.only.xul" ondialogaccept="alert('ok!');"> <hbox> <label value="hey!"/> <spacer flex="1"/> <vbox> <button dlgtype="accept"/> <button dlgtype="cancel"/> </vbox> </hbox> </dialog> default button since firefox 1.5, there are defaultbutton attributes and properties on the <dialog> element bug 284776. the possible values for the attribute are the names of buttons
listed above, and the default is "accept", for compatibility with previous versions. using <dialogheader> you can use the dialogheader element to add "headers" to windows. to get an idea of what it looks like, open options (or preferences) dialog in firefox or thunderbird (v1.0 and earlier only). the header to the right of the sections buttons is made with <dialogheader>: <dialogheader title="gener...
Examples and demos from articles - Archive of obsolete content
[article] fade in/out [html] sometimes a page uses dozens and dozens of animations. in such a condition is difficult and unnatural to keep track of all events started and then to stop them when appropriate through the cleartimeout() function. a possible approach to solve this problem is to nest all the informations needed by each animation to start, stop, etc. etc. ...
...ck of all events started and then to stop them when appropriate through the cleartimeout() function. a possible approach to solve this problem is to nest all the informations needed by each animation to start, stop, etc. etc. in different objects and then to create a constructor for such class of objects in order to standardize and simplify the instantiation of them. here is a possible and minima
list example of such abstraction, which for this reason we named minidaemon. [article] image preview before upload [html] the filereader.prototype.readasdataurl() method is useful, for example, to get a preview of an image before uploading it. [article] note: the filereader() constructor was not supported by internet explorer for versions before 10. for a full compatibility code, see also our cross...
...many properties of dom objects at the same time. filter the digitation into a form field, capture the digitation of a hidden word this example shows the use of the onkeypress event during a digitation into a form field. ajax – submitting forms and uploading files this paragraph shows how to submit forms in pure-ajax. multipage ajax navigation example this article provides a working (minima
list) example of a pure-ajax web site composed only of three pages. do something if current document has changed since last visit here is a possible example of how to show an alert message when current document changes. do something if an external page has changed since last visit here is a possible example of how to show an alert message when an external page changes. import scripts here is a p...
Installing Extensions and Themes From Web Pages - Archive of obsolete content
you should always use the installtrigger api to install themes. a note on updateenabled() installtrigger exposes a function called updateenabled that some of you may be calling before you call installtrigger.install. this is not necessary as install calls updateenabled itself internally. ...
...ling updateenabled may lead to problems if your distribution site is not in the user's white
list, because firefox only displays the "installation blocked" message when install or installchrome are called, or when a xpi file is loaded. so, if you have code that looks like this: if (installtrigger.updateenabled()) installtrigger.install({"foo": "foo.xpi"}); ... and your site is not in the white
list, when the user invokes that code, updateenabled will return false because your site isn't white
listed, and since it was updateenabled that discovered this, not a call to install, there will be no notification to the user. ...
...in the white
list, when the user invokes that code, updateenabled will return false because your site isn't white
listed, and since it was updateenabled that discovered this, not a call to install, there will be no notification to the user. thus you should only use updateenabled to display content in the page to alert the user that software installation is disabled, or your site is not in the white
list—do not place it in the install code path. (* by all means don't let this stop you from developing more ambitious install systems, i am providing this documentation only as a guide that i hope most extension distributors will use since it handles most cases well) ...
Multiple item extension packaging - Archive of obsolete content
y items that are not compatible will not be installed unless a compatibility check discovers updated compatibility information. installation installation can be performed using any of the existing methods used for installing extensions / themes. the same user interface is used for installing a multiple item package (i.e. the individual packages contained in the multiple item package will not be
listed). this also allows displaying of signing information for the multiple item package. if a manager (e.g. extension / theme manager) is used, the manager will display the individual items contained by the multiple item package after the download completes in the same manner that it would if the user had chosen to install multiple individual items simultaneously. the manager will not display the m...
...ying of signing information for the multiple item package. if a manager (e.g. extension / theme manager) is used, the manager will display the individual items contained by the multiple item package after the download completes in the same manner that it would if the user had chosen to install multiple individual items simultaneously. the manager will not display the multiple item package in the
list of items after the download has completed. signing all extensions now require signing by mozilla. for multiple item packages, all internal add-ons need to be signed, but the container doesn't need to be signed. this means that the contained add-ons need to be submitted to amo individually for signing. additionally, the container add-on id must not be the same as the id of any of the contained a...
...ng by mozilla. for multiple item packages, all internal add-ons need to be signed, but the container doesn't need to be signed. this means that the contained add-ons need to be submitted to amo individually for signing. additionally, the container add-on id must not be the same as the id of any of the contained add-ons. official references for toolkit api official references. do not add to this
list without contacting benjamin smedberg. note that this page is included from the pages
listed below. so: don't add breadcrumbs! structure of an installable bundle: describes the common structure of installable bundles, including extensions, themes, and xulrunner applications extension packaging: specific information about how to package extensions theme packaging: specific information about how...
Appendix: What you should know about open-source software licenses - Archive of obsolete content
such as education or citation, use in the strong, authorial sense is permitted to readers. any discussion of copyright eventually turns to the fact that some uses are prohibited, so it’s useful to understand what uses are unrestricted. range of uses restricted to author unrestricted book print, publish, revise read music record, perform, revise
listen movie distribute, screen, revise watch software copy, distribute, modify execute licenses are a use permit in order to use (in the authorial sense) a copyrighted work, the user must either receive a use permit from the copyright holder, or must be assigned partial rights by the author. this use permit for a copyrighted work is called a license. when we tal...
...this license has the following simple terms. it’s short, so read it carefully. <program name> copyright (c) <year>, <copyright holder> all rights reserved. 1. redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer. 2. redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 2. this software is provided "as is" and without warranty. use at your own risk. 3. neither the name of the <organization> ...
...ic license http://www.mozilla.org/mpl/mpl-1.1.html mpl faq http://www.mozilla.org/mpl/mpl-faq.html common public license http://opensource.org/licenses/cpl1.0.php gnu general public license (gpl) http://www.gnu.org/licenses/gpl.html gnu lesser general public license (lgpl) http://www.gnu.org/licenses/lgpl.html various licenses and comments about them http://www.gnu.org/licenses/license-
list.html the bsd license problem http://www.gnu.org/philosophy/bsd.html the free software license diagnostic (in japanese) http://www.rubyist.net/~matz/20030608.html#p02 openoffice.org joint copyright assignment (jca) http://www.openoffice.org/licenses/jca.pdf gnu free documentation license (gfdl) http://www.gnu.org/licenses/fdl.html creative commons http://www.creativecommons.cc/ gnu gplv...
Local Storage - Archive of obsolete content
type, 0774); } return localdir; }, profd is a special identifier for the profile directory that exists so that you don't need to figure out its location. in general this is the only directory flag you'll need, but sometimes you'll need access to other system directories, and you don't want to have to worry about which operating system or system language your extension is running on. a full
list of these flags can be found in the firefox source. having that function in place, we do something like the following: let myfile = xulschool.getlocaldirectory(); myfile.append("somefile.txt"); // do stuff with the file. files are handled with the nsifile interface. an nsifile doesn't necessarily represent an existing file, as in the previous examples. you first specify the file using nsifile ...
...the log is compact and execution is more efficient. note: we recommend that all exception catch blocks include some logging at the error or warn levels, and in general you should use logging freely in order to have as much information as possible to fix bugs and know what is going on. don't log inside functions that are called too often, such as mouseover event handlers, or certain http activity
listeners. this impacts performance and fills the log with useless messages. we normally add a comment that indicates that logging is not done there for performance reasons. sqlite sqlite storage was introduced in firefox 2, and it's the preferred storage mechanism in firefox. it is the storage system used for the places api that manages bookmarks and history. it's also used for storing cookies, for...
...in firefox. they allow you to automatically generate xul content using information from a datasource, and automatically update the content once the datasource changes. they were designed with rdf datasources in mind, but since firefox 3 they have been extended to support sqlite datasources as well. handling templates can also be complicated, but it is worth the effort if you need to display long
lists or trees with complex data. if you manage to get your display code to use templates, you will have saved a lot of coding. since templates are not necessary for most extensions and they're a complicated subject, it's better that you read it from the experts. there's a very detailed xul template guide here. as mentioned before, it revolves around rdf, so you may need to take some time to understan...
Mozilla Documentation Roadmap - Archive of obsolete content
ook into the resources that have helped us the most. the mozilla developer center this is the official and most extensive guide to everything related to mozilla. mdc is where this tutorial is hosted, and where most of its links point to. it encompasses firefox, other mozilla products, javascript, css, xul, web and extension development guidelines, accessibility, usability, best practices... the
list goes on. it's incredibly comprehensive, and its underlying wiki technology makes it easy to expand and evolve with the help of the community. having said that, there are a few problems with it. first of all, the in-site search is not reliable, so we recommend using a search engine like google, with queries such as "mdc javascript code modules" or "javascript code modules site:developer.mozilla.o...
...r it later will thank you for it. the amo developer hub the amo developer hub is a great guide for add-on developers. it includes links to tutorials and documentation, development tools, and most notably, the mozilla add-ons forum. this is a great place to ask questions and have them answered by experienced developers. it also includes discussions on add-on monetization, job postings and a long
list of add-on ideas waiting to be developed. the mozilla source sometimes you need more than just a tutorial. there are various tricks that you can't learn anywhere, but you know that firefox implements them in some way. in these cases you should dive into mozilla's source code and try to locate the code you need. one way to do this is to look into your firefox installation directory, maybe unpack ...
...zilla's bugzilla repository. pretty much every code change done in firefox and mozilla projects is documented in this huge tracking database. but this also means that finding exactly what you need can be time-consuming, and often fruitless. the advanced search is very useful in filtering results, but it is our experience that it's often better to be too general than too specific. better to scan a
list of hundreds of bugs than getting no results at all, right? anywhere else. use your favorite search engine and patiently look for answers. it's better to take a long time finding an answer than taking even longer doing something that has already been done. good luck! « previousnext » this tutorial was kindly donated to mozilla by appcoast. ...
Extensions support in SeaMonkey 2 - Archive of obsolete content
starting with seamonkey 2 alpha 1 seamonkey supports toolkit/-style extensions. these type of extensions have many advantages for both users and developers compared to the old xpinstall/-style extensions. the basics to support seamonkey 2 as a target application, you need to add it to the
list of target applications in the extension's install.rdf file. the code for that will look something like this: <em:targetapplication> <!-- seamonkey --> <description> <em:id>{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}</em:id> <em:minversion>2.0</em:minversion> <em:maxversion>2.*</em:maxversion> </description> </em:targetapplication> the install.js is not supported any more and should be removed. differences as compared to other toolkit/-based applications you need to overlay/open d...
...ion> <em:id>{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}</em:id> <em:minversion>2.0</em:minversion> <em:maxversion>2.*</em:maxversion> </description> </em:targetapplication> the install.js is not supported any more and should be removed. differences as compared to other toolkit/-based applications you need to overlay/open different chrome urls as compared to firefox. ...
...hrome://communicator/content/bookmarks/bm-panel.xul chrome://browser/content/places/places.xul chrome://communicator/content/bookma...rksmanager.xul thunderbird uses mostly the same chrome urls for overlaying as seamonkey. there are exceptions, but these are few and far between. seamonkey also uses different ids for the menu items. ...
Setting up an extension development environment - Archive of obsolete content
firefox binary (firefox.exe on windows), then move the link to your desktop, or your preferred location. to run this version of firefox, simply double click on this file. explore this profile a little: change some settings, install any additional extensions, and finally close this instance of firefox. now run your firefox profile manager. (linux, mac os x, windows instructions.) you'll see the
list of available user profiles one which is default (stable) and other (unstable) profile(s) created automatically when you run other versions of firefox earlier. choose default and uncheck "don't ask at startup" checkbox. click "start firefox". now when you start any version of firefox you may choose any profile you like. development command flags as of gecko 2 (firefox 4), javascript files are ca...
...h provides a menu interface for firefox settings. accessing thunderbird development preferences to change preference settings in thunderbird, open the "preferences" (unix) or "options" (windows) interface. on the "advanced" page, select the "general" tab then click the "config editor" button. recommended development preferences not all preferences are defined by default, and are therefore not
listed by default. you will have to create new (boolean) entries for them. for more information about mozilla preferences, refer to the mozillazine article on "about:config". tip: you can install either the developer profile or devprefs add-ons to handle setting these preferences automatically, and skip the rest of this section. devprefs can now be found at https://github.com/noitidart/devprefs. ma...
...e of tools for extension development (firefox) extension test an add-on which makes it easier to detect problems which will lead to rejection by addons.mozilla.org console² enhanced javascript console (firefox version, thunderbird version) javascript command for writing/testing javascript on firefox windows inspect context open dom inspector at this node from inspect on context menu. ...
Updating addons broken by private browsing changes - Archive of obsolete content
idls nsitransferable: see using the clipboard for information about the new init method. imgicache: this must no longer be obtained as a service. see the imgicache article for more information. moziasyncfavicons/nsifaviconservice: setandfetchfaviconforpage/setandloadfaviconforpage now take a required privacy status argument, either nsifaviconservice.favicon_load_private or nsifavicons...
...move, pause, and resume methods which should be used instead of deprecated similarly-named nsidownloadmanager methods. nsidownload's getdownload method is deprecated; use the asynchronous getdownloadbyguid method instead. nsidownloadmanager now has activeprivatedownloads, activeprivatedownloadcount, and privatedbconnection members to complement the existing public ones. nsidownloadmanager's add
listener method is deprecated. addprivacyaware
listener should be used instead, or no notifications will be received for private downloads. there is a new download-manager-remove-download-guid notification, which passes an nsisupportscstring subject for the guid or null. nsihttpauthmanager: setauthidentity and getauthidentity now take an optional boolean parameter to indicate whether the identity ...
...actively being removed, and may not even exist as of firefox 21. nsirecentbadcertsservice: this is no longer a global service, and has been renamed to nsirecentbadcerts. to obtain this, acquire the nsix509certdb service, and use the new getrecentbadcerts method, passing a boolean indicating whether the private bad certificates or public ones are desired. observer notifications none of the ones
listed above will be sent as of firefox 20. the supporting per-window private browsing article explains further about the equivalent notifications, which are all backwards compatible through to firefox 12 (and are sent side-by-side with the global private browsing notifications in older versions). chrome apis openbrowserwindow: takes an optional parameter to indicate desired properties of the win...
Search Extension Tutorial (Draft) - Archive of obsolete content
fter the add-ons responsible are disabled, mozilla will take any steps necessary to mitigate the impact of offending add-ons. in particular, changing the location bar search keyword url in a way which is not automatically reset when the add-on is removed will result in a reset prompt for users. other settings violations designed to restrict user choice will result in stronger action, such as black
listing of the add-ons in question. the most technically sound method of achieving this, and the only acceptable way of changing preferences such that they are automatically restored on add-on uninstall, is to make such changes in the default preference branch, as explained below. while the technical details below are important to understand, a library which encapsulates the appropriate logic is provi...
... if (reason == addon_uninstall || reason == addon_disable) { let engine = services.search.getenginebyname(engine_details.name); ...
...ed function searchobserver(engine, topic, data) { if (data != "engine-added") return; engine.queryinterface(ci.nsisearchengine); if (engine.name == engine_details.name) { // remove our observer now that we're done with it. ...
CSS3 - Archive of obsolete content
endations, other still are early working drafts. new modules are also added when new needs are identified. formally, there is no css3 standard per se . each module being standardized independently, the standard css consists of css2.1 amended and extended by the completed modules, not necessary all with the same level number. at each point of time, a snapshot of the css standard can be defined,
listing css2.1 and the mature modules. the w3 consortium periodically publishes such snapshots, like in 2007, 2010, 2015, 2017, and 2018. though today no module with a level greater than 3 is standardized, this will change in the future. some modules, like selectors 4 or css borders and backgrounds level 4 already have an editor's draft, though they haven't yet reached the first published working dr...
... due to insufficient browser support, standardization of the navigation properties may be postponed to the next iteration of this module. the ability to control the usage of an ime editor, using the css ime-mode property. at risk: due to insufficient browser support, standardization of the ime-mode property may be postponed to the next iteration of this module. an early
list of what could be in the next iteration of the css basic user interface module is available. stable modules a few css modules are already fairly stable and have reached one of the three recommendation level of the csswg: candidate recommendation, proposed recommendation or recommendation. these can be used without prefix and are pretty stable, though a few features can still be dropped at the ca...
...nsitions working draft allows the definition of transitions effects between two properties values by adding the css transition, transition-delay, transition-duration, transition-property, and transition-timing-function properties. css box alignment module level 3 working draft selectors level 4 working draft css
lists module level 3 working draft extends the
list counter mechanism so that
list markers can be styled and web developers can define new
list counter schemes. motion path module level 1 working draft css fonts module level 4 working draft css easing functions level 1 working draft css l...
No Proxy For configuration - Archive of obsolete content
arity in the mid-90's, many network administrators added proxy servers. initially, proxy servers were used for access control and performance. many networks had limited access to the public network via proxy servers. because the public network was small in scope and connections were slow, a caching proxy could often improve the overall performance. this feature was originally designed as a "black
list" of sites or domains that was within the intranet, and should not be accessed via the proxy server. due to various limitations, this feature should be used for only the most simple black
list scenarios. in almost all cases, pac gives better control and flexibility. user interface "no proxy for" is an optional field, part of "manual proxy configuration". the field is relatively short, but can hol...
...lexibility. user interface "no proxy for" is an optional field, part of "manual proxy configuration". the field is relatively short, but can hold reasonably long (2k+ characters) entries. new profiles contain the values "localhost, 127.0.0.1", by default. entry points: preferences | advanced | proxies control-click menu for off line-online icon (network plug) configuration the no proxy
list is composed of either domain elements or ipv4 address elements. the elements are separated by either a space (" ") or a comma (","). note for former-ie users: "*" is supported only at the beginning of domain filters (*.mozilla.org). to block ... put this into "no proxy for" ...for example use... limitations a domain, including sub-domains domain suffix "mozill...
...only applies to one port (no support for ranges and/or multiple ports). port-only filters ":80" or "*:80" are not supported. all non-fqdn hosts, such as intranet hosts the string "<local>" (without quotes) "<local>" bypasses the proxy for all hostnames which have no periods in them. for example: "https://mycompanyintranet/" formats that are not accepted ...
Download Manager improvements in Firefox 3 - Archive of obsolete content
firefox 3 offers improvements to the download manager that allow multiple progress
listeners, use of the storage api for data management, download resuming, and more. in addition, you can augment or replace the download manager's user interface by implementing the new nsidownloadmanagerui interface. note: these changes will require some modest revisions to code using the download manager; several methods have had minor changes. download manager interfaces nsidownloadmanager gives applications and extensions access to the download manager, allowing them to add and remove files to the download
list, retrieve information about past and present downloads, and request notifications as to the progress of downloads. nsidownload describes a file in the download queue; t...
...s to the download manager, allowing them to add and remove files to the download
list, retrieve information about past and present downloads, and request notifications as to the progress of downloads. nsidownload describes a file in the download queue; these files may currently be queued for download, actively being downloaded, or finished being downloaded. nsidownloadprogress
listener applications and extensions implement this interface to be made aware of changes in the status of downloads. nsidownloadmanagerui implement this interface to replace or augment the download manager user interface. ...
... the download manager schema this article describes the database format used to store and track information about each download. ...
Download Manager preferences - Archive of obsolete content
default value is true. ...
...tion browser.download.antivirus.dontclean note: in gecko 1.9.1. a boolean value that indicates whether the anti virus software should try to clean a downloaded file when a virus is detected. default value is false. browser.download.manager.addtorecentdocs a boolean value that indicates whether or not new downloads should be added to the recent documents
list. default value is true. browser.download.manager.alertonexeopen a boolean value that indicates whether the ui should alert the user about the dangers of opening (executing) an exe. the user may check a "don't ask" box on the ui to toggle this. default value is true. browser.download.manager.closewhendone a boolean value indicating whether or not the downloads windo...
...ssing preference. the following table however, includes preferences which must be included in any product for the download manager to function. preference description browser.download.dir a local folder the user may have selected for downloaded files to be saved. migration of other browser settings may also set this path. this folder is enabled when browser.download.folder
list equals 2. browser.download.folder
list indicates the default folder to download a file to. 0 indicates the desktop; 1 indicates the systems default downloads location; 2 indicates a custom (see: browser.download.dir) folder. in firefox 3 and earlier, the default is 0 (except on windows vista, where it's toggled to 1 on initial launch). in firefox 3.5 and seamonkey, the defaul...
Drag and Drop JavaScript Wrapper - Archive of obsolete content
ething should happen on a drag exit. it has two arguments, the event object and the drag session. ondrop(event, dropdata, session) this function should be defined when you want something to happen when an object is dropped. the first argument is the event object and the second is the data being dragged. the third argument is the drag session. getsupportedflavours() this function should return a
list of flavors that the object being dragged over can accept. this function takes no arguments. this function is necessary so that the wrapper can determine the best flavour to pass to the other functions. for an observer that is observing an element that can start a drag, you should define at least the ondragstart function. for elements that can have objects dropped on them, you should define ondra...
...nt that can start a drag, ondragstart is all that is necessary to implement. for an element that can be dropped on, the observer will need to implement at least the getsupportedflavours, ondragover and ondrop functions. some elements may be able to initiate a drag and accept a drop. in this case, the ondragstart function will be necessary as well. the getsupportedflavours function should return a
list of flavours that the element being dragged over can accept for dropping. a file system directory view might accept files and perhaps text, but wouldn't accept html text. below, we'll define a getsupportedflavours function. we'll allow only one flavour here, that for a string. var textobserver = { getsupportedflavours : function () { var flavours = new flavourset(); flavours.appendflavou...
...for dropping. a file system directory view might accept files and perhaps text, but wouldn't accept html text. below, we'll define a getsupportedflavours function. we'll allow only one flavour here, that for a string. var textobserver = { getsupportedflavours : function () { var flavours = new flavourset(); flavours.appendflavour("text/unicode"); return flavours; } } the flavours
list contains only one flavour, which is 'text/unicode'. the flavourset object can be used to hold a
list of flavours. in some cases, you must provide the xpcom interface as well. for example, for files: var textobserver = { getsupportedflavours : function () { var flavours = new flavourset(); flavours.appendflavour("application/x-moz-file","nsifile"); flavours.appendflavour("text/unicod...
Block and Line Layout Cheat Sheet - Archive of obsolete content
rve space for the floated frames. this is set by default for document frames, area frames, table cell inner frames, absolutely positioned wrapper frames, and floated frames when the frame is created. nslinebox a block consists of lines and other blocks, stacked vertically. a block frame has one nslinebox for each line, and one nslinebox for each block child. these are stored as a doubly-linked
list in the mlines member of nsblockframe. nsinlineframe mflags ns_inline_frame_contains_percent_aware_child this flag is set if the inline frame has any children that have a percentage value set (via the style context) for the width or height of the content area, padding, border, or margin. nshtmlreflowstate the current state of reflow, built up as reflow recursively descends the frame tree...
... this flag is set if the top margin should be considered when placing a linebox that contains a block frame. it may be set as a side-effect of calling nsblockframe::shouldapplytopmargin(); once set, shouldapplytopmargin() uses it as a fast-path way to return whether the top margin should apply. ...
... brs_computemaxelementsize this flag is set if reflow should recompute an element's maximum size. ...
Repackaging Firefox - Archive of obsolete content
components/partnerbookmarks.js from the cck extension, and it allows us to drop in default bookmarks at profile creation. you should not need to edit this file. defaults/preferences/partner.js default preferences for this dex. install.rdf meta-information about your extension, such as the creator (your...
...partner.properties locale/pl/partner.properties locale/pt-br/partner.properties locale/pt-pt/partner.properties locale/ru/partner.properties locale/sk/partner.properties locale/sv-se/partner.properties locale/tr/partner.properties locale/zh-cn/partner.properties locale/zh-tw/partner.properties partner-bookmarks.xml one by one, the files
listed above are: chrome.manifest contains a specialized
listing of the contents of the xpi. components/partnerbookmarks.js from the cck extension, and it allows us to drop in default bookmarks at profile creation. you should not need to edit this file. defaults/preferences/partner.js default preferences for this dex. install.rdf meta-information about your extension, such as the creator (your organization), a unique id, and which versions of firefox ...
...oth the name and the value of the preference. all of these settings are non-localizable, so they are set directly in partner.js and do not need to be in the properties file. mozilla.partner.id=<name> app.partner.<name>=<name> app.distributor=<name> app.distributor.channel=<name> other preferences some settings are commonly set in partner distributions. this is not meant to be a comprehensive
list of preferences, however. if you find a preference you think is generally useful to most partner repacks, please add it below, using the same style: localizable preferences browser.startup.homepage=<string> browser.startup.homepage_reset=<string> url for the default homepage, and what the homepage gets reset to when the user hits "restore to default" in the preferences. these should both be th...
Syncing custom preferences - Archive of obsolete content
for example, if your add-on had a pref called extension.frobnaz.foobar, to have it synced, create a bool preference called services.sync.prefs.sync.extension.frobnaz.foobar and set it to true. ...
...for example, if your add-on had a pref called extension.frobnaz.foobar, to have it synced, create a bool preference called services.sync.prefs.sync.extension.frobnaz.foobar and set it to true. ...
...for example, if your add-on had a pref called extension.frobnaz.foobar, to have it synced, create a bool preference called services.sync.prefs.sync.extension.frobnaz.foobar and set it to true. ...
Hidden prefs - Archive of obsolete content
is defined in messenger.dtd. so if you change the quick search query to match based on phone number, the ui will not match the query. the default (defined in mailnews.js) is: pref("mail.addr_book.quicksearchquery.format","?(or(primaryemail,c,@v)(displayname,c,@v)(firstname,c,@v)(lastname,c,@v))"); "and", "or" and "not" are valid. ...
...ryemail,c,@v)(displayname,c,@v)(firstname,c,@v)(lastname,c,@v))"); "and", "or" and "not" are valid. see http://lxr.mozilla.org/mozilla/sourc...drdatabase.idl for the
list of valid attributes "c" == contains. see nsabquerystringtoexpression::createbooleanconditionstring() for other operators. mail composition "other header" pref ("mail.compose.other.header") the format for this a comma delimited
list of mail headers, like "approved,x-no-archive" an example for your prefs.js would be: user_pref("mail.compose.other.header", "approved"); this will cause "approved" to show up in the compose window address picker, under to:, cc:, bcc:, newsgroup:, etc. for example: when that mail gets sent, approved: test@test.com will be in the message in the headers. this is a useful trick for newsgrou...
...l addressbook for collection pref("mail.collect_addressbook","moz-abmdbdirectory://abook.mab"); for the reasons why the defaults changed, see this document on the collected address book. ...
Mozilla Crypto FAQ - Archive of obsolete content
-commerce solutions has released netscape-branded binary versions of personal security manager that incorporate the rsa bsafe library; the netscape psm software can be installed and used with binary mozilla versions. for the very latest information about psm, nss, and other crypto-related mozilla developments, see the mozilla.dev.tech.crypto newsgroup or the corresponding dev-tech-crypto mailing
list. for more information on nss 3.1 see the nss 3.1 plan and the nss 3.1 build instructions; for more information on psm 1.3 see the psm 1.3 task
list posted by david drinan. for more information on the netscape psm binaries see the netscape personal security manager for mozilla page. what is the open source license used for the mozilla crypto code? the released source code is dual-licensed under...
...pl. (note that mozilla.org will not accept contributed modifications into future psm/nss source releases unless they are so licensed.) for more information see the mozilla public license and the gnu general public license. specific questions about licensing of the psm and nss source code should be directed to the netscape.public.mozilla.license newsgroup or the associated mozilla-license mailing
list. will mozilla.org accept new contributions of crypto code? yes, as long as patent or other legal issues do not prevent such code from being used by the general community of mozilla developers. new contributions of crypto code should also be reviewed and approved by the appropriate mozilla module owners, just as with any other mozilla contributions. for more information about patents related to...
...r non-military encryption export was transferred from the u.s. state department to the u.s. department of commerce by presidential executive order 13026 on november 15, 1996, for regulation under the export administration regulations (ear), along with all other export-controlled commercial products. at that time encryption hardware, software, and technology was transferred from the u.s. munitions
list to the commerce control
list (ccl) of the ear. for more information see the document "principal statutory authority for the export administration regulations", which contains a copy of executive order 13026. haven't u.s. export controls on encryption software already been ruled unconstitutional? yes in a specific case, but the decision may yet be overruled. also, the case itself may be declare...
New Skin Notes - Archive of obsolete content
e is negligible (to the point where i never noticed). direct external links have icons to differentiate them from internal links, so i think we'll just leave the internal/external links colours the same. ==dria you've got to be kidding me, the colors are clearly different (rgb(0,51,153) vs rgb(51,102,187)). --nickolay 09:19, 25 aug 2005 (pdt) (moving this to a new item) on the contrary, the
list of categories current page belongs to, should be near the footer (see mdc:policies_and_guidelines page) (dria: fix catlinks style) the arrows that appear if you select "enhanced recent changes" in your preferences have an ugly border around them. --nickolay 04:43, 25 aug 2005 (pdt) the radio buttons on history page are jumping in a weird way because the selected row becomes bold. --nickolay 0...
...ave a :hover class added which modifies (to a slightly lighter shade) the background color of the link, this will help to make items "appear as links" to many users, possibly add a text-decoration: underline as well. --callek is it possible to remove the blank space on category pages, like category:dom?by the way, it looks like this skin has the same problem as previous - the edit box, category
list on category pages, and others are always below the end of the sidebar. the major problem it caused in cavendish skin - that they were out of the screen - is solved by making the sidebar smaller, which is not the right thing to do, imo (see my comment 1).--nickolay 02:11, 25 aug 2005 (pdt) yeah this is actually a problem with mw, rather than the skin -- they use a <br style="clear:both" /> in som...
...to sort out how to change the default behaviour. --dria headers which are also links that point to as-yet-unwritten wiki pages are colored as though they actually do exist. for an example of this, see creating xpcom components. --waldo 21:09, 25 aug 2005 (pdt) not going to change (yet or possibly ever) adding pipes between buttons in horizontal nav-bar (ie: my talk | preferences | my watch
list) (stricken part is done). also, and this is a nit, it's a little "my" crazy up there -- do we need all the "my"s? --beltzner any chance we can mobe the "main page" scrollbar to the actual "content area" of the page, so that the sidebar `stays` when in-use, and on dynamic pages (such as the preferences page) if you toggle between something that needs a verticle scrollbar and something that doesn...
Table Layout Regression Tests - Archive of obsolete content
pcom_debug_break=warn, the world would be a much better place if we could first fix those assertions. as you will probably run your normal mozilla in parallel with the testing issue then: set moz_no_remote=1 at the command prompt. start the layout debugger via mozilla -layoutdebug - p foo where foo is just another profile than your main profile. select from the regression-test menu the add new
list...entry. select %moz_src%/layout/html/tests/block/rtest.lst. execute the baseline test shutdown the layoutdebugger execute mozilla -layoutdebug - p foo >selftest.txt execute the verify test make a note which tests have failed grep 'failed' selftest.txt (these are false positives, quite frequently they indicate reflow problems, pages showing differently when loaded from cache) make your cha...
...egression tests have failed at the same place as the previous diagnosed false positives => ignore try to figure out what the other regressions are: are they improving the picture or are they regressions? note the difficult to explain test failures. change the source if necessary until the regression tests indicate that your patch does not fork the block and table layout submit your patch and
lists the remaining differences in the bug be prepared to cycle. how the layout regression tests work first the url's to test are red from rtest.lst files in various directories. layout/html/tests/block/rtest.lst points to them. snippet from rtest.lst in the table/marvin directory: body_col.html body_tbody.html body_tfoot.html body_thead.html col_span.html the regression tests compare the frame ...
... <font serif 240 240 0 /> <color data="-16777216"/> <background data="0 2 3 -1 0 0 "/> <spacing data="left: null top: null right: null bottom: null left: null top: null right: null bottom: null left: 1[0x1]enum top: 1[0x1]enum right: 1[0x1]enum bottom: 1[0x1]enum left: null top: null right: null bottom: null left: null top: null right: null bottom: null 1[0x1]enum 0" /> <
list data="100 100 " /> <position data="left: auto top: auto right: auto bottom: auto auto 0[0x0]tw null auto 0[0x0]tw null 0 auto " /> <text data="0 0 0 normal normal 0[0x0]tw normal " /> <textreset data="0 10[0xa]enum " /> <display data="0 1 0 0 0 0 0 0 0 0 0 0 " /> <visibility data="0 1 1.000000" /> <table data="0 0 4 -1 1 " /> <tableborder data="1 null nu...
Running Tamarin performance tests - Archive of obsolete content
untests.py -h usage: runtests.py [options] [tests] -v --verbose enable additional output -e --avm avmplus command to use -a --asc compiler to use -g --globalabc deprecated but still works - use builtin.abc (used to be location of global.abc) -b --builtinabc location of builtin.abc -s --shellabc location of shell_toplevel.abc -x --exclude comma separated
list of directories to skip -h --help display help and exit -t --notime do not generate timestamps (cleaner diffs) -f --forcerebuild force rebuild all test files -c --config sets the config string [default os-tvm] -q --quiet display minimum output during testrun -l --log also log all output to given logfile --summaryonly only display final summary --...
...h raw time values will skew the results towards longer running tests csv output: "--csv filename" will save run results to a csv file that can be analyzed using excel pivottables. use --csvappend if you want to append the results to the csv file support files testconfig.txt this file contains instructions for how the harness should handle performance tests. metricinfo.py this file contains a
list of metrics that the harness will look for and record. see the file header for details testing the android shell the instructions above apply to running tests on an android device as well, but with a few differences. you should set environment variables as described above except for avm, which should be: $ export avm=$tamarin_build_top/platform/android/android_shell.sh where $tamarin_build_top i...
...h script mentioned on the tamarin build documentation page you should already be pathed to the adb executable in the public sdk/ndk, but if not it exists at /android-public/android-sdk-mac_86/platform-tools. adb supports ssh-like commands to an android device. adb automatically connects to a phone if connected by usb. adb shell "ls /" is a good test to see if connected. the command: $ adb devices
lists the device id of each phone. if this fails, do you have a dev os installed? under settings->applications->development, is usb debugging enabled? testsuite setup example commands: root the phone $ adb root copy avmshell to /data/app. the shell can be named variously in the build but on the phone the executable must be 'avmshell' $ adb push avmshell /data/app/avmshell $ adb shell chmod 777 /data/a...
Event Handlers - Archive of obsolete content
this action can be specified either using an action attribute or by specifying the script as a child of the handler element. if both are specified, the attribute wins. ...
...this action can be specified either using an action attribute or by specifying the script as a child of the handler element. if both are specified, the attribute wins. ...
...ng handlers. mouse and key handlers have certain additional properties that are supported by xbl. additional attributes can be used to impose a filter on the event handler. when a filter is imposed, additional conditions must be met before the event handler will fire. for both mouse and key events, modifier keys can be specified using the modifiers attribute. this attribute is a comma-separated
list of modifier keys that must be down at the time the key or mouse event occurs in order for the handler to execute. examples of common keys in the
list are shift and control. for more details, see the xbl element reference for <handler>. in addition, mouse events can specify the button and the clickcount. this allows xbl authors to easily define handlers for right-click, or for left double-click,...
Windows stub installer - Archive of obsolete content
the code how we get setup to debug the xpinstall engine from the windows stub installer? this section needs to be added how do i add an installer package to the windows installer? adding a package involves a few steps: add a section named for your <component> to the packages-win manifest that describes which files from dist belong to which module. for example, see the xpcom section that
lists all the shared libraries as seen in dist. these are eventually zipped with the directory structure preserved. read the top of the packages-win file for it's simple syntax and semantics. add an <component>.jst install script template file. the jst extension stands for javascript template indicating this is a template for the final install.js for the <component>.xpi. checkin the <component>.jst t...
.../seamonkey/sou...ckager/windows> directory. note that there are several macro strings--a macro name wrapped in dollar ($) signs--which may be used in the .jsts, including: $version$ which is replaced at packages time with the browser version. $spacerequired$ which is replaced at package time with the amount of space in kb required for the package when it is fully extracted. other macro strings
listed in makejs.pl can be found by searching for "version", which is one of the macro strings, until you find the line $line =~ s/\$version\$/$inversion/i; other macro strings are grouped in this section. as with "version", the macro name will be the first string in the substitution statement on each line. add a [component <component>]</component> section to the config.ini template file name...
...on statement on each line. add a [component <component>]</component> section to the config.ini template file named config.it found at: <http://lxr.mozilla.org/seamonkey/sou...dows/config.it>. then add the component <component> into the appropriate setup types so the installer module installs it when users select the setup types you choose it to be in. finally add <component> to the component
list array @gcomponent
list at: <http://lxr.mozilla.org/seamonkey/sou...makeall.pl#125> you can test it by changing your current working directory to mozilla/xpinstall/wizard/windows/builder and running "perl build.pl" on the shell prompt. the resulting stub installer and packages will be delivered to "mozilla/dist/win32obj_d/installer". run setup.exe there to launch the stub installer. original ...
Learn XPI Installer Scripting by Example - Archive of obsolete content
tall api reference. most installation scripts, including the one discussed here, take the following basic form (in pseudo-code and with links to the sections in which these installation steps are documented): initinstall(); if (verify_space()) { err = add_dirs_and_files; register_files; if (err==success) { performinstall() }; else { cancelinstall() }; } as you can see in the code
listing, the verification process at the top is on lines 1 to 18; the file addition process, here part of the main installation block, is on lines 24 to 41; the registration part of the main installation block is on lines 42-58; and the execution at the end of the main block is on lines 59 to 71. if you choose not to register the installed software or do the verifications at the front end of the insta...
... addfile, handles both the source file location and the target location. in the example above, all of the contents of the "bin" directory in the archive are queued for installation, and the target of that installation (when the installation is actually begun with a call to performinstall at the end), is the communicatorfolder directory defined at line 22 as "program." "program" is one of a short
list of keywords that can be used in place of full path names in methods such as addfile. "program" represents the directory where software itself is installed (e.g., c:\program files\ on win32 systems), as opposed to supporting directories like "components", "chrome", or "temporary" (see getfolder in the xpinstall api reference for a
list of keywords). registering the software registering software ...
... for registering software with the win32 operating system, the xpinstall api provides two special install objects, winprofile and winreg. these two objects provide programmatic access to the windows user profile and the windows registry, respectively. ...
reserved - Archive of obsolete content
« xul reference home reserved type: string this attribute applies to a command element. setting this attribute to "true" indicates that the command is reserved for chrome code and is not available for use in the content. this means that, to execute these commands, key events won't be passed to content, and event
listeners registered for them in content will not be executed. currently, the content still receives these key events, even though it can't override them. in future releases, it won't receive them. see bug 1173061 for details. example here, the command to open a new browser window is reserved: <command id="cmd_newnavigator" oncommand="openbrowserwindow()" reserved="true"/> if the keyboard shortcut for that is accel-t, then this code will not work as expected, as c...
...n't override them. in future releases, it won't receive them. see bug 1173061 for details. ...
...73061 for details. example here, the command to open a new browser window is reserved: <command id="cmd_newnavigator" oncommand="openbrowserwindow()" reserved="true"/> if the keyboard shortcut for that is accel-t, then this code will not work as expected, as compared to when it is run from web content: document.addevent
listener("keydown", handlekey, true); function handlekey(event) { //
listen for the "new tab" shortcut if (event.metakey && (event.key == "t")) { // log a message console.log("intercepted accel-t"); // prevent the default browser action event.preventdefault(); event.stoppropagation(); } } currently, this event handler as coded above runs and logs the message, but the default behavior persists. in future releases, the event handler ...
treecol.type - Archive of obsolete content
umns is text. if you are using type="checkbox", then the tree and each treecol must be editable. you need to apply css to make the checkbox toggle. here is an example css style using the current theme's checkboxes: treechildren::-moz-tree-checkbox { /* unchecked checkbox treecells. this style must come before treechildren::-moz-tree-checkbox(checked) otherwise it won't take effect. ...
...{ /* unchecked checkbox treecells. this style must come before treechildren::-moz-tree-checkbox(checked) otherwise it won't take effect. */
list-style-image: none; } treechildren::-moz-tree-checkbox(checked) { /* checked checkbox treecells. cbox-check.gif isn't available in firefox 1, 2, and 3 in mac os x so you should specify a url to an image in your extension or elsewhere. */
list-style-image: url("chrome://global/skin/checkbox/cbox-check.gif"); } treechildren::-moz-tree-checkbox(disabled) { /* disabled checkbox treecells. ...
...in mac os x so you should specify a url to an image in your extension or elsewhere. */
list-style-image: url("chrome://global/skin/checkbox/cbox-check.gif"); } treechildren::-moz-tree-checkbox(disabled) { /* disabled checkbox treecells. cbox-check.gif isn't available in firefox 1, 2, and 3 in mac os x, so you should specify a url to an image in your extension or elsewhere. ...
Accessing Files - Archive of obsolete content
ptableio), which was not available in any released version of the platform (pending some fixes). there are alternative xpcom apis you can use, your help in updating this pages to use the supported api is very much welcome! other documentation on files and i/o not using the unavailable nsiscriptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data,
list of file-related error codes. accessing files this section describes how to create a file reference. retrieving a file when working with files, usage is always done via a file object and not via string paths. this allows files to used in a portable way. because string paths are not used, references to files in a file object are made relative to some starting directory. a number of starting directo...
...e object. the first argument to nsiscriptableio.getfile() is the starting directory from which to locate a file. in the example above the word 'profile' is used, which means start from within the user's profile directory. the actual location of this directory will vary by user and system, so this is a convenient means to refer to a common directory without having to locate it yourself. for a full
list of starting directories, see starting directories below. the second argument to nsiscriptableio.getfile() is the filename to locate, which, here, is 'sample.txt'. the result is that a reference is made to the 'sample.txt' file. it is important to note that this file does not have to exist for a file reference to be valid. that is, nsiscriptableio.getfile() will still return a valid file reference...
...eio.getfile() to access a directory and iterate through subdirectories until you come to the file that you want. for more information about this, see working with directories. starting directories the examples above use the profile directory 'profile' as the starting directory for locating a file. there are several other values which may be used as the first argument to nsiscriptableio.getfile(),
listed in the following table. application the directory of the executing application. for firefox, for instance, this will be the directory where firefox is installed. for a xulrunner application, this will be the directory where the application is installed. working the current working directory. if the application was launched from a command line, for inst...
Reading from Files - Archive of obsolete content
ptableio), which was not available in any released version of the platform (pending some fixes). there are alternative xpcom apis you can use, your help in updating this pages to use the supported api is very much welcome! other documentation on files and i/o not using the unavailable nsiscriptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data,
list of file-related error codes. reading data from a file involves getting a reference to a file and then creating an input stream to read from it. an input stream provides a means of reading bytes, strings or other values from the file. while there is only one method to create an input stream, it provides a number of options to control exactly how reading is performed. for instance, there are option...
... reading from the file. this method will open the file and return a stream. naturally, if the file does not exist, an error will occur. you may wish to use nsifile.exists() to check if the file exists before opening it. in fact, it is a good idea to enclose file reading and writing operations within a try-catch block to capture any errors that might occur during the process. see file errors for a
list of errors that might occur. the newinputstream method takes two arguments in this example. the first argument is the file to read from, and the second is a set of flags which control the reading. in this case, the 'text' flag is used which indicates that you expect this file to be text file. this method actually takes a number of additional arguments, however they are optional so they do not need...
...acter encodings the default character encoding is utf-8. if you know that a file is stored using a different encoding, you can specify a third argument to nsiscriptableio.newinputstream() which specifies the encoding. this example opens a file using the utf-16 encoding. var stream = io.newinputstream(file, "text", "utf-16"); this third argument is not needed if the file is stored in utf-8. for a
list of supported character encodings, see supported character sets. the files can be read in the same manner using the readstring and readline methods. the difference is handled internally so you don't need to write any other part of the code differently. reading binary data in addition to text, binary values may be read from a file either as bytes, or interpreted as numbers. a number of methods are ...
IO - Archive of obsolete content
ptableio), which was not available in any released version of the platform (pending some fixes). there are alternative xpcom apis you can use, your help in updating this pages to use the supported api is very much welcome! other documentation on files and i/o not using the unavailable nsiscriptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data,
list of file-related error codes. files and streams this section describes how to access and get information about files, read from files and create and write files. using files a xul application or extension may access files on disk, and either read or write to files. a file is accessed via a file object. to get a reference to a file object use nsiscriptableio.getfile(). the following example will re...
...iles. copying and moving files files may be moved and copied on disk. for details, see copying a file and moving a file. deleting files to learn how to delete a file, see deleting a file. open and save dialogs you can show a dialog to the user to allow them to select a file to open or enter a filename for saving. for details about this, see open and save dialogs. file errors see file errors for a
list of errors that might occur while using files. working with directories directories may be accessed in a similar manner using nsiscriptableio.getfile(). for instance, in the following example, a subdirectory is retrieved. if the name 'subdirname' refers to a directory, then the returned object will refer to this directory. the returned value is still a nsifile object, however a number of methods ...
...irectory, then the returned object will refer to this directory. the returned value is still a nsifile object, however a number of methods may be used which are only of value for subdirectories. var file = io.getfile("profile", "subdirname"); for more information about using directories, see working with directories. specifically, to create a directory, see creating directories and to retrieve a
list of files or subdirectories within a directory, see iterating over the files in a directory. upload and download files upload files to learn how to upload and post files to a web site, see uploading and downloading files. download files to learn how to download and save a file from a web site to disk, see downloading files. ...
Anonymous Content - Archive of obsolete content
her the xul provides its own content. using the children element there may be times when you want both the xbl content and the content provided by the xul file to be displayed. you can do this by using the children element. the children added in the xul are added in place of the children element. this is handy when creating custom menu widgets. ...
...x="1"/> <button src="chrome://global/skin/images/dropbox.jpg"/> </menu> includes attribute in some cases, you may wish to only include specific types of content and not others. or, you may wish to place different types of content in different places. the includes attribute can be used to allow only certain elements to appear in the content. its value should be set to a single tag name, or to a
list of tags separated by vertical bars (the | symbol). <children includes="button"/> this line will add all buttons that are children of the bound element in place of the children tag. other elements will not match this tag. you can place multiple children elements in a binding to place different types of content in different places. if an element in the xul does not match any of the children elemen...
...he inner box with the border has one child, the children tag. this is an important distinction when using the dom with xbl. this also applies to css selector rules. multiple children elements you can also use multiple children elements and have certain elements be placed in one location and other elements placed in another. by adding a includes attribute and setting it to a vertical bar-separated
list of tags, you can make only elements in that
list be placed at that location. for example, the following xbl will cause text labels and buttons to appear in a different location than other elements: source <binding id="navbox"> <content> <xul:vbox> <xul:label value="labels and buttons"/> <children includes="label|button"/> </xul:vbox> <xul:vbox> <xul:label value="ot...
Keyboard Shortcuts - Archive of obsolete content
rd shortcut that is activated when the user presses the shift key and r. the key attribute (note that it has the same name as the element itself) can be used to indicate which key should be pressed, in this case r. you could add any character for this attribute to require that key to be pressed. the modifiers that must be pressed are indicated with the modifiers attribute. it is a space-separated
list of modifier keys, which are
listed below. alt the user must press the alt key. on the macintosh, this is the option key. control the user must press the ctrl key. meta the user must press the meta key. this is the command key on the macintosh. shift the user must press the shift key. os the user must press the win key. this is the super key or the hyper key on linux. if this value is ...
...d. however, there will also be cases where you want to refer to keys that cannot be specified with a character (such as the enter key or the function keys). the key attribute can only be used for printable characters. another attribute, keycode can be used for non-printable characters. the keycode attribute should be set to a special code which represents the key you want. a table of the keys is
listed below. not all of the keys are available on all keyboards. vk_cancel vk_back vk_tab vk_clear vk_return vk_enter vk_shift vk_control vk_alt vk_pause vk_caps_lock vk_escape vk_space vk_page_up vk_page_down vk_end vk_home vk_left vk_up vk_right vk_down vk_printscreen vk_insert vk_delete ...
... soon as the key is pressed, even if it hasn't been released yet. keyup called when a key is released while an element has the focus. key events are only sent to the element that has the focus. typically, this will include textboxes, buttons, checkboxes and so forth. if no element is focused, the key event will instead be targeted at the xul document itself. in this case, you can add an event
listener to the window tag. normally though, if you want to respond to keys globally, you will use a keyboard shortcut as described earlier. the key event object has two properties which hold the key that was pressed. the keycode property holds the key code and may be compared to one of the constants from the key table earlier in this section. the charcode is used for printable characters and will ho...
Localization - Archive of obsolete content
is shown below with the changes shown in red. ...
..."/> </toolbar> </toolbox> <tabbox> <tabs> <tab label="&searchtab;" selected="true"/> <tab label="&optionstab;"/> </tabs> <tabpanels> <tabpanel id="searchpanel" orient="vertical" context="editpopup"> <description> &finddescription; </description> <spacer class="titlespace"/> <groupbox orient="horizontal"> <caption label="&findcriteria;"/> <menu
list id="searchtype"> <menupopup> <menuitem label="&type.name;"/> <menuitem label="&type.size;"/> <menuitem label="&type.date;"/> </menupopup> </menu
list> <spacer class="springspace"/> <menu
list id="searchmode"> <menupopup> <menuitem label="&mode.is;"/> <menuitem label="&mode.isnot;"/> </menupopup> </menu
list> ...
... <menuitem label="&type.name;"/> <menuitem label="&type.size;"/> <menuitem label="&type.date;"/> </menupopup> </menu
list> <spacer class="springspace"/> <menu
list id="searchmode"> <menupopup> <menuitem label="&mode.is;"/> <menuitem label="&mode.isnot;"/> </menupopup> </menu
list> <spacer class="springspace"/> <menu
list id="find-text" flex="1" editable="true" datasources="file:///mozilla/recents.rdf" ref="http://www.xulplanet.com/rdf/recent/all"> <template> <menupopup> <menuitem label="rdf:http://www.xulplanet.com/rdf/recent#label" uri="rdf:*"/> </menupopup> </template> </menu
list> </groupbox> </tabpanel> <tabpanel id="optionspa...
More Button Features - Archive of obsolete content
and then the image is displayed on the button. the button below will have both a label and the image 'happy.png'. the image will appear to the left of the label. you can change this position by using two other attributes. this will be explained in a moment. example 1 : source view <button label="help" image="happy.png"/> button with css image another way to specify the image is by using the css
list-style-image style property on the button. this is designed to allow the 'skin' (in this case, the appearance of the image) to be changed without changing the xul file. an example is shown below. example 2 : source view <button id="find-button" label="find" style="
list-style-image: url('happy.png')"/> in this case, the image 'happy.png' is displayed on the button. the style attribute functions ...
...tton"/> </button> any xul element may be placed inside the button. html elements will be ignored, so you need to wrap them inside a description element. if you specify the label attribute on the button, it will override any content placed inside the button. button with menupopup you can place a menupopup inside the button to cause a menu to drop down when the button is pressed, much like the menu
list. however, in this case you must set the type attribute to the value menu. example 5 : source view <button type="menu" label="device"> <menupopup> <menuitem label="printer"/> <menuitem label="mouse"/> <menuitem label="keyboard"/> </menupopup> </button> in this example, the user may click the button to pop up a menu containing three items. note that selecting one of these menu ...
...he value menu. example 5 : source view <button type="menu" label="device"> <menupopup> <menuitem label="printer"/> <menuitem label="mouse"/> <menuitem label="keyboard"/> </menupopup> </button> in this example, the user may click the button to pop up a menu containing three items. note that selecting one of these menu items does not change the label on the button, unlike a menu
list. this type of button is intended to be used like a menu, with scripts attached to each item to perform a task. we'll see more on menus later. you can also set the type attribute to the value menu-button. this also creates a button with a menu, but the appearance will be different. the image to the right shows the difference. the left one is a 'menu' and the second one is a 'menu-button'. it has a...
Updating Commands - Archive of obsolete content
out when a command is valid and when it is not. in addition, you will need to consider when the state could change and when the commands should be updated. for example, the paste command is valid when a textbox has the focus and there is something on the clipboard to paste. the command will become enabled whenever a textbox is focused and when the clipboard contents change. a command updater will
listen for these situations and code can be executed which enables and disables commands as necessary. a simple command updater looks like this: <commandset id="updatepasteitem" commandupdater="true" events="focus" oncommandupdate="goupdatecommand('cmd_paste');"/> a command updater is indicated by using the commandupdater attribute, which should be set to true. the...
...ode can be executed which enables and disables commands as necessary. a simple command updater looks like this: <commandset id="updatepasteitem" commandupdater="true" events="focus" oncommandupdate="goupdatecommand('cmd_paste');"/> a command updater is indicated by using the commandupdater attribute, which should be set to true. the events attribute is used to
list the events that the command updater
listens for. you can specify multiple events by separating them with commas. in the example above, the command updater
listens for the focus event. this causes commands to be updated when an element receives the focus. when a focus event occurs, the code in the oncommandupdate attribute is called. in the example, the goupdatecommand method is called which is a ...
...les the command. if you have several commands to update, call the goupdatecommand method once for each command. note that the command updater will receive notifications about all focus events on all elements, even if other event handlers respond to the event. essentially, a command updater is like a global event handler. command updaters have a number of events which they can respond to which are
listed below. it is also possible to create your own. focus: occurs when the focused element changes. select: occurs when the selected text changes. undo: occurs when the undo buffer changes. clipboard: occurs when the contents of the clipboard changes. the following example shows the command updaters used in the mozilla browser to update the edit menu commands. the functions used can be fou...
XPCOM Interfaces - Archive of obsolete content
step is getting a file component. second, we query the file component and get the portion of it that implements the nsilocalfile interface. finally, we call functions provided by the interface. this interface is used to represent a single file. we've seen that interfaces are often named starting with 'nsi' or 'mozi'. components, however, are referred to using a uri like string. mozilla stores a
list of all the components that are available in its own registry. a particular user can install new components as needed. it works much like plug-ins. mozilla provides a file component, that is, a component that implements nsilocalfile. this component can be referred to using the string '@mozilla.org/file/local;1'. this string is called a contract id. the syntax of a contract id is: @<internetdomai...
...onents.classes["@mozilla.org/file/local;1"].createinstance(); if (afile) afile.queryinterface(components.interfaces.nsilocalfile); the function queryinterface() is a function provided by all components which can be used to get a specific interface of that component. this function takes one parameter, the interface that you want to get. the interfaces property of the components object contains a
list of all the interfaces that are available. here, we use the nsilocalfile interface and pass it as a parameter to queryinterface(). the result is that afile will be a reference to the part of the component that implements the nsilocalfile interface. the two javascript lines above can be used to get any interface of any component. just replace the component name with the name of the component you w...
...ide general functions which either get or set global data or perform operations on other objects. instead of calling createinstance(), you call getservice() to get a reference to the service component. other than that, services are not very different from other components. one such service provided with mozilla is a bookmarks service. it allows you to add bookmarks to the user's current bookmark
list. an example is shown below: var bmarks = components.classes["@mozilla.org/browser/bookmarks-service;1"].getservice(); bmarks.queryinterface(components.interfaces.nsibookmarksservice); bmarks.addbookmarkimmediately("http://www.mozilla.org","mozilla",0,null); first, the component "@mozilla.org/browser/bookmarks-service;1" is retrieved and its service is placed in the variable bmarks. we use quer...
XUL Structure - Archive of obsolete content
h that you can have as many components as you want pre-installed. each extension is something of a standalone component with a separate chrome url. mozilla also has one component for each installed theme and locale. each of these components, or packages, is made up of a set of files that describe the user interface for it. for example, the messenger component has descriptions of the mail messages
list window, the composition window and the address book dialogs. the packages that are provided with mozilla are located within the chrome directory, which is in the directory where you built mozilla. the chrome directory is where you find all the files that describe the user interface used by the mozilla browser, mail client, and other applications. typically, you put all the xul files for an appli...
...or example, chatzilla is distributed in this way. the content/browser directory contains a number of files with .xul and .js extensions. the xul files are the ones with the .xul extension. the files with .js extensions are javascript files containing scripts that handle the functionality of a window. many xul files have a script file associated with them, and some may have more than one. in the
listing above, two files have been shown. there are of course others, but for simplicity they aren't shown. the file browser.xul is the xul file that describes the main browser window. the main window for a content package should have the same name as the package with a .xul extension. in this case, the package name is "browser" so we expect to find browser.xul. some of the other xul files describe se...
... this is how you can create a new theme. the xul part remains the same but the skin part changes independently. locales the file en-us.jar describes the language information for each component, in this case for us english. like the skins, each language file contains files that specify text used by the package for a specific language. the locale structure is similar to the others, so it won't be
listed here. the localized text is stored in two types of files: dtd files and properties files. the dtd files have a .dtd extension and contain entity declarations, one for each text string that is used in a window. for example, the file browser.dtd contains entity declarations for each menu command. in addition, keyboard shortcuts for each command are also defined, because they may be different for...
Using Remote XUL - Archive of obsolete content
introduction note: support for remote xul has long been a potential security concern; support for it was disabled in gecko 2.0. this also means you can't load xul using file:// urls unless you set the preference dom.allow_xul_xbl_for_file to true. however, there is a white
list that lets you specify sites that can still use remote xul. ...
... introduction note: support for remote xul has long been a potential security concern; support for it was disabled in gecko 2.0. this also means you can't load xul using file:// urls unless you set the preference dom.allow_xul_xbl_for_file to true. however, there is a white
list that lets you specify sites that can still use remote xul. ...
...; } </script> ... </window> the code to load the urls is simple. first we write an event handler function that receives an event, extracts a url from the value attribute of the element where the event occurred (a.k.a. the target element), and loads the url in the iframe. we add an id attribute to the iframe element so we can reference it from our function, and we add an oncommand event
listener to the menubar element that calls the function every time the user clicks a button or selects a menu item. the oncommand event
listener is a generic
listener that fires whenever the user manipulates an element in some conclusive way. because we added it to the menubar item, and events "bubble up" from child element to parent element, it'll fire any time the user manipulates an element inside...
Widget Cheatsheet - Archive of obsolete content
see the periodic table of xul for more examples. ...
... see the periodic table of xul for more examples. ...
... menu <menu value="menu widget"> <menupopup> <menuitem value="foo" /> <menuitem value="shoo" /> <menu value="sub"> <menupopup> <menuitem value="subitem" /> </menupopup> </menu> </menupopup> </menu> <menu
list value="menu
list element"> <menupopup> <menuitem value="foo" /> <menuitem value="shoo" /> <menuitem value="boo" /> </menupopup> </menu
list> <menubutton src="back.gif"> <menupopup> <menuitem value="foo" /> <menuitem value="shoo" /> <menuitem value="boo" /> </menupopup> </menubutton> ...
XUL accessibility tool - Archive of obsolete content
new features: (aaronlev) automatically test any new windows as they are opened. (aaronandy) highlight or blink source element in original xul app upon click of referencing line in report. (aaronle...
... new features: (aaronlev) automatically test any new windows as they are opened. (aaronandy) highlight or blink source element in original xul app upon click of referencing line in report. (aaronlev) compatibility with more xul applications.
... (aaronlev) error: duplicate accesskey in a dialog (already have this for menus) (aaronlev) error: form control without accesskey (aaronlev) warning: accesskey as lowercase letter with descender (underlined g,j,y,q,p are hard to read, not recommended) (aaronandy)
list of things to check manually, such as a
list oftrees in the document (make sure they have accessible column picker equivs) or a
list of toolbarbuttons (make sure they have accessible alternatives). new features: (aaronlev) automatically test any new windows as they are opened. (aaronandy) highlight or blink source element in original xul app upon click of referencing line in report. (aaronlev) compatibility with more xul applications. (aaronandy) maybe an online tool to automatically generate a xul a11y tool compatible w...
arrowscrollbox - Archive of obsolete content
al, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width disabled type: boolean gets and sets the value of the disabled attribute. scrollboxobject type: nsiscrollboxobject the scroll box object implements the nsiscrollboxobject interface, which may be used to retrieve and adjust the scroll position of the
list box. scrollincrement type: integer a read only property that lets you retrieve the number of pixels by which scrolling will occur when the arrowscrollbox is clicked. smoothscroll type: boolean can be set to enable or disable smooth scrolling for the corresponding arrowscrollbox. if not set explicitly, it will fall back to the smoothscroll attribute and then to the ...
...forward that many lines, or a negative value to scroll backward that many lines. scrollbypixels( pixels ) return type: no return value scrolls the contents of the arrowscrollbox by a certain number of pixels. use a positive value as the pixels argument to scroll forward that many pixels, or a negative value to scroll backward that many pixels. ...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
button - Archive of obsolete content
image type: uri the uri of the image to appear on the element. if this attribute is empty or left out, no image appears. the position of the image is determined by the dir and orient attributes. label type: string the label that will appear on the element. if this is left out, no text appears. for an editable menuitem element the value of this attribute is copied to the menu
list.value property upon user selection of the menuitem. open type: boolean for the menu type buttons, the open attribute is set to true when the menu is open. the open attribute is not present if the menu is closed. orient type: one of the values below used to specify whether the children of the element are oriented horizontally or vertically. the default value depends on the elem...
...n type: boolean gets and sets the value of the open attribute. orient type: string gets and sets the value of the orient attribute. tabindex type: integer gets and sets the value of the tabindex attribute. type type: string gets and sets the value of the type attribute. ...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related interfaces nsiaccessibleprovider, nsidomxulbuttonelement ...
caption - Archive of obsolete content
image type: uri the uri of the image to appear on the element. if this attribute is empty or left out, no image appears. the position of the image is determined by the dir and orient attributes. label type: string the label that will appear on the element. if this is left out, no text appears. for an editable menuitem element the value of this attribute is copied to the menu
list.value property upon user selection of the menuitem. tabindex type: integer the tab order of the element. the tab order is the order in which the focus is moved when the user presses the "tab" key. elements with a higher tabindex are later in the tab sequence. properties accesskey type: character gets and sets the value of the accesskey attribute. cro...
...op type: string gets and sets the value of the crop attribute. image type: image url gets and sets the value of the image attribute. label type: string gets and sets the value of the label attribute. tabindex type: integer gets and sets the value of the tabindex attribute. ...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements groupbox, checkbox ...
checkbox - Archive of obsolete content
update additional state. src type: uri set this to an uri pointing to an image to appear in the checkbox. if this attribute is left out, no image appears. you can have both an image and a label. label type: string the label that will appear on the element. if this is left out, no text appears. for an editable menuitem element the value of this attribute is copied to the menu
list.value property upon user selection of the menuitem. preference type: id connects the element to a corresponding preference. this attribute only has any effect when used inside a prefwindow. more information is available in the preferences system article. tabindex type: integer the tab order of the element. the tab order is the order in which the focus is moved when the user pr...
...e. disabled type: boolean gets and sets the value of the disabled attribute. src type: url gets and sets the value of the src attribute. label type: string gets and sets the value of the label attribute. tabindex type: integer gets and sets the value of the tabindex attribute. ...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related interfaces nsiaccessibleprovider, nsidomxulcheckboxelement ...
dropmarker - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a dropmarker is a button with an arrow which will reveal more details when pressed. a dropmarker is not intended to be used as a separate element, but as part of another element. for instance the menu
list and the popup type of datepicker use a dropmarker, that when pressed, will reveal a popup menu. examples properties accessibletype attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal...
...llowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
image - Archive of obsolete content
examples <image src='firefoxlogo.png' width='135' height='130'/> attributes onerror type: script code this event is sent to an image element when an error occurs loading the image. image.onload type: script code this event handler will be called on the image element when the image has finished loading. this applies whether the image is applied via the src attribute or the
list-style-image style property. if you change the image, the event will fire again when the new image loads. this event will not bubble up the element tree. src type: uri the uri of the content to appear in the element. validate type: one of the values below this attribute indicates whether to load the image from the cache or not. this would be useful if the image...
...llowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
...this typically looks like an exclamation mark. this and the other icon classes may be used by image elements or other elements which can have an image. error-icon class that adds an error icon. this will typ...
observes - Archive of obsolete content
the observes element should be placed inside the element that wants to observe the broadcaster. when an observed attribute is modified on the broadcaster, the attribute's value will be forwarded and set on the parent element of the observer. more information is available in the xul tutorial. attributes attribute, element examples (example needed) attributes attribute type: attribute name the attribute that the observer is observing. ...
...llowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
panel - Archive of obsolete content
isplay a panel with a titlebar. the noautohide attribute must be set to true. top type: integer overrides the vertical position of the popup specified by the showpopup method. type type: string the panel type. should be one of the following: autocomplete specify this for a panel that provides a tree for an autocomplete element. autocomplete-rich
listbox specify this for a panel that provides a rich
listbox for an autocomplete element. arrow specify this for a panel that provides an arrow pointing at its anchor. drag specify this for a panel that's being used as a drag image for a drag and drop operation. otherwise leave this attribute out. note: the arrow will draw as long as the panel doesn't...
... closed: the popup is closed and not visible. open: the popup is open and visible on screen. showing: a request has been made to open the popup, but it has not yet been shown. this state will occur during the popupshowing event. hiding: the popup is about to be hidden. this state will occur during the popuphiding event. ...
... moveto( x, y ) return type: no return value moves the popup to a new location defined by screen coordinates (and not client coordinates). if both x and y have ...
preferences - Archive of obsolete content
event(in domelement preference); creates and dispatches a changed (non-bubbling) event to the specified preference element. also executes code specified in onchanged attribute of the element. see also the description of change event of <preference>. ...
...(non-bubbling) event to the specified preference element. also executes code specified in onchanged attribute of the element. see also the description of change event of <preference>. void observe(in nsisupports asubject, in string atopic, in wstring adata); nsiobserver method used internally to react to changes to preferences
listed as children of this element. ...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related preferences system documentation: introduction: getting started | examples | troubleshooting reference: prefwindow | prefpane | preferences | preference | xul attributes ...
progressmeter - Archive of obsolete content
s accessibletype type: integer a value indicating the type of accessibility object for the element. max type: integer gets and sets the value of the max attribute. mode type: string gets and sets the value of the mode attribute. value type: string gets and sets the value of the value attribute. for textbox and user editable menu
list elements, the contents, as visible to the user, are read and set using the textbox.value and menu
list.value syntax. inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal,...
...llowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related interfaces nsiaccessibleprovider ...
<statusbarpanel> - Archive of obsolete content
image type: uri the uri of the image to appear on the element. if this attribute is empty or left out, no image appears. the position of the image is determined by the dir and orient attributes. label type: string the label that will appear on the element. if this is left out, no text appears. for an editable menuitem element the value of this attribute is copied to the menu
list.value property upon user selection of the menuitem. properties image type: image url gets and sets the value of the image attribute. label type: string gets and sets the value of the label attribute. inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, data...
...llowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
...these classes should be used instead of changing the style of the element directly since they will fit more naturally with the user's selected theme. « xul reference home statusbarpanel-iconic use this clas...
stringbundle - Archive of obsolete content
the key and value is separated with an equals sign. ...
...d array. alternatively, numbered indices of the format %n$s (e.g. %1$s, %2$s, etc.) can be used to specify the position of the corresponding parameter explicitly. if you need to handle substitutions involving plurals, take a look at localization and plurals. getstring( key ) return type: string returns the string with the given key name from the string bundle. ...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related xul property files ...
toolbarbutton - Archive of obsolete content
. image type: uri the uri of the image to appear on the element. if this attribute is empty or left out, no image appears. the position of the image is determined by the dir and orient attributes. label type: string the label that will appear on the element. if this is left out, no text appears. for an editable menuitem element the value of this attribute is copied to the menu
list.value property upon user selection of the menuitem. oncommand type: script code this event handler is called when the command is activated. this occurs when a user selects a menu item or presses a keyboard shortcut attached to the command. open type: boolean for the menu type buttons, the open attribute is set to true when the menu is open. the open attribute is not present if...
... open type: boolean gets and sets the value of the open attribute. orient type: string gets and sets the value of the orient attribute. tabindex type: integer gets and sets the value of the tabindex attribute. type type: string gets and sets the value of the type attribute. ...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements toolbar, toolbargrippy, toolbaritem, toolbarpalette, toolbarseparator, toolbarset, toolbarspacer, toolbarspring, toolbox interfaces nsiaccessibleprovider, nsidomxulbuttonelement ...
tooltip - Archive of obsolete content
use the value none: menupopup > menuitem, menupopup > menu { max-width: none; } default type: boolean if true, the tooltip is used as the default popup for displaying tooltips in the window. label type: string the label that will appear on the element. if this is left out, no text appears. for an editable menuitem element the value of this attribute is copied to the menu
list.value property upon user selection of the menuitem. noautohide type: boolean if this attribute is set to false or omitted, the tooltip will automatically disappear after a few seconds. if this attribute is set to true, this will not happen and the tooltip will only hide when the user moves the mouse to another element. onpopuphidden type: script code this event is sent to a popu...
...e: closed: the popup is closed and not visible. open: the popup is open and visible on screen. showing: a request has been made to open the popup, but it has not yet been shown. this state will occur during the popupshowing event. hiding: the popup is about to be hidden. this state will occur during the popuphiding event. ...
... moveto( x, y ) return type: no return value moves the popup to a new location defined by screen coordinates (and not client coordinates). if both x and y have th...
treerow - Archive of obsolete content
related ] a single row in a tree. it should be placed inside a treeitem element. children of the treerow should be treecell elements. if child rows are necessary, they should be placed in a treechildren element inside the parent treeitem. more information is available in the xul tutorial. attributes properties examples (example needed) attributes properties type: space-separated
list of property names sets the properties of the element, which can be used to style the element. for more information, see styling a tree. inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, l...
...llowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
... ...
treeseparator - Archive of obsolete content
for more information, see styling a tree. ...
...llowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
... ...
XUL - Archive of obsolete content
lp you get started with xul, originally from xulplanet. xul (xml user interface language) is mozilla's xml-based language for building user interfaces of applications like firefox. the term xul is sometimes used to refer to the whole mozilla platform (e.g. xul applications are applications using xul and other components of the platform). ...
... the joy of xul describes the key features and components of xul. menus and popups guide a guide on using menus and popup panels. template guide a detailed guide on xul templates, which is a means of generating content from a datasource. ...
...ning the xul periodic table which can be opened with gecko based browsers. you can get it here. see: using firefox 3 to run xulrunner applications for instructions on running xulrunner apps in firefox. view all... community view mozilla forums... ...
XULRunner tips - Archive of obsolete content
useful ...
...r (where the install.rdf is) like this one: /home/username/.mozilla/firefox/numbersandletters/extensions/inspector@mozilla.org/ now create a javascript file with the following code and include it in the main window of your application: function startdomi() { // load the window datasource so that browser windows opened subsequent to dom // inspector show up in the dom inspector's window
list. var windowds = components.classes["@mozilla.org/rdf/datasource;1?name=window-mediator"] .getservice(components.interfaces.nsiwindowdatasource); var tmpnamespace = {}; var sl = components.classes["@mozilla.org/moz/jssubscript-loader;1"] .createinstance(components.interfaces.mozijssubscriptloader); sl.loadsubscript("chrome://inspector/content/hooks.js...
...cons. reading command line arguments see chrome: command line and xulrunner:commandline. command line arguments are handled via nsicommandlinehandler. ...
Gecko Compatibility Handbook - Archive of obsolete content
fox or mozilla which allows you to "spoof" the user-agent strings of the various gecko browsers. here's how: launch mozilla or firefox. the benefit of using these browsers is that if you're only detecting netscape or netscape6 you'll see the issues right away. install the user agent switcher extension. after restarting your browser, add the the user-agent strings that you want to test to the
list (tools | user agent switcher | options | options... | user agents | add...). once you filled the dialog box (it should look like the screenshot below), click ok and close theoptions dialog. you can now start using the user-agent string you've just created by clicking tools | user agent switcher |the name you have chosen. you can verify the string got changed by looking under help | about. ...
...for next generation browsers. an html page can be quickly checked for the use of proprietary html markup by submitting the page to the w3's html validator using the html 4.01 doctype. we will have more to say about doctypes later in this article, but essentially the doctype is supposed to indicate to a browser what version of html is used in the page. the html element cross reference provides a
list of all html elements supported in netscape 4, gecko browsers, internet explorer 4 and up and can be used to determine which html elements are supported by all browsers. browser detection problem: faulty browser detection or sniffing while browser detection is useful in enabling authors to code pages that work only in specific browsers, improper browser detection can lead to major user experie...
...e problems with gecko-based browsers, especially in image maps. you should make sure that your name attributes are coded using valid characters only. bad code due to old apis and tools problem: obsolete apis or web authoring tools generate non-standard code. many older versions of cross-browser apis in common use around the web such as dynapi do not support gecko for one or more of the reasons
listed above. this is also the case for older versions of web authoring tools such as macromedia's dreamweaver 2 and 3. newer versions of these apis and tools do support gecko however. for example, dynapi is now maintained at sourceforge and offers a gecko-compatible version. newer versions of web authoring tools support gecko. wrong doctype problem: an incorrect doctype can completely alter a page...
Extentsions FAQ - Archive of obsolete content
s match, which is chosen)? i have two states switching images in the tool bar and would have no problem implementing a third, so yes it's possible. ...
...nt.getelementbyid("toolbar-button").setattribute("toolbar-button", "on"); //or document.getelementbyid("toolbar-button").setattribute("toolbar-button","off"); //css #myexten-toolbar-button[myexten-toolbar-button="on"] {
list-style-image: url("chrome://myexten/skin/toolbar-button.png"); -moz-image-region: rect(0px 24px 24px 0px);} #myexten-toolbar-button[myexten-toolbar-button="off"] {
list-style-image: url("chrome://myexten/skin/toolbar-button-off.png"); -moz-image-region: rect(0px 24px 24px 0px);} to implement a third i would simply change add an attribute and the corresponding css see http://www.w3.org/tr/rec-css2/cascade.html#cascade friday, october 13 - 20, 2006 (↑ top) how to get a refenece to the sidebar window assuming you have chrome privileges, this should w...
...formation using the stringproperties of an imap message with out changing the properties? string properties are implemented as imap user flags. however not all servers support user flags, in which case you get reduced functionality as follows: all flags are stored in your local cache and are lost if your cache gets invalidated, and only "known" properties are copied when messages are copied. the
list of "known" properties is: junkscore junkscoreorigin label priority keywords. keywords - in the gui they are called tags. they replace the old labels (although the labels are still recognised). preserved properties source code - nsimapmailfolder::copymessages uaq friday, september 22 - 29, 2006 (↑ top) why extension preferences do not get changed until after it's upgrade? why extensi...
Version - Archive of obsolete content
note: there are 3 different versions of rss 0.91. ...
... note: there are 3 different versions of rss 0.91. ...
... note: there are 3 different versions of rss 0.91. ...
Introduction to Public-Key Cryptography - Archive of obsolete content
essential element of network security within most intranets or extranets. the sections that follow contrast two forms of client authentication: password-based authentication. almost all server software permits client authentication by means of a name and password. for example, a server might require a user to type a name and password before granting access to the server. the server maintains a
list of names and passwords; if a particular name is on the
list, and if the user types the correct password, the server grants access. certificate-based authentication. client authentication based on certificates is part of the ssl protocol. the client digitally signs a randomly generated piece of data and sends both the certificate and the signed data across the network. the server uses techniques ...
...g a single password to the local client's private-key database, and get authenticated access to all ssl-enabled servers that user is authorized to use-without sending any passwords over the network. this approach simplifies access for users, because they don't need to enter passwords for each new server. it also simplifies network management, since administrators can control access by controlling
lists of certificate authorities (cas) rather than much longer
lists of users and passwords. in addition to using certificates, a complete single-sign on solution must address the need to interoperate with enterprise systems, such as the underlying operating system, that rely on passwords or other forms of authentication. object signing communicator supports a set of tools and technologies called o...
...ocess includes checking the directory for the presence of the certificate being presented. when an administrator revokes a certificate, the certificate can be automatically removed from the directory, and subsequent authentication attempts with that certificate will fail even though the certificate remains valid in every other respect. another approach involves publishing a certificate revocation
list (crl)-that is, a
list of revoked certificates-to the directory at regular intervals and checking the
list as part of the authentication process. for some organizations, it may be preferable to check directly with the issuing ca each time a certificate is presented for authentication. this procedure is sometimes called real-time status checking. registration authorities interactions between enti...
Scratchpad - Archive of obsolete content
the scratchpad window looks something like this (on macos the menu bar is at the top of the screen): the file menu offers options to save and load javascript code snippets, so you can reuse code later if you like. code completion scratchpad integrates the tern code analysis engine, and uses that to provide autocomplete suggestions and popups containing information on the current symbol. to
list autocomplete suggestions, press ctrl + space. for example, try typing d, then pressing ctrl + space. you'll see the autocomplete box, as shown below: the icon next to each suggestion indicates the type, and the currently highlighted suggestion gets a popup with more information. ↑ and ↓ cycle through the suggestions and enter or tab select the highlighted choice. inline documentation to s...
...wn below: the icon next to each suggestion indicates the type, and the currently highlighted suggestion gets a popup with more information. ↑ and ↓ cycle through the suggestions and enter or tab select the highlighted choice. inline documentation to show the inline documentation popup, press ctrl + shift + space when the cursor is on an identifier. for example, if you type document.addevent
listener, then press ctrl + shift + space, you'll see a popup that shows a summary of the function's syntax and a short description: the "[docs]" link takes you to the mdn documentation for the symbol. executing once you've written your code, select the code you want to run. if you don't select anything, all the code in the window will be run. then choose the way you want the code to run using the ...
... in the editor preferences section of the developer tools settings, you can choose to use vim, emacs, or sublime text key bindings instead. to select these, visit about:config, select the setting devtools.editor.keymap, and assign "vim" or "emacs", or "sublime" to that setting. if you do this, the selected bindings will be used for all the developer ...
Browser Feature Detection - Archive of obsolete content
reports a rating as the percentage of names the browser defines. this article has generally never been more than a way to show off firefox web compatibility, rather than something truly informative in a broader sense. therefore, given that it's also badly out of date, it's been archived. you should not rely on any information here. browser sniffing via api name detection the following tables
list the api names defined for specific w3c dom apis and
lists the percentage of names that your browser actually defines followed by a
list of each of the api names tested along with an indication of whether the name was defined for your browser. it is clear from these test results that netscape 7.0x and mozilla firefox have the greatest dom support although internet explorer, safari, and opera have...
...rue font true true true fontfamily true true true fontsize true true true fontstyle true true true fontvariant true true true fontweight true true true height true true true letterspacing true true true lineheight true true true
liststyle true true true
liststyleimage true true true
liststyleposition true true true
liststyletype true true true margin true true true margintop true true true marginright true true true marginbottom true true true marginleft true true true ...
...}, {name: 'font', 'supported': false}, {name: 'fontfamily', 'supported': false}, {name: 'fontsize', 'supported': false}, {name: 'fontstyle', 'supported': false}, {name: 'fontvariant', 'supported': false}, {name: 'fontweight', 'supported': false}, {name: 'height', 'supported': false}, {name: 'letterspacing', 'supported': false}, {name: 'lineheight', 'supported': false}, {name: '
liststyle', 'supported': false}, {name: '
liststyleimage', 'supported': false}, {name: '
liststyleposition', 'supported': false}, {name: '
liststyletype', 'supported': false}, {name: 'margin', 'supported': false}, {name: 'margintop', 'supported': false}, {name: 'marginright', 'supported': false}, {name: 'marginbottom', 'supported': false}, {name: 'marginleft', 'supported': false}, {name...
-ms-content-zoom-snap-points - Archive of obsolete content
sinheritednocomputed valueas specifiedanimation typediscrete syntax values snapinterval( <percentage>, <percentage> ) specifies where the snap-points will be placed. the first percentage specifies where the first snap-point will be placed. the second percentage specifies the distance between subsequent snap-points, both zoomed in and zoomed out from the initial snap-point. snap
list( <percentage># ) specifies the position of individual snap-points as a comma-separated
list of percentages, each of which represents a zoom factor. if any value specified is less than that specified by the -ms-content-zoom-limit-min property, the value of -ms-content-zoom-limit-min is used. if any value specified is greater than that specified by the -ms-content-zoom-limit-max property,...
...ich represents a zoom factor. if any value specified is less than that specified by the -ms-content-zoom-limit-min property, the value of -ms-content-zoom-limit-min is used. if any value specified is greater than that specified by the -ms-content-zoom-limit-max property, the value of -ms-content-zoom-limit-max is used. formal syntax snapinterval( <percentage>, <percentage> ) | snap
list( <percentage># ) examples this example demonstrates both types of values for the -ms-content-zoom-snap-points property. in the first selector, the first snap-point is at 0%, and the interval is set to 100%. in the second selector, each snap-point is
listed separately—100%, 200%, 300%, and so on. .snappy1 { -ms-content-zoom-snap-points: snapinterval(0%, 100%); ... } .snappy2 { -ms-...
...} specifications not part of any specification. remarks this property has no effect on non-zoomable elements. ...
-ms-scroll-snap-points-x - Archive of obsolete content
be either a <length> or a <percentaqe>. snapinterval( <length-percentage>, <length-percentage> ) specifies a starting snap-point followed by the interval between all snap-points. the first value specifies where the first snap-point will be placed. the second value specifies the distance between subsequent snap-points both to the left and the right of the initial snap-point. snap
list( <length-percentage># ) specifies the position of individual snap-points as a comma-separated
list of values, each of which represents a zoom factor. if any value is less than -ms-scroll-limit-x-min , then -ms-scroll-limit-x-min is used. if any value is greater than -ms-scroll-limit-x-max, then -ms-scroll-limit-x-max is used. formal syntax snapinterval( <length-percentage>, <le...
... specifies the position of individual snap-points as a comma-separated
list of values, each of which represents a zoom factor. if any value is less than -ms-scroll-limit-x-min , then -ms-scroll-limit-x-min is used. if any value is greater than -ms-scroll-limit-x-max, then -ms-scroll-limit-x-max is used. formal syntax snapinterval( <length-percentage>, <length-percentage> ) | snap
list( <length-percentage># )where <length-percentage> = <length> | <percentage> examples this example demonstrates both types of values for the -ms-scroll-snap-points-x property. in the first selector, the first snap-point is at 0%, and the interval is set to 100%. in the second selector, each snap-point is
listed separately — 100%, 200%, 300%, and so on. (the -ms-scroll-snap-points-x property be...
... remarks this property requires windows 8 or later. this property has no effect on non-scrollable elements. starting with windows 8.1, this property is also supported for mouse, keyboard, and touchpad interaction. ...
-ms-scroll-snap-points-y - Archive of obsolete content
lue that can be either a <length> or a <percentaqe>. snapinterval( <length-percentage>, <length-percentage> ) specifies a starting snap-point followed by the interval between all snap-points. the first value specifies where the first snap-point will be placed. the second value specifies the distance between subsequent snap-points both above and below the initial snap-point. snap
list( <length-percentage># ) specifies the position of individual snap-points as a comma-separated
list of values, each of which represents a zoom factor. if any value is less than -ms-scroll-limit-y-min , then -ms-scroll-limit-y-min is used. if any value is greater than -ms-scroll-limit-y-max, then -ms-scroll-limit-y-max is used. formal syntax snapinterval( <length-percentage>, <le...
... specifies the position of individual snap-points as a comma-separated
list of values, each of which represents a zoom factor. if any value is less than -ms-scroll-limit-y-min , then -ms-scroll-limit-y-min is used. if any value is greater than -ms-scroll-limit-y-max, then -ms-scroll-limit-y-max is used. formal syntax snapinterval( <length-percentage>, <length-percentage> ) | snap
list( <length-percentage># )where <length-percentage> = <length> | <percentage> examples this example demonstrates both types of values for the -ms-scroll-snap-points-y property. in the first selector, the first snap-point is at 0%, and the interval is set to 100%. in the second selector, each snap-point is
listed separately — 100%, 200%, 300%, and so on. (the -ms-scroll-snap-points-y property be...
... remarks this property requires windows 8 or later. this property has no effect on non-scrollable elements. starting with windows 8.1, this property is also supported for mouse, keyboard, and touchpad interaction. ...
CSS - Archive of obsolete content
normally, ...
...normally, a <xul:...
...border-bottom-colorsin mozilla applications like firefox, the -moz-border-bottom-colors css property sets a
list of colors for the bottom border.-moz-border-left-colorsin mozilla applications like firefox, the -moz-border-left-colors css property sets a
list of colors for the left border.-moz-border-right-colorsin mozilla applications like firefox, the -moz-border-right-colors css property sets a
list of colors for the right border.-moz-border-top-colorsin mozilla applications like firefox, the -moz-border-top-colors css property sets a
list of colors for the top border.-moz-stack-sizing-moz-stack-sizing is an extended css property. normally, a <xul:stack> will change its size so that all of its child elements are completely visible. for example, moving a child of the stack far to the right wi...
background-size - Archive of obsolete content
should not the "browser compatibility" table also
list google chrome and konqueror? chome is not mentioned at all, but is becoming increasingly popular. konqueror is
listed below the table, which seems inconsistent. znerd 04 august 2009 chrome, iron, icab4, omniweb etc. are based on webkit, like netscape 6-8, seamonkey, camino, flock, fennec, blackbird etc. are based on gecko. both layout engines are mentioned in the table. people should refer to the webkit and gecko version to get the info they need. agreed; we should definitely encourage people to look stuff up by engine rather than browser. these tables should be revised over time to
list gecko, webkit, internet explorer, and opera, with perhaps a tooltip on each that provides details on which browsers are encompassed by each. i'm g...
...age web developers to ask for layout engines, not for browsers. [that said, the popularity of chrome let me think of a table row like safari, chrome (webkit) | 4.0, 2.0 (528). but i'm not able and willing spending time for this. remember you have to test yourself, don't trust online references, don't trust webkit | apple | google homepage, they are wrong. don't trust the internet at alll! ]
listing konqueror below the table is a compromise for consistency. feel free to put it inside, nothing is set in stone. konqueror's global market share is 0.05%, (< 5% of linux users). given the fact that this reference has serious shortcomings in many places and few contributors, i think spending much time here is not effective. people especially interested in this browser are welcome to contribute.
... css properties? if so, feel free to change the en/css_reference/property_template and all css property pages ; ) start with -webkit-background-size and investigate support of contain and cover keywords and "omitted second value" behavior. [i assume it's the same as safari, since they just backported a webkit patch into khtml. but we need facts, rather than assumptions.] btw, some time ago i'v
listed opera in the property template table and removed netscape because netscape is gecko based and opera has a global market share of > 2% (> 40% in some european countries). user:jürgen jeka 2009-08-04 <hr> is there anyway to have the -moz-border-image only apply if -moz-background-size is not supported? i'm guessing not, just asking because having both rules in for 3.6 creates a strange effect: ...
Community - Archive of obsolete content
if you know of useful mailing
lists, newsgroups, forums, or other communities related to xforms, please link to them here. view mozilla forums... ...
... if you know of useful mailing
lists, newsgroups, forums, or other communities related to xforms, please link to them here. view mozilla forums... ...
... if you know of useful mailing
lists, newsgroups, forums, or other communities related to xforms, please link to them here. view mozilla forums... ...
Implementation Status - Archive of obsolete content
on has some limitations and custom extension to the xforms 1.1 specification. these can be found on the mozilla xforms specials page. specification chapter index here we give an overview of xforms 1.1 specification chapters and the current status of the mozilla support. the sections are marked with their current status: supported, partial support, in progress, and not currently supported. we have
listed the most relevant bugs here, but check out the bugzilla xforms bug
list for the complete
list. 3. document structure section title status notes bugs 3.1 namespaces supported 3.2.1 common attributes supported 3.2.2 linking attributes supported ...
...ethod call supported 5. datatypes section title status notes bugs 5.1 xml schema built-in datatypes partial whitespace facet not supported. ...
... section title status notes bugs 5.1 xml schema built-in datatypes partial whitespace facet not supported. ...
Game promotion - Game development
n't send them something that is not relevant to them in the first place. if you're honest with your approach and your game is good, then you've got more of a chance of success. if you want to learn more about the etiquette of contacting the press you should definitely check out how to contact press - a great guide from pixel prospector, and the video game journaliser site curated by them for the
list of sites to contact. tutorials it's good to share your knowledge with other devs — after all you probably learned a thing or two from online articles, so you take the time to pay that knowledge forward. talking or writing about something you achieved or problems you overcame is something people would be interested it. and you can use your own game as an example, especially in a tutorial when ...
... not interested in your content because you don't have any experience yet, try writing tutorials and publish them on your own blog first. it's the easiest way to train your writing skills on your own. youtubers it's a rising trend — don't underestimate the power of youtubers playing your game, talking about it and streaming their experience to give you lots of promotion. you should also be rea
listic however — don't think this alone will skyrocket your downloads or visits, and be prepared to deal with bad reviews as well as good ones. there are two options to get coverage from the youtubers: first is you contact them directly and send a link to your game via email or private message. the second is earned in time - if you're known enough the youtubers will contact you and ask for the link...
...lone will skyrocket your downloads or visits, and be prepared to deal with bad reviews as well as good ones. there are two options to get coverage from the youtubers: first is you contact them directly and send a link to your game via email or private message. the second is earned in time - if you're known enough the youtubers will contact you and ask for the link or build of your game. this big
list of youtubers is a great place to start. you can find youtube and twitch.tv influencers at gameinfluencer.com to help promote your game. events if you've gone through all the options
listed above you can still find new, creative ways to promote your game — events are another good example. attending events, both local and global, gives you the ability to meet your fans face to face, as well as ...
Audio for Web games - Game development
e "countdown.mp3" mp3 file consists of a number being spoken every 2 seconds, the idea being that we play back that number when the corresponding button is pressed. let's add some javascript to make this work: var myaudio = document.getelementbyid('myaudio'); var buttons = document.getelementsbytagname('button'); var stoptime = 0; for (var i = 0; i < buttons.length; i++) { buttons[i].addevent
listener('click', function() { myaudio.currenttime = this.getattribute("data-start"); stoptime = this.getattribute("data-stop"); myaudio.play(); }, false); } myaudio.addevent
listener('timeupdate', function() { if (this.currenttime > stoptime) { this.pause(); } }, false); note: you can try out our audio sprite player live on jsfiddle. note: on mobile we may need to trigger t...
... in the context of your game world you may have loops and samples t...
... parameter is 0 or less than the context currenttime, playback will commence immediately. positional audio positional audio can be an important technique in making audio a key part of an immersive gaming experience. the web audio api not only enables us to position a number of audio sources in three-dimensional space but it can also allow us to apply filters that make that audio appear more rea
listic. the pannernode harnesses the positional capabilities of the web audio api so we can relate further information about the game world to the player. there's a tutorial here to help understand the pannernode in better detail. we can relate: the position of objects the direction and movement of objects the environment (cavernous, underwater, etc.) this is especially useful in a three-dime...
Gecko FAQ - Gecko Redirect 1
bars, etc.), such as firefox. mozilla.org assembles the necessary components into its applications, such as firefox, thunderbird, seamonkey, which are available for free download from mozilla.org. netscape released its own version of the browser branded as netscape navigator. other companies release their own software and hardware products that use gecko. see xulrunner hall of fame for a partial
list of application that use gecko via xulrunner. third parties such as isvs and hardware vendors will pick and choose the components they want to use in their applications or hardware devices. certain browser components are not provided as part of gecko, such as bookmarks, history, address book, etc. however, the source for all those components is available for free download from mozilla.org. why w...
...he open-source gecko codebase, and it follows that every commercial product that has ever shipped and ever will ship based on gecko will have known bugs at the time of its release. (the same principle of course applies to other browser engine development projects and products based upon them as well.) known bugs in the open-source gecko codebase are documented in bugzilla. here are some links to
lists of reported bugs related to the standards mentioned above; be aware that these raw
lists of open in-process bugs will inevitably include some duplicate, out of date, unreproducible, invalid, and incorrectly tagged reports: the links themselves are probably outdated too. layout component tracks content layout bugs that may be related to a variety of specifications html 4.0 elements, fo...
...sociated css or xslt, gecko displays the pretty-printed source of the document. how does gecko help content developers? content developers are sick and tired of developing and testing every single web page multiple times in order to support the different, incompatible, proprietary doms of browsers from different vendors. they have been demanding that all vendors fully support the open standards
listed above so that they can have a rich, powerful formatting system and object model at their disposal, and "write once, view anywhere." gecko's robust support for these standards makes gecko the platform of choice for web content and web application developers worldwide. are gecko's apis based on activex? com? javabeans? gecko is reusable on all platforms thanks to xpcom, a subset of com th...
Call stack - MDN Web Docs Glossary: Definitions of Web-related terms
t function, etc. when a script calls a function, the interpreter adds it to the call stack and then starts carrying out the function. any functions that are called by that function are added to the call stack further up, and run where their calls are reached. when the current function is finished, the interpreter takes it off the stack and resumes execution where it left off in the last code
listing. if the stack takes up more space than it had assigned to it, it results in a "stack overflow" error. 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 reach...
...ack overflow" error. 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. add the greeting() function to the call stack
list. call stack
list: - greeting execute all lines of code inside the greeting() function. get to the sayhi() function invocation. add the sayhi() function to the call stack
list. call stack
list: - sayhi - greeting execute all lines of code inside the sayhi() function, until reaches its end. return execution to the line that invoked sayhi() and continue executing th...
...eting() function. get to the sayhi() function invocation. add the sayhi() function to the call stack
list. call stack
list: - sayhi - greeting execute all lines of code inside the sayhi() function, until reaches its end. return execution to the line that invoked sayhi() and continue executing the rest of the greeting() function. delete the sayhi() function from our call stack
list. call stack
list: - greeting when everything inside the greeting() function has been executed, return to its invoking line to continue executing the rest of the js code. delete the greeting() function from the call stack
list. call stack
list: empty in summary, then, we start with an empty call stack. whenever we invoke a function, it is automatically added to the ca...
MVC - MDN Web Docs Glossary: Definitions of Web-related terms
patterns are based on mvc, such as mvvm (model-view-viewmodel), mvp (model-view-presenter), and mvw (model-view-whatever). the three parts of the mvc software-design pattern can be described as follows: model: manages data and business logic. view: handles layout and display. controller: routes commands to the model and view parts. model view controller example imagine a simple shopping
list app. all we want is a
list of the name, quantity and price of each item we need to buy this week. below we'll describe how we could implement some of this functionality using mvc. the model the model defines what data the app should contain. if the state of this data changes, then the model will usually notify the view (so the display can change as needed) and sometimes the controller (if dif...
...to buy this week. below we'll describe how we could implement some of this functionality using mvc. the model the model defines what data the app should contain. if the state of this data changes, then the model will usually notify the view (so the display can change as needed) and sometimes the controller (if different logic is needed to control the updated view). going back to our shopping
list app, the model would specify what data the
list items should contain — item, price, etc. — and what
list items are already present. the view the view defines how the app's data should be displayed. in our shopping
list app, the view would define how the
list is presented to the user, and receive the data to display from the model. the controller the controller contains logic that updates...
...these actions require the model to be updated, so the input is sent to the controller, which then manipulates the model as appropriate, which then sends updated data to the view. ...
Semantics - MDN Web Docs Glossary: Definitions of Web-related terms
html element have" (rather than "what does it look like?".) semantics in javascript in javascript, consider a function that takes a string parameter, and returns an <li> element with that string as its textcontent. would you need to look at the code to understand what the function did if it was called build('peach'), or createliwithcontent('peach')? semantics in css in css, consider styling a
list with li elements representing different types of fruits. would you know what part of the dom is being selected with div > ul > li, or .fruits__item? semantics in html in html, for example, the <h1> element is a semantic element, which gives the text it wraps around the role (or meaning) of "a top level heading on your page." <h1>this is a top level heading</h1> by default, most browser's user...
... semantic elements these are some of the roughly 100 semantic elements available: <article> <aside> <details> <figca...
... semantic elements these are some of the roughly 100 semantic elements available: <article> <aside> <details> <figcaption> <figure> <footer> <header> <main> <mark> <nav> <section> <summary> <time> learn more html el...
Test your skills: CSS and JavaScript accessibility - Learn web development
practices article. note: you can try out solutions in the interactive editors below, however it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks. if you get stuck, then ask us for help — see the assessment or further help section at the bottom of this page. css accessibility 1 in the first task you are presented with a
list of links. however, their accessibility is pretty bad — there is no way to really tell that they are links, or to tell which one the user is focussed on. we'd like you to assume that the existing ruleset with the a selector is supplied by some cms, and that you can't change it — instead, you need to create new rules to make the links look and behave like links, and for the user to be able to ...
...ccessibility is pretty bad — there is no way to really tell that they are links, or to tell which one the user is focussed on. we'd like you to assume that the existing ruleset with the a selector is supplied by some cms, and that you can't change it — instead, you need to create new rules to make the links look and behave like links, and for the user to be able to tell where they are in the
list. try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor. css accessibility 2 in this next task you are presented with a simple bit of content — just headings and paragraphs. there are accessibility issues with the colors and sizing of the text; we'd like you to: 1. explain what the ...
...the problem is now fixed. explain what tools or methods you used to select the new values and test the code. try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor. javascript accessibility 1 in our final task here, you have some javascripting to do. we have a simple app that presents a
list of animal names. clicking one of the animal names causes a further description of that animal to appear in a box below the
list. but it is not very accessible — in its current state you can only operate it with the mouse. we'd like you to add to the html and javascript to make it keyboard acessible too. download the starting point for this task to work in your own editor or in an online edit...
What is accessibility? - Learn web development
and think about solutions/alternatives. text content (as you'll see in the next article) is easy, but what about your multimedia content, and your whizzy 3d graphics? you should look at your project budget and think about what solutions you have available to make such content accessible. having all your multimedia content transcribed is one option which, while expensive, is possible. also, be rea
listic. "100% accessibility" is an unobtainable ideal — you will always come across some kind of edge case that results in a certain user finding certain content difficult to use — but you should do as much as you can. if you are planning to include a whizzy 3d pie chart graphic made using webgl, you might want to include a data table as an accessible alternative representation of the data. or, yo...
...fit everyone, not just users with disabilities. for example, lean semantic markup is not only good for screen readers, but it is also fast to load and performant. this benefits everyone, especially those on mobile devices and/or slow connections. publish an accessibility statement on your site and engage with people having problems. accessibility guidelines and the law there are numerous check
lists and sets of guidelines available for basing accessibility tests on, which might seem overwhelming at first glance. our advice is to familiarize yourself with the basic areas in which you need to take care, as well as understanding the high-level structures of the guidelines that are most relevant to you. for a start, the w3c has published a large and very detailed document that includes very ...
...lso have specific legislation governing the need for websites serving their population to be accessible — for example en 301 549 in the eu, section 508 of the rehabilitation act in the us, federal ordinance on barrier-free information technology in germany, the accessibility regulations 2018 in the uk, accessibilità in italy, the disability discrimination act in australia, etc. the w3c keeps a
list of web accessibility laws & policies by country. so while the wcag is a set of guidelines, your country will probably have laws governing web accessibility, or at least the accessibility of services available to the public (which could include websites, television, physical spaces, etc.) it is a good idea to find out what your laws are. if you make no effort to check that your content is access...
Styling tables - Learn web development
we've center-aligned the text in the table cells inside the <tbody> so that they line up with the headings. by default, cells are given a text-al...
... we've center-aligned the text in the table cells inside the <tbody> so that they line up with the headings. ...
...ter-spacing: 1px; } there is nothing remarkable here, except for the caption-side property, which has been given a value of bottom. this causes the caption to be positioned on the bottom of the table, which along with the other declarations gives us this final look (see it live at punk-bands-complete.html): table styling quick tips before moving on, we thought we'd provide you with a quick
list of the most useful points illustrated above: make your table markup as simple as possible, and keep things flexible, e.g. by using percentages, so the design is more responsive. use table-layout: fixed to create a more predictable table layout that allows you to easily set column widths by setting width on their headings (<th>). use border-collapse: collapse to make table elements borders co...
CSS FAQ - Learn web development
se before 2001 will be rendered in quirks mode. standards mode: the browser attempts to follow the w3c standards strictly. new html pages are expected to be designed for standards-compliant browsers, and as a result, pages with a modern doctype declaration will be rendered with standards mode. gecko-based browsers, have a third almost standards mode that has only a few minor quirks. this is a
list of the most commonly used doctype declarations that will trigger standards or almost standards mode: <!doctype html> /* this is the html5 doctype. given that each modern browser uses an html5 parser, this is the recommended doctype */ <!doctype html public "-//w3c//dtd html 4.0 transitional//en" "http://www.w3.org/tr/html4/loose.dtd"> <!doctype html public "-//w3c//dtd html ...
...style to be defined in terms of another. (see eric meyer's note about the working group's stance). however, assigning multiple classes to a single element can provide the same effect, and css variables now provide a way to define style information in one place that can be reused in multiple places. how do i assign multiple classes to an element? html elements can be assigned multiple classes by
listing the classes in the class attribute, with a blank space to separate them. <style type="text/css"> .news { background: black; color: white; } .today { font-weight: bold; } </style> <div class="news today"> ... content of today's news ... </div> if the same property is declared in both rules, the conflict is resolved first through specificity, then according to the order of the css declaratio...
...st through specificity, then according to the order of the css declarations. the order of classes in the class attribute is not relevant. why don't my style rules work properly? style rules that are syntactically correct may not apply in certain situations. you can use dom inspector's css style rules view to debug problems of this kind, but the most frequent instances of ignored style rules are
listed below. html elements hierarchy the way css styles are applied to html elements depends also on the elements hierarchy. it is important to remember that a rule applied to a descendent overrides the style of the parent, in spite of any specificity or priority of css rules. .news { color: black; } .corpname { font-weight: bold; color: red; } <!-- news item text is black, but corporate name is ...
What text editors are available? - Learn web development
ct's cost has little connection with its quality or capability. there's a big chance you'll find a suitable text editor for free. here are some popular editors: editor licence price os support doc. ...
...ist, wiki online manual yes brackets mit/bsd free windows, mac, linux forum, irc github wiki yes coda closed source $99 mac twitter, forum, e-mail ebook yes codelobster closed source free windows, mac, linux forum, e-mail no end user doc yes emacs gpl 3 free windows, mac, linux faq, mailing
list, news group online manual yes espresso closed source $75 mac faq, e-mail no end user doc, but plug-in doc yes gedit gpl free windows, mac, linux mailing
list, irc online manual yes kate lgpl, gpl free windows, mac, linux mailing
list, irc online manual yes komodo edit mpl free windows, mac...
...free windows, mac, linux forum online manual yes notepad++ gpl free windows forum wiki yes pspad closed source free windows faq, forum online help yes sublime text closed source $70 windows, mac, linux forum official, unofficial yes textmate closed source $50 mac twitter, irc, mailing
list, e-mail online manual, wiki yes textwrangler closed source free mac faq, forum pdf manual no vim specific open license free windows, mac, linux mailing
list online manual yes visual studio code open source under mit licence/ specific licence for product free windows, mac, linux faq documentation yes ...
What are browser developer tools? - Learn web development
he debugger tab. chrome: open the developer tools and then select the sources tab. (opera works the same way.) edge and internet explorer 11: press f12 and then, ctrl + 3, or if the tools are already displayed, click on the debugger tab. safari: open the developer tools and then select the debugger tab. exploring the debugger there are three panes in the javascript debugger on firefox. file
list the first pane on the left contains the
list of files associated with the page you are debugging. select the file you want to work with from this
list. click on a file to select it and view its contents in the center pane of the debugger. source code set breakpoints where you want to pause execution. in the following image, the highlight on the number 18 shows that the line has a breakpoint ...
... the page you are debugging. select the file you want to work with from this
list. click on a file to select it and view its contents in the center pane of the debugger. source code set breakpoints where you want to pause execution. in the following image, the highlight on the number 18 shows that the line has a breakpoint set. watch expressions and breakpoints the right-hand pane shows a
list of the watch expressions you have added and breakpoints you have set. in the image, the first section, watch expressions, shows that the
listitems variable has been added. you can expand the
list to view the values in the array. the next section, breakpoints,
lists the breakpoints set on the page. ...
... the call stack section shows you what code was executed to get to the current line. you can see that the code is in the function that handles a mouse click, and that the code is currently paused on the breakpoint. ...
Your first form - Learn web development
for simple cases. what are web forms? web forms are one of the main points of interaction between a user and a web site or application. forms allow users to enter data, which is generally sent to a web server for processing and storage (see sending form data later in the module), or used on the client-side to immediately update the interface in some way (for example, add another item to a
list, or show or hide a ui feature). a web form's html is made up of one or more form controls (sometimes called widgets), plus some additional elements to help structure the overall form — they are often referred to as html forms. the controls can be single or multi-line text fields, dropdown boxes, buttons, checkboxes, or radio buttons, and are mostly created using the <input> element, although t...
...oment we will just get you to add some css to make it look ok. first of all, add a <style> element to your page, inside your html head. ...
...i> <label for="msg">message:</label> <textarea id="msg" name="user_message"></textarea> </li> ... in our example, the form will send 3 pieces of data named "user_name", "user_email", and "user_message". that data will be sent to the url "/my-handling-form-page" using the http post method. on the server side, the script at the url "/my-handling-form-page" will receive the data as a
list of 3 key/value items contained in the http request. the way this script will handle that data is up to you. each server-side language (php, python, ruby, java, c#, etc.) has its own mechanism of handling form data. it's beyond the scope of this guide to go deeply into that subject, but if you want to know more, we have provided some examples in our sending form data article later on. summary co...
HTML Cheatsheet - Learn web development
an extended quotation <blockquote>the blockquote element indicates an extended quotation.</blockquote> the blockquote element indicates an extended quotation. ...
...quotation. ...
...elements block elements an unordered
list <ul> <li>i'm an item</li> <li>i'm another item</li> </ul> i'm an item i'm another item an ordered
list <ol> <li>i'm the first item</li> <li>i'm the second item</li> </ol> i'm the first item i'm the second item a definition
list <dl> <dt>a term</dt> <dd>definition of a term</dd> <dt>another term</dt> <dd>definition of another term</dd> </dl> a term definition of a term another term definition of another term a horizontal rule <hr> text heading <h1> this is heading 1 </h1> <h2> this ...
Introduction to HTML - Learn web development
this module will introduce the first two of these and introduce fundamental concepts and syntax you need to know to understand html. ...
...ta about the html, such as who wrote it, and important keywords that describe the document). html text fundamentals one of html's main jobs is to give text meaning (also known as semantics), so that the browser knows how to display it correctly. this article looks at how to use html to break up a block of text into a structure of headings and paragraphs, add emphasis/importance to words, create
lists, and more. creating hyperlinks hyperlinks are really important — they are what makes the web a web. this article shows the syntax required to make a link and discusses best practices for links. advanced text formatting there are many other elements in html for formatting text that we didn't get to in the html text fundamentals article. the elements here are less well-known, but still usefu...
...es the web a web. this article shows the syntax required to make a link and discusses best practices for links. advanced text formatting there are many other elements in html for formatting text that we didn't get to in the html text fundamentals article. the elements here are less well-known, but still useful to know about. in this article, you'll learn about marking up quotations, description
lists, computer code and other related text, subscript and superscript, contact information, and more. document and website structure as well as defining individual parts of your page (such as "a paragraph" or "an image"), html is also used to define areas of your website (such as "the header," "the navigation menu," or "the main content column.") this article looks into how to plan a basic website ...
Object-oriented JavaScript for beginners - Learn web development
y with javascript basics (see first steps and building blocks) and oojs basics (see introduction to objects). objective: to understand the basic theory behind object-oriented programming, how this relates to javascript ("everything is an object"), and how to create constructors and object instances. object-oriented programming — the basics to start with, let's give you a simp
listic, high-level view of what object-oriented programming (oop) is. we say simp
listic, because oop can quickly get very complicated, and giving it a full treatment now would probably confuse more than help. the basic idea of oop is that we use objects to model real world things that we want to represent inside our programs, and/or provide a simple way to access functionality that would otherwise be ...
...ject instances — objects that contain the data and functionality defined in the class. from our person class, we can now create some actual people: when an object instance is created from a class, the class's constructor function is run to create it. this process of creating an object instance from a class is called instantiation — the object instance is instantiated from the class. specia
list classes in this case we don't want generic people — we want teachers and students, which are both more specific types of people. in oop, we can create new classes based on other classes — these new child classes can be made to inherit the data and code features of their parent class, so you can reuse functionality common to all the object types rather than having to duplicate it. where func...
... start with, try adding a couple more object creation lines of your own, and try getting and setting the members of the resulting object instances. in addition, there are a couple of problems with our bio() method — the output always includes the pronoun "he", even if your person is female, or some other preferred gender classification. and the bio only includes two interests, even if more are
listed in the interests array. can you work out how to fix this in the class definition (constructor)? you can put any code you like inside a constructor (you'll probably need a few conditionals and a loop). think about how the sentences should be structured differently depending on gender, and depending on whether the number of
listed interests is 1, 2, or more than 2. note: if you get stuck, we ha...
Introduction to the server side - Learn web development
revious buying habits, simplify purchases, etc. banks use server-side programming to store account information and allow only authorized users to view and make transactions. other services like facebook, twitter, instagram, and wikipedia use server-side programming to highlight, share, and control access to interesting content. some of the common uses and benefits of server-side programming are
listed below. you'll note that there is some overlap! efficient storage and delivery of information imagine how many products are available on amazon, and imagine how many posts have been written on facebook? creating a separate static page for each product or post would be completely impractical. server-side programming allows us to instead store the information in a database and dynamically const...
...many sites store credit cards so that details don't have to be entered again. sites like google maps can use saved or current locations for providing routing information, and search or travel history to highlight local businesses in search results. a deeper analysis of user habits can be used to anticipate their interests and further customize responses and notifications, for example providing a
list of previously visited or popular locations you may want to look at on a map. note: google maps saves your search and visit history. frequently visited or frequently searched locations are highlighted more than others. google search results are optimized based on previous searches. go to google search. search for "football". now try typing "favourite" in the search box and observe the a...
...ge. server-side programming can be used to refine responses based on analysis of this data. for example, amazon and google both advertise products based on previous searches (and purchases). note: if you're a facebook user, go to your main feed and look at the stream of posts. note how some of the posts are out of numerical order - in particular, posts with more "likes" are often higher on the
list than more recent posts. also look at what kind of ads you are being shown — you might see ads for things you looked at on other sites. facebook's algorithm for highlighting content and advertising can be a bit of a mystery, but it is clear that it does depend on your likes and viewing habits! summary congratulations, you've reached the end of the first article about server-side programming.
Framework main features - Learn web development
l be initially rendered like so in the browser: <button>clicked 0 times</button> the usestate() call keeps track of the count value in a robust way across the app, without you needing to write code to do that yourself. events in order to be interactive, components need ways to respond to browser events, so our applications can respond to our users. frameworks each provide their own syntax for
listening to browser events, which reference the names of the equivalent native browser events. in react,
listening for the click event requires a special property, onclick. let’s update our counterbutton code from above to allow it to count clicks: function counterbutton() { const [count, setcount] = usestate(0); return ( <button onclick={() => setcount(count + 1)}>clicked {count} times</...
...work you'd like to start learning first: react ember vue note: we only have three framework tutorial series available now, but we hope to have more available in the future. ...
...accessibility in react react resources ember getting started with ember ember app structure and componentization ember interactivity: events, classes and state ember interactivity: footer functionality, conditional rendering routing in ember ember resources and troubleshooting vue getting started with vue creating our first vue component rendering a
list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo
list app dynamic behavior in svelte: working with variables and props ...
React resources - Learn web development
prerequisites: familiarity with the core html, css, and javascript languages, knowledge of the terminal/command line. objective: to provide further resources for learning more about react. component-level styles although this tutorial doesn't use this approach, many react applications define their styles on a per-component basis, rather than in a single, monolithic stylesheet. ...
...these projects will be merging in the near future. when this merge happens, react router will be the surviving project (with the addition of the focus management features of reach). ...
...accessibility in react react resources ember getting started with ember ember app structure and componentization ember interactivity: events, classes and state ember interactivity: footer functionality, conditional rendering routing in ember ember resources and troubleshooting vue getting started with vue creating our first vue component rendering a
list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo
list app dynamic behavior in svelte: working with variables and props ...
Vue resources - Learn web development
prerequisites: familiarity with the core html, css, and javascript languages, knowledge of the terminal/command line. vue components are written as a combination of javascript objects that manage the app's data and an html-based template syntax that maps to the underlying dom structure. ...
...hange in how apps are initialized in vue. to read more about the changes involved with vue 3, refer to this article by vue school which goes over most of the major changes in vue 3. ...
...accessibility in react react resources ember getting started with ember ember app structure and componentization ember interactivity: events, classes and state ember interactivity: footer functionality, conditional rendering routing in ember ember resources and troubleshooting vue getting started with vue creating our first vue component rendering a
list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo
list app dynamic behavior in svelte: working with variables and props ...
Introduction to cross browser testing - Learn web development
nd review the required featureset and what technologies you are going to use. for example, if the e-commerce site owner wants a webgl-powered 3d tour of each product built into the product pages, they will need to accept that this just won't work in ie versions before 11. you'd have to agree to provide a version of the site without this feature to users of older ie versions. you should compile a
list of the potential problem areas. note: you can find browser support information for technologies by looking up the different features on mdn — the site you're on! you should also consult caniuse.com, for some further useful details. once you've agreed on these details, you can go ahead and start developing the site. development now on to the development of the site. you should split the di...
...n a couple of stable browsers on your system, like firefox, safari, chrome, or ie/edge. do some lo-fi accessibility testing, such as trying to use your site with only the keyboard, or using your site via a screen reader to see if it is navigable. test on a mobile platform, such as android or ios. at this point, fix any problems you find with your new code. next, you should try expanding your
list of test browsers to a full
list of target audience browsers and start concentrating on weeding out cross browser issues (see the next article for more information on determining your target browsers). for example: try to test the latest change on all the modern desktop browsers you can — including firefox, chrome, opera, ie, edge, and safari on desktop (mac, windows, and linux, ideally). te...
...owsers). for example: try to test the latest change on all the modern desktop browsers you can — including firefox, chrome, opera, ie, edge, and safari on desktop (mac, windows, and linux, ideally). test it in common phone and tablet browsers (e.g. ios safari on iphone/ipad, chrome and firefox on iphone/ipad/android), also do tests in any other browsers you have included inside your target
list. the most lo-fi option is to just do all the testing you can by yourself (pulling in team mates to help out if you are working in a team). you should try to test it on real physical devices where possible. if you haven't got the means to test all those different browser, operating system, and device combinations on physical hardware, you can also make use of emulators (emulate a device using ...
Accessibility Features in Firefox
we are optimistic that jaws support will catch up this year. ...
...y pieces of text to the clipboard. the f7 key toggles this feature on/off. tabbed browsing helps keyboard users by putting all of the browsed documents in one firefox application window rather than cluttering the alt+tab order which makes keyboard navigation within the entire windows os much simpler. both history and bookmarks can be searched with a "quick search" field that quickly narrows the
list down via a substring search. bookmarks can have a keyword assigned to them which can be typed into the address bar to bring up the bookmark. a "smart keywords" feature enhances this even further by allowing custom searches from the command line such as "word punditry" to look up the word "punditry" in an online dictionary. these smart keywords can be setup via the context menu for the search fie...
...x will support topnotch screen reader accessibility on unix and linux. that's the great thing about the open firefox community model and source code license -- anyone can contribute, and everyone benefits. downloads, support and more information firefox information and downloads general online support and community forums accessibility newsgroup for users. can also be accessed as a mailing
list. accessibility compliance statement (section 508): http://www.mozilla.com/firefox/vpat.html ...
Accessibility/LiveRegionDevGuide
methods will need to be implemented that purge the queue based on one of the priority criterion. the "purge by timestamp" method will be used to remove old messages that are no longer deemed relevant while "purge by politeness" is used to satisfy the aria live politeness specification. the later method will be explained in detail below. event types the table for web page mutation event types
lists the two major event types associated with live regions, namely text-changed and object changed events. both will be discussed in detail below. object changed the object changed events are slightly different in at-spi and iaccessible2. in at-spi, the object changed event are called object:children-changed events because the event is triggered on the parent of the object. the actual object that...
...ged event is directly in the event object. the event.any_data field holds the entire text string while event.detail1 is the start index while event.detail2 is the text string length. in iaccessible2, iaccessibletext::get_oldtext and iaccessibletext::get_newtext are used to acquire the text and offsets. filtering events text changed events certain web page mutation events, such as adding to a
list, trigger both an object changed and a text changed event. both events should not be acted upon or double announcements would result. instead, all text changed events should be examined for the presence of an embed character. if one is present, the text changed event should be discarded because an object changed event will follow. filtering user actions this paragraph describes object properti...
...tion to minimize performance degradation by only acting on events that are truly live regions. these "non-live" events may be events originating from the chrome, user interaction in the chrome or document, document loading events, or real live region events from hidden tabs. with the goal of eliminating the "non-live" events, some sort of event filtering logic must be employed. the following is a
list of potential filtering techniques: the "event-from-input" object attribute can be used to filter events that were triggered by user action. the ":system" (or lack thereof) can be used to filter events that are system generated. (at-spi only) a global variable can be set in a document:load:complete event
listener and reset in a object:state-changed:busy
listener. this variable can then be used...
Index
found 689 pages: # page tags and summary 1 add-ons add-ons, extension, extensions, landing, mozilla add-ons allow developers to extend and modify the functionality of firefox. 675 creating an appealing add-on
listing add-ons, beginner, guide, webextension, publishing there are two essential steps to getting people to use your add-on: they need to discover your add-on and open the
listing page, then the
listing page needs to encourage them to click the add to firefox button. ...
...to extend and modify the functionality of firefox. 675 creating an appealing add-on
listing add-ons, beginner, guide, webextension, publishing there are two essential steps to getting people to use your add-on: they need to discover your add-on and open the
listing page, then the
listing page needs to encourage them to click the add to firefox button. the content you add to a
listing is therefore vital: from making effective use of keywords in your descriptions, to get visibility in external search engine results, through having an icon that attracts a user’s attention from a category
list, to screenshots that show how useful your add-on is. 676 index add-ons, glossary, guide, index found 689 pages: 677 signing and distributing your add-on...
... (amo), this doesn’t mean you can’t make money from browser extensions, and to a more limited extent themes. 679 promoting your extension or theme add-ons, extensions, promotion, themes, webextensions, distribution so you’ve written a great extension, but only a few people have found and installed it from addons.mozilla.org—despite your efforts to create an appealing
listing. so, how do you encourage more people to install your extension? this page looks at how. 680 resources for publishers add-ons, extensions, distribution, publication now your add-on is published on amo, check out the following resources: 681 retiring your extension extensions, webextension, end-of-life, publication there may be occasions where you want ...
Adding a new event
ng or retrieving something from dom tree. how to implement an internal event class if you're in case 1 (a simple dom event), you can skip this section. add event messages you need to add event messages which are stored by widgetevent::message. all messages are defined by macro in "messages" section of basicevents.h. define event class name you need to add an event class name in eventclass
list.h. use ns_event_class macro for adding it. the macro takes two arguments, aprefix and aname. aprefix defines prefix of event class name which should be widget or internal. widget should be used if the event class is dispatched from widget. otherwise, i.e., the event class is just used for internal event class of a dom event class, it should be internal. aname defines its event class specific n...
...t define construnctor in it. create xpcom interface for the dom event if your event class should be accessible via xpcom interface, you should create a new nsidomfooevent interface in dom/interfaces/events/. however, in these days, this is not necessary. ...
...instance. you need to modify this. the last half of it is the implementation of legacy event creator of javascript such as: var event = document.createevent("fooevent"); if you support this feature, you need to modify here. however, this feature shouldn't be implemented for compabitility with other browsers since web applications should use event constructor. register each event into eventname
list.h if you're in case 3, you can skip this section. eventname
list.h defines mapping between dom event name, internal event message, event handler attribute owner and internal event class. see the comments of the head of the file for the detail. modify tests if you're in case 3, you can skip this section. you need to modify test_all_synthetic_events.html which tests if calling getmodifierst...
Adding phishing protection data providers
installing a new data provider to install a data provider for phishing protection, it's necessary to set a series of preferences to provide details about the provider. each data provider has a unique id number. the data provider with the id number 0 is the default data provider shipped with firefox. when installing a new provider, you should use the next unused number. ...
...ces in the article adding preferences to an extension. required preferences browser.safebrowsing.provider.idnum.name a human-readable name for the data provider. browser.safebrowsing.provider.idnum.keyurl an url that returns a private key to be used for encrypting of other requests. browser.safebrowsing.provider.idnum.lookupurl the url to use to look up urls to see if they're block-
listed. this request must be encrypted using the private key returned by the keyurl request. optional preferences browser.safebrowsing.provider.idnum.reporturl an url used for reporting when users visit phishing pages and whether or not they decided to heed the warning or to ignore it. browser.safebrowsing.provider.idnum.updateurl an url used to request an updated
list of phishing sites. th...
...ed using the private key returned by the keyurl request. optional preferences browser.safebrowsing.provider.idnum.reporturl an url used for reporting when users visit phishing pages and whether or not they decided to heed the warning or to ignore it. browser.safebrowsing.provider.idnum.updateurl an url used to request an updated
list of phishing sites. the server either provides a full
list or incremental updates in order to bring the client's tables up to date. browser.safebrowsing.provider.idnum.reportgenericurl not currently used; intended for use in reporting other issues with the phishing protection service. browser.safebrowsing.provider.idnum.reporterrorurl an url to which the user is directed in order to report a safe page that is incorrectly being reported as a phi...
Testopia
and until we have time to do so. anyone wishing to help in this effort is more than welcome. ...
...dules: text::csv xml::schema validator xml::schema::parser (for importer) and json 2.10 todo user preferences notification emails more reports see the roadmap and bug
list for more details. ...
...arser (for importer) and json 2.10 todo user preferences notification emails more reports see the roadmap and bug
list for more details. ...
Chrome registration
versions of firefox will need to provide a fallback. for example: content packagename chrome/path/ content packagename chrome/path/ contentaccessible=yes os extensions (or themes) may offer different features depending on the operating system on which firefox is running. the value is compared to the value of os_target for the platform. os=winnt os=darwin see os_target for a more complete
list of os names. the os name is case insensitive. osversion an extension or theme may need to operate differently depending on which version of an operating system is running. for example, a theme may wish to adopt a different look on mac os x 10.5 than 10.4: osversion>=10.5 abi if a component is only compatible with a particular abi, it can specify which abi/os by using this directive. the v...
...this is very helpful when trying to write a chrome.manifest file as you can inspect where the files are being mapped from (jar files, local directory, etc.) old-style contents.rdf manifests before the plaintext manifests were introduced (which happened in firefox 1.5, toolkit 1.8), rdf manifests named "contents.rdf" were used to register chrome. this forma...
... the contents.rdf manifest format is no longer supported at all starting with gecko 1.9.2; add-ons already installed using this format will continue to work but can no longer be installed. be sure to remove your add-on and reinstall it to ensure that it installs correctly after updating it to use a plaintext manifest. official references for toolkit api official references. do not add to this
list without contacting benjamin smedberg. note that this page is included from the pages
listed below. so: don't add breadcrumbs! structure of an installable bundle: describes the common structure of installable bundles, including extensions, themes, and xulrunner applications extension packaging: specific information about how to package extensions theme packaging: specific information about how...
Configuring Build Options
a release build without extra debugging information; if you are a developer who wants to hack the source code, you probably want a non-optimized build with extra debugging macros. there are many options recognized by the configure script which are special-purpose options intended for embedders or other special situations, and should not be used to build the full suite/xul applications. the full
list of options can be obtained by running ./configure --help. warning: do not use a configure option unless you know what it does. the default values are usually the right ones. each additional option you add to your mozconfig file reduces the chance that your build will compile and run correctly. the following build options are very common: optimization ac_add_options --enable-optimize ...
...mpact compared to the --enable-debug option. you can make an optimized build with debugging symbols. see building firefox with debug symbols. extensions ac_add_options --enable-extensions=default|all|ext1,ext2,-skipext3 there are many optional pieces of code that live in extensions/. many of these extensions are now considered an integral part of the browsing experience. there is a default
list of extensions for the suite, and each app-specific mozconfig specifies a different default set. some extensions are not compatible with all apps, for example: cookie is not compatible with thunderbird typeaheadfind is not compatible with any toolkit app (firefox, thunderbird) unless you know which extensions are compatible with which apps, do not use the --enable-extensions option; the ...
...bber build, so pulling in new updates and rebasing is less time-consuming. example mozconfig files mozilla's official builds use mozconfig files from the appropriate directory within each repository. warning: these mozconfig files are taken from production builds and are provided as examples only. it is recommended to use the default build options, and only change the properties from the
list above as needed. the production builds aren't really appropriate for local builds. firefox, debugging build (mac os x 64bits) thunderbird, debugging build (linux 64 bits) building multiple applications from the same source tree it is possible to build multiple applications from the same source tree, as long as you use a different objdir for each application. you can either crea...
Creating Custom Events That Can Pass Data
t's it. the trunk you needed to download (or check out) the trunk source because you will have to modify it in order to implement your event. be aware that this means your stuff won't work with everyone else's version of firefox unless you get your patches into the trunk. at the time of writing the author is not aware of a way to do this that doesn't involve modifications to trunk. what follows a
list of the files you'll need to modify, as well as a discussion of each change. mozilla/dom/base/nsdomclassinfoclasses.h the change you make here is really rather small but it is incredibly important. if you peruse nsdomclassinfoclasses.h you'll see of
list of macros of the form domci_class(foo). you'll want to add an entry to it which looks like this: domci_class({truncated name}) here's the fun pa...
...riptable_flags) around line 2900: dom_classinfo_map_begin({truncated name}, nsidom{truncatedname}) dom_classinfo_map_entry(nsidom{truncated name}) dom_classinfo_event_map_entries dom_classinfo_map_end remember, {truncated name} is the same as above. mozilla/content/events/src/nseventdispatcher.cpp note: in the mozilla 1.8.x branch this code is actually in mozilla/content/events/src/nsevent
listenermanager.cpp this is quite an important file since this holds the createevent method which acts as a factory method dom events. the change you want to make is in nseventdispatcher::createevent(). you will find that there is a bunch of code like: if (aeventtype.lowercaseequalsliteral("{somethingsomething}event")) return ns_{somethingsomething}event(adomevent, aprescontext, nsnull); you can ei...
... createevent method which acts as a factory method dom events. the change you want to make is in nseventdispatcher::createevent(). you will find that there is a bunch of code like: if (aeventtype.lowercaseequalsliteral("{somethingsomething}event")) return ns_{somethingsomething}event(adomevent, aprescontext, nsnull); you can either have a function like this or write the code straight in nsevent
listenermanager::createevent() like this: if (aeventtype.lowercaseequalsliteral("nsmyevent")){ //note: the lowercase is important! nsdomevent* it = new nsdommyevent(aprescontext, aevent); if (nsnull == it) { return ns_error_out_of_memory; } return callqueryinterface(it, adomevent); } in general though i'd strongly recommend using a function the way that everyone else does. you can find th...
Displaying Places information using views
string) of the nsinavhistoryresultnode to select. convenience properties in addition to the methods above, some properties of convenience are implemented directly on the built-in tree view. warning: until bug 476952 is fixed, you may experience problems using some of these properties in conjunction with the place attribute and property. property type description flat
list boolean if true the view does not recurse into containers. the action to take when a container is toggled can be set via the onopenflatcontainer property. at least one of flat
list and showroot must be false. onopenflatcontainer string the body of function that will be called when a container is toggled. only applies if property flat
list is true. the function will be passed on...
...t will be called when a container is toggled. only applies if property flat
list is true. the function will be passed one nsinavhistoryresultnode argument named acontainer. you can queryinterface acontainer to an nsinavhistorycontainerresultnode. showroot boolean if true the root nsinavhistorycontainerresultnode is shown as the first row in the tree. at least one of showroot and flat
list must be false. example uses to get the nsinavhistoryresultnode at a specific row: var treeview = document.getelementbyid("myplacestreeview"); var rowindex = 0; var historyresultnode = treeview.view.nodefortreeindex(rowindex); to get the row index of a specific nsinavhistoryresultnode: var treeview = document.getelementbyid("myplacestreeview"); var rowindex = treeview.view.treeindexfor...
... note that the tree element above does not have the special type attribute common to the built-in views. it's just a regular tree element that you've hooked up to a places query, with none of the convenience properties or methods of the built-in places tree view. if your custom view is used only once in your application, code similar to the ...
Error codes returned by Mozilla APIs
an error will typically be displayed on the error console, but can be captured using a try-catch block in javascript. these constants can be accessed through components.results. for example, by using components.results.ns_error_not_initialized general errors the following errors are general and can occur when using any component. ns_error_not_initialized (0xc1f30001) an attempt was made to use a component or object which has not yet been initialized. these components usually provide an initialization method, often called init, which must be called before other methods are used. ...
... ns_error_proxy_invalid_out_parameter (0x80010011) ns_error_cannot_convert_data (0x80460001) ns_error_object_is_immutable (0x80460002) ns_error_loss_of_significant_data (0x80460003) ns_error_illegal_during_shutdown (0x8046001e) many operations cannot be performed once the application is being shutdown. this error will occur in this situation. file errors the following table
lists the errors that could occur when using files. while these errors can occur when using the file apis, they can also occur with other components that use files. ns_error_file_unrecognized_path (0x80520001) this error occurs when an attempt is made to set a path that isn't valid for the platform. for example, if a character in the path is not valid for a filename. in addition, this error may oc...
...t (0x804b0014) ns_error_ftp_login (0x804b0015) ns_error_ftp_cwd (0x804b0016) ns_error_ftp_pasv (0x804b0017) ns_error_ftp_pwd (0x804b0018) ns_error_not_resumable (0x804b0019) ns_error_invalid_content_encoding (0x804b001b) the content encoding of the source document was incorrect, for example returning a plain html document advertised as content-encoding: gzip ns_error_ftp_
list (0x804b001c) ns_error_unknown_host (0x804b001e) ns_error_redirect_loop (0x804b001f) ns_error_entity_changed (0x804b0020) ns_error_unknown_proxy_host (0x804b002a) ns_error_unknown_socket_type (0x804b0033) ns_error_socket_create_failed (0x804b0034) ns_error_cache_key_not_found (0x804b003d) ns_error_cache_data_is_stream (0x804b003e) ns_error_cache_data_is_not_stre...
Frame script environment
the frame script's global is a contentframemessagemanager, giving it the following environment: content the dom window of the content loaded in the browser. may be null (see below) docshell the nsidocshell associated with the browser. addevent
listener()
listen to events from content. removeevent
listener() stop
listening to events from content. addmessage
listener()
listen to messages from chrome. removemessage
listener() stop
listening to messages from chrome. sendasyncmessage() send an asynchronous message to chrome. sendsyncmessage() send a synchronous message to chrome. dump() print a message to the console. atob() base64 decode. btoa() base64 encode. ...
...ot work in a frame script. see limitations of frame scripts for more details. events besides the regular dom events being captured/bubbling up from content the current content object the following additional events get fired in a frame script environment: unload fires when the frame script environment is shut down, i.e. when a tab gets closed. if you use a capturing event
listener on the contentframemessagemanager, you should verify that its event.target is set to the contentframemessagemanager global object in order to avoid handling unload events from content. does not bubble. domwindowcreated fires when a new content object is created. this can be used if a framescript needs to interact with individual dom windows instead of simp...
...r on the contentframemessagemanager, you should verify that its event.target is set to the contentframemessagemanager global object in order to avoid handling unload events from content. does not bubble. domwindowcreated fires when a new content object is created. this can be used if a framescript needs to interact with individual dom windows instead of simply
listening for events bubbling up from content. another use is to interact with the content very early in the page load process, long before domcontentloaded event is fired. ...
Frame script environment
the frame script's global is a contentframemessagemanager, giving it the following environment: content the dom window of the content loaded in the browser may be null (see below) docshell the nsidocshell associated with the browser. addevent
listener()
listen to events from content. removeevent
listener() stop
listening to events from content. addmessage
listener()
listen to messages from chrome. removemessage
listener() stop
listening to messages from chrome. sendasyncmessage() send an asynchronous message to chrome. sendsyncmessage() send a synchronous message to chrome. dump() print a message to the console. atob() base64 decode. btoa() base64 encode. ...
...imitations of frame scripts for more details. events besides the regular dom events being captured/bubbling up from content the current content object the following additional events get fired in a frame script environment: unload bubbles no fires when the frame script environment is shut down, i.e. when a tab gets closed. ...
... another use is to interact with the content very early in the page load process, long before domcontentloaded event is fired. ...
Security best practices for Firefox front-end engineers
for chrome-privileged documents. this policy includes all dom apis that take a string and parse it into a dom tree. we use our built-in sanitizer with the following flags: sanitizerallowstyle sanitizerallowcomments sanitizerdropforms sanitizerlogremovals the sanitizer removes all scripts (script tags, event handlers) and form elements (form, input, keygen, option, optgroup, select, button, data
list). the canonical truth for the
list of white
listed elements is the source code. the last flag ensures that developers will identify and avoid the problems early on in the development cycle and before shipping the code. linter rules against unsanitized dom interaction the security assurance team maintains an eslint rule that disallows unsafe uses of innerhtml and similar dom apis. the linter m...
...that uses string literals that are hard coded in the source code, assuming benevolent developers. ...
...emplate 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. ...
mozbrowseropenwindow
or not. details read only object a custom object. details the details property returns an anonymous javascript object with the following properties: url a domstring representing the url of the document loaded within the frameelement property. name a domstring representing the name of the new browser window. ...
...ject. details the details property returns an anonymous javascript object with the following properties: url a domstring representing the url of the document loaded within the frameelement property. name a domstring representing the name of the new browser window. features a domstring containing features represented by a
list of names and values separated by commas. for a complete
list of possible features, see window.open(). ...
...a domstring representing the name of the new browser window. features a domstring containing features represented by a
list of names and values separated by commas. for a complete
list of possible features, see window.open(). frameelement an object representing the new browser <iframe> that will embed the new content. ...
MozBeforePaint
this computes the current position for the animating box and updates the box's position on screen, and, if the animation sequence is not yet complete, ...
...this computes the current position for the animating box and updates the box's position on screen, and, if the animation sequence is not yet complete, calls window.requestanimationframe() to schedule the next anim...
... you may take a look at this example live if you like. ...
Gecko
the layout engine developed by the mozilla project. it was originally named nglayout. gecko's function is to render web content, such as html, css, xul, javascript, and render it on the user's screen or print it. in xul-based applications gecko also renders the application's user interface. gecko is used in many applications, including a few browsers such as firefox and seamonkey (for a complete
list, please refer to wikipedia's article on gecko). products using the same version of gecko have identical support for web standards. documentation chrome this page contains information specific to browser chrome (not google chrome) code running in gecko. gecko faq frequently asked questions about gecko. gecko dom reference reference to ...
...ions about gecko. gecko dom reference reference to the dom. gecko event reference reference to events used within gecko and mozilla applications; for web-standard dom events, see the dom event reference. introduction to layout in mozilla tech talk on layout. embedding mozilla using gecko in your own application. ...
...in your own application. character sets supported by gecko a
list of the character sets supported by gecko. html parser threading description of multithreading in the html parser. gecko home page on mozillawiki home for the active developers. roadmaps and more up-to-date resources. ...
How to Report a Hung Firefox
here (source code). running this tool will search for firefox.exe and inject crashing code into it. the tool also has command-line options to kill processes with other names or by process id. run the crashfirefox.exe tool. the firefox crash report ui should appear. please check the box to send the crash report to mozilla start firefox. type "about:crashes" in the url bar and click on the top
listing. the crash report should look something like this report, which is an example of bug 1132241. create a new bug report at bugzilla.mozilla.org using this link. linux and mac on linux and mac (firefox >=27), sending sigabrt to a process will trigger the crash reporter. you can use any process monitoring tool to find the firefox process id (pid). then, in a terminal, kill firefox using a ...
...toring tool to find the firefox process id (pid). then, in a terminal, kill firefox using a command such as this: # replace 31042 with the pid of firefox found above kill -n sigabrt 31042 # on osx kill -s sigabrt 31042 the firefox crash report ui should appear. please check the box to send the crash report to mozilla start firefox. type "about:crashes" in the url bar and click on the top
listing. create a new bug report at bugzilla.mozilla.org using this link. all os as long as you do not need to be in firerfox's safe mode, a user friendly method of crashing firefox is to install and use the addon crash me now! (simple) use the menu button to find the crash me icon and click the icon. firefox crash report ui should appear. please check the box to send the crash report to mozi...
... os as long as you do not need to be in firerfox's safe mode, a user friendly method of crashing firefox is to install and use the addon crash me now! (simple) use the menu button to find the crash me icon and click the icon. firefox crash report ui should appear. please check the box to send the crash report to mozilla start firefox. type "about:crashes" in the url bar and click on the top
listing. create a new bug report at bugzilla.mozilla.org using this link. another way to trigger a crash in a hung tab is to run the following script in the browser console (opened after selecting the hung tab): let wm = cc["@mozilla.org/appshell/window-mediator;1"]. getservice(ci.nsiwindowmediator); let win = wm.getmostrecentwindow("navigator:browser"); let browser = win.gbrowser.select...
Implementing Download Resuming
that happen, get the entityid from the channel, and store it for later use. the entity id is what ensures that the file remains unchanged. this can also be used to check whether the download is resumable: if it is not (e.g. the server is not using http 1.1), then accessing this attribute will throw an ns_error_not_resumable exception. if the download gets interrupted, necko will call the stream
listener's onstoprequest method with a failure status. (todo: document what webbrowserpersist/exthandler do). the front-end code can then notify the user of this, and offer to resume the download. resuming a download in order to resume a download, you should create a channel as usual (using nsiioservice). then, you can check if it implements nsiresumablechannel. if it does not, the protocol does no...
...all resumeat with the desired start position, and the previously stored entity id. (it is possible to pass an empty string as the id; however, this means that you have no assurance that the file remained unchanged) now, you can open the channel as usual (using nsichannel.asyncopen() in the common case) and write to the file in the ondataavailable notifications. you may want to use nsisimplestream
listener to simplify this task; to get progress notifications, you can implement nsiprogresseventsink and set an interface requester as the notificationcallbacks of the channel that gives out such an event sink (this needs to be done before calling asyncopen). note: in versions of firefox prior to 3.0 alpha 7, nsiwebbrowserpersist cannot append to existing files (as opposed to overwriting them), and ...
... out such an event sink (this needs to be done before calling asyncopen). note: in versions of firefox prior to 3.0 alpha 7, nsiwebbrowserpersist cannot append to existing files (as opposed to overwriting them), and is therefore not usable for this task (see bug 129921). detecting when a file changed if the file changed (that is, the entity id does not match), then necko will notify the stream
listener with an ns_error_entity_changed error code. the front-end may want to offer the user to get the new file from scratch in such a case. resuming not supported in some cases, it's not possible to detect whether the server supports resuming until the user actually tries to resume. in such a case, the stream
listener will get an ns_error_not_resumable status. here, too, the front-end may want to...
Introduction to Layout in Mozilla
struction style resolution reflow painting setting up assume basic knowledge of embedding and network apis (doc shell, streams) content dll auto-registers a document loader factory (dlf) @mozilla.org/content-viewer-factory/view;1?type=text/html all mime types mapped to the same class, nscontentdlf nsdocshell receives inbound content via nsdsuricontent
listener invokes nsidlf::createinstance, passes mime type to dlf nscontentdlf creates a nshtmldocument object, invokes startdocumentload. creates a parser, returned as nsistream
listener back to the docshell creates a content sink, which is linked to the parser and the document creates a documentviewerimpl object, which is returned as ...
... creates a parser, returned as nsistream
listener back to the docshell creates a content sink, which is linked to the parser and the document creates a documentviewerimpl object, which is returned as nsicontentviewer back to the docshell documentviewerimpl creates pres context and pres shell content model construction content arrives from network via nsistream
listener::ondataavailable parser tokenizes & processes content; invokes methods on nsicontentsink with parser node objects some buffering and fixup occurs here opencontainer, closecontainer, addleaf content sink creates and attaches content nodes using nsicontent interface content sink maintains stack of “live” elements more buffering and fixup occurs her...
...notifications passes these to the style set object, who in turn passes to the frame constructor frame constructor creates frames constructframeinternal recursively walks content tree, resolves style and creates frames either created by tag (<select>) or by display type (<p>) frame manager maintains mapping from content to frame style resolution compute sty
listic information based on the style rules that apply for the frame’s content node style data broken into different structures display, visibility, font, color, background, … inherit vs. reset style context object is a placeholder for partially computed sty
listic data style data is computed lazily, as it is asked for reflow recursively compute geometr...
Bootstrapping a new locale
ion. make sure to have the directory where you intend to work as the current path on your terminal. (you should "cd" to the directory before beginning.) in the terminal, type the following command: $ hg clone http://hg.mozilla.org/releases/mozilla-x.x.x/ where "x.x.x" is the existing release branch version. for instance, for firefox 3.6, we use mozilla-1.9.2. refer to l10n:branches for the
list of all branches. if you are interested in localizing thunderbird 3, seamonkey 2 or other mozilla projects based on gecko 1.9.1 you'll need to follow the instructions on getting the source-code of the comm-central repository. create a bare-bones localization next, create a base localization. this is done by cloning the en-us (united states english) files into your localization. first, you sho...
...oice, type the following command in the same path from above (~/ab-cd/browser/chrome/browser) $ edit ab-cd/browser/chrome/browser/aboutcerterror.dtd read the top of the file to get any context on how to translate contained in the notes written by the developers or l10n-drivers. localization notes will look like this: <!-- localization notes... --> after the localization notes, you will see a
list of <!entity> strings like the following: <!entity certerror.pagetitle "untrusted connection"> you should go through each entity, translating the value in the parameters (e.g. untrusted connection in the example above), like so (example for polish): <!entity certerror.pagetitle "niezaufane poÅÄ
czenie"> once you have translated all the <!entity> strings in this file, you should save your w...
...ample for polish): <!entity certerror.pagetitle "niezaufane poÅÄ
czenie"> once you have translated all the <!entity> strings in this file, you should save your work and open the next .dtd or .property file. you will need to go through each and every file to in every directory in ab-cd. recommended order of localization for recommended order of localization, refer to the localization "phase
list" which provides a very rough guide on where to start and in what order to proceed through translation. the localization phase
lists (firefox 3.5: ff35.phase
list, firefox 3.6: ff36.phase
list). description of phases. land your translated files one by one, making sure it follows the *mozilla-1.9.2* structure. this will familiarize you with our "hg" commands and will get us something that we ...
Index
18 localization technical reviews guide, localization, mozilla this guide provides details on what a localization technical review is, what criteria are used for the technical reviews, and the process for requesting one and following its progress. 19 localization: frequently asked questions faq, guide, internationalization, localization, mozilla this page
lists tweaks and tips that may not require a complete page on its own. for more detailed documentation about localization in general, see our localization page. 20 localizing xliff files for ios oasis, translate, xliff, xml, ios firefox for ios uses the xliff xml-based file format to hold and transfer localization data. xliff (extensible localisation interchange file format) is a ...
...o aurora guide, localization, mozilla localizers who are working on l10n-central are responsible for getting their work onto the aurora repository. 34 web localizability internationalization, localizability, localization, web development localizability (or l12y for short) is a characteristic found in an application or content that enables localization. ...
...following
list contains links to pages that highlight steps that can be taken to make web content localizable. the documentation is divided into 4 parts: 35 creating localizable web applications internationalization, localizability, localization, web development an important step of developing a web application or creating web content is making sure that it can be localized.
listed below are good practices and recommendations that should be followed in order to make your content easily localizable. 36 creating localizable web apps no summary! 37 creating localizable web content internationalization, localizability, localization, web development no summary! 38 localization formats there are 4 main approaches ...
Mozilla Content Localized in Your Language
capitalization what is the appropriate form of expressing capitalization in your language? note: if this doens't apply, how is expressed in your language to indicate importance or name of a movie, book title, product uis (save, file...). hyphens and compounds what is the appropriate form of expressing hyphens and compounds in your language? note: if th...
... so with n/a. punctuation what is the appropriate form of expressing punctuation in your language? what are language specific puntuations used? even if there are same or similar punctuations, are they used differently than those in english. reference material on other languages can be found here. pluralization what is the appropriate form of expressing pluralization in your language? if yes,
list all forms of plural forms and examples if there is more than one. additional discussions can be found here. voice what is the appropriate form of expressing voice in your language? how should emphasis be made in your language? character styles how are bold, italics, underlines, etc. used to express certain concepts in your language? if these are not applicable styles, what are some of the c...
...ated or resolved through ellipsis. title on the final page (meaning no more click through) should allow enough room to display full text. buttons capitalize the first letter of each word. limit to one or two words. use verbs that precisely describe the button's action. for example, "cancel", "clear history", "add email", "select all", etc. value selector
lists capitalize the first letter of the first word and the first letter of any proper nouns. limit to one or two words. note: if this doesn't apply to your language, indicate so as n/a. articles -- avoid them articles (such as the word "the" in english) should be avoided wherever possible. user interface elements have limited space available for text. avoid...
Localizing with Pontoon
locale's project for you to get started. note that for our purposes here, we'll be using firefox affiliates website to demo pontoon's functionality and workflow. and there it is, opened inside pontoon: main toolbar as you can see, most of the interface is taken by the website being translated. only the toolbar on top belongs to pontoon, containing the following items (from left to right):
list of strings opens a sidebar with a
list of all strings to localize. project selector (affiliates) switches between projects to localize. resource selector (homepage) switches between project resources to localize, like subpages or localization files. hidden if no resources available for project. locale selector (slovenian) switches between languages to localize. go opens project-r...
...itches between languages to localize. go opens project-resource-locale selection. progress indicator displays your progress on the resource being localized. more details are available in the popup. user menu allows for user-specific tasks, like commiting to repository, downloading files and signing out. info menu gives important information, like the anticipated project timeline and a
list of keyboard shortcuts. alright, how about we do some translating now? translate strings when using pontoon for localization, you have a couple of options to translate your strings. you can translate in-context, out-of-context, or a combination of the two. we'll start with looking at in-context translation. in-context pontoon's in-context translation mode is what puts it above others. ...
...t text. click on it to enable the translate mode. replace the original text with its translation into your language. click the save button to save your translation. out-of-context some strings are impossible to translate in-context, e.g. the contents of the <title> tag in websites and strings with placeables or different plural forms. by clicking on the hamburger icon in the main toolbar, a
list of all strings and available translations will open in the sidebar. you can also use the sidebar for out-of-context localization: click on the string you'd like to translate. translation panel with original string and its details (e.g. comments) opens. translate the string in the translation area below. click the save button to save your translation. as you translate strings out-of-con...
Creating localizable web applications
note: most of the code snippets used in the examples below come from an early version of the getpersonas.com website. in some cases, the code snippets were slightly changed to better illustrate the recommendations or for clarity. cheatsheet don't hardcode english text, formats (numbers, dates, addresses, etc.), word order or sentence structure. don't put text or numbers in images. ...
...ght to left as well, making the last element in the html the first one to be displayed. separate urls from navigation sometimes, when the urls are well-designed, you may want to use the url to do something in the code depending on where the user is. take the url structure of the getpersonas.com website for example. the url http://getpersonas.com/nature/popular/2 points to the second page of the
listing of the popular personas in the "nature" category. you could easily use
list($category, $tab, $page) = explode('/', $path); to get this information directly from the url. after that, it is tempting to use the $category or $tab variables in the interface. however, this is problematic for localization. you probably don't want to localize the urls to keep them uniform across locales as well as to ...
...localizable english names used in the urls and the localizable english strings used in the interface. consider the following example: snippet 1. good: $tab_labels = array( "popular" => _('popular'), "recent" => _('recent'), "all" => _('all'), "my" => _('my'), "favorites" => _('favorites') );
list($category, $tab, $page) = explode('/', $path); if ($tab == 'popular') { // $tab is always english // .... echo $tab_labels($tab); // this will display the translation } indicate the language of the pages you link to indicate the language of the pages you link to if it is different from the user's current language. for english, add hreflang="en" to links to resources that ar...
MathML In Action
</mrow> </mfrac> </mrow> </mstyle> </math> </p> javascript content function zoomtoggle() { if (this.hasattribute("mathsize")) { this.removeattribute("mathsize"); } else { this.setattribute("mathsize", "200%"); } } function load() { document.getelementbyid("zoomablemath"). ...
... </math> </p> javascript content function zoomtoggle() { if (this.hasattribute("mathsize")) { this.removeattribute("mathsize"); } else { this.setattribute("mathsize", "200%"); } } function load() { document.getelementbyid("zoomablemath"). ...
... ...
Mozilla Quirks Mode Behavior
removed in firefox 50 (bug 648331). don't inherit font properties into tables except for font-family. make table borders gray rather than using the foreground color. collapse top margin of body and td and bottom margin of td. collapse the bottom or top margins of empty elements (bug 97361). ...
...removed in firefox 50 (bug 648331). don't inherit font properties into tables except for font-family. make table borders gray rather than using the foreground color. collapse top margin of body and td and bottom margin of td. collapse the bottom or top margins of empty elements (bug 97361). ...
...removed in firefox 50 (bug 648331). ...
BloatView
ber of bytes per instance times the number of objects leaked: (bytes per-inst) x (objects rem). use this number to look for the worst offenders. (should be zero!) objects total - the total count of objects allocated of a given class. objects rem - the number of objects allocated of a given class that weren't deleted. (should be zero!) interesting things to look for: are your classes in the
list? - look! if they aren't, then you're not using the ns_impl_addref and ns_impl_release (or ns_impl_isupports which calls them) for xpcom objects, or moz_count_ctor and moz_count_dtor for non-xpcom objects. not having your classes in the
list is not ok. that means no one is looking at them, and we won't be able to tell if someone introduces a leak. (see below for how to fix this.) the bytes leaked...
... occurs, it will trigger a test job failure. bloatview's output file can also show you where the leaked objects are allocated. ...
...ment variables, which may be more convenient in some cases: mach mochitest --setenv=xpcom_mem_log_classes=myclass [options] for getting allocation stacks in automation, you can add the appropriate --setenv options to the test configurations for the platforms you're interested in. those configurations are located in testing/mozharness/configs/. ...
Profile Manager
, profile manager will manage firefox profiles, but you can also use it to work with profiles of other xulrunner apps, like thunderbird or seamonkey. to use profile manager with an application other than firefox, you need to launch it using the application's name as an argument, for example: profilemanager-bin seamonkey profiles and application versions profile manager manages two different
lists: one of user profiles, and the other of application versions that can be used with the profiles. by default, this means it tracks a
list of firefox applications that are installed on your system, and a
list of profiles for use by firefox. an individual profile can be linked to a specific installation of firefox, so that version of firefox will be launched when that profile is selected. for ...
... be linked with a copy of firefox 3.6.10, while profileb might be linked with a copy of firefox 3.5.3. when launched, profile manager will look in some default locations for installed versions of firefox (or other application you're using profile manager with). additionally, you can manually add firefox versions by clicking the "manage firefox versions..." button: each firefox version in the
list has the following properties: path, version, and default. the default property indicates that this version of firefox will be used with profiles that don't have a specific application version associated with them. creating a profile to create a new profile, just click the new button from profile manager's toolbar. a dialog will appear that allows you to specify the profile's name, and opti...
...ve" from the toolbar's backup menu. you'll be prompted for a name and location for the archive. to create a profile from a profile archive: select "restore from->archive" from the toolbar's backup menu. you'll be prompted for the location of the archive, and then for the name of the profile you'd like to create from the archive. other operations context-clicking any profile in the profile
list will cause a popup menu to appear with the following commands: copy - makes a copy of the profile using a name and location of your choice. delete - deletes the profile, and all files associated with it. properties - shows a dialog that displays the profile's path and last-modified date. rename - allows you to specify a new name for the profile. version - allows you change the default appl...
A guide to searching crash reports
button, you will get results like the ones in the following screenshot. by default, the "signature facet" tab is selected. ("facet" is a term that means "group".) in these results, the found crash reports are grouped according to crash signature and ranked by group size. the columns show each group's rank, signature, size (both a count and a proportion of matching crash reports), and finally a
list of bugs that have been marked as relating to this signature. the numbers are large because this search matched all firefox crash reports from the past seven days. the first group has over 100,000 crash reports, which accounts for 7.77% of all matching crashes. this indicates there are over 1.3 million crash reports matching this search. you can reorder the groups in various ways by clicking on ...
...rash reports with that signature. the "add term" link in each "signature" column cell lets you perform a narrower subsequent search among crash reports with that signature. the links in each "bugs" column cell link to bug reports in bugzilla. the default search: crash reports if you switch to the "crash reports" tab you will see results like the ones in the following screenshot. this is a
list of all the individual crash reports that match the search criteria. if the number of matches is large -- in this case it exceeds 1.3 million, just as we saw in the "signature facet" tab -- the results will be spread across multiple pages, which you can visit by clicking the links at the top right of the tab. the links within the results do the following things. the link in each "crash id" col...
...he page's url. to become an expert at searching and grouping requires understanding the full range of the 100+ fields available for searching and grouping. one way to learn about them is to read lots of individual crash reports; note that all fields shown in the details tab of an individual crash report have a tool-tip that indicates its key for search. alternatively, you can browse the complete
list. there is also an api through which searches can be performed programmatically. see the api documentation for full details; note that it uses the term "aggregation" for grouping/faceting. ...
L20n HTML Bindings
a-l10n-id attribute on an html element to mark it as localizable. <p data-l10n-id="about"></p> notice that you don't have to put the text content in the html anymore (you still can if you want to). all content lives in the localization resources. a safe subset of html elements (e.g. em, sup), attributes (e.g. title) and entities can be used in translations. in addition to the pre-defined white
lists, any element found in the original source html is allowed in the translation as well. consider the following source html: <p data-l10n-id="save"> <input type="submit"> <a href="/main" class="btn-cancel"></a> </p> assume the following malicious translation: <save """ <input value="save" type="text"> or <a href="http://myevilwebsite.com" onclick="alert('pwnd!')" title="back t...
...ranslation: <save """ <input value="save" type="text"> or <a href="http://myevilwebsite.com" onclick="alert('pwnd!')" title="back to the homepage">cancel</a>. """> the result will be: <p data-l10n-id="back"> <input value="save" type="submit"> or <a href="/main" class="btn-cancel" title="back to the homepage">cancel</a>. </p> the input element is not on the default white
list but since it's present in the source html, it is also allowed in the translation. the value attribute is allowed on input elements, but type is not. similarly, href and onclick attributes are not allowed in translations and they are not inserted in the final dom. however, the title attribute is safe. it is important to note that applying translations doesn't replace dom elements, but only modifi...
... and they are not inserted in the final dom. however, the title attribute is safe. it is important to note that applying translations doesn't replace dom elements, but only modifies their text nodes and their attributes. this makes it possible to use l20n in conjunction with mvc frameworks. when all dom nodes are localized, the document element will fire a documentlocalized event, which you can
listen to: document.addevent
listener('documentlocalized', function() { // the dom has been localized and the user sees it in their language yourapp.init(); }); exposing context data you can expose important bits of data to the localization context in form of context data. <script type="application/l10n-data+json"> { "newnotifications": 3, "user": { "name": "jane", "gender": "femi...
PR_AcceptRead
acceptedsock a pointer to a pointer to a prfiledesc object. on return, *acceptedsock points to the prfiledesc object for the newly connected socket. ...
... acceptedsock a pointer to a pointer to a prfiledesc object. on return, *acceptedsock points to the prfiledesc object for the newly connected socket. ...
... acceptedsock a pointer to a pointer to a prfiledesc object. on return, *acceptedsock points to the prfiledesc object for the newly connected socket. this parameter is valid only if the function return does not indicate failure. ...
Getting Started With NSS
how to get involved with nss network security services (nss) is a base library for cryptographic algorithms and secure network protocols used by mozilla software. would you like to get involved and help us to improve the core security of mozilla firefox and other applications that make use of nss? we are looking forward to your contributions! we have a large
list of tasks waiting for attention, and we are happy to assist you in identifying areas that match your interest or skills. you can find us on mozilla irc in channel #nss or you could ask your questions on the mozilla.dev.tech.crypto newsgroup. the nss library and its supporting command line tools are written in the c programming language. its build system and the automated tests are based on makefiles and bash scripts. over ...
... you are welcome to download the samples via: hg clone https://hg.mozilla.org/projects/nss; cd nss; hg update samples_branch how to contribute ... (this section is still under construction, but there are many contribution opportunities) start by opening a bugzilla account at bugzilla.mozilla.org if you don't have one. nss :: libraries component for issues you'd like to work on. we maintain a
list of nss bugs marked with a keyword "good-first-bug" that you can view. creating your patch seee our section on nss sources, building, and testing to get started making your patch. when you're satisfied with it, you'll need code review. code review http://phabricator.services.mozilla.com/ is our code review tool, which uses your bugzilla account. use our phabricator user instructions to upload ...
...ng your patch seee our section on nss sources, building, and testing to get started making your patch. when you're satisfied with it, you'll need code review. code review http://phabricator.services.mozilla.com/ is our code review tool, which uses your bugzilla account. use our phabricator user instructions to upload patches for review. some items that will be evaluated during code review are
listed in check
list form on github. after passing review, your patch can be landed by a member of the nss team. you can find us on mozilla irc in channel #nss. note that we don't land code that isn't both reviewed and tested. code only works when it has tests, and tests only work when they're part of the automation. ...
4.3.1 Release Notes
release date: 2009-12-02 introduction network security services for java (jss) 4.3.1 is a minor release with the following new features: support for ssl3 & tls renegotiation vulnerablity support to explicitly set the key usage for the generated private key jss 4.3.1 is tri-licensed under mpl 1.1/gpl 2.0/lgpl 2.1. new in jss 4.3.1 a
list of bug fixes and enhancement requests were implemented in this release can be obtained by running this bugzilla query jss 4.3.1 requires nss 3.12.5 or higher. ssl3 & tls renegotiation vulnerability see cve-2009-3555 and us-cert vu#120541 for more information about this security vulnerability. all ssl/tls renegotiation is disabled by default in nss 3.12.5 and therefore will be disabled by default with jss 4.3.1. this will cause programs that attempt...
...of jss can be affected by the nss environment variables. platform information you can check out the source from cvs by cvs co -r jss_4_3_1_rtm jss jss 4.3.1 works with jdk versions 4 or higher we suggest the latest. jss 4.3.1 requires nss 3.12.5 or higher. jss 4.3.1 requires nspr 4.7.1 or higher. jss only supports the native threading model (no green threads). known bugs and issues for a
list of reported bugs that have not yet been fixed, click here. note that some bugs may have been fixed since jss 4.3.1 was released. compatibility jss 4.3.1 is backwards compatible with jss 4.2. applications compiled against jss 4.2 will work with jss 4.3.1. the 4.3.1 version of libjss4.so/jss4.dll must only be used with jss4.jar. in general, a jss jar file must be used with the jss shared library...
...the exact same release. ...
4.3 Release Notes
ces for java (jss) 4.3 is a minor release with the following new features: sqlite-based shareable certificate and key databases libpkix: an rfc 3280 compliant certificate path validation library pkcs11 needslogin method support hmacsha256, hmacsha384, and hmacsha512 support for all nss 3.12 initialization options jss 4.3 is tri-licensed under mpl 1.1/gpl 2.0/lgpl 2.1. new in jss 4.3 a
list of bug fixes and enhancement requests were implemented in this release can be obtained by running this bugzilla query jss 4.3 requires nss 3.12 or higher. new sqlite-based shareable certificate and key databases by prepending the string "sql:" to the directory path passed to configdir parameter for crypomanager.initialize method or using the nss environment variable nss_default_db_type. lib...
...://mxr.mozilla.org/mozilla/source/security/jss/ the run time behavior of jss can be affected by the nss environment variables. platform information jss 4.3 works with jdk versions 4 or higher we suggest the latest. jss 4.3 requires nss 3.12 or higher. jss 4.3 requires nspr 4.7.1 or higher. jss only supports the native threading model (no green threads). known bugs and issues for a
list of reported bugs that have not yet been fixed, click here. note that some bugs may have been fixed since jss 4.3 was released. compatibility jss 4.3 is backwards compatible with jss 4.2. applications compiled against jss 4.2 will work with jss 4.3. the 4.3 version of libjss4.so/jss4.dll must only be used with jss4.jar. in general, a jss jar file must be used with the jss shared library fr...
...act same release. ...
JSS
ewed at: http://www.dogtagpki.org/wiki/jss note: as much of the jss documentation is sorely out-of-date, updated information will be a work in progress, and many portions of any legacy documentation will be re-written over the course of time. stay tuned! legacy jss information can still be found at: source: https://hg.mozilla.org/projects/jss issues: https://bugzilla.mozilla.org/bug
list.cgi?product=jss wiki: /docs/mozilla/projects/nss/jss network security services for java (jss) is a java interface to nss. jss supports most of the security standards and encryption technologies supported by nss. jss also provides a pure java interface for asn.1 types and ber/der encoding. jss offers a implementation of java ssl sockets that uses nss's ssl/tls implementation rather tha...
... sunpkcs11 jce provider may do all that you need. note that java 1.5 claimed no fips compliance, and java 1.6 or higher needs to be used. a current limitation to the configured sunpkcs11-nss bridge configuration is if you add a pkcs#11 module to the nss database such as for a smartcard, you won't be able to access that smartcard through the sunpkcs11-nss bridge. if you use jss, you can easily get
lists of modules and tokens that are configured in the nss db and freely access all of it. documentation before you use jss, you should have a good understanding of the crypto technologies it uses. you might want to read these documents: introduction to public-key cryptography. explains the basic concepts of public-key cryptography that underlie nss and jss. introdu...
...source download binaries, source, and javadoc view the source online testing jss tests frequently asked questions jss faq information on jss planning can be found at wiki.mozilla.org, including: nss fips validation nss roadmap page community view mozilla cryptography forums... mailing
list newsgroup rss feed related topics security ...
NSS 3.12.6 release notes
nchors ssl_getnegotiatedhostinfo new enum for sni: sslsninametype (see sslt.h) new functions in cert.h certdistnames: duplicate distinguished name array. cert_distnamesfromcert
list: generate an array of distinguished names from a
list of certs. in ocsp.h cert_cacheocspresponsefromsidechannel: this function is intended for use when ocsp responses are provided via a side-channel, i.e. tls ocsp stapling (a.k.a. the status_request extension). in ssl.h ...
...new and revised documents available since the release of nss 3.11 include the following: build instructions nss shared db compatibility nss 3.12.6 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linke...
...tructions nss shared db compatibility nss 3.12.6 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.12.6 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions
listed in nss public functions will remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with mozilla.org bugzilla (product nss). ...
NSS 3.14.2 release notes
bug where, under certain circumstances, when applications supplied invalid/out-of-bounds parameters for aes encryption, a double free may occur. bug 813857 - modification of certificate trust flags from multiple threads is now a thread-safe operation. bug 618418 - c_decrypt/c_decryptfinal now correctly validate the pkcs #7 padding when present. ...
...st flags from multiple threads is now a thread-safe operation. bug 618418 - c_decrypt/c_decryptfinal now correctly validate the pkcs #7 padding when present. bug 807890 - added support for microsoft trust
list signing eku. bug 822433 - fixed a crash in dtls_freehandshakemessages. bug 823336 - reject invalid ldap aia uris sooner. bugs fixed in nss 3.14.2 https://bugzilla.mozilla.org/bug
list.cgi?
list_id=5502456;resolution=fixed;classification=components;query_format=advanced;target_milestone=3.14.2;product=nss compatibility nss 3.14.2 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.14.2 shared libraries without recompiling or relinking. furthermore, applications that restrict ...
...lassification=components;query_format=advanced;target_milestone=3.14.2;product=nss compatibility nss 3.14.2 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.14.2 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions
listed in nss public functions will remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with bugzilla.mozilla.org (product nss). ...
NSS 3.15.3 release notes
ug 934016 - (cve-2013-5605) handle invalid handshake packets bug 910438 - (cve-2013-5606) return the correct result in cert_verifycert on failure, if a verifylog isn't used new in nss 3.15.3 new functionality no new major functionality is introduced in this release. this release is a patch release to address cve-2013-1741, cve-2013-5605 and cve-2013-5606. ...
...if a verifylog isn't used new in nss 3.15.3 new functionality no new major functionality is introduced in this release. this release is a patch release to address cve-2013-1741, cve-2013-5605 and cve-2013-5606. bugs fixed in nss 3.15.3 bug 850478 -
list rc4_128 cipher suites after aes_128 cipher suites bug 919677 - don't advertise tls 1.2-only ciphersuites in a tls 1.1 clienthello a complete
list of all bugs resolved in this release can be obtained at https://bugzilla.mozilla.org/bug
list.cgi?resolution=fixed&classification=components&query_format=advanced&target_milestone=3.15.3&product=nss compatibility nss 3.15.3 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.15.3 shared librarie...
...classification=components&query_format=advanced&target_milestone=3.15.3&product=nss compatibility nss 3.15.3 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.15.3 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions
listed in nss public functions will remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with bugzilla.mozilla.org (product nss). ...
NSS 3.15.5 release notes
tions, ssl_enable_npn and ssl_enable_alpn, can be used to control whether npn or alpn (or both) should be used for application layer protocol negotiation. added the tls padding extension. the extension type value is 35655, which may change when an official extension type value is assigned by iana. nss automatically adds the padding extension to clienthello when necessary. added a new macro cert_
list_tail, defined in certt.h, for getting the tail of a certcert
list. notable changes in nss 3.15.5 bug 950129: improve the ocsp fetching policy when verifying ocsp responses bug 949060: validate the iov input argument (an array of priovec structures) of ssl_writev (called via pr_writev). applications should still take care when converting struct iov to priovec because the iov_len members of the ...
...policy when verifying ocsp responses bug 949060: validate the iov input argument (an array of priovec structures) of ssl_writev (called via pr_writev). applications should still take care when converting struct iov to priovec because the iov_len members of the two structures have different types (size_t vs. int). size_t is unsigned and may be larger than int. bugs fixed in nss 3.15.5 a complete
list of all bugs resolved in this release can be obtained at https://bugzilla.mozilla.org/bug
list.cgi?resolution=fixed&classification=components&query_format=advanced&target_milestone=3.15.5&product=nss compatibility nss 3.15.5 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.15.5 shared librarie...
...classification=components&query_format=advanced&target_milestone=3.15.5&product=nss compatibility nss 3.15.5 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.15.5 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions
listed in nss public functions will remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with bugzilla.mozilla.org (product nss). ...
NSS 3.15 release notes
pr_true notable changes in nss 3.15 secitem_reallocitem is now deprecated. please consider using secitem_reallocitemv2 in all future code. nss has migrated from cvs to the mercurial source control management system. updated build instructions are available at migration to hg as part of this migration, the source code directory layout has been re-organized. the
list of root ca certificates in the nssckbi module has been updated. the default implementation of ssl_authcertificate has been updated to add certificate status responses stapled by the tls server to the ocsp cache. applications that use ssl_authcertificatehook to override the default handler should add appropriate calls to ssl_peerstapledocspresponse and cert_cacheocspresponsefromsidec...
...d other ocsp caching behaviour. bug 853285: fixed bugs in aes gcm. bug 341127: fix the invalid read in rc4_wordconv. ...
...csp caching behaviour. bug 853285: fixed bugs in aes gcm. bug 341127: fix the invalid read in rc4_wordconv. faster nist curve p-256 implementation. ...
NSS 3.17.3 release notes
a program linked with older nss 3.x s...
...a program linked with older nss 3.x shared libraries will work with nss 3.17.3 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of ns...
...assification=components&query_format=advanced&product=nss&target_milestone=3.17.3 compatibility nss 3.17.3 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.17.3 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions
listed in nss public functions will remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with bugzilla.mozilla.org (product nss). ...
NSS 3.18.1 release notes
bution information the hg tag is nss_3_18_1_rtm. nss 3.18.1 requires nspr 4.10.8 or newer. nss 3.18.1 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_18_1_rtm/src/ new in nss 3.18.1 no new functionality is introduced in this release. this is a patch release to update the
list of root ca certificates. notable changes in nss 3.18.1 the following ca certificate had the websites and code signing trust bits restored to their original state to allow more time to develop a better transition strategy for affected sites. the websites and code signing trust bits were turned off in nss 3.18. but when firefox 38 went into beta, there was a huge spike in the number of certific...
...4b:b1:fd:99:41:34 the following intermediate ca certificate has been added as actively distrusted because it was misused to issue certificates for domain names the holder did not own or control. cn=mcsholding test, o=mcsholding, c=eg sha1 fingerprint: e1:f3:59:1e:76:98:65:c4:e4:47:ac:c3:7e:af:c9:e2:bf:e4:c5:76 the version number of the updated root ca
list has been set to 2.4 bugs fixed in nss 3.18.1 this bugzilla query returns all the bugs fixed in nss 3.18.1: https://bugzilla.mozilla.org/bug
list.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.18.1 compatibility nss 3.18.1 shared libraries are backward compatible with all older nss 3.18 shared libraries. a program linked with older nss 3.18...
...sification=components&query_format=advanced&product=nss&target_milestone=3.18.1 compatibility nss 3.18.1 shared libraries are backward compatible with all older nss 3.18 shared libraries. a program linked with older nss 3.18 shared libraries will work with nss 3.18.1 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions
listed in nss public functions will remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with bugzilla.mozilla.org (product nss). ...
NSS 3.18 release notes
a program linked with older nss 3.x shared li...
...a program linked with older nss 3.x shared libraries will work with nss 3.18 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis...
...xed&classification=components&query_format=advanced&product=nss&target_milestone=3.18 compatibility nss 3.18 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.18 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions
listed in nss public functions will remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with bugzilla.mozilla.org (product nss). ...
NSS 3.21 release notes
c...
... compatibility nss 3.21 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x sha...
...karthikeyan bhargavan from inria for responsibly disclosing the issue in bug 1158489. compatibility nss 3.21 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.21 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions
listed in nss public functions will remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with bugzilla.mozilla.org (product nss). ...
NSS 3.22 release notes
ith cipheralgtag and prfalgtag set to sec_oid_hmac_sha256, sec_oid_hmac_sha224, sec_oid_hmac_sha384, or sec_oid_hmac_sha512. enforce an external policy on nss from a config file (bug 1009429) you can now add a config= line to pkcs11.txt (assuming you are using sql databases), which will force nss to restrict the application to certain cryptographic algorithms and protocols. a complete
list can be found in nss config options. new functions in pk11pub.h pk11_signwithmechanism - this function is an extended version pk11_sign(). pk11_verifywithmechanism - this function is an extended version of pk11_verify(). these functions take an explicit mechanism and parameters as arguments rather than inferring it from the key type using pk11_mapsignkeytype(). the m...
...ssl.h ssl_enable_signed_cert_timestamps in sslt.h ssl_max_extensions is updated to 13 notable changes in nss 3.22 nss c++ tests are built by default, requiring a c++11 compiler. set the nss_disable_gtests variable to 1 to disable building these tests. bugs fixed in nss 3.22 this bugzilla query returns all the bugs fixed in nss 3.22: https://bugzilla.mozilla.org/bug
list.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.22 compatibility nss 3.22 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.22 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis...
...xed&classification=components&query_format=advanced&product=nss&target_milestone=3.22 compatibility nss 3.22 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.22 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions
listed in nss public functions will remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with bugzilla.mozilla.org (product nss). ...
NSS 3.23 release notes
ion for new serverrandom anti-downgrade mechanism. clients that perform a version downgrade (which is a dangerous practice) call this with the highest version number that they possibly support. this gives them access to the version downgrade protection from tls 1.3. notable changes in nss 3.23 the copy of sqlite shipped with nss has been updated to version 3.10.2 (bug 1234698) the
list of tls extensions sent in the tls handshake has been reordered to increase compatibility of the extended master secret with servers (bug 1243641) the build time environment variable nss_enable_zlib has been renamed to nss_ssl_enable_zlib (bug 1243872). the build time environment variable nss_disable_chachapoly was added, which can be used to prevent compilation of the chacha20/poly1305 code. t...
...245528 / cve-2016-1950 - fixed a heap-based buffer overflow related to the parsing of certain asn.1 structures. an attacker could create a specially-crafted certificate which, when parsed by nss, would cause a crash or execution of arbitrary code with the permissions of the user. bugs fixed in nss 3.23 this bugzilla query returns all the bugs fixed in nss 3.23: https://bugzilla.mozilla.org/bug
list.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.23 acknowledgements the nss development team would like to thank security researcher francis gabriel for responsibly disclosing the issue in bug 1245528. compatibility nss 3.23 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x ...
...urity researcher francis gabriel for responsibly disclosing the issue in bug 1245528. compatibility nss 3.23 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.23 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions
listed in nss public functions will remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with bugzilla.mozilla.org (product nss). ...
NSS 3.25 release notes
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. regression fix: nss no longer reports a failure if an application attempts to disable the ssl v2 protocol. the trusted ca certificate
list has been updated to version 2.8. the following ca certificate was removed cn = sonera class1 ca sha-256 fingerprint: cd:80:82:84:cf:74:6f:f2:fd:6e:b5:8a:a1:d5:9c:4a:d4:b3:ca:56:fd:c6:27:4a:89:26:a7:83:5f:32:31:3d the following ca certificates were added cn = hellenic academic and research institutions rootca 2015 sha-256 fingerprint: a0:40:92:9a:02:...
...a program linked with older nss 3.x shared libraries will work with nss 3.25 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis...
...xed&classification=components&query_format=advanced&product=nss&target_milestone=3.25 compatibility nss 3.25 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.25 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions
listed in nss public functions will remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with bugzilla.mozilla.org (product nss). ...
NSS 3.27 release notes
e handshake (ssl_namedgroupconfig). 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). although the maximum tls version enabled by default is still tls 1.2, there are applications that query the
list of tls protocol versions supported by nss, and enable all supported versions. for those applications, updating to nss 3.27 may result in tls 1.3 (draft) to be enabled. the tls 1.3 (draft) protocol can be disabled, by defining symbol nss_disable_tls_1_3 when building nss. npn can not be enabled anymore. hard limits on the maximum number of tls records encrypted with the same key are enfo...
...a program linked with older nss 3.x shared libraries will work with nss 3.27 shared libraries without recompiling or relinking. applications that restrict their use of nss apis to the func...
...esolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.27 compatibility nss 3.27 shared libraries are backwards compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.27 shared libraries without recompiling or relinking. 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. feedback bugs discovered should be reported by filing a bug report with bugzilla.mozilla.org (product nss). ...
NSS 3.28.1 release notes
bution information the hg tag is nss_3_28_1_rtm. nss 3.28.1 requires nspr 4.13.1 or newer. nss 3.28.1 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_28_1_rtm/src/ new in nss 3.28.1 no new functionality is introduced in this release. this is a patch release to update the
list of root ca certificates, and address a minor tls compatibility issue, that some applications experienced with nss 3.28. notable changes in nss 3.28.1 the following ca certificates were removed cn = buypass class 2 ca 1 sha-256 fingerprint: 0f:4e:9c:dd:26:4b:02:55:50:d1:70:80:63:40:21:4f:e9:44:34:c9:b0:2f:69:7e:c7:10:fc:5f:ea:fb:5e:38 cn = root ca generalitat valen...
... bugs fixed in nss 3.28.1 bug 1296697 - december 2016 batch of root ca changes bug 1322496 - internal error assert when the other side closes connection before reading eoed compatibility nss 3.28.1 shared libraries are backward compatible with al...
...- internal error assert when the other side closes connection before reading eoed compatibility nss 3.28.1 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.28.1 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions
listed in nss public functions will remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with bugzilla.mozilla.org (product nss). ...
NSS 3.31 release notes
read safe way. new functions in cert.h cert_getcertisperm - retrieve the permanent storage status attribute of a certificate in a thread safe way. cert_getcertistemp - retrieve the temporary storage status attribute of a certificate in a thread safe way. in pk11pub.h pk11_findcertfromuri - find a certificate identified by the given uri. pk11_findcertsfromuri - find a
list of certificates identified by the given uri. pk11_getmoduleuri - retrieve the uri of the given module. pk11_gettokenuri - retrieve the uri of a token based on the given slot information. in pkcs11uri.h pk11uri_createuri - create a new pk11uri object from a set of attributes. pk11uri_destroyuri - destroy a pk11uri object. pk11uri_formaturi - format a pk11uri object to a str...
...oding of domain name constraints extensions created by certutil nss supports a clean seeding mechanism for *nix systems now using only /dev/urandom. this is used only when seed_only_dev_urandom is set at compile time. cert_asciitoname can handle oids in dotted decimal form now. bugs fixed in nss 3.31 this bugzilla query returns all the bugs fixed in nss 3.31: https://bugzilla.mozilla.org/bug
list.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.31 compatibility nss 3.31 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.31 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis...
...xed&classification=components&query_format=advanced&product=nss&target_milestone=3.31 compatibility nss 3.31 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.31 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions
listed in nss public functions will remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with bugzilla.mozilla.org (product nss). ...
NSS 3.33 release notes
verified implementation of curve25519 on 64-bit systems. the compile time flag disable_ecc has been removed. when nss is compiled without nss_force_fips=1 startup checks are no longer performed. fixes cve-2017-7805, a potential use-after-free in tls 1.2 server, when verifying client authentication. various minor improvements and correctness fixes. new in nss 3.33 new functionality when
listing an nss database, using certutil -l, and the database hasn't yet been initialized with any non-empty or empty password, the text "database needs user init" will be included in the
listing. when using certutil to set an inacceptable password in fips mode, a correct explanation of acceptable passwords will be printed. new functions in cert.h cert_findcertbyissuerandsncx - a variation...
...nss_securememcmpzero - check if a memory region is all zero in constant time. port_zallocaligned - allocate aligned memory. port_zallocalignedoffset - allocate aligned memory for structs. in ssl.h ssl_getexperimentalapi - access experimental apis in libssl. bugs fixed in nss 3.33 this bugzilla query returns all the bugs fixed in nss 3.33: https://bugzilla.mozilla.org/bug
list.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.33 compatibility nss 3.33 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.33 shared libraries, without recompiling, or relinking. furthermore, applications that restrict their use of nss ap...
...d&classification=components&query_format=advanced&product=nss&target_milestone=3.33 compatibility nss 3.33 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.33 shared libraries, without recompiling, or relinking. furthermore, applications that restrict their use of nss apis to the functions
listed in nss public functions will remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with bugzilla.mozilla.org (select product 'nss'). ...
NSS 3.34.1 release notes
removed in nss 3.34, but now re-added with only the email trust bit set. (bug 1418678) cn = certum ca, o=unizeto sp. z o.o. sha-256 fingerprint: d8:e0:fe:bc:1d:b2:e3:8d:00:94:0f:37:d2:7d:41:34:4d:99:3e:73:4b:99:d5:65:6d:97:78:d4:d8:14:36:24 removed entries from certdata.txt for actively distrusted certificates that have expired (bug 1409872). ...
...1:34:4d:99:3e:73:4b:99:d5:65:6d:97:78:d4:d8:14:36:24 removed entries from certdata.txt for actively distrusted certificates that have expired (bug 1409872). the version of the ca
list was set to 2.20. 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/bug
list.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. a program linked with older nss 3.x shared libraries will work with nss 3.34 shared libraries, without recompiling, or relinking. furthermore, applications that restrict their use of ns...
...assification=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. a program linked with older nss 3.x shared libraries will work with nss 3.34 shared libraries, without recompiling, or relinking. furthermore, applications that restrict their use of nss apis to the functions
listed in nss public functions will remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with bugzilla.mozilla.org (select product 'nss'). ...
NSS 3.34 release notes
2 sha-256 fingerprint: d4:87:a5:6f:83:b0:74:82:e8:5e:96:33:94:c1:ec:c2:c9:e5:1d:09:03:ee:94:6b:02:c3:01:58:1e:d9:9e:16 cn = ca wosign ecc root sha-256 fingerprint: 8b:45:da:1c:06:f7:91:eb:0c:ab:f2:6b:e5:88:f5:fb:23:16:5c:2e:61:4b:f8:85:56:2d:0d:ce:50:b2:9b:02 libfreebl no longer requires sse2 instructions. new in nss 3.34 new functionality when
listing an nss database. using certutil -l, and the database hasn't yet been initialized with any non-empty or empty password, the text "database needs user init" will be included in the
listing. when using certutil, to set an inacceptable password in fips mode, a correct explanation of acceptable passwords will be printed. sslkeylogfile is now supported with tls 1.3, see bug 1287711 for details. s...
...hen the session is resumed, and pr_false otherwise. rsa-pss signatures are now supported on certificates. certificates with rsa-pss or rsa-pkcs#1v1.5 keys can be used to create an rsa-pss signature on a certificate, using the --pss-sign argument to certutil. new functions bugs fixed in nss 3.34 this bugzilla query returns all the bugs fixed in nss 3.34: https://bugzilla.mozilla.org/bug
list.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. a program linked with older nss 3.x shared libraries will work with nss 3.34 shared libraries, without recompiling, or relinking. furthermore, applications that restrict their use of nss ap...
...d&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. a program linked with older nss 3.x shared libraries will work with nss 3.34 shared libraries, without recompiling, or relinking. furthermore, applications that restrict their use of nss apis to the functions
listed in nss public functions will remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with bugzilla.mozilla.org (select product 'nss'). ...
NSS 3.37 release notes
with nss 3.37, this alternative implementation for linux/unix can be selected in "make" builds by defining the environment variable nss_seed_only_dev_urandom. with nss 3.37, this alternative implementation for linux has been enhanced to use the glibc function getentropy(), instead of reading from /dev/urandom directly, if the build and runtime linux platform supports it. the ca certificates
list was updated to version 2.24. the following ca certificates were removed: cn = s-trust universal root ca sha-256 fingerprint: d8:0f:ef:91:0a:e3:f1:04:72:3b:04:5c:ec:2d:01:9f:44:1c:e6:21:3a:df:15:67:91:e7:0c:17:90:11:0a:31 cn = tc trustcenter class 3 ca ii sha-256 fingerprint: 8d:a0:84:fc:f9:9c:e0:77:22:f8:9b:32:05:93:98:06:fa:5c:b8:11:e1:c8:13:f6:a1:08:c7:d3:...
...a program linked with older nss 3.x shared libraries will work with nss 3.37 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis...
...xed&classification=components&query_format=advanced&product=nss&target_milestone=3.37 compatibility nss 3.37 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.37 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions
listed in nss public functions will remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with bugzilla.mozilla.org (product nss). ...
NSS 3.39 release notes
ber from rfc 8446. previous versions of nss accepted an rsa pkcs#1 v1.5 signature where the digestinfo structure was missing the null parameter. starting with version 3.39, nss requires the encoding to contain the null parameter. the tstclnt and selfserv test utilities no longer accept the -z parameter, as support for tls compression was removed in a previous nss version. the ca certificates
list was updated to version 2.26. the following ca certificates were added: ou = globalsign root ca - r6 sha-256 fingerprint: 2cabeafe37d06ca22aba7391c0033d25982952c453647349763a3ab5ad6ccf69 cn = oiste wisekey global root gc ca sha-256 fingerprint: 8560f91c3624daba9570b5fea0dbe36ff11a8323be9486854fb3f34a5571198d the following ca certificate was rem...
...a program linked with older nss 3.x shared libraries will work with nss 3.39 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis...
...xed&classification=components&query_format=advanced&product=nss&target_milestone=3.39 compatibility nss 3.39 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.39 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions
listed in nss public functions will remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with bugzilla.mozilla.org (product nss). ...
NSS 3.52 release notes
sion objects in ckfw. bug 1629105 - add pkcs11 v3.0 functions to module debug logger. bug 1626751 - fix error in generation of fuzz32 docker image after updates. bug 1625133 - fix implicit declaration of function 'getopt' error. bug 1624864 - allow building of gcm-arm32-neon on non-armv7 architectures. bug 1624402 - fix compilation error in firefox android. bug 1624130 - require ck_function_
list structs to be packed. bug 1624377 - fix clang warning for unknown argument '-msse4'. bug 1623374 - support new pkcs #11 v3.0 message interface for aes-gcm and chachapoly. bug 1623184 - fix freebl_cpuid for querying extended features. bug 1622555 - fix argument parsing in lowhashtest. bug 1620799 - introduce nss_disable_gcm_arm32_neon to build on arm32 without neon support. bug 1619102 - add...
...kefile build produced extraneous object files. bug 1619959 - properly handle multi-block seed ecb inputs. bug 1630925 - guard all instances of nsscmssigneddata.signerinfo to avoid a cms crash bug 1571677 - name constraints validation: cn treated as dns name even when syntactically invalid as dns name this bugzilla query returns all the bugs fixed in nss 3.52: https://bugzilla.mozilla.org/bug
list.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.52 compatibility nss 3.52 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.52 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis...
...xed&classification=components&query_format=advanced&product=nss&target_milestone=3.52 compatibility nss 3.52 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.52 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions
listed in nss public functions will remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with bugzilla.mozilla.org (product nss). ...
NSS 3.54 release notes
uthority - g4 sha-256 fingerprint: 363f3c849eab03b0a2a0f636d7b86d04d3ac7fcfe26a0a9121ab9795f6e176df bug 1618402 - verisign class 3 public primary certification authority - g3 sha-256 fingerprint: eb04cf5eb1f39afa762f2bb120f296cba520c1b97db1589565b81cb9a17b7244 a number of certificates had their email trust bit disabled. see bug 1618402 for a complete
list. bugs fixed in nss 3.54 bug 1528113 - use arm cryptography extension for sha256. bug 1603042 - add tls 1.3 external psk support. bug 1642802 - add uint128 support for hacl* curve25519 on windows. bug 1645186 - add "certsign root ca g2" root certificate. bug 1645174 - add microsec's "e-szigno root ca 2017" root certificate. bug 1641716 - add microsoft's non-ev root certificates. bug 162...
...sl_exportearlykeyingmaterial with external psks. bug 1643557 - fix numerous compile warnings in nss. bug 1644774 - ssl gtests to use clearservercache when resetting self-encrypt keys. bug 1645479 - don't use secitem_makeitem in secutil.c. bug 1646520 - stricter enforcement of asn.1 integer encoding. this bugzilla query returns all the bugs fixed in nss 3.54: https://bugzilla.mozilla.org/bug
list.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.54 compatibility nss 3.54 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.54 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis...
...xed&classification=components&query_format=advanced&product=nss&target_milestone=3.54 compatibility nss 3.54 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.54 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions
listed in nss public functions will remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with bugzilla.mozilla.org (product nss). ...
NSS Developer Tutorial
types (char16_t and char32_t). nss source should only include ascii text. escape non-printing characters (with \x if there is no special escape such as \r, \n, and \t) and avoid defining string literals that use non-ascii characters. one line comments starting with // are permitted. check with nss-dev@ before using a language feature not already used, if you are uncertain. please update this
list if you do. these restrictions are different for c++ unit tests, which can use most c++11 features. the mozilla c++ language features guide, and the chromium c++ usage guide,
list c++ features that are known to be widely available and compatible. you should limit features to those that appear in both guides. ask on nss-dev@ if you think this is restrictive, or if you wish to prohibit a specific ...
...new members to an exported struct at the end. opaque structs give us complete freedom to change them, but require applications to call nss functions, to allocate and free them. enums the numeric values of public enumerators cannot be changed. to stress this fact, we often explicitly assign numeric values to enumerators, rather than relying on the values assigned by the compiler. symbol export
lists the manifest.mn file, in a directory in the nss source tree, specifies which headers are public, and which headers are private. public headers are in the exports variable. private headers,which may be included by files in other directories, are in the private_exports variable. private headers, that are only included by files in the same directory, are not
listed in either variable. ...
....mn file, in a directory in the nss source tree, specifies which headers are public, and which headers are private. public headers are in the exports variable. private headers,which may be included by files in other directories, are in the private_exports variable. private headers, that are only included by files in the same directory, are not
listed in either variable. only functions
listed in the symbol export
lists (nss.def, ssl.def, smime.def, etc.) are truly public functions. unfortunately, public headers may declare private functions, for historical reasons. the symbol export
lists are the authoritative source of public functions. behavioral changes bug/quirk compatible: occasionally we cannot fix a bug, because applications may depend on the buggy behavior. we would need t...
NSS tools : cmsutil
ryption, on cryptographic message syntax (cms) messages. synopsis cmsutil [options] arguments description the cmsutil command-line uses the s/mime toolkit to perform basic operations, such as encryption and decryption, on cryptographic message syntax (cms) messages. to run cmsutil, type the command cmsutil option [arguments] where option and arguments are combinations of the options and arguments
listed in the following section. each command takes one option. each option may take zero or more arguments. to see a usage string, issue the command without options. options and arguments options options specify an action. option arguments modify an action. the options and arguments for the cmsutil command are defined as follows: -d decode a message. -c encrypt a message. -e envelope a message. -o cr...
...sage (decode only). -i infile use infile as a source of data (default is stdin). -n nickname specify nickname of certificate to sign with (sign only). -n suppress output of contents (decode only). -o outfile use outfile as a destination of data (default is stdout). -p include an s/mime capabilities attribute. -p password use password as key database password. -r recipient1,recipient2, ... specify
list of recipients (email addresses) for an encrypted or enveloped message. for certificates-only message,
list of certificates to send. -t suppress content in cms message (sign only). -u certusage set type of cert usage (default is certusageemailsigner). -y ekprefnick specify an encryption key preference by nickname. usage encrypt example cmsutil -c [-i infile] [-o outfile] [-d dbdir] [-p password] -...
...ntained in conjunction with pki and security-related projects through mozilla dn fedora. the most closely-related project is dogtag pki, with a project wiki at [1]http://pki.fedoraproject.org/wiki/. for information specifically about nss, the nss project wiki is located at [2]http://www.mozilla.org/projects/security/pki/nss/. the nss site relates directly to nss code changes and releases. mailing
lists: pki-devel@redhat.com and pki-users@redhat.com irc: freenode at #dogtag-pki authors the nss tools were written and maintained by developers with netscape and now with red hat. authors: elio maldonado <emaldona@redhat.com>, deon lackey <dlackey@redhat.com>. copyright (c) 2010, red hat, inc. licensed under the gnu public license version 2. references visible links 1. http://pki.fedoraproject.org/w...
sslcrt.html
escapes a special character $ matches the end of the string [abc] matches one occurrence of a, b, or c. the only character that needs to be escaped in this is ], all others are not special. [a-z] matches any character between a and z [^az] matches any character except a or z ~ followed by another shell expression removes any pattern matching the shell expression from the match
list (foo|bar) matches either the substring foo or the substring bar. these can be shell expressions as well. cert_checkcertvalidtimes checks whether a specified time is within a certificate's validity period. syntax #include <cert.h> #include <certt.h> seccerttimevalidity cert_checkcertvalidtimes( certcertificate *cert, int64 t); parameters this function has the following para...
...period. for more information, see the nspr header pr_time.h. returns the function returns an enumerator of type seccerttimevalidity: typedef enum { seccerttimevalid, seccerttimeexpired, seccerttimenotvalidyet } seccerttimevalidity; nss_cmpcertchainwcanames determines whether any of the signers in the certificate chain for a specified certificate are on a specified
list of ca names. syntax #include <nss.h> secstatus nss_cmpcertchainwcanames( certcertificate *cert, certdistnames *canames); parameters this function has the following parameters: cert a pointer to the certificate structure for the certificate whose certificate chain is to be checked. canames ...
... nss_cmpcertchainwcanames( certcertificate *cert, certdistnames *canames); parameters this function has the following parameters: cert a pointer to the certificate structure for the certificate whose certificate chain is to be checked. canames a pointer to a structure that contains a
list of distinguished names (dns) against which to check the dns for the signers in the certificate chain. returns the function returns one of these values: if successful, secsuccess. if unsuccessful, secfailure. use pr_geterror to obtain the error code. manipulating certificates cert_dupcertificate cert_destroycertificate cert_dupcertificate makes a shallow copy ...
S/MIME functions
the mozilla cross reference (mxr) link for each function provides access to the function definition, prototype definition, and source code references. the nss version column indicates which versions of nss support the function. ...
...encode mxr 3.8 and later nss_cmsrecipientinfo_getcertandkey mxr 3.8 and later nss_cmsrecipientinfo_unwrapbulkkey mxr 3.7.2 and later nss_cmsrecipientinfo_wrapbulkkey mxr 3.7.2 and later nss_cmssigneddata_addcertchain mxr 3.2 and later nss_cmssigneddata_addcert
list mxr 3.2 and later nss_cmssigneddata_addcertificate mxr 3.2 and later nss_cmssigneddata_adddigest mxr 3.2 and later nss_cmssigneddata_addsignerinfo mxr 3.2 and later nss_cmssigneddata_create mxr 3.2 and later nss_cmssigneddata_createcertsonly mxr 3...
...fo_addsmimeenckeyprefs mxr 3.2 and later nss_cmssignerinfo_addsigningtime mxr 3.2 and later nss_cmssignerinfo_create mxr 3.2 and later nss_cmssignerinfo_createwithsubjkeyid mxr 3.6 and later nss_cmssignerinfo_destroy mxr 3.2 and later nss_cmssignerinfo_getcert
list mxr 3.2 and later nss_cmssignerinfo_getsignercommonname mxr 3.2 and later nss_cmssignerinfo_getsigneremailaddress mxr 3.2 and later nss_cmssignerinfo_getsigningcertificate mxr 3.2 and later nss_cmssignerinfo_getsigningtime mxr 3.2 and later nss_cmssignerinfo_...
Utility functions
the mozilla cross reference (mxr) link for each function provides access to the function definition, prototype definition, and source code references. the nss version column indicates which versions of nss support the function. ...
... mxr 3.9.3 and later secmod_candeleteinternalmodule mxr 3.5 and later secmod_createmodule mxr 3.4 and later secmod_deletemodule mxr 3.4 and later secmod_findmodule mxr 3.4 and later secmod_findslot mxr 3.4 and later secmod_freemodulespec
list mxr 3.4 and later secmod_getdbmodule
list mxr 3.9 and later secmod_getdeadmodule
list mxr 3.9 and later secmod_getmodulespec
list mxr 3.4 and later secmod_hasremovableslots mxr 3.9.3 and later secmod_ismodulepresent mxr 3.2 and later ...
....4 and later secmod_lookupslot mxr 3.2 and later secmod_pubcipherflagstointernal mxr 3.4 and later secmod_pubmechflagstointernal mxr 3.4 and later secmod_unloadusermodule mxr 3.4 and later secmod_updatemodule mxr 3.4 and later secmod_updateslot
list mxr 3.9.3 and later secmod_waitforanytokenevent mxr 3.9.3 and later secoid_addentry mxr 3.10 and later secoid_comparealgorithmid mxr 3.2 and later secoid_copyalgorithmid mxr 3.2 and later secoid_destroyalgorithmid mxr 3.2 and later ...
NSS tools : cmsutil
ic message syntax (cms) messages. synopsis cmsutil [options] arguments description the cmsutil command-line uses the s/mime toolkit to perform basic operations, such as encryption and decryption, on cryptographic message syntax (cms) messages. to run cmsutil, type the command cmsutil option [arguments] where option and arguments are combinations of the options and arguments
listed in the following section. each command takes one option. each option may take zero or more arguments. to see a usage string, issue the command without options. options and arguments options options specify an action. option arguments modify an action. the options and arguments for the cmsutil command are defined as follows: -d decode a message. -c ...
... specify nickname of certificate to sign with (sign only). -n suppress output of contents (decode only). -o outfile use outfile as a destination of data (default is stdout). -p include an s/mime capabilities attribute. -p password use password as key database password. -r recipient1,recipient2, ... specify
list of recipients (email addresses) for an encrypted or enveloped message. for certificates-only message,
list of certificates to send. -t suppress content in cms message (sign only). -u certusage set type of cert usage (default is certusageemailsigner). -y ekprefnick specify an encryption key preference by nickname. usage enc...
...on with pki and security-related projects through mozilla dn fedora. the most closely-related project is dogtag pki, with a project wiki at [1]http://pki.fedoraproject.org/wiki/. for information specifically about nss, the nss project wiki is located at [2]http://www.mozilla.org/projects/security/pki/nss/. the nss site relates directly to nss code changes and releases. mailing
lists: pki-devel@redhat.com and pki-users@redhat.com irc: freenode at #dogtag-pki authors the nss tools were written and maintained by developers with netscape and now with red hat. authors: elio maldonado <emaldona@redhat.com>, deon lackey <dlackey@redhat.com>. copyright (c) 2010, red hat, inc. licensed under the gnu public license version 2. references visible links 1...
Necko Interfaces Overview
resource once) download initiated via nsichannel::asyncopen method can be canceled via nsirequest::cancel method at anytime after invocation of asyncopen method nsiprotocolhandler a service that manages a protocol, identified by it's uri scheme (eg. ...
...ges a protocol, identified by it's uri scheme (eg. ...
... ...
Necko walkthrough
l::loaduri(string) create nsiuri from string nsdocshell::loaduri(nsiuri) creates 2 nsiinputstream for read response from; passes them with uri to ... nsdocshell::internalload nsdocshell::douriload opens the nsichannel for the uri (ns_newchannel) if "http:", it will be an nsihttpchannel nsdocshell::dochannelload nsuriloader::openuri passes an nsistream
listener pointer, 'loader' to nsuriloader::openchannel - it creates an nsdocumentopeninfo object, which implements nsistream
listener, i.e. has onstartrequest, onstoprequest, ondataavailable, the three functions in which channel responses are received asynchronously. nshttpchannel::asyncopen called from openuri; openchannel isn't named the best, since the opening happens in the context of o...
...best, since the opening happens in the context of openuri, its calling function. this is where it hits necko code. but the interface for clients of necko is important to consider: send request uri helps creates channel setup channel (headers, request data, response callback...) channel->asyncopen. receive response get a callback to each of these: nsistream
listener::onstartrequest (header info) nsistream
listener::ondataavailable (data in single or multiple chunks) nsistream
listener::onstoprequest (no more data from http) this all happens on the main thread, in a non-blocking fashion: make your request on the main thread, then carry on and get the async response later, also on the main thread. there is an option to receive ondat...
...e connection manager on the socket thread. and in that function it created a proxy callback because it wished to have oninputstreamready called on the main thread. back on the main thread: nsinputstreampump::oninputstreamready this function in turn calls nsinputstreampump::onstatestart, nsinputstreampump::onstatetransfer and nsinputstreampump::onstatestop. these functions call nsistream
listener::onstartrequest, nsistream
listener::ondataavailable and nsistream
listener::onstoprequest respectively. and that brings us back to the nshttpchannel api and nsdocshell gets its data. ...
Garbage collection
s can share an arena. objects from different zones cannot be stored in the same arena. a zone remains alive as long as any js heap objects in the zone are alive. chunk a chunk is the largest internal unit of memory allocation. a chunk is 1mb and contains arenas, padding, the mark bitmap (chunkbitmap), a bitmap of decommitted arenas, and a chunk header (chunkinfo). the chunkinfo contains a
list of unallocated arenas, starting at chunkinfo::freearenashead and linked through arenaheader::next. the chunkinfo also contains some basic stats, such as the number of free arenas. arena an arena is an internal unit of memory allocation. an arena is one page (4096 bytes on almost all platforms) and contains an arenaheader, a few pad bytes, and then an array of aligned elements. all elements in ...
...hrough arenaheader::next. the chunkinfo also contains some basic stats, such as the number of free arenas. arena an arena is an internal unit of memory allocation. an arena is one page (4096 bytes on almost all platforms) and contains an arenaheader, a few pad bytes, and then an array of aligned elements. all elements in an arena have the same allocation kind and size. every arena maintains a
list of free spans, starting at arenaheader::firstfreespanoffets. the last cell in each free span (except the last one) holds a freespan for the next free span. free span struct freespan represents a contiguous sequence of free cells [first,last] within an arena. freespan contains functions to allocate from the free span. mark bitmap the mark bitmap is represented by chunkbitmap. the mark bitmap ...
...eeds a read barrier for weak references (see dictionary). this is because weak references have a similar problem as is solved by the incremental write barrier above, but cannot use the same solution. by definition, a weak reference should not hold a target live by itself. that means that we can't trace weak references when we encounter them during gc graph traversal. instead, we append them to a
list. after marking everything live we scan through the
list to null out references to garbage. but this also means that pre-barriers are inadequate to prevent incremental gc from missing edges due to graph mutation. live cells will be marked either because they're reachable or because they were marked by a pre-barrier before being removed from the graph. but reachable weak references aren't traced! ...
JSAPI User Guide
pport for multiple jscontexts per jsruntime will be removed in the future. if your application creates multiple runtimes, the application may need to know which runtime a context is associated with. in this case, use js_getruntime. use js_setcontextprivate and js_getcontextprivate to associate application-specific data with a context. initializing built-in and global js objects for a complete
list of built-in objects provided by spidermonkey, see js_initstandardclasses. the global object that an application provides to scripts largely determines what those scripts can do. for example, the firefox browser uses its own global object, window. to change the global object for your application, call js_setglobalobject. creating and initializing custom objects in addition to using the engine's...
...o security fixes are deployed as soon as they are available. unless you also regularly deploy spidermonkey security updates, a determined hacker could use publicly known bugs in the engine to attack your application. note that the kind of attack we're talking about here is where a hacker uses javascript to attack the c++ code of the engine itself (or your embedding). the rest of the items in this
list talk about security issues that arise within javascript itself, even if the engine is working properly. block simple denial-of-service attacks - a program like while(true){} should not hang your application. to stop execution of scripts that run too long, use js_setoperationcallback. likewise, a function like function f(){f();} should not crash your application with a stack overflow. to block th...
...t decide what security policy to enforce for each of these checks.) implement one or more jsprincipals objects in your application. you need one jsprincipals object for each different set of privileges that a script might have. when compiling or executing code, use the jsapi functions that attach principals to the compiled code. these functions have forprincipals in the name. they are
listed below. the purpose of using these functions is to ensure that your access check callbacks have accurate information about who is trying to access an object. function purpose js_compilescriptforprincipals, js_compileucscriptforprincipals, js_compilefilehandleforprincipals compile a script with security information. (to execute a compiled scr...
JS_AddArgumentFormatter
ge allocated by the caller, which is typically a string constant. if format is in dynamic storage, the caller must keep the string alive until js_removeargumentformatter is called. js_removeargumentformatter removes any conversion functions associated with format. callback syntax jsbool (*jsargumentformatter)(jscontext *cx, const char *format, jsbool fromjs, jsval **vpp, va_
list *app); name type description cx jscontext * the context in which the conversion is being performed. format const char * the tail of the format string whose prefix is associated with this formatting function. fromjs jsbool js_true if the conversion function should convert from jsval values to c values; js_false if the conversion function...
...nst char * the tail of the format string whose prefix is associated with this formatting function. fromjs jsbool js_true if the conversion function should convert from jsval values to c values; js_false if the conversion function should convert from c values to jsval values. vpp jsval ** in-out parameter. a pointer into an array of jsval values. app va_
list * in-out parameter. a pointer to an argument pointer, used to retrieve pointers to c values. callback description the conversion function should return true on success, and return false after reporting an error or detecting an already-reported error. for a given format string, for example "aa", the formatter is called from js_convertargumentsva like so: formatter(cx, "aa...", js_true, &s...
... callback description the conversion function should return true on success, and return false after reporting an error or detecting an already-reported error. for a given format string, for example "aa", the formatter is called from js_convertargumentsva like so: formatter(cx, "aa...", js_true, &sp, &ap); sp points into the arguments array on the js stack, while ap points into the stdarg.h va_
list on the c stack. the js_true passed for fromjs tells the formatter to convert zero or more jsvals at sp to zero or more c values accessed via pointers-to-values at ap, updating both sp (via *vpp) and ap (via *app) to point past the converted arguments and their result pointers on the c stack. when called from js_pushargumentsva, the formatter is invoked thus: formatter(cx, "aa...", js_false, &sp, ...
JS_PushArguments
e is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. convert any number of arguments to jsvals and store the resulting jsvals in an array. syntax jsval * js_pusharguments(jscontext *cx, void **markp, const char *format, ...); jsval * js_pushargumentsva(jscontext *cx, void **markp, const char *format, va_
list ap); name type description cx jscontext * the context in which to perform any necessary conversions. cx also affects the interpretation of format, if js_addargumentformatter has been called. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. markp void ** out parameter. on success, *markp receives th...
...affects the interpretation of format, if js_addargumentformatter has been called. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. markp void ** out parameter. on success, *markp receives the internally allocated stack mark which should be passed to js_poparguments. format const char * null-terminated string holding a
list of format types to convert the following arguments to. ... various (in js_pusharguments) a variable number of arguments to be converted to jsvals. there must be one argument for each argument described in format. ap va_
list (in js_pushargumentsva) the
list of arguments to be converted to jsvals. there must be one argument for each argument described in format. the ty...
...it is defined in <stdarg.h>. ...
SpiderMonkey 1.8.5
le with previous releases, nor is it source-code compatible. many jsapi types, functions, and callback signatures have changed, though most of them still have the same names and do the same things. applications will need significant changes, but most of those changes will be detected by the c/c++ compiler, so they are easy to detect and updating the code is a fairly straightforward job. here is a
list of the most significant changes. previous versions of spidermonkey supported two types of native functions: jsnative and jsfastnative. all support for the slow native function type has been removed, and the fast signature has been renamed to jsnative. embeddings that defined jsnatives in previous versions must update all those functions to the new signature. getters and setters of type jsprope...
...d. strings js_comparestrings received a new function signature with bug 609440, allowing us to correctly propagate exceptions when the underlying functions to retrieve the characters in the string failed. additionally, js_newstring, js_getstringbytes, and js_getstringchars were removed, replaced by fallible interfaces like js_getstringcharszandlength and js_encodestringtobuffer (not an exhaustive
list). numbers spidermonkey 1.8.5 now stores integers up to 32-bits in the jsval. this means that the int_fits_in_jsval macro is always returns true (be careful to only use this macro with jsints, not 64-bit integers). the jsval now also stores jsdoubles directly, rather than storing them on the heap. the jsval_to_double and double_to_jsval macros have been updated to work directly on jsdoubles rathe...
... aware that mozilla has no plans to keep the jsapi, nor the jsdbgapi stable for embedders. we have chosen to concentrate on performance and correctness as primary concerns instead. the team is considering the removal of tinyids js_threadsafe is going away, with future versions supporting only thread-safe builds a new debugging api is on the way to replace jsd. release notes errata this is a
list of changes which need to be made to the release notes asap. feel free to fix any problems you spot -- this is a wiki! jsxdrapi changes were missed jsstrictpropertyop for setters (affects jsclass) - maybe general notes about es5 strict mode changes in jsapi tricks like argv[-2] not guaranteed to work any more; is js_callee or similar instead ...
SpiderMonkey 1.8.7
le with previous releases, nor is it source-code compatible. many jsapi types, functions, and callback signatures have changed, though most of them still have the same names and do the same things. applications will need significant changes, but most of those changes will be detected by the c/c++ compiler, so they are easy to detect and updating the code is a fairly straightforward job. here is a
list of the most significant changes. xxx is there anything here? these and other changes are explained in detail below. new javascript language features xxx needs updating javascript 1.8.5 adds support for ecmascript edition 5, including es5 strict mode. for details, see new in javascript 1.8.5. note that there are a very small number of incompatibilities between es5 and and es3, the version of e...
...d. strings js_comparestrings received a new function signature with bug 609440, allowing us to correctly propagate exceptions when the underlying functions to retrieve the characters in the string failed. additionally, js_newstring, js_getstringbytes, and js_getstringchars were removed, replaced by fallible interfaces like js_getstringcharszandlength and js_encodestringtobuffer (not an exhaustive
list). numbers spidermonkey 1.8.5 now stores integers up to 32-bits in the jsval. this means that the int_fits_in_jsval macro is always returns true (be careful to only use this macro with jsints, not 64-bit integers). the jsval now also stores jsdoubles directly, rather than storing them on the heap. the jsval_to_double and double_to_jsval macros have been updated to work directly on jsdoubles rath...
... aware that mozilla has no plans to keep the jsapi, nor the jsdbgapi stable for embedders. we have chosen to concentrate on performance and correctness as primary concerns instead. the team is considering the removal of tinyids js_threadsafe is going away, with future versions supporting only thread-safe builds a new debugging api is on the way to replace jsd. release notes errata this is a
list of changes which need to be made to the release notes asap. feel free to fix any problems you spot -- this is a wiki! jsxdrapi changes were missed jsstrictpropertyop for setters (affects jsclass) - maybe general notes about es5 strict mode changes in jsapi tricks like argv[-2] not guaranteed to work any more; is js_callee or similar instead ...
SpiderMonkey 1.8.8
le with previous releases, nor is it source-code compatible. many jsapi types, functions, and callback signatures have changed, though most of them still have the same names and do the same things. applications will need significant changes, but most of those changes will be detected by the c/c++ compiler, so they are easy to detect and updating the code is a fairly straightforward job. here is a
list of the most significant changes. a significant number of typedefs of built-in types, or of types which are now standardized, have been removed. these and other changes are explained in detail below. new javascript language features javascript 1.8.8 includes significant updates to language features, yo. typedef changes many types have been removed from the jsapi and replaced with simpler altern...
...needed for older versions of visual studio. in the long run we anticipate removing the environment variable-based overriding when we drop support for versions of visual studio prior to 2010. in the meantime moz_custom_stdint_h is intended to function as a bridge to always using the standard header. for more information on the fixed-size integer types changes, see this blog post. new c apis ...
list and link to new apis here... new c++ helpers while jsapi remains a c api, the engine is now implemented in c++. some c++ helpers have been introduced into the api, to help embedders writing c++ projects. please note that spidermonkey reserves the js:: namespace for itself. ...
list new c++ helpers here... obsolete apis ...
list obsolete methods/structs/apis here... deleted apis js_get_cla...
... aware that mozilla has no plans to keep the jsapi, nor the jsdbgapi stable for embedders. we have chosen to concentrate on performance and correctness as primary concerns instead. the team is considering the removal of tinyids js_threadsafe is going away, with future versions supporting only thread-safe builds a new debugging api is on the way to replace jsd. release notes errata this is a
list of changes which need to be made to the release notes asap. feel free to fix any problems you spot -- this is a wiki! don't add anything here -- this is for after the release notes are completed. :-) ...
SpiderMonkey 17
le with previous releases, nor is it source-code compatible. many jsapi types, functions, and callback signatures have changed, though most of them still have the same names and do the same things. applications will need significant changes, but most of those changes will be detected by the c/c++ compiler, so they are easy to detect and updating the code is a fairly straightforward job. here is a
list of the most significant changes. a significant number of typedefs of built-in types, or of types which are now standardized, have been removed. these and other changes are explained in detail below. new javascript language features javascript 17 includes significant updates to language features, yo. typedef changes many types have been removed from the jsapi and replaced with simpler alternati...
...needed for older versions of visual studio. in the long run we anticipate removing the environment variable-based overriding when we drop support for versions of visual studio prior to 2010. in the meantime moz_custom_stdint_h is intended to function as a bridge to always using the standard header. for more information on the fixed-size integer types changes, see this blog post. new c apis ...
list and link to new apis here... new c++ helpers while jsapi remains a c api, the engine is now implemented in c++. some c++ helpers have been introduced into the api, to help embedders writing c++ projects. please note that spidermonkey reserves the js:: namespace for itself. ...
list new c++ helpers here... obsolete apis ...
list obsolete methods/structs/apis here... deleted apis js_get_cla...
...primary concerns instead. the team is considering the removal of tinyids js_threadsafe is going away, with future versions supporting only thread-safe builds a new debugging api is on the way to replace jsd. in the future every api is going to take handles instead of raw pointers. exact stack rooting is requirement for a (moving) generational garbage collector. release notes errata this is a
list of changes which need to be made to the release notes asap. feel free to fix any problems you spot -- this is a wiki! don't add anything here -- this is for after the release notes are completed. :-) ...
SpiderMonkey 24
le with previous releases, nor is it source-code compatible. many jsapi types, functions, and callback signatures have changed, though most of them still have the same names and do the same things. applications will need significant changes, but most of those changes will be detected by the c/c++ compiler, so they are easy to detect and updating the code is a fairly straightforward job. here is a
list of the most significant changes. many of the garbage collector changes require type signature changes to jsapi methods: specifically introducing js::rooted, js::handle, and js::mutablehandle types. these types, with the appropriate parametrizations, can roughly be substituted for plain types of gc things (values, string/object pointers, etc.). these and other changes are explained in detail...
...og post. new c apis js_getarrayprototype provides access to the original value of array.prototype. new c++ helpers while jsapi remains a c api, the engine is now implemented in c++. some c++ helpers have been introduced into the api, to help embedders writing c++ projects. please note that spidermonkey reserves the js:: namespace for itself (and the js:: namespace for internal use). ...
list new c++ helpers here... obsolete apis ...
list obsolete methods/structs/apis here... deleted apis js_get_class (use js_getclass instead) js_enumerateresolvedstandardclasses js_getglobalobject js_setcstringsareutf8 ...
list other deleted apis... api changes break out and discuss all api changes here... jsoption_strict has been renamed to jsoption_extra_warnings. js_setversion has ...
...are that mozilla has no plans to keep the jsapi, nor the jsdbgapi stable for embedders. we have chosen to concentrate on performance and correctness as primary concerns instead. the team is considering the removal of tinyids js_threadsafe is going away, with future versions supporting only thread-safe builds a new debugging api is on the way to replace jsd. release notes errata this is a
list of changes which need to be made to the release notes asap. feel free to fix any problems you spot -- this is a wiki! don't add anything here -- this is for after the release notes are completed. :-) ...
SpiderMonkey 31
location. the js::handle<js::value> and js::mutablehandle<js::value> classes have been specialized to implement the same interface as js::value, for simplicity and to ease migration pain. changes to introduce handles to the jsapi are not individually documented, because of the breadth of the changes involved. the following features in earlier versions of spidermonkey have been dropped. xxx
list removed features here spidermonkey 31 is not binary-compatible with previous releases, nor is it source-code compatible. 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. applications will need significant changes, but most of those changes will be detected by th...
...e compatible. 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. applications will need significant changes, but most of those changes will be detected by the c/c++ compiler, so they are easy to detect and updating the code is a fairly straightforward job. here is a
list of the most significant changes: many of the garbage collector changes require type signature changes to jsapi methods: specifically introducing js::rooted, js::handle, and js::mutablehandle types. these types, with the appropriate parametrizations, can roughly be substituted for plain types of gc things (values, string/object pointers, etc.). the jsbool type has been removed, along with the...
...re plans... spidermonkey embedders should be aware that mozilla has no plans to keep the jsapi, nor the jsdbgapi stable for embedders. we have chosen to concentrate on performance and correctness as primary concerns instead. js_threadsafe is going away, with future versions supporting only thread-safe builds a new debugging api is on the way to replace jsd. release notes errata this is a
list of changes which need to be made to the release notes asap. feel free to fix any problems you spot -- this is a wiki! don't add anything here -- this is for after the release notes are completed. :-) ...
SpiderMonkey 38
location. the js::handle<js::value> and js::mutablehandle<js::value> classes have been specialized to implement the same interface as js::value, for simplicity and to ease migration pain. changes to introduce handles to the jsapi are not individually documented, because of the breadth of the changes involved. the following features in earlier versions of spidermonkey have been dropped. xxx
list removed features here spidermonkey 38 is not binary-compatible with previous releases, nor is it source-code compatible. 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. applications will need significant changes, but most of those changes will be detected by th...
...e compatible. 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. applications will need significant changes, but most of those changes will be detected by the c/c++ compiler, so they are easy to detect and updating the code is a fairly straightforward job. here is a
list of the most significant changes: .... these and other changes are explained in detail below. new javascript language features javascript 38 includes significant updates to language features, yo. new c++ apis jsapi is now a c++-only api. please note that spidermonkey reserves the js:: namespace for itself (and the js:: namespace for internal use). js::clonefunctionobject (bug 1088228) ...
...e plans... spidermonkey embedders should be aware that mozilla has no plans to keep the jsapi, nor the jsdbgapi, stable for embedders. we have chosen to concentrate on performance and correctness as primary concerns instead. js_threadsafe is going away, with future versions supporting only thread-safe builds a new debugging api is on the way to replace jsd. release notes errata this is a
list of changes which need to be made to the release notes asap. feel free to fix any problems you spot -- this is a wiki! don't add anything here -- this is for after the release notes are completed. :-) ...
Signing Mozilla apps for Mac OS X
terminal window. the main options of note are: -s your-signing-identity lets you specify the signing certificate you want to sign the application with your-signing-identity is the name of your certificate. --keychain /path/to/keychain lets you specify which keychain contains the signing certificate specified by your-signing-identity, rather than allowing the codesign to search the keychain
list. the path specified must be a full path; it's usually something similar to /users/username/library/keychains/keychain-name.keychain. --resource-rules /path/to/coderesources specifies a file to use when generating the rules to be applied to the code signing. when you're signing mozilla applications with v1 signatures, you'll need to specify a custom coderesources file here. -f forces codesign ...
...fier requirement if you do this, or otherwise you need to sign the outer application again with the identifier requirement. --requirement 'designated requirement' adds additional requirements for verifying the signature and application metadata. at a minimum you'll need to provide: identifier: this must be the same as the value of the cfbundleidentifier specified in your application's info.p
list file. leaf[subject.ou]: this needs to be the subject ou of your developer id. you can find it by running this command in the terminal: openssl x509 -text -noout -inform der -in devloperid_application.cer | grep subject putting it all together, you'll wind up using a command similar to the one below to sign your app. you'll of course need to change the signing id, keychain, bundle path, and r...
...nces, the codesign command may display a popup asking for the password for the specified keychain. once the application has been signed, the signature of an application bundle can be validated by calling: codesign -vvvv application.app where application.app is the application bundle you wish to validate. the folder will fail to validate if any of these cases occur (there may be other cases not
listed here): if any files that were included in the signature have been removed or modified if any files have been added to a folder that should have all files signed the coderesources file this file is located in your application's bundle at contents/_codesignature/coderesources. if you don't provide one, codesign will automatically generate it. however, to modify apple's automatic signing pr...
ROLE_ROW
« gecko roles page represents a row of cells within a table. also, see role_table. ...
... « gecko roles page represents a row of cells within a table. also, see role_table. ...
... « gecko roles page represents a row of cells within a table. also, see role_table. ...
Places utilities for JavaScript
string apostdata); boolean showaddlivemarkui(nsiuri afeeduri, nsiuri asiteuri, string atitle, string adescription, int adefaultinsertionpoint, boolean ashowpicker); boolean showminimaladdlivemarkui(nsiuri afeeduri, nsiuri asiteuri, string atitle, string adescription, int adefaultinsertionpoint, boolean ashowpicker); boolean showminimaladdmultibookmarkui(array nsiuri auri
list); boolean showbookmarkproperties(int aid); boolean showfolderproperties(int aid); boolean showaddfolderui(string atitle, int adefaultinsertionpoint, boolean ashowpicker); array object getannotationsforuri(nsiuri auri); array object getannotationsforitem(int aitemid); void setannotationsforuri(nsiuri auri, object aannos); void setannot...
...rom the default places stringbundle. getstring() string getstring(string key) parameters key the name of the string to get. return type returns a string from the default places stringbundle. nodeis() there are a ton of nodeis(something) functions in here to check properties of a bookmark node. the all take in the same argument and return a boolean true or false, so i'm just going to
list them all in one lump: boolean nodeisfolder(anode) determines whether or not a resultnode is a bookmark folder or not. boolean nodeisbookmark(anode) determines whether or not a resultnode represents a bookmarked uri. boolean nodeisseparator(anode) determines whether or not a resultnode is a bookmark separator. boolean nodeisvisit(anode) determines whether or not a resultnode is a visit i...
... atitle, adescription, adefaultinsertionpoint, ashowpicker) see showaddlivemarkui for a description of the params. showminimaladdmultibookmarkui() show an "add bookmarks" dialog to allow the adding of a folder full of bookmarks corresponding to the objects in the uri
list. this will be called most often as the result of a "bookmark all tabs..." command. showaddmultibookmarkui(auri
list) parameters auri
list list of nsiuri objects representing the locations to be bookmarked. return type return true if any transaction has been performed. showbookmarkproperties() opens the bookmark properties panel for a given bookmark identifier. showbookmarkproperties(...
extIPreferenceBranch
erence get(in astring aname) nsivariant getvalue(in astring aname, in nsivariant adefaultvalue) void setvalue(in astring aname, in nsivariant avalue) void reset() attributes attribute type description root readonly attribute astring the name of the branch root. all readonly attribute nsivariant array of extipreference
listing all preferences in this branch. events readonly attribute extievents the events object for the preferences supports: "change" methods has() check to see if a preference exists. boolean has(in astring aname) parameters aname the name of preference return value true if the preference exists, false if not get() gets an object representing a preference extipref...
...eturn value reset() resets all preferences in a branch back to their default values. note: this function has not been implemented and will raise an exception. ...
...ee bug 481044 void reset() parameters return value examples var myext = application.extensions.get('myapplicationid'); function myfunc (event) { application.console.log('change!'); }; myext.prefs.get("myprefname").events.add
listener("change", myfunc); see also fuel (firefox), steel (thunderbird) and smile (seamonkey) known issues bug 488587 - function registered as fuel preference
listener not always called ...
XPCOM changes in Gecko 2.0
all existing xpcom components will need to be updated to support this. however, it's very easy to do, and you can actually support both types of registration for backward compatibility. component manifests all component registration is now handled through manifest files. for extensions, this is the same chrome.manifest currently used to register chrome. xpt files the path of any xpt files must be
listed explicitly in a manifest using an interfaces directive: interfaces components/mycomponent.xpt javascript components the registration information for javascript components is no longer located in the component itself; instead, it's located in the manifest. the component is loaded only when the xpcom component manager needs to create a component. chrome.manifest: # the {classid} here must match t...
...** * xpcomutils.generatensgetfactory was introduced in mozilla 2 (firefox 4, seamonkey 2.1). * xpcomutils.generatensgetmodule was introduced in mozilla 1.9 (firefox 3.0). */ if (xpcomutils.generatensgetfactory) var nsgetfactory = xpcomutils.generatensgetfactory([mycomponent]); else var nsgetmodule = xpcomutils.generatensgetmodule([mycomponent]); binary components binary components must be
listed explicitly in a manifest using a binary-component directive: binary-component components/mycomponent.dll c++ in the component must be changed: a binary component no longer exports a nsgetmodule() function. instead, it exports an nsmodule data symbol which points to a mozilla::module structure. for more information about the mozilla::module structure, see the module.h header file. for an up-to-...
....dylib abi=darwin_x86_64-gcc3 binary-component components/linux/mycomponent.so abi=linux_x86-gcc3 this also means that platform-specific preferences are no longer possible. if you need to adjust default preferences based on platform, you can do so at first run by looking up what platform you're on and changing the preferences at that time. category registration prior to gecko 2, extensions could
listen for the xpcom-startup and app-startup notifications during startup, and perform actions during those. this is no longer the case. the earliest startup notification extensions can receive now is profile-after-change, which has always been the recommended notification to observe. that's because it's among the earliest notifications that occurs after the profile folder (and therefore preferences a...
Creating the Component Code
supported ways. overview of the weblock module source as we mentioned in the previous section, components have layers. there are three main parts to every xpcom component. from the innermost and moving outward, the first object is the xpcom object. this is the object that contains the business logic, that implements functionality such as starting a network download, implementing interfaces that
listen to the download progress, or providing a new content type handler. in weblock, this is the part that brings together various gecko services and prevents users from leaving the
list of acceptable domains. in a way, the factory and module layers are glue to plug the xpcom object into the larger xpcom system. one layer above the object itself is the nsifactory object. this object provides basic a...
...siclassinfo. starting from the outside in, onion peel view of xpcom component creation represents the sequence for constructing an xpcom object. onion peel view of xpcom component creation before we begin looking at the various parts of the component and how they'll be implemented in the source, let's look at the module in weblock.cpp to see where we're going. the source we're referring to is
listed in its entirety at the end of this chapter (see weblock1.cpp). the source file for the weblock component contains three classes. in order to make the weblock component work in mozilla, you have to implement a new interface to the weblock component, iweblock, where the actual work specific to the the web locking features happens. you also have to create weblockmodule to implement the necessary ...
...upports* sample; compmanager->createinstance(ksamplecid, nsnull, kisupportsiid, (void**)&sample); in the above snippet, we assume that the component manager has been initialized. in many cases this value is passed in or easily accessible. if not, it can always be obtained by a call to ns_getcomponentmanager(). a
listing of this and other global xpcom functions is in the xpcom api reference. the first parameter of the call to createinstance specifies the component the client code is looking for, which is the same value passed to registerfactorylocation. the next parameter is for aggregation, which the weblock component does not support. the third parameter is the interface used to talk to the component. the l...
Setting up the Gecko SDK
. for example, the headers for networking are all located in the necko directory, and the headers that xpcom requires are in the xpcom directory. this directory structure makes build scripts slightly more complicated (since there will be many different include paths), but it helps to organize the parts of the sdk meaningfully. the two top level header files are special. the file mozilla-config.h
lists all of the defines used in the sdk. including this header file in your project ensures that the component you create uses the same defines as the gecko libraries themselves. note that mozilla-config.h may be need to be included before other includes in your component's source code. each module directory is divided into three subdirectories: module subdirectories the bin directory contains s...
...r testing. i used a different firefox profile for testing purposes called extensions. copy the .dll file to your extensions directory. %applicationdata%\mozilla\firefox\profiles\x.extensions\extensions\bob@george.com. then copy the .xpt file to the c:\program files (x86)\mozilla firefox\components directory. ...
..., to make sure the class and the interface were showing. now you can use this component in your javascript extension. a makefile for unix on linux, the equivalent project settings are typically handled in a makefile. the makefile allows you to specify any number of options for your build environment, including the path and configuration updates you need to build with the gecko sdk. below is a
listing for a makefile that configures your compiler to work with the sdk. explaining the details of the makefile is outside the scope of this appendix, but it modifies the same properties that are configured in the visual c++ project (see building a microsoft visual cpp project). for a
listing of the commands that appear in this
listing, see the make manual. sample makefile for the gecko sdk module...
Components.utils.cloneInto
to the cloned object. example this add-on script creates an object, clones it into the content window and makes it a property of the content window global: // add-on script var addonscriptobject = {"greeting" : "hello from add-on"}; contentwindow.addonscriptobject = cloneinto(addonscriptobject, contentwindow); scripts running in the page can now access the object: // page script button.addevent
listener("click", function() { console.log(window.addonscriptobject.greeting); // "hello from add-on" }, false); of course, you don't have to assign the clone to the window itself: you can assign it to some other object in the target scope: contentwindow.foo.addonscriptobject = cloneinto(addonscriptobject, contentwindow); you can also pass it into a function defined in the page script. suppose t...
...if you pass the {wrapreflectors:true} flag, then the object you clone is allowed to contain these objects: // add-on script var ad...
... ...
Components.utils.exportFunction
xray filtering and waiving xrays provide a filtered view of the original object. for...
...because you can call function xrays just like normal functions, this means that passing callbacks into the exported function just works, making the allowcallbacks option redundant: // privileged scope: for example, a content script fu...
...this prevents passing cross-origin objects (like window or location) to privileged functions, since the privileged code will have full access to those objects and might unintentio...
imgILoader
imgirequest loadimage( in nsiuri auri, in nsiuri ainitialdocumenturl, in nsiuri areferreruri, in nsiprincipal aloadingprincipal, in nsiloadgroup...
...imgirequest loadimage( in nsiuri auri, in nsiuri ainitialdocumenturl, in nsiuri areferreruri, in nsiprincipal aloadingprincipal, in nsiloadgroup aloadgrou...
...ewithchannel() start the load and decode of an image. libpr0n does not keep a strong ref to the observer; this prevents reference cycles. this means that callers of loadimagewithchannel should make sure to cancel() the resulting request before the observer goes away. imgirequest loadimagewithchannel( in nsichannel achannel, in imgidecoderobserver aobserver, in nsisupports cx, out nsistream
listener a
listener ); parameters achannel the channel to load the image from. this must already be opened before this method is called, and there must have been no ondataavailable calls for it yet. aobserver the observer (may be null) cx some random data. a
listener a
listener that you must send the channel's notifications and data to. can be null, in which case imagelib has found a cached image and ...
nsIAccessibleEvent
inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) attributes attribute type description accessible nsiaccessible the nsiaccessible associated with the event. may return null if no accessible is available. read only. accessibledocument nsiaccessibledocument the nsiaccessibledocument that the event target nsiaccessible resides in. ...
...hide 0x0005 an object is hidden -- this is a layout occurrence and is thus asynchronous. event_asynch_significant_change 0x0006 an object had a significant layout change which could affect the type of accessible object -- this is a layout occurrence and is thus asynchronous. ...
...ynchronous. event_asynch_significant_change 0x0006 an object had a significant layout change which could affect the type of accessible object -- this is a layout occurrence and is thus asynchronous. event_document_load_start 0x002a event_internal_load 0x005b used internally in gecko. ...
nsICachingChannel
in "http-offline". offlinecachetoken nsisupports the same as cachetoken but accessing the offline app cache token if there is any. exceptions thrown ns_error_not_available when there is not offline cache token. constants constant value description load_no_network_io 1 << 26 this load flag inhibits fetching from the net. an error of ns_error_document_not_cached will be sent to the
listener's onstoprequest if network io is necessary to complete the request. this flag can be used to find out whether fetching this url would cause validation of the cache entry via the network. combining this flag with load_bypass_local_cache will cause all loads to fail. this flag differs from load_only_from_cache in that this flag fails the load if validation is required while load_only_from_cache...
...-to-end load (that is, it does not affect proxy caches). load_bypass_local_cache_if_busy 1 << 29 this load flag causes the local cache to be skipped if the request would otherwise block waiting to access the cache. load_only_from_cache 1 << 30 this load flag inhibits fetching from the net if the data in the cache has been evicted. ...
...of ns_error_document_not_cached will be sent to the
listener's onstoprequest in this case. this flag is set automatically when the application is offline. load_only_if_modified 1 << 31 this load flag controls what happens when a document would be loaded from the cache to satisfy a call to asyncopen. if this attribute is set to true, then the document will not be loaded from the cache. a stream
listener can check isfromcache() to determine if the asyncopen will actually result in data being streamed. if this flag has been set, and the request can be satisfied via the cache, then the ondataavailable events will be skipped. the
listener will only see onstartrequest followed by onstoprequest. methods isfromcache() obsolete since gecko 2.0 (firefox 4 / thunderbird 3.3 / seamo...
nsIChromeFrameMessageManager
n aallowdelayedload ); parameters aurl the url of the script to load into the frame; this must be an absolute url, but data: urls are supported. aallowdelayedload if true, the script will be loaded when the remote frame becomes available; otherwise, the script will only be loaded if the frame is already available. ...
... aallowdelayedload if true, the script will be loaded when the remote frame becomes available; otherwise, the script will only be loaded if the frame is already available. removedelayedframescript() removes a script from the
list of scripts supporting delayed load. ...
... frame is already available. removedelayedframescript() removes a script from the
list of scripts supporting delayed load. void removedelayedframescript( in astring aurl ); parameters aurl the url of the script to remove from the
list of scripts supporting delayed load. ...
nsICollection
it provides basic operations on those items like: getting, setting, appending, removing, and so on. ...
... void queryelementat(in pruint32 index, in nsiidref uuid, [iid_is(uuid),retval] out nsqiresult result); void removeelement(in nsisupports item); void setelementat(in pruint32 index, in nsisupports item); methods appendelement() appends a new item to the collection. void appendelement( in nsisupports item ) parameters item nsisupports item to be appended to the
list. clear() removes all items from the collection. void clear(); parameters none. count() returns the number of items in the collection. pruint32 count(); parameters none. return value number of items in the
list. enumerate() returns an nsienumerator that lets you iterate over the items in the collection. nsienumerator enumerate(); parameters none. return value an nsienumerator. getelementat() r...
...x, in nsiidref uuid, [iid_is(uuid),retval] out nsqiresult result ); parameters index position of the item to be queried. uuid nsiidref of the item. result comparison result of the previous two parameters. removeelement() removes an item from the collection. void removeelement( in nsisupports item ); parameters item nsisupports item to be removed from the
list. setelementat() replaces an item at a specified index in the collection with a new one. void setelementat( in pruint32 index, in nsisupports item ); parameters index index position where the new item will be set. item the nsisupports item to be set in that position. remarks nsienumerator is a broken interface, and nsisimpleenumerator should be used in its place. see also ...
nsIComponentRegistrar
taining component files to be registered. xpcom <= 1.8: if aspec is null, then the application component's directory as defined by ns_xpcom_component_dir will be registered. see nsdirectoryservice. xpcom >= 1.9: if aspec is null, static components, gre components, and the the application's component directories will be registered. see ns_gre_dir, ns_xpcom_component_dir, and ns_xpcom_component_dir_
list in nsdirectoryservice. autounregister() unregister a component file or all component files in a directory. this method may only be called from the main thread. void autounregister( in nsifile aspec ); parameters aspec this parameter indicates either a component file to be unregistered or a directory containing component files to be unregistered. if aspec is null, then the application compone...
...ding to aclassid if one exists and is registered. contractidtocid() returns the classid for a given contractid, if one exists and is registered. nscidptr contractidtocid( in string acontractid ); parameters acontractid the contractid to be queried. return value the classid corresponding to acontractid if one exists and is registered. enumeratecids() this method returns an enumerator over the
list of registered classids. elements of the enumeration can be queryinterfaced for the nsisupportsid interface. from the nsisupportsid, you can obtain the actual classid. nsisimpleenumerator enumeratecids(); parameters none. return value an nsisimpleenumerator over the
list of registered classes. elements of the enumerator implement nsisupportsid. enumeratecontractids() this method returns an enumer...
... classids. elements of the enumeration can be queryinterfaced for the nsisupportsid interface. from the nsisupportsid, you can obtain the actual classid. nsisimpleenumerator enumeratecids(); parameters none. return value an nsisimpleenumerator over the
list of registered classes. elements of the enumerator implement nsisupportsid. enumeratecontractids() this method returns an enumerator over the
list of registered contractids. elements of the enumeration can be queryinterfaced for the nsisupportscstring interface. from the nsisupportscstring interface, you can obtain the actual contractid string. nsisimpleenumerator enumeratecontractids(); parameters none. return value an nsisimpleenumerator over the
list of registered classes. elements of the enumerator implement nsisupportscstring. iscidre...
nsICookieManager
an optional interface for accessing or removing the cookies that are in the cookie
list. netwerk/cookie/nsicookiemanager.idlscriptable please add a summary to this article. last changed in gecko 1.7 inherits from: nsisupports this interface is intended to be used as a service. it is implemented by the @mozilla.org/cookiemanager;1 component, but should generally be accessed via services.cookies method overview void remove(in autf8string ahost, in acstring aname, in autf8string apath, in boolean ablocked, in jsval aoriginattributes); void removeall(); attributes attribute type description enumerator nsisimpleenumerator called to enumerate through each cookie in the cookie
list. the objects enumerated over are of typ...
...if the cookie cannot be found, no exception is thrown. ...
... of acceptable host strings. if the target cookie is a domain cookie, a leading dot must be present. aname the name specified in the cookie. apath the path for which the cookie was set. ablocked indicates if cookies from this host should be permanently blocked. aoriginattributes the originattributes of this cookie. removeall() this method is called to remove all cookies from the cookie
list. void removeall(); parameters none. see also nsicookie nsicookie2 nsicookiemanager2 nsicookiepermission ...
nsIDOMFontFace
attributes font source attributes these attributes indicate how the font was found during the font matching process. ...
...gful values when the font is a user font defined using @font-face. attribute type description format domstring the font format. read only. ...
... localname domstring null if not a src:local(...) rule. read only. metadata domstring xml metadata from woff file(if any). read only. ...
nsIFrameScriptLoader
rate instance of the frame script into every tab open in the window associated with this window message manager. as the user opens new tabs in this window, copies of the script will be loaded into these new tabs, as well. frame scripts are essentially per-tab, so they don't get reloaded when the user navigates. if you want a frame script to do something whenever a new document is loaded, you can
listen for the document-element-inserted notification. parameters name type description aurl string url for the script to load. aurl must be the absolute url. data: urls are also supported. for example data:,dump("foo\n"); aallowdelayedload boolean if true, this flag means that the frame script will be loaded into any new frames opened after the loadf...
...se. by default, frame scripts each have their own scope, so they can declare global variables without causing conflicts with any other frame scripts. if present and set to true, this flag switches off that behavior, meaning that the script's scope is shared with any other frame scripts in the same frame that have also set the flag. removedelayedframescript() removes aurl from the
list of scripts which support delayed load. this cancels the effect of the aallowdelayedload flag, meaning that the loader will no longer load the script into new frames. if you used aallowdelayedload, you should call this as part of your cleanup (for example, when your add-on is disabled or uninstalled). parameters name type description aurl string url for the script ...
... new frames. if you used aallowdelayedload, you should call this as part of your cleanup (for example, when your add-on is disabled or uninstalled). parameters name type description aurl string url for the script to remove. getdelayedframescripts() returns all delayed scripts that will be loaded once a (remote) frame becomes available. the return value is a
list of pairs [<url>, <wasloadedinglobalscope>]. returns
list of the delayed scripts. each script is returned as a pair: [<url>, <wasloadedinglobalscope>]. ...
nsIHttpChannel
rver. there are no assumptions made about the charset of the returned text. you have been warned! read only. exceptions thrown ns_error_not_available if called before the response has been received (before onstartrequest()). referrerpolicy read only unsigned long the referrer policy in use for this channel, indicated by one of the constants
listed above methods getoriginalresponseheader() get the value of a particular original response header, that is, in the same form as it came from the network. i.e. empty headers will have an empty string as value and multiple headers will not be merged as opposed to getresponseheader(). void getoriginalresponseheader( in acstring aheader, in nsihttpheadervisitor avisitor ); parameters ...
... aheader the case-insensitive name of the request header to query (for example "cookie"). avalue the request header value to set (for example "x=1"). amerge if true, the new header value will be merged with any existing values for the specified header. this flag is ignored if the specified header does not support merging (for example the "content-type" header can only have one value). the
list of headers for which this flag is ignored is an implementation detail. if this flag is false, then the header value will be replaced with the contents of avalue. exceptions thrown ns_error_in_progress if called after the channel has been opened. ns_error_failure if called during visitrequestheaders(). setresponseheader() set the value of a particular response header. this method allow...
...der the case-insensitive name of the response header to set(for example "cache-cookie"). value the response header value to set (for example "no-cache"). merge if true, the new header value will be merged with any existing values for the specified header. this flag is ignored if the specified header does not support merging (for example the "content-type" header can only have one value). the
list of headers for which this flag is ignored is an implementation detail. if this flag is false, then the header value will be replaced with the contents of value. exceptions thrown ns_error_not_available if called before the response has been received (before onstartrequest()). ns_error_illegal_value if changing the value of this response header is not allowed. ns_error_failure if called...
nsIMacDockSupport
ocument.createelementns('http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul', 'menupopup'); macmenu.setattribute('id', 'mymacmenu'); var macmenuitem = win.document.createelementns('http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul', 'menuitem'); macmenuitem.setattribute('label', 'show most recent window'); macmenuitem.setattribute('id', 'mymacmenuitem'); macmenuitem.addevent
listener('command', function(){ var docksupport = cc['@mozilla.org/widget/macdocksupport;1'].getservice(ci.nsimacdocksupport); docksupport.activateapplication(true); services.wm.getmostrecentwindow(null).focus() }) macmenu.appendchild(macmenuitem); var mainpopupset = win.document.getelementbyid('mainpopupset'); mainpopupset.appendchild(macmenu); let dockmenuelement = macmenu; //document.getelem...
...e, if you would like to add or remove items to the menu it is recommended to manipulate the default menu item which is on the hidden window of firefox. note: the hidden window of firefox (services.appshel.hiddendomwindow) loads on browser startup, so if you would like to access it on startup of the browser make sure to check and wait for the window to be loaded. this can be done by adding a event
listenr for load of the hidden window. this is the recommended way to add to the native menu, just maniuplate the default menu dom element. var macmenuitem = services.appshell.hiddendomwindow.document.createelementns('http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul', 'menuitem'); macmenuitem.setattribute('label', 'show most recent window'); macmenuitem.setattribute('id', 'mymacmenuitem')...
...dden window. this is the recommended way to add to the native menu, just maniuplate the default menu dom element. ...
nsIMessageBroadcaster
idl file: mozilla-central/source/dom/base/nsimessagemanager.idl inherits from: nsimessage
listenermanager message "broadcasters" don't have a single "other side" that they send messages to, but rather a set of subordinate message managers. for example, broadcasting a message through a window message manager will broadcast the message to all frame message managers within its window. see message manager interfaces for more details on the distinction between message senders and message broadcasters. ...
...r will broadcast the message to all frame message managers within its window. see message manager interfaces for more details on the distinction between message senders and message broadcasters. methods void broadcastasyncmessage([optional] in astring messagename, [optional] in jsval obj, [optional] in jsval objects); nsimessage
listenermanager getchildat(in unsigned long aindex); broadcastasyncmessage() like sendasyncmessage(), but also broadcasts this message to all "child" message managers of this message manager. see nsimessage
listener::receivemessage() for the format of the data delivered to
listeners. warning: broadcasting messages can be very expensive and leak sensitive data. use with extreme caution. throws...
...e properties is an object. this becomes the objects property of the received message, with each original object replaced with a cross process object wrapper for it. getchildat() return a single subordinate message manager. parameters name type description aindex number the index of the subordinate message manager to retrieve. returns nsimessage
listenermanager: the message manager at the given index. attributes childcount number: the number of subordinate message managers. read only. ...
nsIMsgSendLater
the nsimsgsendlater interface provides functions for managing the unsent folder of a messaging account. inherits from: nsistream
listener implemented by: @mozilla.org/messengercompose/sendlater;1. ...
...ging account. inherits from: nsistream
listener implemented by: @mozilla.org/messengercompose/sendlater;1. to create an instance, use var msgsendlater = components.classes["@mozilla.org/messengercompose/sendlater;1"] .getservice(components.interfaces.nsimsgsendlater); method overview void sendunsentmessages(in nsimsgidentity identity); void remove
listener(in nsimsgsendlater
listener
listener); void add
listener(in nsimsgsendlater
listener
listener); nsimsgfolder getunsentmessagesfolder](in nsimsgidentity identity); attributes attribute type description msgwindow nsimsgwindow methods sendunsentmessages() sends all unsent messages for an identity. void sendunsentmessages(in nsimsgi...
...er); nsimsgfolder getunsentmessagesfolder](in nsimsgidentity identity); attributes attribute type description msgwindow nsimsgwindow methods sendunsentmessages() sends all unsent messages for an identity. void sendunsentmessages(in nsimsgidentity identity) parameters identity the nsimsgidentity to send unsent messages for remove
listener() remove an event
listener from this nsisendmsglater instance void remove
listener(in nsimsgsendlater
listener
listener); parameters
listener the nsimsgsendlater
listener to remove. add
listener() add an event
listener to this nsisendmsglater instance. void add
listener(in nsimsgsendlater
listener
listener); parameters
listener the nsimsgsendlater
listener to add. getunsent...
nsINavHistoryQuery
fault value is "-1", and in that case all items are matched regardless of their visit count. minvisits long set lower limits for how many times an item has been visited. the default value is "-1", and in that case all items are matched regardless of their visit count. onlybookmarked boolean when set, returns only bookmarked items, when unset, returns anything. setting this is equivalent to
listing all bookmark folders in the folders parameter. searchterms astring text search terms. tags nsivariant a
list of tags to use for filtering query results. this attribute must be an array of strings. duplicate tags may be specified, but when reading the
list, only unique tags are returned. when called as a getter, this returns an array of strings sorted in ascending lexicographical (alphabe...
...) order. this array may be empty, in which case no filtering by tags is performed. to search for items that are tagged with any given tags instead of all, multiple queries may be passed to the nsinavhistoryservice method nsinavhistoryservice.executequeries(). tagsarenot boolean if true, the results include only items that are not tagged with the specified tags. if false, only tags in the tags
list are included in the results. uri nsiuri this is a uri to match, to, for example, find out every time you visited a given uri. use uriisprefix to control whether this is an exact match. uriisprefix boolean controls the interpretation of uri. when unset (default), the uri will request an exact match of the specified uri. when set, any history entry beginning in uri will match. for example http:...
...s query. void gettransitions( out unsigned long count, optional [retval,array,size_is(count)] out unsigned long transitions ); parameters count optional the number of transitions transitions missing description settransitions() when the set of transitions is nonempty, results are limited to pages which have at least one visit for each of the transition types. limit results to the specified
list of transition types. void settransitions( [const,array, size_is(count)] in unsigned long transitions, in unsigned long count ); parameters transitions missing description. count the number of transitions. see also places using the places history service querying places nsinavhistoryservice ...
nsINavHistoryQueryOptions
8string this option excludes items from a bookmarks query if the parent of the item has this annotation. an example is to exclude livemark items (parent folders have the "livemark/feeduri" annotation). ignored for queries over history. excludeitems boolean this option excludes all uris and separators from a bookmarks query. this would be used if you just wanted a
list of bookmark folders and queries (such as the left pane of the places page). ignored for queries over history. defaults to false. excludequeries boolean set to true to exclude queries ("place:" uris) from the query results. simple folder queries (bookmark folder symlinks) will still be included. defaults to false. excludereadonlyfolders boolean ...
... boolean set to true to exclude queries ("place:" uris) from the query results. simple folder queries (bookmark folder symlinks) will still be included. defaults to false. excludereadonlyfolders boolean set to true to exclude read-only folders from the query results. this is designed for cases where you want to give the user the option of filing something into a
list of folders. it only affects cases where the actual folder result node would appear in its parent folder and filters it out. it doesn't affect the query at all, and doesn't affect more complex queries (such as "folders with annotation x"). expandqueries boolean when set, allows items with "place:" uris to appear as containers, with the container's contents filled in fro...
... each time a page was visited (this will often give you multiple results for one uri). individual result nodes will have type "visit". results_as_full_visit 2 this is identical to result_type_visit except that individual result nodes will have type "fullvisit". this is used for the attributes that are not commonly accessed to save space in the common case (the
lists can be very long). note: supported only for query_type_history. results_as_date_query 3 returns nsinavhistoryqueryresultnode nodes for each predefined date range where we had visits. note: supported only for query_type_history. results_as_site_query 4 returns nsinavhistor...
nsIObserverService
see nsiobserver for a javascript example. void addobserver( in nsiobserver anobserver, in string atopic, in boolean ownsweak ); parameters anobserver the nsiobserver object which will receive notifications. atopic the notification topic or subject. ownsweak if set to false, the nsiobserverservice will hold a strong reference ...
...reference interface, a weak reference will be held. otherwise an error will be returned. (in most cases, you should use false.) enumerateobservers() called to enumerate all observers registered for a particular topic. nsisimpleenumerator enumerateobservers( in string atopic ); parameters atopic the notification topic or subject. return value returns an enumeration of all registered
listeners. see nsisimpleenumerator. notifyobservers() this method is called to notify all observers for a particular topic. see example. void notifyobservers( in nsisupports asubject, in string atopic, in wstring somedata ); parameters asubject a notification specific interface pointer. this usually corresponds to the source of the notification, but could be defined differently dependin...
...es all nsiobservers watching the "mytopicid" topic with an additional data parameter. components.classes["@mozilla.org/observer-service;1"] .getservice(components.interfaces.nsiobserverservice) .notifyobservers(null, "mytopicid", "someadditionalinformationpassedas'data'parameter"); see also nsobserverservice observer notifications provides an overview of observers and a
list of built-in notifications fired by mozilla. usage examples are provided in the nsiobserver documentation. ...
nsIPluginHost
e only! void instantiateembeddedplugin(in string amimetype, in nsiuri aurl, in nsiplugininstanceowner aowner); native code only! void instantiateembededplugin(in string amimetype, in nsiuri aurl, in nsiplugininstanceowner aowner); obsolete since gecko 1.8 void instantiatefullpageplugin(in string amimetype, in nsiuri auri, in nsiplugininstanceowner aowner, out nsistream
listener astream
listener); native code only! nsistream
listener instantiatepluginforchannel(in nsichannel achannel, in nsiplugininstanceowner aowner); native code only! void ispluginenabledforextension(in string aextension, in constcharstarref amimetype); native code only! void ispluginenabledfortype(in string amimetype); native code only! void loadplugins(); native...
...ce gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) void instantiateembededplugin( in string amimetype, in nsiuri aurl, in nsiplugininstanceowner aowner ); parameters amimetype aurl aowner native code only!instantiatefullpageplugin void instantiatefullpageplugin( in string amimetype, in nsiuri auri, in nsiplugininstanceowner aowner, out nsistream
listener astream
listener ); parameters amimetype auri aowner astream
listener native code only!instantiatepluginforchannel instantiate an embedded plugin for an existing channel. the caller is responsible for opening the channel. it may or may not be already opened when this function is called. nsistream
listener instantiatepluginforchannel( in nsichannel achannel, in nsipl...
...then using nsihandlerservice it gets the handler info. a handler is, default application that should open or deal with this file. let pluginhost = cc["@mozilla.org/plugin/host;1"].getservice(ci.nsipluginhost); let handlerservice = cc['@m...
nsIPrefBranch2
et the new value of the modified preference. for example, if your observer is registered with addobserver("bar.", ...) on a branch with root "foo.", modifying the preference "foo.bar.baz" will trigger the observer, and adata parameter will be "bar.baz". void addobserver( in string adomain, in nsiobserver aobserver, in boolean aholdweak ); parameters adomain the preference on which to
listen for changes. this can be the name of an entire branch to observe. for example holding the "root" prefbranch and calling addobserver("foo.bar.", ...) will observe changes to foo.bar.baz and foo.bar.bzip. aobserver the object to be notified if the preference changes. aholdweak true holds a weak reference to aobserver. the object must implement the nsisupportsweakreference interface or this wi...
...using the branch to hold a reference to the observer) and holds a reference to the branch object for the purpose of getting/setting preference values. there are 3 approaches which have been implemented in an attempt to avoid these situations: the nsprefbranch object supports nsisupportsweakreference. any consumer may hold a weak reference to it instead of a strong one. ...
... branch object for the purpose of getting/setting preference values. there are 3 approaches which have been implemented in an attempt to avoid these situations: the nsprefbranch object supports nsisupportsweakreference. any consumer may hold a weak reference to it instead of a strong one. the nsprefbranch object
listens for xpcom-shutdown and frees all of the objects currently in its observer
list. this ensures that long lived objects (services for example) will be freed correctly. the observer can request to be held as a weak reference when it is registered. this insures that shorter lived objects (say one tied to an open window) will not fall into the cyclical reference trap. the
list of registered observers may be changed during the dispatch of nspref:changed notification. however, t...
nsIProgressEventSink
hannel. the information is intended to be displayed to the user in some meaningful way. an implementation of this interface can be passed to a channel via the channel's notificationcallbacks attribute. see nsichannel for more info. the channel will begin passing notifications to the progress event sink after its asyncopen method has been called. notifications will cease once the channel calls its
listener's onstoprequest method or once the channel is canceled (via nsirequest.cancel()). note: this interface is actually not specific to channels and may be used with other implementations of nsirequest. method overview void onprogress(in nsirequest arequest, in nsisupports acontext, in unsigned long long aprogress, in unsigned long long aprogressmax); void onstatus(i...
...rogress() called to notify the event sink that progress has occurred for the given request. void onprogress( in nsirequest arequest, in nsisupports acontext, in unsigned long long aprogress, in unsigned long long aprogressmax ); parameters arequest the request being observed (may qi to nsichannel). acontext if arequest is a channel, then this parameter is the
listener context passed to nsichannel.asyncopen(). aprogress numeric value in the range 0 to aprogressmax indicating the number of bytes transfered thus far. aprogressmax numeric value indicating maximum number of bytes that will be transfered (or 0xffffffffffffffff if total is unknown). onstatus() called to notify the event sink with a status message for the given request...
...fffffff if total is unknown). onstatus() called to notify the event sink with a status message for the given request. void onstatus( in nsirequest arequest, in nsisupports acontext, in nsresult astatus, in wstring astatusarg ); parameters arequest the request being observed (may qi to nsichannel). acontext if arequest is a channel, then this parameter is the
listener context passed to nsichannel.asyncopen(). astatus status code (not necessarily an error code) indicating the state of the channel (usually the state of the underlying transport). see nsisockettransport for socket specific status codes. astatusarg status code argument to be used with the string bundle service to convert the status message into localized, human reada...
nsIProtocolProxyFilter
s used to apply filters to the proxies selected for a given uri. use nsiprotocolproxyservice.registerfilter() to hook up instances of this interface. ...
...this can be just be aproxy if the filter chooses not to modify the proxy. it can also be null to indicate that a direct connection should be used. use aproxyservice.newproxyinfo to construct nsiproxyinfo objects. ...
... auri, in nsiproxyinfo aproxy ); parameters aproxyservice a reference to the protocol proxy service. this is passed so that implementations may easily access methods such as newproxyinfo. auri the uri for which these proxy settings apply. aproxy the proxy (or
list of proxies) that would be used by default for the given uri. this may be null. return value the proxy (or
list of proxies) that should be used in place of aproxy. this can be just be aproxy if the filter chooses not to modify the proxy. it can also be null to indicate that a direct connection should be used. use aproxyservice.newproxyinfo to construct nsiproxyinfo objects. see also nsiproxyinfo nsiprotocolproxyservice ...
nsIRequest
netwerk/base/nsirequest.idlscriptable this interface is used by the request initiator to control the request. inherits from: nsisupports last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) for example nsichannel typically passes itself as the nsirequest argument to the nsistream
listener on each onstartrequest, ondataavaliable, and onstoprequest invocation. method overview void cancel(in nsresult astatus); boolean ispending(); void resume(); void suspend(); attributes attribute type description loadflags nsloadflags the load flags of this request. bits 0-15 are reserved. when added to a load group, this request's load flags are merged with the load flags of the load group...
...t, however, prevent cached content from being used to satisfy this request. inhibit_persistent_caching 1 << 8 this flag prevents caching on disk (or other persistent media), which may be needed to preserve privacy. for https, this flag is set automatically. the following flags control what happens when the cache contains data that could perhaps satisfy this request. they are
listed in descending order of precedence. constant value description load_bypass_cache 1 << 9 force an end-to-end download of content data from the origin server. this flag is used for a shift-reload. load_from_cache 1 << 10 load from the cache, bypassing protocol specific validation logic. this flag is used when browsing via history. it is not recommended...
...sync requests. users should normally pass ns_binding_aborted, although other errors may also be passed. the error passed in will become the value of the status attribute. implementations must not send any notifications (for example via nsirequestobserver) synchronously from this function. similarly, removal from the load group (if any) must also happen asynchronously. requests that use nsistream
listener must not call ondataavailable anymore after cancel has been called. note: most nsirequest implementations expect astatus to be a failure code; however, some implementations may allow astatus to be a success code such as ns_ok. in general, astatus should be a failure code. void cancel( in nsresult astatus ); parameters astatus the reason for canceling this request. ispending() ind...
nsISHEntry
me page in the sense that one could go from the state represented by one to the state represented by the other simply by scrolling (so the entries are separated by an anchor traversal or a subframe navigation in some other frame). obsolete since gecko 6.0 parent nsishentry parent of this entry. postdata nsiinputstream post data for the document. referreruri nsiuri referrer uri. refreshuri
list nsisupportsarray saved refresh uri
list for the content viewer. savelayoutstateflag boolean indicate whether layouthistorystate should be saved. statedata nsistructuredclonecontainer get/set data associated with this history state via a pushstate() call, serialized using structured clone. (prior to gecko 6.0 returned a json encoded string.) sticky boolean whether the content viewer is mar...
... string.) sticky boolean whether the content viewer is marked "sticky" windowstate nsisupports saved state of the global window object. methods addchildshell() saved child docshells corresponding to contentviewer. the child shells are restored as children of the parent docshell, in this order, when the parent docshell restores a saved presentation. append a child shell to the end of our
list. void addchildshell( in nsidocshelltreeitem shell ); parameters shell childshellat() nsidocshelltreeitem childshellat( in long index ); parameters index the child shell at index; null if index is out of bounds. return value clearchildshells() clear the child shell
list. void clearchildshells(); parameters none. clone() nsishentry clone(); parameters none. return value native code o...
...void syncpresentationstate(); parameters none. example see nssessionstore.js for a real example. ...
nsIStyleSheetService
layout/base/nsistylesheetservice.idlscriptable please add a summary to this article. last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) inherits from: nsisupports implemented by: @mozilla.org/content/style-sheet-service;1. ...
...a user sheet loaded via this api will come before usercontent.css and userchrome.css in the cascade (so the rules in it will have lower precedence than rules in those sheets). an agent sheet loaded via this api will come after ua.css in the cascade (so the rules in it will have higher precedence than rules in ua.css). the relative ordering of two user or two agent s...
...d and register. type one of the type constants. sheetregistered() check if a stylesheet has been registered boolean sheetregistered( in nsiuri sheeturi, in unsigned long type ); parameters sheeturi uri of the stylesheet to check. type one of the type constants. return value returns true if a style sheet at sheeturi has previously been added to the
list of style sheets specified by type. unregistersheet() remove the style sheet at sheeturi from the
list of style sheets specified by type. the removal takes effect immediately, even for already-loaded documents. void unregistersheet( in nsiuri sheeturi, in unsigned long type ); parameters sheeturi uri of the stylesheet to unregister. type one of the type constants.
nsIToolkitProfileService
in nsilocalfile adirectory, in nsilocalfile atempdirectory); attributes attribute type description profilecount unsigned long the number of user profiles currently in existence. this will always return 0, 1, or 2; if there are more than 2 profiles, 2 is always returned. read only. profiles nsisimpleenumerator an enumerator providing access to the
list of profiles; each profile is an nsitoolkitprofile object (though you must first call aprofile.queryinterface(components.interfaces.nsitoolkitprofile) to get access to its attributes and methods). selectedprofile nsitoolkitprofile the profile that is marked as "default=1" in the profiles.ini file. (not the profile currently in use.) not sure what happens if you change this setting b...
... to give the new profile. return value an nsitoolkitprofile object representing the newly-created profile. exceptions thrown ns_error_unexpected an unexpected error condition occurred. ns_error_file_not_directory one of the specified directory files is not actually a directory. ns_error_out_of_memory unable to allocate the new profile object. flush() flushes the profile
list to disk. the profile
list file is constructed in memory, then written out as one large chunk, in order to reduce the risk of the profile
list file being corrupted by disk errors. void flush(); parameters none. exceptions thrown ns_error_out_of_memory an error occurred trying to allocate the memory buffer used to construct the profile
list. ns_error_unexpected an error occurred w...
... getprofilebyname() gets a profile, given the profile's name. nsitoolkitprofile getprofilebyname( in autf8string aname ); parameters aname the profile name to find. return value an nsitoolkitprofile object describing the specified profile. exceptions thrown ns_error_failure no matching profile was found. ...
nsITreeView
he orientation paramater specifies before/on/after the given row. void drop( in long row, in long orientation, in nsidomdatatransfer datatransfer ); parameters row the index of the row. orientation the position around the given row. defined in constants. datatransfer this parameter, added in gecko 1.9.2, provides the data that has been dropped. getcellproperties() an atomized
list of properties for a given cell. each property, x, that the view gives back will cause the css ::moz-tree-cell-*(x) pseudoelement to be matched on the treechildren element. see getrowproperties() for an example. astring getcellproperties( in long row, in nsitreecolumn col, in nsisupportsarray properties ); parameters row the index of the row. col the current column. properties an...
... the parent row. getprogressmode() the progress mode for a given cell. this method is only called for columns of type progressmeter. see the constants section for possible modes. long getprogressmode( in long row, in nsitreecolumn col ); parameters row the index of the row. col the index of the column. return value the progress mode for the cell. getrowproperties() an atomized
list of properties for a given row. each property, x, that the view gives back will cause the css ::moz-tree-row(x) pseudoelement to be matched on the treechildren element. void getrowproperties( in long index, in nsisupportsarray properties ); parameters index the index of the row. properties an array of the row's current properties. obsolete since gecko 22 return value a string of sp...
...s after. return value true if the row has a next sibling. otherwise false iscontainer() whether the row has the potential to hold other rows within it. this does not determine whether a twisty is actually drawn; that's left up to iscontainerempty. for very simple tree views, such as those without multi-level data, you might want to consider using something simpler than a tree view, such as a
listbox. for tree views with multi-level data, it's advisable to distinguish between a row which is an empty container (i.e., a row with the potential to hold children but that currently has none), and a non-empty container (i.e., a row that positively does currently have children). the tree frame code that handles drag and drop, for example, uses this method to determine how to interpret the drop po...
nsIUpdateChecker
toolkit/mozapps/update/nsiupdateservice.idlscriptable this interface describes an object that knows how to check for software updates. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void checkforupdates(in nsiupdatecheck
listener
listener, in boolean force); void stopchecking(in unsigned short duration); constants constant value description current_check 1 constant for the stopchecking() method indicating that only the current update check should be stopped. current_session 2 constant for the stopchecking() method indicating that all update checks during the current session should be stopped. any_checks 3 constant for the stopchecking() method indi...
...t update check should be stopped. current_session 2 constant for the stopchecking() method indicating that all update checks during the current session should be stopped. any_checks 3 constant for the stopchecking() method indicating that all update checking should be stopped. this disables the update checking preferences. methods checkforupdates() checks for available updates, notifying a
listener of the results. void checkforupdates( in nsiupdatecheck
listener
listener, in boolean force ); parameters
listener an object implementing nsiupdatecheck
listener to be notified of the results of an update check. force if true, the update checker checks for updates, regardless of the current value of the user's update settings. this is used by any user interface that offers the user the op...
...offers the user the opportunity to check for updates immediately. ...
nsIUpdateManager
toolkit/mozapps/update/nsiupdateservice.idlscriptable this interface describes a global application service that maintains a
list of previously installed updates, as well as the currently in use update. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview nsiupdate getupdateat(in long index); void saveupdates(); attributes attribute type description activeupdate nsiupdate an nsiupdate object describing the currently in use update. this update is not in the history
list. read only. updatecount long the number of updates in the history
list; the updates can be fetched by calling getupdateat(). read only. methods getupdateat() returns the update at the sp...
...pdates(); attributes attribute type description activeupdate nsiupdate an nsiupdate object describing the currently in use update. this update is not in the history
list. read only. updatecount long the number of updates in the history
list; the updates can be fetched by calling getupdateat(). read only. methods getupdateat() returns the update at the specified index into the history
list. nsiupdate getupdateat( in long index ); parameters index an index into the history
list for the nsiupdate to retrieve. return value the nsiupdate at the specified index into the history
list. ...
... methods getupdateat() returns the update at the specified index into the history
list. nsiupdate getupdateat( in long index ); parameters index an index into the history
list for the nsiupdate to retrieve. return value the nsiupdate at the specified index into the history
list. saveupdates() saves all updates to disk. void saveupdates(); parameters none. ...
nsIWebSocketChannel
8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) implemented by: ?????????????????????????????????????. to create an instance, use: var websocketchannel = components.classes["@mozilla.org/????????????????????????????"] .createinstance(components.interfaces.nsiwebsocketchannel); method overview void asyncopen(in nsiuri auri, in acstring aorigin, in nsiwebsocket
listener a
listener, in nsisupports acontext); void close(in unsigned short acode, in autf8string areason); void sendbinarymsg(in acstring amsg); void sendmsg(in autf8string amsg); attributes attribute type description extensions acstring sec-websocket-extensions response header value. read only. loadgroup nsiloadgroup the lo...
...served for future use by the websocket standard. 2000-2999 reserved for use by websocket extensions. 3000-3999 available for use by libraries and frameworks. may not be used by applications. 4000-4999 available for use by applications. methods asyncopen() asynchronously opens the websocket connection. received messages are fed to the socket
listener as they arrive. the socket
listener's methods are called on the thread that calls asyncopen() and are not called until after asyncopen() returns. if asyncopen() returns successfully, the protocol implementation promises to call at least onstart and onstop of the
listener. note: implementations should throw ns_error_already_opened if the websocket connection is reopened. void asyncopen( in n...
...re called on the thread that calls asyncopen() and are not called until after asyncopen() returns. if asyncopen() returns successfully, the protocol implementation promises to call at least onstart and onstop of the
listener. note: implementations should throw ns_error_already_opened if the websocket connection is reopened. void asyncopen( in nsiuri auri, in acstring aorigin, in nsiwebsocket
listener a
listener, in nsisupports acontext ); parameters auri the uri of the websocket protocol; this may be redirected. aorigin the uri of the originating resource. a
listener the nsiwebsocket
listener implementation. acontext an opaque parameter forwarded to a
listener's methods. close() void close( in unsigned short acode, in autf8string areason ); parameters...
Address book sync client design
through the local database and update the // sync mapping table. if the crc has changed, mark the entry modified, if // it's a new record, add an entry and mark it new, if a record was deleted, // mark the entry deleted, etc. // // sync approach - server handles all conflict resolution: // // step 2: // using the sync mapping table and the local records database, generate the change //
list to send to the server. mark any modified or new record with the ret (retry) // flag. // // step 3: // get the response back from the server. since the communication was successful, // clear the ret (retry) flag on all records. then apply the server changes back // to the local database (updating the crc's in the process). save the changes to // the local database, clear the sync mappin...
...updating the crc's in the process). save the changes to // the local database, clear the sync mapping table flags and save the new sync // mapping table. // public interfaces there is a very simple interface to the address book sync component. this interface is defined in mozilla/mailnews/addrbook/public/nsiabsyncdriver.idl #include "nsrootidl.idl" #include "nsiabsync
listener.idl" [scriptable, uuid(91fdfee1-efbc-11d3-8f97-000073757374)] interface nsiabsyncdriver : nsiabsync
listener { void kickit(); }; as you can see, this is a very simple interface which allows for the starting of the address book sync operation. the interface of greater interest is the address book sync
listener. this provides feedback of the current sync operation. this interface is as...
... * */ void onstartauthoperation(); /** * notify the observer that the ab sync operation has been completed. ...
Filelink Providers
s part of an add-on, the add-on must register the component in chrome.manifest. also, you must add the component's contract id to the "cloud-file" category. see cloudfile/cloudfilecomponents.manifest for an example, as well as this document on chrome.manifest files. the account setup dialog the account setup dialog allows the user to select what account type they would like to create from a menu
list. some providers require thunderbird to do very little in order to connect a user to their account. other providers however may require the user to fill in additional details in order to connect to the service. hightail, for example, requires a username and password. other services may require the user to fill in a server string or port number. a provider implementation can choose what informa...
...equire the user to fill in a server string or port number. a provider implementation can choose what information it gets from the user from the setup dialog by pointing the settingsurl attribute of their nsimsgcloudfileprovider implementation to a chrome url for an xhtml page that contains a form with the extra information. that url is then loaded into an iframe directly beneath the provider menu
list. note: the setup dialog window should resize itself automatically in order to fit the content of the iframe without scrollbars. custom settings fields to handle custom settings, the settings xhtml page should contain a form with the id "provider-form", with its onsubmit attribute set to "return false;". example: <form id="provider-form" onsubmit="return false;"> <label for="username">usern...
...the key mail.cloud_files.accounts.account_key.username where account_key is the value passed into the implementations init function. the hightail settings.xhtml and settings.js file have examples of this. management interface once an account has been created, it is manageable from within the preferences dialog, in the attachment pane, in the outgoing tab. the content to the right of the menu
list is an iframe, pointed at a url read from the providers managementurl attribute, which should point to an xhtml page. the xhtml page should have a function in the global scope called onloadprovider. this function is called automatically once the dom content is done loading, and is passed a single parameter - the provider instance whose data is being displayed. ...
Building a Thunderbird extension 3: install manifest
rsion of your extension. it is not the thunderbird version number (which is stored in the minversion and maxversion fields). <em:creator>jenzed</em:creator>: this optional value is used to store the extension author's name. <em:id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</em:id>: this element contains the version id of the application that this add on is developed for. it is defined by mozilla. ...
...ped for. it is defined by mozilla. a
list of valid application ids can be found here. normally the id does not change and is always the same even for different versions of thunderbird. <em:minversion>1.5</em:minversion>: this element indicates the earliest version of thunderbird for which the extension is intended to work. do not use a wildcard (such as "*"). see valid application versions for a
list of the supported version numbers and formats. <em:maxversion>5.0.*</em:maxversion>: this element indicates the most recent version of thunderbird for which the extension is intended to work. this cannot be higher than the currently available version. "5.0.*" indicates that the extension works with thunderbird 5.0 and any subsequent 5.0.x releases. ...
... there are more optional elements that can be specified in install.rdf. these are described on the install manifests page. note that elements can be specified in any order, as long as they are children of the <description> node. ...
Thunderbird
es. thunderbird api documentation thunderbird api documentation extension documentation tutorials and tips for building thunderbird extensions view all... ...
...tion tutorials and tips for building thunderbird extensions view all... ...
...project community pages user support is handled at mozilla support development discussion happens on the tb-planning mailing
list: subscribe archives add-on developers forum/mailing
list mozillazine forums mozilla messaging web page #thunderbird on irc.mozilla.org (for users) #maildev on irc.mozilla.org (for developers) a
list of all thunderbird communication channels ...
Inspecting web sockets - Firefox Developer Tools
since firefox 71, the network monitor has had the ability to inspect web socket connections. this article explores what functionality the web socket inspector makes available. accessing the inspector when you are inspecting a web app that utilizes a web socket connection, the web socket requests are
listed in the
list of requests in the network monitor along with all other requests. you can use the ws button to filter the
list for just web socket connections. only requests with the 101 status code (websocket protocol handshake) are visible, which indicates that the server is switching to a web socket connection. clicking on a web socket request opens the usual sidebar to reveal additional details. choose the reponse tab to inspect web socket frames sent and received through the selected...
...e button in the network monitor toolbar to stop intercepting web socket traffic. this allows you to capture only the frames that you are interested in. filtering web socket frames to focus on specific messages, frames can be filtered using the filter at the top of the messages panel. there are also predefined filters, available in the tool bar of the response pane, grouped into a selection
list. the following filters are available: all displays all messages (by default, except control messages). sent displays only messages sent by the browser (by default, except control messages). received displays only messages received from the server (by default, except control messages). control (available starting in firefox 76). displays messages for control frames (ping, pong, or clo...
...the response pane, you can choose to show the following information about each frame: data size time opcode maskbit finbit the data and time columns are visible by default, but you can customize the interface to see more columns by choosing which ones to show from the context menu that is opened by right-clicking in the table header. expanding each message selecting a message in the
list shows a preview of the data being sent in that message, at the bottom of the response pane. supported ws protocols the inspector currently supports the following web socket protocols: plain json socket.io sockjs signalr wamp the payload based on those protocols is parsed and displayed as an expandable tree for easy inspection, although you can of course still see the raw data (as sen...
Performance Analysis - Firefox Developer Tools
the network monitor includes a performance analysis tool, to help show you how long the browser takes to download the different parts of your site. using the performance analysis tool to run the performance analysis tool click the stopwatch icon in the toolbar. (alternatively, if you have only just opened the network monitor, so it's not yet populated with the
list of requests, you'll get a stopwatch icon in the main window.) the network monitor then loads the site twice: once with an empty browser cache, and once with a primed browser cache. this simulates the first time a user visits your site, and subsequent visits. it displays the results for each run side by side, or vertically if the browser window is narrow: the results for each run are summarised in a table and a pie chart. the...
... it displays the results for each run side by side, or vertically if the browser window is narrow: the results for each run are summarised in a table and a pie chart. the tables group resources by type, and show the total size of each resource and the total time it took to load them. the accompanying pie chart shows the relative size of each resource type. ...
... each resource type. to get back to the network monitor's
list of network requests click the "back" button on the left. clicking on a slice of the pie takes you to the network monitor for that run, with a filter automatically applied to see only that resource type. ...
Edit CSS filters - Firefox Developer Tools
css filter properties in the rules view have a circular gray and white swatch next to them: clicking the swatch opens a filter editor: the filter editor
lists each of the effects performed by that filter on a separate line. you can edit these lines, remove them individually, or drag the effects to change the order in which they are applied. you can also add new effects by selecting an effect from the dropdown
list at the bottom of the dialog. once you have selected the effect you want to add, click the plus sign (+) to the right of the dropdown
list. once you have added an effect, enter the settings you want and then press enter to update the effect. the change will be apparent as soon as youpress enter. saving filter presets from firefox 42 onwards, you can also add filters to a li...
... at the bottom of the dialog. once you have selected the effect you want to add, click the plus sign (+) to the right of the dropdown
list. once you have added an effect, enter the settings you want and then press enter to update the effect. the change will be apparent as soon as youpress enter. saving filter presets from firefox 42 onwards, you can also add filters to a
list of presets. the
list of presets will be preserved between browser sessions, making it easy to apply the settings in the future. you can save the current filter to the preset
list: click to edit the filter, display the preset
list by clicking the icon as shown below. type a name for your preset, and then click the plus sign to add it to the
list of presets. you can then apply saved filters to new elements. to ap...
...s, making it easy to apply the settings in the future. you can save the current filter to the preset
list: click to edit the filter, display the preset
list by clicking the icon as shown below. type a name for your preset, and then click the plus sign to add it to the
list of presets. you can then apply saved filters to new elements. to apply one of your saved presets, click its name in the
list. ...
UI Tour - Firefox Developer Tools
e following image shows the 3-pane mode (available from firefox 62 onwards) which moves the css rules view into a separate pane in the center of the inspector. the following image shows 3-pane mode: as you can see, the css pane has moved into the center of the inspector. to learn more about the structure of the html pane, see the guide to examining and editing html. rules view the rules view
lists all the rules that apply to the selected element, ordered from most-specific to least-specific. see above. see examine and edit css for more details. layout view the layout view displays the box model of the page. if the page includes any sections using either the flexbox display model or css grids, this view shows the flexbox or grid settings used on the page. to learn more about the la...
... model of the page. if the page includes any sections using either the flexbox display model or css grids, this view shows the flexbox or grid settings used on the page. to learn more about the layout view, see examine and edit the box model. note that before firefox 50, the box model view did not appear in the "computed view" tab, but had its own tab. to learn more about the css declarations
listed in this view, see examine computed css. changes view when you are editing in the rules view, you can see the changes you have made in the changes view. computed view the computed view shows you the complete computed css for the selected element (the computed values are the same as what getcomputedstyle would return.): compatibility view starting with firefox developer edition version ...
...lect that element in the inspector. if more than one element has a given property applied to it, click the triangle to show all the occurences. to configure the set of browsers you want the compatibility view to check for, click settings at the bottom of the panel. untick the checkbox for any browser you are not interested in. as new browser versions are released, the version numbers in this
list will be updated. fonts view the fonts view shows all the fonts in the page along with editable samples. see view fonts for more details. animations view the animations view gives you details of any animations applied to the selected element, and a controller to pause them: see work with animations for more details. ...
Intensive JavaScript - Firefox Developer Tools
main thread code would look something like this: const iterations = 50; const multiplier = 1000000000; var worker = new worker("js/calculate.js"); function dopointlesscomputationsinworker() { function handleworkercompletion(message) { if (message.data.command == "done") { pointlesscomputationsbutton.disabled = false; console.log(message.data.primes); worker.removeevent
listener("message", handleworkercompletion); } } worker.addevent
listener("message", handleworkercompletion, false); worker.postmessage({ "multiplier": multiplier, "iterations": iterations }); } the main difference here, compared with the original, is that we need to: create a worker send it a message when we are ready to calculate
listen for a message called "done", which i...
...e); worker.postmessage({ "multiplier": multiplier, "iterations": iterations }); } the main difference here, compared with the original, is that we need to: create a worker send it a message when we are ready to calculate
listen for a message called "done", which indicates that the worker has finished. ...
...the code that actually performs the computations is exactly the same as the original code. so how does this version perform? switch the radio button to "use a worker", and capture a new profile. you should see something like this: in this profile we pushed the button three times. compared with the original, ...
Style Editor - Firefox Developer Tools
the "style editor" option from the "web developer" menu (which is a submenu in the "tools" menu on the mac). the toolbox will appear at the bottom of the browser window, with the style editor activated: the style editor is divided into three main sections: the style sheet pane on the left the editor on the right the media sidebar. the style sheet pane the style sheet pane, on the left,
lists all the style sheets being used by the current document. you can quickly toggle the use of a given sheet on and off by clicking the eyeball icon to the left of the sheet's name. you can save any changes you've made to the style sheet to your local computer by clicking the save button in the bottom-right corner of each sheet's entry in the
list. from firefox 40 onwards, the style sheet pane also...
...tor provides line numbers and syntax highlighting to help make it easier to read your css. it also supports a number of keyboard shortcuts. the style editor automatically de-minimizes style sheets that it detects, without affecting the original. this makes it much easier to work on pages that have been optimized. the style editor supports autocomplete. just start typing, and it will offer you a
list of suggestions. you can switch autocomplete off in the style editor settings. the media sidebar the style editor displays a sidebar on the right-hand side whenever the current sheet contains any @media rules. the sidebar
lists the rules and provides a link to the line of the sheet where the rule is defined. click an item to jump to that rule in the sheet. the condition text of the rule is grey...
...is simply by passing the --watch option: sass index.scss:index.css --watch next, save the original source in the style editor by clicking the "save" button next to the file, and saving it over the original file. now when you make changes to the source file in the style editor the css is regenerated and you can see the changes right away. keyboard shortcuts source editor shortcuts this table
lists the default shortcuts for the source editor. in the editor preferences section of the developer tools settings, you can choose to use vim, emacs, or sublime text key bindings instead. to select these, visit about:config, select the setting devtools.editor.keymap, and assign "vim" or "emacs", or "sublime" to that setting. if you do this, the selected bindings will be used for all the developer ...
Console messages - Firefox Developer Tools
and console api messages, the message can be traced to a specific line of code. the console then provides a link to the filename and line number that generated the message. by default, the console is cleared each time you navigate to a new page or reload the current page. to override this behavior, enable persist logs in the console settings menu (gear icon). the context menu options
listed below are available on all message categories. additional context menu options are described in the subsection for the message category they apply to. copy message copies the selected message to the clipboard. select all selects all messages available in the message display pane. export visible messages to clipboard copies all messages available in the display pane to the clipboard. ...
...by a previous write call, you force a synchronous reflow. security the security messages shown in the web console help developers find potential or actual vulnerabilities in their sites. additionally, many of these messages help educate developers because they end with a “learn more” link that takes you to a page with background information and advice for mitigating the issue. the complete
list of security messages is as follows: message details blocked loading mixed active content the page contained mixed active content: that is, the main page was served over https, but asked the browser to load "active content", such as scripts, over http. the browser blocked this active content. see mixed content for more details. blocked loading mixed display conten...
...". network requests with response codes in the 400-499 (client error) or 500-599 (server error) ranges are considered errors. their display is controlled by the errors button, not the requests button. filtering by text to see only messages that contain a specific string, type in the text box labeled "filter output". for example, if you entered the string img into the text box, you would have a
list something like this: a small "x" icon appears at the right end of the text box when you have entered a string on which to filter the output. click the "x" icon to clear the filter and show the entire
list again. you can negate a text search by prefixing it with the - character. for example, -img shows only items that do not contain the string img. filtering with regular expressions you can ...
Web Console Helpers - Firefox Developer Tools
cument. equivalent to document.queryselector() or calls the $ function in the page, if it exists. see the queryselector code snippet. $$(selector, element) looks up a css selector string selector, returning an array of dom nodes descended from element that match. if unspecified, element defaults to document. this is like for document.queryselectorall(), but returns an array instead of a node
list. $0 the currently-inspected element in the page. $_ stores the result of the last expression executed in the console's command line. for example, if you type "2+2 <enter>", then "$_ <enter>", the console will print 4. $x(xpath, element, resulttype) evaluates the xpath xpath expression in the context of element and returns an array of matching nodes. if unspecified, element defaults to docum...
...he argument, and the result will be copied to the clipboard. help()deprecated since gecko 62 :help displays help text. actually, in a delightful example of recursion, it brings you to this page. inspect() given an object, generates rich output for that object. once you select the object in the output area, you can use the arrow keys to navigate the object. keys() given an object, returns a
list of the keys (or property names) on that object. this is a shortcut for object.keys. pprint() obsolete since gecko 74 formats the specified value in a readable way; this is useful for dumping the contents of objects and arrays. :screenshot creates a screenshot of the current page with the supplied filename. if you don't supply a filename, the image file will be named with the following format:...
...e element on the page. when supplied, only this element will be included in the screenshot. :unblock (starting in firefox 80) followed by an unquoted string, removes blocking for urls containing that string. in the network monitor, the string is removed from the request blocking sidebar. no error is given if the string was not previously blocked. values() given an object, returns a
list of the values on that object; serves as a companion to keys(). please refer to the console api for more information about logging from content. variables tempn the "use in console" option in the inspector generates a variable for a node named temp0, temp1, temp2, etc. referencing the node. examples looking at the contents of a dom node let's say you have a dom node with the id "title".
Rich output - Firefox Developer Tools
t to the headers panel in the network monitor tool. export output to the clipboard once you have output in the console window, you can save it to the clipboard by right-clicking on the output and selecting export visible messages to clipboard: this will copy all of the output to the clipboard. then you can paste it into a document. ...
...cting export visible messages to clipboard: this will copy all of the output to the clipboard. then you can paste it into a document. the output will look something like this: console.log(todo
list) array(4) [ {…}, {…}, {…}, {…} ] debugger eval code:1:9 undefined if you expand objects, such as arrays, you get slightly different content. ...
... this will copy all of the output to the clipboard. then you can paste it into a document. the output will look something like this: console.log(todo
list) array(4) [ {…}, {…}, {…}, {…} ] debugger eval code:1:9 undefined if you expand objects, such as arrays, you get slightly different content. ...
The JavaScript input interpreter - Firefox Developer Tools
ant to search for in the input box at the bottom of the console. start typing part of the expression you are looking for and the first match is displayed in the console. repeatedly typing f9 on windows and linux ( ctrl+r on mac) cycles backwards through the matches. once you have initiated the reverse search, you can use shift + f9 on windows or linux ( ctrl+s on mac) to search forward in the
list of matches. you can also use the ā and ā icons in the expression search bar. when you find the expression you want, press enter (return) to execute the statement. 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. there ...
...cument. equivalent to document.queryselector() or calls the $ function in the page, if it exists. see the queryselector code snippet. $$(selector, element) looks up a css selector string selector, returning an array of dom nodes descended from element that match. if unspecified, element defaults to document. this is like for document.queryselectorall(), but returns an array instead of a node
list. $0 the currently-inspected element in the page. $_ stores the result of the last expression executed in the console's command line. for example, if you type "2+2 <enter>", then "$_ <enter>", the console will print 4. $x(xpath, element, resulttype) evaluates the xpath xpath expression in the context of element and returns an array of matching nodes. if unspecified, element defaults to docum...
...pe) evaluates the xpath xpath expression in the context of element and returns an array of matching nodes. if unspecified, element defaults to document. the resulttype parameter specifies the type of result to return; it can be an xpathresult constant, or a corresponding string: "number", "string", "bool", "node", or "nodes"; if not provided, any_type is used. keys() given an object, returns a
list of the keys (or property names) on that object. this is a shortcut for object.keys. values() given an object, returns a
list of the values on that object; serves as a companion to keys(). clear() clears the console output area. inspect() given an object, opens the object inspector for that object. pprint() obsolete since gecko 74 formats the specified value in a readable way; this is usef...
AddressErrors - Web APIs
s describes the supported payment handlers and the details for those. in this example, only the basic card handler is supported, and it's configured to permit both debit and credit cards from visa, master card, american express, and discover. defaultpaymentdetails describes the payment being requested. a description of the total amount being requested (including a label and the currency used), a
list of the line items (in this case only one, "original donation amount"), and a
list of shipping options available; in this case only one. process the payment the main payment processing code is found in the process() method, up next. let request; function process() { let options = {requestshipping: true}; try { request = new paymentrequest(supportedhandlers, defaultpaymentdetails, opti...
... request.onshippingaddresschange = handleaddresschange; // call show() to trigger the browser's payment flow. request.show().then(function(instrumentresponse) { // do something with the response from the ui. ...
...he updatedetails object. this lets the payment request api know to present the specified error or errors but to allow the user to keep trying to edit the address. setting up the donate now button this code creates a handler for the load event on the window which in turn adds the needed click event handler to the "donate now" button so that clicking it starts the payment process. window.addevent
listener("load", function(ev) { document.getelementbyid("pay").addevent
listener("click", process, false); }, false); see addevent
listener() for information about event handlers and how they work. html here's the simple html for this example. <p>donate us $65 to our worthwhile cause and we will send you a totally not-useless gift as a token of our thanks!</p> <button id="pay">donate now</button...
Ambient Light Events - Web APIs
ging the exposure necessary to take a picture. light events when the light sensor of a device detects a change in the light level, it notifies the browser of that change. when the browser gets such a notification, it fires a devicelightevent event that provides information about the exact light intensity (in lux units). ...
...ux units). this event can be captured at the window object level by using the addevent
listener method (using the devicelight event name) or by attaching an event handler to the window.ondevicelight property. once captured, the event object gives access to the light intensity expressed in lux through the devicelightevent.value property. ...
...ame) or by attaching an event handler to the window.ondevicelight property. once captured, the event object gives access to the light intensity expressed in lux through the devicelightevent.value property. example if ('ondevicelight' in window) { window.addevent
listener('devicelight', function(event) { var body = document.queryselector('body'); if (event.value < 50) { body.class
list.add('darklight'); body.class
list.remove('brightlight'); } else { body.class
list.add('brightlight'); body.class
list.remove('darklight'); } }); } else { console.log('devicelight event not supported'); } specifications specification status comment ambient light sensorthe definition of 'ambient light events' in that specification. candid...
Animation.onremove - Web APIs
oved (i.e., put into an active replace state). syntax var removehandler = animation.onremove; animation.onremove = removehandler; value a function to be called to handle the remove event, or null if no remove event handler is set. ...
...for this reason, modern browsers automatically remove overriding forward filling animations. ...
...for this reason, modern browsers automatically remove overriding forward filling animations. ...
Animation.persist() - Web APIs
nimation interface explicitly persists an animation, when it would otherwise be removed due to the browser's automatically removing filling animations behavior. syntax animation.persist(); parameters none. return value none. ...
...for this reason, modern browsers automatically remove overriding forward filling animations. ...
...for this reason, modern browsers automatically remove overriding forward filling animations. you can see the replacestate of the animation being logged at the end of the handler. ...
Animation.replaceState - Web APIs
has been removed by the browser's automatically removing filling animations behavior. persisted: the animation has been explicitly persisted by invoking animation.persist() on it. removed: the animation has been explicitly removed. ...
...for this reason, modern browsers automatically remove overriding forward filling animations. ...
...for this reason, modern browsers automatically remove overriding forward filling animations. you can see the replacestate of the animation being logged at the end of the handler. ...
BasicCardRequest - Web APIs
ary is a javascript object-structure that can be used in the payment request api. the properties of basiccardrequest are defined in the basic card payment spec). properties basiccardrequest.supportednetworks optional secure context an optional array of domstrings representing the card networks that the retailer supports (e.g. "amex", "mastercard"); see card network identifiers for a complete
list. if the property is missing, it implies that all networks are supported. obsolete properties these properties have been removed from the payment method: basic card specification and should no longer be used. basiccardrequest.supportedtypes optional secure context this obsolete property was used to provide an optional array of domstrings representing the card types that the retailer suppo...
...provide an optional array of domstrings representing the card types that the retailer supports (e.g. credit, debit, prepaid). if the property is missing, it implies that all the card types are supported. instead of using this property, it is up to the server to check support for the card given the information coded into the account number. card network identifiers the w3c maintains an official
list of approved card network identifier strings, which may be used in the supportednetworks
list. those are: amex cartebancaire diners discover jcb mastercard mir unionpay visa examples in the following example, the paymentrequest() constructor is used to create a new payment request, which takes three objects as parameters — one containing details of the payment methods that can be...
... // call show() to trigger the browser's payment flow. request.show().then(function(instrumentresponse) { // do something with the response from the ui. }) .catch(function(err) { // do something with the error from request.show(). }); } catch (e) { // catch any other errors. } once the payment flow has been triggered using paymentrequest.show() and the promise resol...
BasicCardResponse - Web APIs
// call show() to trigger the browser's payment flow. request.show().then(function(instrumentresponse) { // do something with the response from the ui. }) .catch(function(err) { // do something with the error from request.show(). }); } catch (e) { // catch any other errors. } once the payment flow has been triggered using paymentrequest.show() and the promise resol...
...to change preferences in firefox, visit about:config.ie no support noopera no support nosafari ? webview android no support ...
...to change preferences in firefox, visit about:config.opera android no support nosafari ios ? samsung internet android full support 7.0billingaddresschrome ...
CSSRule - Web APIs
properties common to all cssrule instances cssrule.csstext represents the textual representation of the rule, e.g. "h1,h2 { font-size: 16pt }" or "@import 'url'". to access or modify parts of the rule (e.g. ...
... properties common to all cssrule instances cssrule.csstext represents the textual representation of the rule, e.g. "h1,h2 { font-size: 16pt }" or "@import 'url'". to access or modify parts of the rule (e.g. the value of "font-size" in the example) use the properties on the specialized interface for the rule's type. ...
... specifications specification status comment css object model (cssom)the definition of 'cssrule' in that specification. working draft obsoleted values charset_rule and unknown_rule. added value namespace_rule. css animationsthe definition of 'cssrule' in that specification. working draft added values ke...
CSSStyleDeclaration.setProperty() - Web APIs
working draft document object model (dom) level 2 style spe...
... working draft document object model (dom) level 2 style specificationthe definition of 'cssstyledeclaration' in th...
... working draft document object model (dom) level 2 style specificationthe definition of 'cssstyledeclaration' in that specification. obsolete ...
CSSStyleSheet.insertRule() - Web APIs
syntax stylesheet.insertrule(rule [, index]) parameters rule a domstring containing the rule to be inserted. what the inserted rule must contain depends on its type: for rule-sets, both a selector and a style declaration. ...
...at-rules, both an at-identifier and the rule content. index optional a positive integer less than or equal to stylesheet.cssrules.length, representing the newly inserted rule's position in cssstylesheet.cssrules. the default is 0. (in older implementations, this was required. see browser compatibility for details.) return value the newly inserted rule's index within the stylesheet's rule-
list. restrictions css has some intuitive and not-so-intuitive restrictions affecting where rules can be inserted. violating them will likely raise a domexception. if index > cssrule
list.length, the method aborts with an indexsizeerror. if rule cannot be inserted at index 0 due to some css constraint, the method aborts with a hierarchyrequesterror. if more than one rule is given in the rule par...
...ngth, the method aborts with an indexsizeerror. if rule cannot be inserted at index 0 due to some css constraint, the method aborts with a hierarchyrequesterror. if more than one rule is given in the rule parameter, the method aborts with a syntaxerror. if trying to insert an @import at-rule after a style rule, the method aborts with a hierarchyrequesterror. if rule is @namespace and the rule-
list has more than just @import at-rules and/or @namespace at-rules, the method aborts with an invalidstateerror. examples inserting a new rule this snippet pushes a new rule onto the top of my stylesheet. mystyle.insertrule('#blanc { color: white }', 0); function to add a stylesheet rule /** * add a stylesheet rule to the document (it may be better practice * to dynamically change classes, ...
CSSStyleSheet.ownerRule - Web APIs
eturned value is null. syntax var ownerrule = cssstylesheet.ownerrule; value a cssimportrule corresponding to the @import rule which imported the stylesheet into the document. if the stylesheet wasn't imported into the document using @import, the returned value is null. examples this snippet of code looks for rules which were not imported into the document using an @import at-rule. ...
...wnerrule; value a cssimportrule corresponding to the @import rule which imported the stylesheet into the document. if the stylesheet wasn't imported into the document using @import, the returned value is null. examples this snippet of code looks for rules which were not imported into the document using an @import at-rule. ...
...ned value is null. examples this snippet of code looks for rules which were not imported into the document using an @import at-rule. let rule
list = document.stylesheets[0].cssrules; for (let rule of rule
list) { if (!rule.ownerrule) { /* rule is not imported */ } } this snipped obtains a reference to the stylesheet associated with the @import and processes it in some manner: let rule
list = document.stylesheets[0].cssrules; for (let rule of rule
list) { if (rule.ownerrule) { checkstylesheet(rule.ownerrule.stylesheet); } } specifications specification status comment css object model (cssom)the definition of 'cssstylesheet.ownerrule' in that specification. working draft ...
Managing screen orientation - Web APIs
ibus. ...
...entation, ensuring that the user will always be able to read what's on the screen. while this behavior is perfectly suited for text content, there is some content that can be negatively affected by such a change. for example, games based on the orientation of the device could be messed up by such a change of the orientation. the screen orientation api is made to prevent or handle such a change. ...
...le, games based on the orientation of the device could be messed up by such a change of the orientation. the screen orientation api is made to prevent or handle such a change.
listening orientation change the orientationchange event is triggered each time the device change the orientation of the screen and the orientation itself can be read with the screen.orientation property. screen.addevent
listener("orientationchange", function () { console.log("the orientation of the screen is: " + screen.orientation); }); preventing orientation change any web application can lock the screen to suits its own needs. the screen is locked using the screen.lockorientation() method and unlocked using the screen.unlockorientation(). the screen.lockorientation() accepts a string (or series of strings) t...
CSS Typed Object Model API - Web APIs
he given property and value. stylepropertymap.delete() method that removes the css declaration with the given property from the stylepropertymap. stylepropertymap.clear() method that removes all declarations in the stylepropertymap. cssunparsedvalue the cssunparsedvalue interface of the css typed object model api represents property values that reference custom properties. it consists of a
list of string fragments and variable references. cssunparsedvalue.cssunparsedvalue() constructor creates a new cssunparsedvalue object which represents property values that reference custom properties. cssunparsedvalue.entries() method returning an array of a given object's own enumerable property [key, value] pairs in the same order as that provided by a for...in loop (the difference being tha...
...words and other identifiers. csskeywordvalue.value() property of the csskeywordvalue interface returning or setting the value of the csskeywordvalue. cssstylevalue interfaces cssstylevalue is the base class through which all css values are expressed. subclasses include: cssimagevalue objects an interface representing values for properties that take an image, for example background-image,
list-style-image, or border-image-source. csskeywordvalue an interface which creates an object to represent css keywords and other identifiers. when used where a string is expected, it will return the value of csskeyword.value. cssnumericvalue an interface representing operations that all numeric values can perform, including: cssnumericvalue.add - adds supplied numbers to the cssnumericvalue.
... and value, in the same order. otherwise, false cssnumericvalue.to - converts value into another one with the specified unit. cssnumericvalue.tosum cssnumericvalue.type cssnumericvalue.parse - returns a number parsed from a css string csspositionvalue represents values for properties that take a position, for example object-position. csstransformvalue an interface representing a
list of transform
list values. they "contain" one or more csstransformcomponents, which represent individual transform function values. cssunparsedvalue represents property values that reference custom properties. it consists of a
list of string fragments and variable references. specifications specification status comment css typed om level 1 working draft initial...
CanvasRenderingContext2D.drawFocusIfNeeded() - Web APIs
eded() method is used to draw a focus ring when appropriate. ...
...propriate. ...
...n id="button1">continue</button> <button id="button2">quit</button> </canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); const button1 = document.getelementbyid('button1'); const button2 = document.getelementbyid('button2'); document.addevent
listener('focus', redraw, true); document.addevent
listener('blur', redraw, true); canvas.addevent
listener('click', handleclick, false); redraw(); function redraw() { ctx.clearrect(0, 0, canvas.width, canvas.height); drawbutton(button1, 20, 20); drawbutton(button2, 20, 80); } function handleclick(e) { // calculate click coordinates const x = e.clientx - canvas.offsetleft; const y = e.clienty - canvas.offsettop; // focus button1, if appropriate drawbutton(button1, 20, 20); if (...
Manipulating video using canvas - Web APIs
n background in the video. the javascript code is imported from a script named processor.js. the javascript code the javascript code in processor.js consists of three methods. initializing the chroma-key player the doload() method is called when the xhtml document initially loads. ...
...vent
listener so we can detect when the user starts playing the video. var processor; processor.doload = function doload() { this.video = document.getelementbyid('video'); this.c1 = document.getelementbyid('c1'); this.ctx1 = this.c1.getcontext('2d'); this.c2 = document.getelementbyid('c2'); this.ctx2 = this.c2.getcontext('2d'); let self = this; this.video.addevent
listener('play', function() { self.width = self.video.videowidth / 2; self.height = self.video.videoheight / 2; self.timercallback(); }, false); }, this code grabs references to the elements in the xhtml document that are of particular interest, namely the video element and the two canvas elements. it also fetches references to the graphics contexts for each of the t...
...f.video.videoheight / 2; self.timercallback(); }, false); }, this code grabs references to the elements in the xhtml document that are of particular interest, namely the video element and the two canvas elements. it also fetches references to the graphics contexts for each of the two canvases. these will be used when we're actually doing the chroma-keying effect. then addevent
listener() is called to begin watching the video element so that we obtain notification when the user presses the play button on the video. in response to the user beginning playback, this code fetches the width and height of the video, halving each (we will be halving the size of the video when we perform the chroma-keying effect), then calls the timercallback() method to start watching the video an...
DataTransfer.files - Web APIs
example there are two live examples of this interface: firefox only: http://jsfiddle.net/9c2ef/ all browsers: https://jsbin.com/hiqasek/ specifications specification status comment html living standardthe definition of 'files' in that specification. ...
... example there are two live examples of this interface: firefox only: http://jsfiddle.net/9c2ef/ all browsers: https://jsbin.com/hiqasek/ specifications specification status comment html living standardthe definition of 'files' in that specification. ...
... example there are two live examples of this interface: firefox only: http://jsfiddle.net/9c2ef/ all browsers: https://jsbin.com/hiqasek/ specifications specification status comment html living standardthe definition of 'files' in that specification. ...
DedicatedWorkerGlobalScope: messageerror event - Web APIs
the messageerror event is fired on a dedicatedworkerglobalscope object when it receives a message that can't be deserialized. ...
... the messageerror event is fired on a dedicatedworkerglobalscope object when it receives a message that can't be deserialized. ...
... the messageerror event is fired on a dedicatedworkerglobalscope object when it receives a message that can't be deserialized. ...
Using light sensors - Web APIs
in light intensity, the browser is notified of the change and fires a devicelightevent event. the event gives information about the light intensity of the device's environment. the devicelightevent provides a value attribute with light intensity in lux which is generally treated as shown below. ...
...ange and fires a devicelightevent event. the event gives information about the light intensity of the device's environment. the devicelightevent provides a value attribute with light intensity in lux which is generally treated as shown below. 10 ~ 50 lux : dim environment 100 ~ 1000 lux : normal > 10000 lux : bright it uses the addevent
listener method of the window object. ...
...des a value attribute with light intensity in lux which is generally treated as shown below. 10 ~ 50 lux : dim environment 100 ~ 1000 lux : normal > 10000 lux : bright it uses the addevent
listener method of the window object. window.addevent
listener("devicelight", function (event) { // read out the lux value var luminosity = event.value; alert(luminosity); }); example: window.addevent
listener('devicelight', function(event) { var bodybg= document.body.style; //event.value is the lux value returned by the sensor on the device if (event.value < 100) { alert('hey, you! you are working in a dark environment'); bodybg.backgroundcolor="lightgrey"; } else { bodybg.backgroundcolor="#fff"; } }); this example shows how the api can actually be used in the wild. if your app contains a...
Document.forms - Web APIs
each item in the collection is a htmlformelement representing a single <form> element. if the document has no forms, the returned collection is empty, with a length of zero. ...
...each item in the collection is a htmlformelement representing a single <form> element. if the document has no forms, the returned collection is empty, with a length of zero. ...
...each item in the collection is a htmlformelement representing a single <form> element. if the document has no forms, the returned collection is empty, with a length of zero. ...
Document.getElementsByName() - Web APIs
the getelementsbyname() method of the document object returns a node
list collection of elements with a given name in the document. syntax var elements = document.getelementsbyname(name); elements is a live node
list collection, meaning it automatically updates as new elements with the same name are added to/removed from the document. name is the value of the name attribute of the element(s). ...
...ment(s). example <!doctype html> <html lang="en"> <title>example: using document.getelementsbyname</title> <input type="hidden" name="up"> <input type="hidden" name="down"> <script> var up_names = document.getelementsbyname("up"); console.log(up_names[0].tagname); // displays "input" </script> </html> notes the name attribute can only be applied in (x)html documents. the returned node
list collection contains all elements with the given name, such as <meta>, <object>, and even elements which do not support the name attribute at all. the getelementsbyname method works differently in ie10 and below. there, getelementsbyname() also returns elements that have an id attribute with the specified value. be careful not to use the same string as both a name and an id. the getelementsby...
... and below. there, getelementsbyname() also returns elements that have an id attribute with the specified value. be careful not to use the same string as both a name and an id. the getelementsbyname method works differently in ie. there, getelementsbyname() does not return all elements which may not have a name attribute (such as <span>). both ie and edge return an htmlcollection, not a node
list specifications specification status comment html living standardthe definition of 'document.getelementsbyname()' in that specification. living standard document object model (dom) level 2 html specificationthe definition of 'document.getelementsbyname()' in that specification. obsolete initial definition ...
Document: keydown event - Web APIs
now fired during ime composition, to improve cross-browser compatibility for cjkt users (bug 354358, also see keydown and keyup events are now fired during ime composition for more useful details). ...
...w fired during ime composition for more useful details). to ignore all keydown events that are part of composition, do something like this (229 is a special value set for a keycode relating to an event that has been processed by an ime): eventtarget.addevent
listener("keydown", event => { if (event.iscomposing || event.keycode === 229) { return; } // do something }); examples addevent
listener keydown example this example logs the keyboardevent.code value whenever you press down a key. <p>focus the iframe first (e.g. ...
... by an ime): eventtarget.addevent
listener("keydown", event => { if (event.iscomposing || event.keycode === 229) { return; } // do something }); examples addevent
listener keydown example this example logs the keyboardevent.code value whenever you press down a key. <p>focus the iframe first (e.g. ...
Document.scripts - Web APIs
example this example looks to see if the page has any <script> elements. ...
... example this example looks to see if the page has any <script> elements. ...
... example this example looks to see if the page has any <script> elements. ...
EffectTiming.fill - Web APIs
s and after it ends, and so forth. here we specify that the animation should take 2000 milliseconds (2 seconds) to complete, should only run once, and that the fill mode should be "none". as defined above, the "none" fill mode means that the element will be rendered in its natural, unaltered condition anytime the animation isn't actively running. ...
...defined above, the "none" fill mode means that the element will be rendered in its natural, unaltered condition anytime the animation isn't actively running. document.getelementbyid("animatebutton").addevent
listener("click", event => { document.getelementbyid("box").animate( boxrotationkeyframes, boxrotationtiming ); }, false); the rest of the code is pretty simple: it adds an event
listener to the "animate" button so that when it's clicked by the user, the box is animated by calling element.animate() on it, providing the boxrotationkeyframes and boxrotationtiming objects to describe the animation that should occur. result below we see what the result looks like. notice how before the animation starts running, the box is upright, then upon clicking the "animate!" button, the bo...
...g the animation and then animate from the start value. this is the approach used in flip animation. elem.style.transform = 'translatey(100px)'; elem.animate({ transform: 'none', offset: 0 }, 200); for some complex effects where animations layer on top of one another, it may be necessary to use a fill mode temporarily to capture the final value of an animation before canceling it. elem.addevent
listener('click', async evt => { const animation = elem.animate( { transform: `translate(${evt.clientx}px, ${evt.clienty}px)` }, { duration: 800, fill: 'forwards' } ); await animation.finished; // commitstyles will record the style up to and including `animation` and // update elem’s specified style with the result. animation.commitstyles(); animation.cancel(); }); specificat...
Element: click event - Web APIs
0,0) set opacity: 0 and an explicit background-color other than transparent for ie8 and ie9: set filter: alpha(opacity=0); and an explicit background-color other than transparent safari mobile safari mobile 7.0+ (and likely earlier versions too) suffers from a bug where click events aren't fired on elements that aren't typically interactive (e.g. <div>) and which also don't have event
listeners directly attached to the elements themselves (i.e. event delegation is being used). see this live example for a demonstration. see also safari's docs on making elements clickable and the definition of "clickable element". known workarounds for this bug: set cursor: pointer; on the element or any of its ancestors. add a dummy onclick="void(0)" attribute to the element or any of its ances...
...g., <a>) instead of one that isn't typically interactive (e.g., <div>). stop using click event delegation. ...
...if you take a break between clicks, the count will reset. ...
Element.insertAdjacentElement() - Web APIs
error the position specified is not a recognised value. typeerror the element specified is not a valid element. visualization of position names <!-- beforebegin --> <p> <!-- afterbegin --> foo <!-- beforeend --> </p> <!-- afterend --> note: the beforebegin and afterend positions work only if the node is in a tree and has an element parent. ...
...oo <!-- beforeend --> </p> <!-- afterend --> note: the beforebegin and afterend positions work only if the node is in a tree and has an element parent. ...
...d --> note: the beforebegin and afterend positions work only if the node is in a tree and has an element parent. example beforebtn.addevent
listener('click', function() { var tempdiv = document.createelement('div'); tempdiv.style.backgroundcolor = randomcolor(); if (activeelem) { activeelem.insertadjacentelement('beforebegin',tempdiv); } set
listener(tempdiv); }); afterbtn.addevent
listener('click', function() { var tempdiv = document.createelement('div'); tempdiv.style.backgroundcolor = randomcolor(); if (activeelem) { activeelem.insertadjacentelement('afterend',tempdiv); } set
listener(tempdiv); }); have a look at our insertadjacentelement.html demo on github (see the source code too.) here we have a sequence of <div> elements inside a container. when one is clic...
Event.composed - Web APIs
the composed property returns true beause the click event is always able to propagate across shadow boundaries. you'll notic...
... the composed property returns true beause the click event is always able to propagate across shadow boundaries. you'll notice a difference in the value of composedpath for the two elements. the ...
... specifications specification status comment domthe definition of 'composed' in that specification. living standard ...
EventSource: message event - Web APIs
ceived through an event source. bubbles no cancelable no interface messageevent event handler property eventsource.onmessage examples in this basic example, an eventsource is created to receive events from the server; a page with the name sse.php is responsible for generating the events. ...
... cancelable no interface messageevent event handler property eventsource.onmessage examples in this basic example, an eventsource is created to receive events from the server; a page with the name sse.php is responsible for generating the events. ...
...in this basic example, an eventsource is created to receive events from the server; a page with the name sse.php is responsible for generating the events. var evtsource = new eventsource('sse.php'); var event
list = document.queryselector('ul'); evtsource.addevent
listener('message', (e) => { var newelement = document.createelement("li"); newelement.textcontent = "message: " + e.data; event
list.appendchild(newelement); }); onmessage equivalent evtsource.onmessage = (e) => { var newelement = document.createelement("li"); newelement.textcontent = "message: " + e.data; event
list.appendchild(newelement); }; specifications specification status html living standardthe definition of 'message event' in that specification. living standard ...
ExtendableMessageEvent - Web APIs
d message channel. methods inherits methods from its parent, extendableevent. examples in the below example a page gets a handle to the serviceworker object via serviceworkerregistration.active, and then calls its postmessage() function. ...
... ...
...eworker.addevent
listener('message', event => { // event is a messageevent object console.log(`the service worker sent me a message: ${event.data}`); }); navigator.serviceworker.ready.then( registration => { registration.active.postmessage("hi service worker"); }); } the service worker can receive the message by
listening to the message event: // in the service worker addevent
listener('message', event => { // event is an extendablemessageevent object console.log(`the client sent me a message: ${event.data}`); event.source.postmessage("hi client"); }); specifications specification status comment service workersthe definition of 'extendablemessageevent' in that specification. working draft initial definition. ...
FileReader - Web APIs
important note: filereader is used to read file content from the user's (remote) system in secure ways only. ...
...his event is triggered each time the reading is starting. filereader.onloadend a handler for the loadend event. this event is triggered each time the reading operation is completed (either in success or failure). filereader.onprogress a handler for the progress event. this event is triggered while reading a blob content. as filereader inherits from eventtarget, all those events can also be
listened for by using the addevent
listener method. methods filereader.abort() aborts the read operation. upon return, the readystate will be done. filereader.readasarraybuffer() starts reading the contents of the specified blob, once finished, the result attribute contains an arraybuffer representing the file's data. filereader.readasbinarystring() starts reading the contents of the specifi...
... as a string. filereader.readasdataurl() starts reading the contents of the specified blob, once finished, the result attribute contains a data: url representing the file's data. filereader.readastext() starts reading the contents of the specified blob, once finished, the result attribute contains the contents of the file as a text string. an optional encoding name can be specified. events
listen to these events using addevent
listener() or by assigning an event
listener to the oneventname property of this interface. abort fired when a read has been aborted, for example because the program called filereader.abort(). also available via the onabort property. error fired when the read failed due to an error. also available via the onerror property. load fired when a read has compl...
FontFaceSet - Web APIs
set interface of the css font loading api manages the loading of font-faces and querying of their download status. properties fontfaceset.status read only indicates the font-face's loading status. it will be one of 'loading' or 'loaded'. fontfaceset.ready read only promise which resolves once font loading and layout operations have completed. ...
...atus read only indicates the font-face's loading status. it will be one of 'loading' or 'loaded'. fontfaceset.ready read only promise which resolves once font loading and layout operations have completed. events fontfaceset.onloading an event
listener called whenever an event of type loading is fired, indicating a font-face set has started loading. fontfaceset.onloadingdone an event
listener called whenever an event of type loadingdone is fired, indicating that a font face set has finished loading. fontfaceset.onloadingerror an event
listener called whenever an event of type loadingerror is fired, indicating that an error occurred whilst loading a font-face set. methods fontfaceset.add() adds a font to the font set. fontfaceset.check() a boolean that indicates whether a ...
...t set. fontfaceset.check() a boolean that indicates whether a font is loaded, but doesn't initiate a load when it isn't. fontfaceset.clear() removes all manually-added fonts from the font set. css-connected fonts are unaffected. fontfaceset.delete() removes a manually-added font from the font set. css-connected fonts are unaffected. fontfaceset.load() returns a promise which resolves to a
list of font-faces for a requested font. specifications specification status comment css font loading module level 3the definition of 'fontfaceset' in that specification. editor's draft initial definition ...
FormDataEvent - Web APIs
this happens when the form is submitted, but can also be triggered by the invocation of a formdata() constructor. this allows a formdata object to be quickly obtained in response to a formdata event firing, rather than needing to put it together yourself when you wish to submit form data via a method like xmlhttprequest (see using formdata objects). constructor formdataevent() creates a new formdataevent object instance. ...
...nt object instance. properties inherits properties from its parent interface, event. formdataevent.formdata contains the formdata object representing the data contained in the form when the event was fired. methods inherits methods from its parent interface, event. ...
...rom its parent interface, event. ...
Fullscreen API - Web APIs
the browser compatibility section below for details on support for this api. you may wish to consider using a library such as fscreen for vendor agnostic access to the fullscreen api. interfaces the fullscreen api has no interfaces of its own. instead, it augments several other interfaces to add the methods, properties, and event handlers needed to provide full-screen functionality. these are
listed in the following sections. methods the fullscreen api adds methods to the document and element interfaces to allow turning off and on full-screen mode. methods on the document interface document.exitfullscreen() requests that the user agent switch from full-screen mode back to windowed mode. returns a promise which is resolved once full-screen mode has been completely shut off. methods...
...t or element if an error occurs while attempting to switch it into or out of full-screen mode. dictionaries fullscreenoptions provides optional settings you can specify when calling requestfullscreen(). controlling access the availability of full-screen mode can be controlled using feature policy. the full-screen mode feature is identified by the string "fullscreen", with a default allow-
list value of "self", meaning that full-screen mode is permitted in top-level document contexts, as well as to nested browsing contexts loaded from the same origin as the top-most document. see using feature policy to learn more about using feature policy to control access to an api. usage notes users can choose to exit full-screen mode simply by pressing the esc (or f11) key, rather than waiting f...
...itching to another application using any application switcher (or alt-tab) will likewise exit full-screen mode. example in this example, a video is presented in a web page. pressing the return or enter key lets the user toggle between windowed and full-screen presentation of the video. view live examples watching for the enter key when the page is loaded, this code is run to set up an event
listener to watch for the enter key. document.addevent
listener("keypress", function(e) { if (e.keycode === 13) { togglefullscreen(); } }, false); toggling full-screen mode this code is called by the event handler above when the user hits the enter key. function togglefullscreen() { if (!document.fullscreenelement) { document.documentelement.requestfullscreen(); } else { if (...
GlobalEventHandlers.onerror - Web APIs
the globaleventhandlers mixin is an eventhandler that processes error events. error events are fired at various targets for different kinds of errors: when a javascript runtime error (including syntax errors and exceptions thrown within handlers) occurs, an error event using interface errorevent is fired at window and window.onerror() is invoked (as well as handlers attached by window.addevent
listener (not only capturing)). when a resource (such as an <img> or <script>) fails to load, an error event using interface event is fired at the element that initiated the load, and the onerror() handler on the element is invoked. these error events do not bubble up to window, but (at least in firefox) can be handled with a window.addevent
listener configured with usecapture set to true. installin...
... window.onerror window.onerror = function(message, source, lineno, colno, error) { ... }; function parameters: message: error message (string). available as event (sic!) in html onerror="" handler. ...
...error message (string). available as event (sic!) in html onerror="" handler. source: url of the script where the error was raised (string) lineno: line number where error was raised (number) colno: column number for the line where the error occurred (number) error: error object (object) when the function returns true, this prevents the firing of the default event handler. window.addevent
listener('error') window.addevent
listener('error', function(event) { ... }) event of type errorevent contains all the information about the event and the error. element.onerror element.onerror = function(event) { ... } element.onerror accepts a function with a single argument of type event. a good example for this is when you are using an image tag, and need to specify a backup image in case t...
HTMLAnchorElement - Web APIs
ing representing the protocol component, including trailing colon (':'), of the referenced url. htmlanchorelement.referrerpolicy is a domstring that reflects the referrerpolicy html attribute indicating which referrer to use. htmlanchorelement.rel is a domstring that reflects the rel html attribute, specifying the relationship of the target object to the linked object. htmlanchorelement.rel
list read only returns a domtoken
list that reflects the rel html attribute, as a
list of tokens. htmlhyperlinkelementutils.search is a usvstring representing the search element, including leading question mark ('?'), if any, of the referenced url. htmlelement.tabindex is a long containing the position of the element in the tabbing navigation order for the current document. htmlanchorelement.tar...
...at reflects the type html attribute, indicating the mime type of the linked resource. htmlhyperlinkelementutils.username is a usvstring containing the username specified before the domain name. obsolete properties htmlanchorelement.charset is a domstring representing the character encoding of the linked resource. htmlanchorelement.coords is a domstring representing a comma-separated
list of coordinates. htmlanchorelement.name is a domstring representing the anchor name. htmlanchorelement.rev is a domstring representing that the rev html attribute, specifying the relationship of the link object to the target object. note: currently the w3c html 5.2 spec states that rev is no longer obsolete, whereas the whatwg living standard still has it labeled obsolete. until this disc...
... html5the definition of 'htmlanchorelement' in that specification. recommendation the methods blur() and focus(), as well as the properties tabindex and accesskey, are now defined on htmlelement. the following properties are now obsolete: charset, coords, name, rev, and shape. the following properties have been added: hash, host, hostname, media, pathname, port, protocol, rel
list, search, and text. document object model (dom) level 2 html specificationthe definition of 'htmlanchorelement' in that specification. obsolete no change from document object model (dom) level 1 specification. document object model (dom) level 1 specificationthe definition of 'htmlanchorelement' in that specification. obsolete initial definition. ...
HTMLElement: change event - Web APIs
change explicitly (e.g., by selecting a value from a <select>'s dropdown with a mouse click, by selecting a date from a date picker for <input type="date">, by selecting a file in the file picker for <input type="file">, etc.); when the element loses focus after its value was changed, but not commited (e.g., after editing the value of <textarea> or <input type="text">). the html specification
lists the <input> types that should fire the change event. examples <select> element html <label>choose an ice cream flavor: <select class="ice-cream" name="ice-cream"> <option value="">select one …</option> <option value="chocolate">chocolate</option> <option value="sardine">sardine</option> <option value="vanilla">vanilla</option> </select> </label> <div class="result"></...
...try entering something into the field below, and then click somewhere else to trigger the event. html <input plac...
...r some elements, including <input type="text">, the change event doesn't fire until the control loses focus. try entering something into the field below, and then click somewhere else to trigger the event. html <input placeholder="enter some text" name="name"/> <p id="log"></p> javascript const input = document.queryselector('input'); const log = document.getelementbyid('log'); input.addevent
listener('change', updatevalue); function updatevalue(e) { log.textcontent = e.target.value; } result specifications specification status html living standardthe definition of 'change' in that specification. living standard ...
HTMLElement - Web APIs
mstringmap with which script can read and write the element's custom data attributes (data-*) . htmlelement.dir is a domstring, reflecting the dir global attribute, representing the directionality of the element. possible values are "ltr", "rtl", and "auto". htmlelement.draggable is a boolean indicating if the element can be dragged. htmlelement.dropzone read only returns a domsettabletoken
list reflecting the dropzone global attribute and describing the behavior of the element regarding a drop operation. htmlelement.hidden is a boolean indicating if the element is hidden or not. htmlelement.inert is a boolean indicating whether the user agent must act as though the given node is absent for the purposes of user interaction events, in-page text searches ("find in page"), and text sele...
...nd text selection. htmlelement.innertext represents the "rendered" text content of a node and its descendants. as a getter, it approximates the text the user would get if they highlighted the contents of the element with the cursor and then copied it to the clipboard. htmlelement.itemscope is a boolean representing the item scope. htmlelement.itemtype read only returns a domsettabletoken
list… htmlelement.itemid is a domstring representing the item id. htmlelement.itemref read only returns a domsettabletoken
list… htmlelement.itemprop read only returns a domsettabletoken
list… htmlelement.itemvalue returns a object representing the item value. htmlelement.lang is a domstring representing the language of an element's attributes, text, and element contents. htmlel...
...internals() attaches an elementinternals instance to the custom element. htmlorforeignelement.blur() removes keyboard focus from the currently focused element. htmlelement.click() sends a mouse click event to the element. htmlorforeignelement.focus() makes the element the current keyboard focus. htmlelement.forcespellcheck() runs the spell checker on the element's contents. events
listen to these events using addevent
listener() or by assigning an event
listener to the oneventname property of this interface. invalid fired when an element does not satisfy its constraints during constraint validation. also available via the oninvalid property. animation events animationcancel fired when an animation unexpectedly aborts. also available via the onanimationcancel property...
HTMLFontElement.face - Web APIs
the obsolete htmlfontelement.face property is a domstring that reflects the face html attribute, containing a comma-separated
list of one or more font names. the document text, in the default style, is rendered as the first font face that the client's browser supports. if no font
listed is installed on the local system, the browser typically defaults to the proportional or fixed-width font for that system. ...
... names. the document text, in the default style, is rendered as the first font face that the client's browser supports. if no font
listed is installed on the local system, the browser typically defaults to the proportional or fixed-width font for that system. ...
... is rendered as the first font face that the client's browser supports. if no font
listed is installed on the local system, the browser typically defaults to the proportional or fixed-width font for that system. the format of the string must follow one of the following html microsyntax: microsyntax description examples
list of one or more valid font family names a
list of font names, that have to be present on the local system courier,verdana syntax facestring = fontobj.face; fontobj.face = facestring; examples // assumes there is <font id="f"> element in the html var f = document.getelementbyid("f"); f.face = "arial"; specifications the <font> tag is not supported in html5 and as a result neither is <font>.face . ...
HTMLFormElement.elements - Web APIs
the htmlformelement property elements returns an htmlformcontrolscollection
listing all the form controls contained in the <form> element. independently, you can obtain just the number of form controls using the length property. you can access a particular form control in the returned collection by using either an index or the element's name or id. prior to html 5, the returned object was an htmlcollection, on which htmlformcontrolscollection is based. note: similarly, you can get a
list of all of the forms contained within a given document using the document's forms property. syntax node
list = htmlformelement.elements value an htmlformcontrolscollection containing all non-image controls in the form. this is a live collection; if form controls are added to or removed from the form, ...
...r in the form by following a preorder, depth-first traversal of the tree. this is called tree order. the elements included by htmlformelement.elements and htmlformelement.length are the following: <button> <fieldset> <input> (with the exception that any whose type is "image" are omitted for historical reasons) <object> <output> <select> <textarea> no other elements are included in the
list returned by elements, which makes it an excellent way to get at the elements most important when processing forms. example quick syntax example in this example, we see how to obtain the
list of form controls as well as how to access its members by index and by name or id. <form id="my-form"> <input type="text" name="username"> <input type="text" name="full-name"> <input type="password" ...
...ell as how to access its members by index and by name or id. <form id="my-form"> <input type="text" name="username"> <input type="text" name="full-name"> <input type="password" name="password"> </form> var inputs = document.getelementbyid("my-form").elements; var inputbyindex = inputs[0]; var inputbyname = inputs["username"]; accessing form controls this example gets the form's element
list, then iterates over the
list, looking for <input> elements of type "text" so that some form of processing can be performed on them. var inputs = document.getelementbyid("my-form").elements; // iterate over the form controls for (i = 0; i < inputs.length; i++) { if (inputs[i].nodename === "input" && inputs[i].type === "text") { // update text input inputs[i].value.tolocaleuppercase(); ...
IDBCursor.continue() - Web APIs
the object store. the cursor does not require us to select the data based on a key; we can just grab all of it. also note that in each iteration of the loop, you can grab data from the current record under the cursor object using cursor.value.foo. ...
...on a key; we can just grab all of it. also note that in each iteration of the loop, you can grab data from the current record under the cursor object using cursor.value.foo. ...
... the cursor object using cursor.value.foo. for a complete working example, see our idbcursor example (view example live.) function displaydata() { var transaction = db.transaction(['rushalbum
list'], "readonly"); var objectstore = transaction.objectstore('rushalbum
list'); objectstore.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var
listitem = document.createelement('li');
listitem.innerhtml = cursor.value.albumtitle + ', ' + cursor.value.year;
list.appendchild(
listitem); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specifications specification status comment indexed database api 2.0the definition of 'continue()' in that specification. ...
IDBCursor.continuePrimaryKey() - Web APIs
or prevunique. invalidstateerror the cursor is currently being iterated or has iterated past its end. invalidaccesserror the cursor's direction is not prev or next. ...
... recommendation ...
... recommendation ...
IDBCursor - Web APIs
the object store. the cursor does not require us to select the data based on a key; we can just grab all of it. also note that in each iteration of the loop, you can grab data from the current record under the cursor object using cursor.value.foo. ...
...on a key; we can just grab all of it. also note that in each iteration of the loop, you can grab data from the current record under the cursor object using cursor.value.foo. ...
... the cursor object using cursor.value.foo. for a complete working example, see our idbcursor example (view example live.) function displaydata() { var transaction = db.transaction(['rushalbum
list'], "readonly"); var objectstore = transaction.objectstore('rushalbum
list'); objectstore.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var
listitem = document.createelement('li');
listitem.innerhtml = cursor.value.albumtitle + ', ' + cursor.value.year;
list.appendchild(
listitem); cursor.continue(); } else { console.log('entries all displayed.'); } }; } specifications specification status comment indexed database api 2.0the definition of 'cursor' in that specification. recomm...
IDBIndex.openKeyCursor() - Web APIs
ect; the key property of the cursor object is set to the found key and the primarykey property is set to the the corresponding primary key of the found record. if no keys match the key range, then then the result property of the event is set to null. note: cursors returned by openkeycursor() do not make the referenced value available as idbindex.opencursor does. this makes obtaining a
list of keys much more efficient. note: this feature is available in web workers. syntax var request = myindex.openkeycursor(); var request = myindex.openkeycursor(range); var request = myindex.openkeycursor(range, direction); parameters range optional a key or idbkeyrange to use as the cursor's range. if nothing is passed, this will default to a key range that selects all the records in this...
...n objectstore using idbobjectstore.openkeycursor except that the returned records are sorted based on the index, not the primary key. finally, we iterate through each record in the index, and insert the last name and the corresponding primary key of the referenced record into an html table. ...
...records are sorted based on the index, not the primary key. finally, we iterate through each record in the index, and insert the last name and the corresponding primary key of the referenced record into an html table. ...
IDBObjectStore.autoIncrement - Web APIs
example in the following code snippet, we open a read/write transaction on our database and add some data to an object store using add(). after the object store has been created, we log objectstore.autoincrement to the console. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todo
list", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. // this is used a lot below db = dbopenrequest.result; // run the adddata() function to add the data to the database adddata(); }; function adddata() { // create a new object ready to insert into the idb var newit...
...duplicate items not allowed.</li>'; }; // create an object store on the transact...
...transaction completing, when everything is done transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error. ...
IDBObjectStore.clear() - Web APIs
sactioninactiveerror this idbobjectstore's transaction is inactive. example in the following code snippet, we open a read/write transaction on our database and clear all the current data out of the object store using clear(). for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todo
list", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. // this is used a lot below db = dbopenrequest.result; // clear all the data form the object store cleardata(); }; function cleardata() { // open a read/write db transaction, ready for clearing the data var transa...
...ss = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. ...
...he transaction completing, when everything is done transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error: ' + transaction.error + '</li>'; }; // create an object store on the transaction var objectstore = transaction.objectstore("todo
list"); // make a request to clear all the data out of the object store var objectstorerequest = objectstore.clear(); objectstorerequest.onsuccess = function(event) { // report the success of our request note.innerhtml += '<li>request successful.</li>'; }; }; specification specification status comment indexed database api 2.0the definition of 'clear()' in th...
IDBObjectStore.createIndex() - Web APIs
wing example you can see the idbopendbrequest.onupgradeneeded handler being used to update the database structure if a database with a higher version number is loaded. createindex() is used to create new indexes on the object store. for a full working example, see our to-do notifications app (view example live.) var db; // let us open our database var dbopenrequest = window.indexeddb.open("todo
list", 4); // two event handlers for opening the database. dbopenrequest.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. // this is used a lot below. db = request.result; // run the displayda...
...pening the database. dbopenrequest.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. // this is used a lot below. db = request.result; // run the displaydata() function to populate the task
list with // all the to-do
list data already in the idb displaydata(); }; // this handler fires when a new database is created and indicates // either that one has not been created before, or a new version // was submitted with window.indexeddb.open(). (see above.) // it is only implemented in recent browsers. dbopenrequest.onupgradeneeded = function(event) { var db = event.target.result; db...
...fore, or a new version // was submitted with window.indexeddb.open(). (see above.) // it is only implemented in recent browsers. ...
IDBObjectStore.delete() - Web APIs
a valid key or a key range. example in the following code snippet, we open a read/write transaction on our database and delete one specific record out of our object store using delete() — a sample record with the key "walk dog". for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todo
list", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. this is used a lot below db = dbopenrequest.result; // run the deletedata() function to delete a record from the database deletedata(); }; function deletedata() { // open a read/write db transaction, ready for deletin...
... note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. ...
...he transaction completing, when everything is done transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error: ' + transaction.error + '</li>'; }; // create an object store on the transaction var objectstore = transaction.objectstore("todo
list"); // make a request to delete the specified record out of the object store var objectstorerequest = objectstore.delete("walk dog"); objectstorerequest.onsuccess = function(event) { // report the success of our request note.innerhtml += '<li>request successful.</li>'; }; }; specification specification status comment indexed database api 2.0the definitio...
IDBObjectStore.get() - Web APIs
record from object store using get() — a sample record with the key "walk dog". once this data object is retrieved, you could then update it using normal javascript, then put it back into the database using a idbobjectstore.put operation. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todo
list", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. // this is used a lot below db = dbopenrequest.result; // run the getdata() function to get the data from the database getdata(); }; function getdata() { // open a read/write db transaction, ready for retrieving the...
...t) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. ...
...he transaction completing, when everything is done transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error: ' + transaction.error + '</li>'; }; // create an object store on the transaction var objectstore = transaction.objectstore("todo
list"); // make a request to get a record by key from the object store var objectstorerequest = objectstore.get("walk dog"); objectstorerequest.onsuccess = function(event) { // report the success of our request note.innerhtml += '<li>request successful.</li>'; var myrecord = objectstorerequest.result; }; }; specifications specification status comment i...
IDBObjectStore.keyPath - Web APIs
e any value type. example in the following code snippet, we open a read/write transaction on our database and add some data to an object store using add(). after the object store has been created, we log objectstore.keypath to the console. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todo
list", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. // this is used a lot below db = dbopenrequest.result; // run the adddata() function to add the data to the database adddata(); }; function adddata() { // create a new object ready to insert into the idb var newit...
...duplicate items not allowed.</li>'; }; // create an object store on the transactio...
...e transaction completing, when everything is done transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error. ...
IDBObjectStore.name - Web APIs
the specified name. example in the following code snippet, we open a read/write transaction on our database and add some data to an object store using add(). after the object store has been created, we log objectstore.name to the console. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todo
list", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. // this is used a lot below db = dbopenrequest.result; // run the adddata() function to add the data to the database adddata(); }; function adddata() { // create a new object ready to insert into the idb var newit...
...duplicate items not allowed.</li>'; }; // create an object store on the transactio...
...e transaction completing, when everything is done transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error. ...
IDBObjectStore.put() - Web APIs
iated record from the idbobjectstore (made available as objectstoretitlerequest.result), updates one property of the record, and then puts the updated record back into the object store in another request with put(). ...
...made available as objectstoretitlerequest.result), updates one property of the record, and then puts the updated record back into the object store in another request with put(). ...
...oretitlerequest.result), updates one property of the record, and then puts the updated record back into the object store in another request with put(). ...
IDBObjectStore.transaction - Web APIs
action object. example in the following code snippet, we open a read/write transaction on our database and add some data to an object store using add(). after the object store has been created, we log objectstore.transaction to the console. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todo
list", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. // this is used a lot below db = dbopenrequest.result; // run the adddata() function to add the data to the database adddata(); }; function adddata() { // create a new object ready to insert into the idb var newit...
...duplicate items not allowed.</li>'; }; // create an object store on the transact...
...transaction completing, when everything is done transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error. ...
IDBOpenDBRequest.onblocked - Web APIs
this event is triggered when the upgradeneeded should be triggered because of a version change but the database is still in use (that is, not closed) somewhere, even after the versionchange event was sent. note: this feature is available in web workers. syntax idbopendbrequest.onblocked = function(event) { ... }; example var db; // let us open our database var request = indexeddb.open("todo
list", 4); // these two event handlers act on the database being opened // successfully, or not request.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; request.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. // this is used a lot below db = request.result;...
...ng opened // successfully, or not request.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; request.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. // this is used a lot below db = request.result; // run the displaydata() function to populate the task
list with // all the to-do
list data already in the idb displaydata(); }; // this event handles the event whereby a new version of the // database needs to be created. either one has not been created // before, or a new version number has been submitted via the // window.indexeddb.open line above //it is only implemented in recent browsers request.onupgradeneeded = function(event) { var db = ev...
...}; request.onblocked = function() { console.log("your database version can't be upgraded because the app is open somewhere else."); } specifications specification status comment indexed database api 2.0the definition of 'onblocked' in that specification. recommendation indexed database api draftthe definition of 'on...
IDBRequest.onerror - Web APIs
erequest.result), updates one property of the record, and then puts the updated record back into the object store. also included at the bottom is an onerror function that reports what the error was if the request fails. ...
... of the record, and then puts the updated record back into the object store. also included at the bottom is an onerror function that reports what the error was if the request fails. ...
...uts the updated record back into the object store. also included at the bottom is an onerror function that reports what the error was if the request fails. ...
IDBRequest.onsuccess - Web APIs
rd title, onsuccess gets the associated record from the idbobjectstore (made available as objectstoretitlerequest.result), updates one property of the record, and then puts the updated record back into the object store. ...
...d record from the idbobjectstore (made available as objectstoretitlerequest.result), updates one property of the record, and then puts the updated record back into the object store. ...
...tstore (made available as objectstoretitlerequest.result), updates one property of the record, and then puts the updated record back into the object store. ...
IDBRequest.readyState - Web APIs
objectstoretitlerequest.result), updates one property of the record, and then puts the updated record back into the object store in another request. the readystate of the 2nd request is logged to the developer console. ...
...tes one property of the record, and then puts the updated record back into the object store in another request. the readystate of the 2nd request is logged to the developer console. ...
...cord, and then puts the updated record back into the object store in another request. the readystate of the 2nd request is logged to the developer console. ...
IDBRequest.result - Web APIs
rd title, onsuccess gets the associated record from the idbobjectstore (made available as objectstoretitlerequest.result), updates one property of the record, and then puts the updated record back into the object store. ...
...d record from the idbobjectstore (made available as objectstoretitlerequest.result), updates one property of the record, and then puts the updated record back into the object store. ...
...tstore (made available as objectstoretitlerequest.result), updates one property of the record, and then puts the updated record back into the object store. ...
IDBRequest.source - Web APIs
e as objectstoretitlerequest.result), updates one property of the record, and then puts the updated record back into the object store in another request. the source of the 2nd request is logged to the developer console. ...
...updates one property of the record, and then puts the updated record back into the object store in another request. the source of the 2nd request is logged to the developer console. ...
...e record, and then puts the updated record back into the object store in another request. the source of the 2nd request is logged to the developer console. ...
IDBRequest.transaction - Web APIs
tes one property of the record, and then puts the updated record back into the object store in another request. the source of the requests is logged to the developer console — both originate from the same transaction. ...
...en puts the updated record back into the object store in another request. the source of the requests is logged to the developer console — both originate from the same transaction. ...
... back into the object store in another request. the source of the requests is logged to the developer console — both originate from the same transaction. ...
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. at the end, we simply abort any activity done under the current transaction using abort(). for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todo
list", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. this is used a lot below db = dbopenrequest.result; // run the adddata() function to add the data to the database adddata(); }; function adddata() { // create a new object ready for being inserted into the idb var n...
...duplicate items not allowed.</li>'; }; // create an object store on the tra...
...he transaction transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed: database modification finished.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error. ...
IDBTransaction.db - Web APIs
data to an object store. note also the functions attached to transaction event handlers to report on the outcome of the transaction opening in the event of success or failure. at the end, we return the associated database connection using db. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todo
list", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. // this is used a lot below db = dbopenrequest.result; // run the adddata() function to add the data to the database adddata(); }; function adddata() { // create a new object ready for being inserted into the idb ...
...duplicate items not allowed.</li>'; }; // create an object store on the tran...
...the transaction transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed: database modification finished.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error. ...
IDBTransaction.error - Web APIs
the outcome of the transaction opening in the event of success or failure. note the transaction.onerror = function(event) { }; block, making use of transaction.error to help in reporting what went wrong when the transaction was unsuccessful. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todo
list", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. // this is used a lot below db = dbopenrequest.result; // run the adddata() function to add the data to the database adddata(); }; function adddata() { // create a new object ready for being inserted into the idb ...
... // run the adddata() function to add the data to the database adddata(); }; function adddata() { // create a new object ready for being inserted into the idb var newitem = [ { tasktitle: "walk dog", hours: 19, minutes: 30, day: 24, month: "december", year: 2013, notified: "no" } ]; // open a read/write db transaction, ready for adding the data var transaction = db.transaction(["todo
list"], "readwrite"); // report on the success of opening the transaction transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed: database modification finished.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error: ' + transaction.error + '</li>'; }; // create an object store on the transa...
...g the transaction transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed: database modification finished.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error: ' + transaction.error + '</li>'; }; // create an object store on the transaction var objectstore = transaction.objectstore("todo
list"); // add our newitem object to the object store var objectstorerequest = objectstore.add(newitem[0]); objectstorerequest.onsuccess = function(event) { // report the success of the request (this does not mean the item // has been stored successfully in the db - for that you need transaction.onsuccess) note.innerhtml += '<li>request successful.</li>'; }; }; specification ...
IDBTransaction.mode - Web APIs
an object store. note also the functions attached to transaction event handlers to report on the outcome of the transaction opening in the event of success or failure. at the end, we simply log the mode of the current transaction using mode. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todo
list", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. // this is used a lot below db = dbopenrequest.result; // run the adddata() function to add the data to the database adddata(); }; function adddata() { // create a new object ready for being inserted into the idb ...
...duplicate items not allowed.</li>'; }; // create an object store on the tran...
...the transaction transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed: database modification finished.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error. ...
IDBTransaction.objectStore() - Web APIs
pet, we open a read/write transaction on our database and add some data to an object store. note also the functions attached to transaction event handlers to report on the outcome of the transaction opening in the event of success or failure. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todo
list", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. // this is used a lot below db = dbopenrequest.result; // run the adddata() function to add the data to the database adddata(); }; function adddata() { // create a new object ready for being inserted into the idb ...
...duplicate items not allowed.</li>'; }; // create an object store on the tran...
...the transaction transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed: database modification finished.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error. ...
IDBTransaction.onabort - Web APIs
nctions attached to transaction event handlers to report on the outcome of the transaction opening in the event of success or failure. note the transaction.onabort = function(event) { }; block, reporting when the transaction has been aborted. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todo
list", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. // this is used a lot below db = dbopenrequest.result; // run the adddata() function to add the data to the database adddata(); }; function adddata() { // create a new object ready for being inserted into the idb ...
... // run the adddata() function to add the data to the database adddata(); }; function adddata() { // create a new object ready for being inserted into the idb var newitem = [ { tasktitle: "walk dog", hours: 19, minutes: 30, day: 24, month: "december", year: 2013, notified: "no" } ]; // open a read/write db transaction, ready for adding the data var transaction = db.transaction(["todo
list"], "readwrite"); // report on the success of opening the transaction transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed: database modification finished.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error: ' + transaction.error + '</li>'; }; // create an object store on the transac...
...ng the transaction transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed: database modification finished.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error: ' + transaction.error + '</li>'; }; // create an object store on the transaction var objectstore = transaction.objectstore("todo
list"); // add our newitem object to the object store var objectstorerequest = objectstore.add(newitem[0]); objectstorerequest.onsuccess = function(event) { // report the success of the request (this does not mean the item // has been stored successfully in the db - for that you need transaction.onsuccess) note.innerhtml += '<li>request successful.</li>'; }; transaction.onabor...
IDBTransaction.oncomplete - Web APIs
tached to transaction event handlers to report on the outcome of the transaction opening in the event of success or failure. note the transaction.oncomplete = function(event) { }; block, which reports back when the transaction was successful. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todo
list", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. // this is used a lot below db = dbopenrequest.result; // run the adddata() function to add the data to the database adddata(); }; function adddata() { // create a new object ready for being inserted into the idb ...
... // run the adddata() function to add the data to the database adddata(); }; function adddata() { // create a new object ready for being inserted into the idb var newitem = [ { tasktitle: "walk dog", hours: 19, minutes: 30, day: 24, month: "december", year: 2013, notified: "no" } ]; // open a read/write db transaction, ready for adding the data var transaction = db.transaction(["todo
list"], "readwrite"); // report on the success of opening the transaction transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed: database modification finished.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error: ' + transaction.error + '</li>'; }; // create an object store on the transac...
...ng the transaction transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed: database modification finished.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error: ' + transaction.error + '</li>'; }; // create an object store on the transaction var objectstore = transaction.objectstore("todo
list"); // add our newitem object to the object store var objectstorerequest = objectstore.add(newitem[0]); objectstorerequest.onsuccess = function(event) { // report the success of the request (this does not mean the item // has been stored successfully in the db - for that you need transaction.oncomplete) note.innerhtml += '<li>request successful.</li>'; }; }; specification ...
IDBTransaction.onerror - Web APIs
the outcome of the transaction opening in the event of success or failure. note the transaction.onerror = function(event) { }; block, making use of transaction.error to help in reporting what went wrong when the transaction was unsuccessful. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todo
list", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable. // this is used a lot below db = dbopenrequest.result; // run the adddata() function to add the data to the database adddata(); }; function adddata() { // create a new object ready for being inserted into the idb ...
... // run the adddata() function to add the data to the database adddata(); }; function adddata() { // create a new object ready for being inserted into the idb var newitem = [ { tasktitle: "walk dog", hours: 19, minutes: 30, day: 24, month: "december", year: 2013, notified: "no" } ]; // open a read/write db transaction, ready for adding the data var transaction = db.transaction(["todo
list"], "readwrite"); // report on the success of opening the transaction transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed: database modification finished.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error: ' + transaction.error + '</li>'; }; // create an object store on the transa...
...g the transaction transaction.oncomplete = function(event) { note.innerhtml += '<li>transaction completed: database modification finished.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error: ' + transaction.error + '</li>'; }; // create an object store on the transaction var objectstore = transaction.objectstore("todo
list"); // add our newitem object to the object store var objectstorerequest = objectstore.add(newitem[0]); objectstorerequest.onsuccess = function(event) { // report the success of the request (this does not mean the item // has been stored successfully in the db - for that you need transaction.onsuccess) note.innerhtml += '<li>request successful.</li>'; }; }; specification ...
IIRFilterNode.getFrequencyResponse() - Web APIs
function calcfrequencyresponse() { iirfilter.getfrequencyresponse(myfrequencyarray, magresponseoutput, phaseresponseoutput); for(i = 0; i <= myfrequencyarray...
...ge: var feedforwardcoefficients = [0.1, 0.2, 0.3, 0.4, 0.5]; var feedbackcoefficients = [0.5, 0.4, 0.3, 0.2, 0.1]; var iirfilter = audioctx.createiirfilter(feedforwardcoefficients, feedbackcoefficients); ... ...
... 0.3, 0.4, 0.5]; var feedbackcoefficients = [0.5, 0.4, 0.3, 0.2, 0.1]; var iirfilter = audioctx.createiirfilter(feedforwardcoefficients, feedbackcoefficients); ... function calcfrequencyresponse() { iirfilter.getfrequencyresponse(myfrequencyarray, magresponseoutput, phaseresponseoutput); for(i = 0; i <= myfrequencyarray.length-1;i++){ var
listitem = document.createelement('li');
listitem.innerhtml = '<strong>' + myfrequencyarray[i] + 'hz</strong>: magnitude ' + magresponseoutput[i] + ', phase ' + phaseresponseoutput[i] + ' radians.'; freqresponseoutput.appendchild(
listitem); } } calcfrequencyresponse(); specifications specification status comment web audio apithe definition of 'getfrequencyresponse()' in that specification. working draft ...
LargestContentfulPaint - Web APIs
eturned as the area (width * height). largestcontentfulpaint.id the id of the element. this property returns an empty string when there is no id. largestcontentfulpaint.url if the element is an image, the request url of the image. methods largestcontentfulpaint.tojson() returns the above properties as json. examples the following example shows how to create a performanceobserver that
listens for largest-contentful-paint entries and logs the lcp value to the console. this example also demonstrates how to include buffered entries (those that ocurred before observer() was called), which is done by setting the buffered option to true. note that in this example data is only sent to the server when the user leaves the tab. // catch errors since some browsers throw when using the new ...
... buffered entries (those that ocurred before observer() was called), which is done by setting the buffered option to true. note that in this example data is only sent to the server when the user leaves the tab. // catch errors since some browsers throw when using the new `type` option. // https://bugs.webkit.org/show_bug.cgi?id=209216 try { let lcp; const po = new performanceobserver((entry
list) => { const entries = entry
list.getentries(); const lastentry = entries[entries.length - 1]; // update `lcp` to the latest value, using `rendertime` if it's available, // otherwise using `loadtime`. (note: `rendertime` may not be available on // image elements loaded cross-origin without the `timing-allow-origin` header.) lcp = lastentry.rendertime || lastentry.loadtime; ...
...te `lcp` to the latest value, using `rendertime` if it's available, // otherwise using `loadtime`. (note: `rendertime` may not be available on // image elements loaded cross-origin without the `timing-allow-origin` header.) lcp = lastentry.rendertime || lastentry.loadtime; }); po.observe({type: 'largest-contentful-paint', buffered: true}); // send data to the server. addevent
listener('visibilitychange', function fn() { if (lcp && document.visibilitystate === 'hidden') { console.log('lcp:', lcp); removeevent
listener('visibilitychange', fn, true); } }, true); } catch (e) { // do nothing if the browser doesn't support this api. } specifications specification status comment largest contentful paintthe definition of 'largestco...
MediaRecorder: error event - Web APIs
t is fired when an error occurs: for example because recording wasn't allowed or was attempted using an unsupported codec. bubbles no cancelable no interface mediarecordererrorevent event handler property onerror for details of the all the possible errors see the documentation for the event handler property: onerror. ...
...hen an error occurs: for example because recording wasn't allowed or was attempted using an unsupported codec. bubbles no cancelable no interface mediarecordererrorevent event handler property onerror for details of the all the possible errors see the documentation for the event handler property: onerror. ...
...rorevent event handler property onerror for details of the all the possible errors see the documentation for the event handler property: onerror. ...
MediaSource.addSourceBuffer() - Web APIs
the new sourcebuffer is also returned. syntax var sourcebuffer = mediasource.addsourcebuffer(mimetype); parameters mimetype a domstring specifying the mime type of the sourcebuffer to create and add to the mediasource. return value a sourcebuffer object representing the new source buffer that has been created and added to the media source. exceptions invalidaccesserror the value specified for mimetype is an empty string rather than a valid mime type. ...
.... exceptions invalidaccesserror the value specified for mimetype is an empty string rather than a valid mime type. invalidstateerror the mediasource is not in the "open" readystate. notsupportederror the specified mimetype isn't supported by the user agent, or is not compatible with the mime types of other sourcebuffer objects that are already included in the media source's sourcebuffers
list. quotaexceedederror the user agent can't handle any more sourcebuffer objects, or creating a new sourcebuffer using the given mimetype would result in an unsupported configuration of sourcebuffers. example the following snippet is from a simple example written by nick desaulniers (view the full demo live, or download the source for further investigation.) var asseturl = 'frag_bunny.mp4'; //...
...ag_bunny.mp4'; // need to be specific for blink regarding codecs // ./mp4info frag_bunny.mp4 | grep codec var mimecodec = 'video/mp4; codecs="avc1.42e01e, mp4a.40.2"'; if ('mediasource' in window && mediasource.istypesupported(mimecodec)) { var mediasource = new mediasource; //console.log(mediasource.readystate); // closed video.src = url.createobjecturl(mediasource); mediasource.addevent
listener('sourceopen', sourceopen); } else { console.error('unsupported mime type or codec: ', mimecodec); } function sourceopen (_) { //console.log(this.readystate); // open var mediasource = this; var sourcebuffer = mediasource.addsourcebuffer(mimecodec); fetchab(asseturl, function (buf) { sourcebuffer.addevent
listener('updateend', function (_) { mediasource.endofstream(); ...
MediaSource - Web APIs
nt-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">mediasource</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constructor mediasource() constructs and returns a new mediasource object with no associated source buffers. properties mediasource.sourcebuffers read only returns a sourcebuffer
list object containing the
list of sourcebuffer objects associated with this mediasource. mediasource.activesourcebuffers read only returns a sourcebuffer
list object containing a subset of the sourcebuffer objects contained within mediasource.sourcebuffers — the
list of objects providing the selected video track, enabled audio tracks, and shown/hidden text tracks. mediasource.readystate read on...
...nsourceclose the event handler for the sourceclose event. mediasource.onsourceended the event handler for the sourceended event. mediasource.onsourceopen the event handler for the sourceopen event. methods inherits methods from its parent interface, eventtarget. mediasource.addsourcebuffer() creates a new sourcebuffer of the given mime type and adds it to the mediasource.sourcebuffers
list. mediasource.clearliveseekablerange() clears a seekable range previously set with a call to setliveseekablerange(). mediasource.endofstream() signals the end of the stream. mediasource.removesourcebuffer() removes the given sourcebuffer from the mediasource.sourcebuffers
list. mediasource.setliveseekablerange() sets the range that the user can seek to in the media element. static method...
..._bunny.mp4'; // need to be specific for blink regarding codecs // ./mp4info frag_bunny.mp4 | grep codec var mimecodec = 'video/mp4; codecs="avc1.42e01e, mp4a.40.2"'; if ('mediasource' in window && mediasource.istypesupported(mimecodec)) { var mediasource = new mediasource(); //console.log(mediasource.readystate); // closed video.src = url.createobjecturl(mediasource); mediasource.addevent
listener('sourceopen', sourceopen); } else { console.error('unsupported mime type or codec: ', mimecodec); } function sourceopen (_) { //console.log(this.readystate); // open var mediasource = this; var sourcebuffer = mediasource.addsourcebuffer(mimecodec); fetchab(asseturl, function (buf) { sourcebuffer.addevent
listener('updateend', function (_) { mediasource.endofstream(); ...
MediaStream.onaddtrack - Web APIs
y adds tracks to the stream (by calling addtrack()). syntax mediastream.onaddtrack = eventhandler; value this should be set to a function which you provide that accepts as input a mediastreamtrackevent object representing the addtrack event which has occurred. the mediastreamtrack representing the track which was added is specified in the event's track property. ...
...ack = eventhandler; value this should be set to a function which you provide that accepts as input a mediastreamtrackevent object representing the addtrack event which has occurred. the mediastreamtrack representing the track which was added is specified in the event's track property. example this example adds a
listener which, when a new track is added to the stream, appends a new item to a
list of tracks; the new item shows the track's kind ("audio" or "video") and label. ...
...epresenting the addtrack event which has occurred. the mediastreamtrack representing the track which was added is specified in the event's track property. example this example adds a
listener which, when a new track is added to the stream, appends a new item to a
list of tracks; the new item shows the track's kind ("audio" or "video") and label. stream.onaddtrack = function(event) { let track
list = document.getelementbyid("tracks"); let label = document.createelement("li"); label.innerhtml = event.track.kind + ": " + event.track.label; track
list.appendchild(label); }; specifications specification status comment media capture and streamsthe definition of 'mediastream.onaddtrack' in that specification. candidate recommendation initial specificatio...
MediaStream - Web APIs
ither by using the constructor or by calling mediadevices.getusermedia(). some user agents subclass this interface to provide more precise information or functionality, like in canvascapturemediastream. constructor mediastream() creates and returns a new mediastream object. you can create an empty stream, a stream which is based upon an existing stream, or a stream that contains a specified
list of tracks (specified as an array of mediastreamtrack objects). properties this interface inherits properties from its parent, eventtarget. mediastream.active read only a boolean value that returns true if the mediastream is active, or false otherwise. mediastream.ended read only a boolean value set to true if the end of the stream has been reached. this has been removed from the spec...
...methods this interface inherits methods from its parent, eventtarget. mediastream.addtrack() stores a copy of the mediastreamtrack given as argument. if the track has already been added to the mediastream object, nothing happens. mediastream.clone() returns a clone of the mediastream object. the clone will, however, have a unique value for id. mediastream.getaudiotracks() returns a
list of the mediastreamtrack objects stored in the mediastream object that have their kind attribute set to audio. the order is not defined, and may not only vary from one browser to another, but also from one call to another. mediastream.gettrackbyid() returns the track whose id corresponds to the one given in parameters, trackid. if no parameter is given, or if no track with that id does exist,...
...rder is not defined, and may not only vary from one browser to another, but also from one call to another. mediastream.gettrackbyid() returns the track whose id corresponds to the one given in parameters, trackid. if no parameter is given, or if no track with that id does exist, it returns null. if several tracks have the same id, it returns the first one. mediastream.gettracks() returns a
list of all mediastreamtrack objects stored in the mediastream object, regardless of the value of the kind attribute. the order is not defined, and may not only vary from one browser to another, but also from one call to another. mediastream.getvideotracks() returns a
list of the mediastreamtrack objects stored in the mediastream object that have their kind attribute set to "video". the order is ...
MediaStreamTrack - Web APIs
see capabilities, constraints, and settings to learn how to correctly work with constrainable properties. not doing so correctly will result in your code being unreliable. ...
... true if the track is sourced by a rtcpeerconnection, false otherwise. methods mediastreamtrack.applyconstraints() lets the application specify the ideal and/or ranges of acceptable values for any number of the available constrainable properties of the mediastreamtrack. mediastreamtrack.clone() returns a duplicate of the mediastreamtrack. mediastreamtrack.getcapabilities() returns the a
list of constrainable properties available for the mediastreamtrack. mediastreamtrack.getconstraints() returns a mediatrackconstraints object containing the currently set constraints for the track; the returned value matches the constraints last set using applyconstraints(). mediastreamtrack.getsettings() returns a mediatracksettings object containing the current values of each of the mediastreamt...
...returned value matches the constraints last set using applyconstraints(). mediastreamtrack.getsettings() returns a mediatracksettings object containing the current values of each of the mediastreamtrack's constrainable properties. mediastreamtrack.stop() stops playing the source associated to the track, both the source and the track are deassociated. the track state is set to ended. events
listen to these events using addevent
listener() or by assigning an event
listener to the oneventname property of this interface: ended sent when playback of the track ends (when the value readystate changes to ended). also available using the onended event handler property. mute sent to the mediastreamtrack when the value of the muted property is changed to true, indicating that the track is un...
Transcoding assets for Media Source Extensions - Web APIs
need to transcode your assets into multiple resolutions. most dash clients expect a corresponding media presentation description (mpd) manifest file, which is typically generated while generating the multiple resolution asset files. below we'll cover all of these steps, but first let's look at a toolchain we can use to do this fairly easily. sample media if you're looking to follow the steps
listed here, but don't have any media to experiment with, you can grab the trailer to big buck bunny [0] here. big buck bunny is licensed under the creative commons attribution 3.0 license. throughout this tutorial, you'll see the filename trailer_1080p.mov which is the download. [0] (c) copyright 2008, blender foundation / www.bigbuckbunny.org / https://peach.blender.org/about/ tools required whe...
...s. to check if the browser supports a particular container, you can pass a string of the mime type to the mediasource.istypesupported method: mediasource.istypesupported('audio/mp3'); // false mediasource.istypesupported('video/mp4'); // true mediasource.istypesupported('video/mp4; codecs="avc1.4d4028, mp4a.40.2"'); // true the string is the mime type of the container, optionally followed by a
list of codecs. while the mime type is fairly simple to figure out, we can get the codec string using the mp4info utility. currently, mp4 containers with h.264 video and aac audio codecs have support across all modern browsers, while others don't. to convert our sample media from a quicktime mov container to an mp4 container, we can use ffmpeg. because the audio codec in the mov container is alread...
...p4 trailer_1080p.mov checking fragmentation in order to properly stream mp4, we need the asset to be an iso bmf format mp4. without proper fragmentation, any given mp4 file is not guaranteed to work with mse. this means that metadata within the container is spread out and not lumped together. to check whether an mp4 file is a proper mp4 stream, you can again use the mp4info utility to
list the atoms of an mp4. note: the fragmented version is slightly larger than the original, due to additional metadata spread throughout the file. this is usually a file size increase of 1 percent or less. fragmenting if you have an asset that is not already an mp4, ffmpeg can handle emitting a properly fragmented mp4 during the transcode process, with the -movflags frag_keyframe+empty_moov comm...
MessageEvent - Web APIs
o entries, but also worker.postmessage(), worker.onmessage, serviceworkerglobalscope.onmessage, etc.) broadcast channels (see broadcastchannel.postmessage()) and broadcastchannel.onmessage). webrtc data channels (see rtcdatachannel.onmessage). the action triggered by this event is defined in a function set as the event handler for the relevant message event (e.g. using an onmessage handler as
listed above). note: this feature is available in web workers. <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 13.333333333333334%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 80" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/even...
...even if their pages are running inside different windows. the following code snippet shows creation of a sharedworker object using the sharedworker() constructor. both scripts contain this: var myworker = new sharedworker('worker.js'); both scripts then access the worker through a messageport object created using the sharedworker.port property. ...
...rker we use the sharedworkerglobalscope.onconnect handler to connect to the same port discussed above. the ports associated with that worker are accessible in the connect event's ports property — we then use messageport start() method to start the port, and the onmessage handler to deal with messages sent from the main threads. onconnect = function(e) { var port = e.ports[0]; port.addevent
listener('message', function(e) { var workerresult = 'result: ' + (e.data[0] * e.data[1]); port.postmessage(workerresult); }); port.start(); // required when using addevent
listener. otherwise called implicitly by onmessage setter. } specifications specification status comment html living standardthe definition of 'messageevent' in that specification. living st...
MessagePort.postMessage() - Web APIs
the postmessage() method of the messageport interface sends a message from the port, and optionally, transfers ownership of objects to other browsing contexts. note: this feature is available in web workers. syntax port.postmessage(message, transfer
list); returns void. parameters message the message you want to send through the channel. this can be of any basic data type. multiple data items can be sent as an array. transfer
list optional transferable objects to be transferred — these objects have their ownership transferred to the receiving browsing context, so are no longer usable by the sending browsing context. example in the following code block, you can see a new channel being created using the messagechannel.messagechannel constructor. when the iframe has loaded, we pas...
... in the following code block, you can see a new channel being created using the messagechannel.messagechannel constructor. when the iframe has loaded, we pass messagechannel.port2 to the iframe using window.postmessage along with a message. ...
...along with a message. the handlemessage handler then responds to a message being sent back from the iframe using onmessage, putting it into a paragraph — messagechannel.port1 is
listened to, to check when the message arrives. var channel = new messagechannel(); var para = document.queryselector('p'); var ifr = document.queryselector('iframe'); var otherwindow = ifr.contentwindow; ifr.addevent
listener("load", iframeloaded, false); function iframeloaded() { otherwindow.postmessage('hello from the main page!', '*', [channel.port2]); } channel.port1.onmessage = handlemessage; function handlemessage(e) { para.innerhtml = e.data; } for a full working example, see our channel messaging basic demo on github (run it live too). specifications specification status comment ...
MessagePort.start() - Web APIs
the start() method of the messageport interface starts the sending of messages queued on the port. this method is only needed when using eventtarget.addevent
listener; it is implied when using messagechannel.onmessage. note: this feature is available in web workers. syntax port.start() returns void. parameters none. ...
...s available in web workers. syntax port.start() returns void. parameters none. ...
... living standard ...
MutationObserverInit.attributeOldValue - Web APIs
attributes option to true is optional. example in this example, a mutation observer is set up to watch for changes to the status and username attributes in any elements contained within a subtree that displays the names of users in a chat room. this lets the code, for example, reflect changes to users' nicknames, or to mark them as away from keyboard (afk) or offline. ...
...to true is optional. example in this example, a mutation observer is set up to watch for changes to the status and username attributes in any elements contained within a subtree that displays the names of users in a chat room. this lets the code, for example, reflect changes to users' nicknames, or to mark them as away from keyboard (afk) or offline. ...
...for any items representing an attribute change (which can be detected by the value of mutationrecord.type being "attributes"), a function called notifyuser() is used to tell the user the name of the attribute that changed as well as the attribute's new value (mutation.target[mutation.attributename]) and its old value (mutation.oldvalue). when observe() is called, the s...
MutationObserverInit.attributes - Web APIs
if you don't expressly set it as such. example in this example, a mutation observer is set up to watch for changes to the status and username attributes in any elements contained within a subtree that displays the names of users in a chat room. this lets the code, for example, reflect changes to users' nicknames, or to mark them as away from keyboard (afk) or offline. ...
...ssly set it as such. example in this example, a mutation observer is set up to watch for changes to the status and username attributes in any elements contained within a subtree that displays the names of users in a chat room. this lets the code, for example, reflect changes to users' nicknames, or to mark them as away from keyboard (afk) or offline. ...
...for any items representing an attribute change (which can be detected by the value of mutationrecord.type being "attributes"), a function called notifyuser() is used to tell the user the name of the attribute that changed as well as the attribute's new value (mutation.target[mutation.attributename]) and its old value (mutation.oldvalue). when observe() is called, the s...
MutationRecord - Web APIs
a mutationrecord represents an individual dom mutation. it is the object that is passed to mutationobserver's callback. properties property type description mutationrecord.type string returns "attributes" if the mutation was an attribute mutation, "characterdata" if it was a mutation to a characterdata node, and "child
list" if it was a mutation to the tree of nodes. ...
...n attribute mutation, "characterdata" if it was a mutation to a characterdata node, and "child
list" if it was a mutation to the tree of nodes. mutationrecord.target node returns the node the mutation affected, depending on the mutationrecord.type. for attributes, it is the element whose attribute changed. for characterdata, it is the characterdata node. for child
list, it is the node whose children changed. mutationrecord.addednodes node
list return the nodes added. will be an empty node
list if no nodes were added. mutationrecord.removednodes node
list return the nodes removed. will be an empty node
list if no nodes were removed. mutationrecord.previoussibling node return the previous sibling of the added or removed no...
... or null. mutationrecord.attributenamespace string returns the namespace of the changed attribute, or null. mutationrecord.oldvalue string the return value depends on the mutationrecord.type. for attributes, it is the value of the changed attribute before the change. for characterdata, it is the data of the changed node before the change. for child
list, it is null. note that for this to work as expected, attributeoldvalue or characterdataoldvalue must be set to true in the corresponding mutationobserverinit parameter of the mutationobserver observe method specifications specification status comment domthe definition of 'mutationrecord' in that specification. living standard ...
Navigator.onLine - Web APIs
rn more, see the html5 rocks article, working off the grid. in firefox and internet explorer, switching the browser to offline mode sends a false value. until firefox 41, all other conditions return a true value; testing actual behavior on nightly 68 on windows shows that it only looks for lan connection like chrome and safari giving false positives. you can see changes in the network state by
listening for the events on window.ononline and window.onoffline. syntax online = window.navigator.online; value online is a boolean true or false. example view a live example. to check if you are online, query window.navigator.online, as in the following example: if (navigator.online) { console.log('online'); } else { console.log('offline'); } if the browser doesn't support navigator.o...
...nline is a boolean true or false. example view a live example. to check if you are online, query window.navigator.online, as in the following example: if (navigator.online) { console.log('online'); } else { console.log('offline'); } if the browser doesn't support navigator.online the above example will always come out as false/undefined. ...
...oolean true or false. example view a live example. to check if you are online, query window.navigator.online, as in the following example: if (navigator.online) { console.log('online'); } else { console.log('offline'); } if the browser doesn't support navigator.online the above example will always come out as false/undefined. to see changes in the network state, use addevent
listener to
listen for the events on window.online and window.offline, as in the following example: window.addevent
listener('offline', function(e) { console.log('offline'); }); window.addevent
listener('online', function(e) { console.log('online'); }); specifications specification status comment html living standardthe definition of 'navigator.online' in that specification. livi...
Node.childNodes - Web APIs
the node.childnodes read-only property returns a live node
list of child nodes of the given element where the first child node is assigned index 0. ...
... the node.childnodes read-only property returns a live node
list of child nodes of the given element where the first child node is assigned index 0. ...
...here the first child node is assigned index 0. syntax let node
list = elementnodereference.childnodes; examples simple usage // parg is an object reference to a <p> element // first check that the element has child nodes if (parg.haschildnodes()) { let children = parg.childnodes; for (let i = 0; i < children.length; i++) { // do something with each child as children[i] // note:
list is live! adding or removing children will change the
list's `length` } } remove all children from a node // this is one way to remove all children from a node // box is an object reference to an element while (box.firstchild) { //the
list is live so it will re-index each call box.removechild(box.firstchild); } notes the items in the collection of nodes are objects, not strings. to ...
Node - Web APIs
all;} properties in addition to the properties below, node inherits properties from its parent, eventtarget. node.baseuriread only returns a domstring representing the base url of the document containing the node. node.baseuriobject read only (not available to web content.) the nsiuri object representing the base uri for the element. node.childnodesread only returns a live node
list containing all the children of this node. node
list being live means that if the children of the node change, the node
list object is automatically updated. node.firstchildread only returns a node representing the first direct child node of the node, or null if the node has no child. node.isconnectedread only a boolean indicating whether or not the node is connected (directly or indirectly) t...
... the new position. node.clonenode() clone a node, and optionally, all of its contents. by default, it clones the content of the node. node.comparedocumentposition() compares the position of the current node against another node in any other document. node.contains() returns a boolean value indicating whether or not a node is a descendant of the calling node. node.getboxquads() returns a
list of the node's css boxes relative to another node. node.getrootnode() returns the context object's root which optionally includes the shadow root if it is available. node.haschildnodes() returns a boolean indicating whether or not the element has any child nodes. node.insertbefore() inserts a node before the reference node as a child of a specified parent node. node.isdefaultnamespace() a...
...t box = document.getelementbyid("box") eachnode(box, function(node) { if (null != node.textcontent) { console.log(node.textcontent) } }) the above will result in the following strings printing to the user's console: "\n\t", "foo", "\n\t", "bar", "\n\t", "baz" note: whitespace forms part of a text node, meaning indentation and newlines form separate text between the element nodes. rea
listic usage the following demonstrates a real-world use of the eachnode() function: searching for text on a web-page. we use a wrapper function named grep to do the searching: function grep(parentnode, pattern) { const matches = [] let endscan = false eachnode(parentnode, function(node){ if (endscan) { return false } // ignore anything which isn't a text node if (node.node...
NonDocumentTypeChildNode.previousElementSibling - Web APIs
the nondocumenttypechildnode.previouselementsibling read-only property returns the element immediately prior to the specified one in its parent's children
list, or null if the specified element is the first one in the
list. ...
... the nondocumenttypechildnode.previouselementsibling read-only property returns the element immediately prior to the specified one in its parent's children
list, or null if the specified element is the first one in the
list. ...
...ode.previouselementsibling read-only property returns the element immediately prior to the specified one in its parent's children
list, or null if the specified element is the first one in the
list. ...
NotificationEvent - Web APIs
id of the notification button the user clicked. this value returns an empty string if the user clicked the notification somewhere other than an action button, or the notification does not have a button. methods inherits methods from its parent, extendableevent. extendableevent.waituntil() extends the lifetime of the event. tells the browser that work is ongoing. ...
... the lifetime of the event. tells the browser that work is ongoing. ...
...browser that work is ongoing. example self.addevent
listener('notificationclick', function(event) { console.log('on notification click: ', event.notification.tag); event.notification.close(); // this looks to see if the current is already open and // focuses if it is event.waituntil(clients.matchall({ type: "window" }).then(function(client
list) { for (var i = 0; i < client
list.length; i++) { var client = client
list[i]; if (client.url == '/' && 'focus' in client) return client.focus(); } if (clients.openwindow) return clients.openwindow('/'); })); }); specifications specification status comment notifications apithe definition of 'notificationevent' in that specification. living standard living stan...
OrientationSensor - Web APIs
e cannot be used directly. instead it provides properties and methods accessed by interfaces that inherit from it. if a feature policy blocks use of a feature it is because your code is inconsistent with the policies set on your server. this is not something that would ever be shown to a user. see feature-policy for implementation instructions. interfaces based on orientationsensor below is a
list of interfaces based on the orientationsensor interface. absoluteorientationsensor relativeorientationsensor properties orientationsensor.quaternion returns a four element array whose elements contain the components of the unit quaternion representing the device's orientation. methods orientationsensor.populatematrix() populates the given object with the rotation matrix based on ...
...asic example the following example, which is loosely based on intel's orientation phone demo, instantiates an absoluteorientationsensor with a frequency of 60 times a second. on each reading it uses orientationsensor.quaternion to rotate a visual model of a phone. ...
...imes a second. on each reading it uses orientationsensor.quaternion to rotate a visual model of a phone. const options = { frequency: 60, referenceframe: 'device' }; const sensor = new absoluteorientationsensor(options); sensor.addevent
listener('reading', () => { // model is a three.js object instantiated elsewhere. model.quaternion.fromarray(sensor.quaternion).inverse(); }); sensor.addevent
listener('error', error => { if (event.error.name == 'notreadableerror') { console.log("sensor is not available."); } }); sensor.start(); permissions example using orientation sensors requires requsting permissions for multiple device sensors. becuase the permissions uses promises, a good way to request permissions is to use promise.all. const sensor = new absoluteorientationsensor(); promi...
PannerNode.coneInnerAngle - Web APIs
p us visualise how the orientation vector affects, we can use the right-hand rule: first, let's start by writing a utility function to figure out our orientation vector. 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. however, normally this would mean the pannernode points to the left of the
listener at 0° rotation – since `x = cos(0) = 1` and `z = sin(0) = 0`. it's more useful to offset the angle by -90°, which means the pannernode will point directly at the
listener at 0° rotation. // this utility converts amount of rotation around the y axis // (i.e. rotation in the 'horizontal plane') to an orientation vector const yrotationtovector = degrees => { // convert degrees to radians...
...` and `z = sin(0) = 0`. it's more useful to offset the angle by -90°, which means the pannernode will point directly at the
listener at 0° rotation. // this utility converts amount of rotation around the y axis // (i.e. rotation in the 'horizontal plane') to an orientation vector const yrotationtovector = degrees => { // convert degrees to radians and offset the angle so 0 points towards the
listener const radians = (degrees - 90) * (math.pi / 180); // using cosine and sine here ensures the output values are always normalised // i.e. they range between -1 and 1 const x = math.cos(radians); const z = math.sin(radians); // we hard-code the y component to 0, as y is the axis of rotation return [x, 0, z]; }; now we can create our audiocontext, an oscillator and a pannernode: ...
...ll decrease gradually panner.coneouterangle = 45; // this value determines the volume of the sound outside of both inner and outer cone // setting it to 0 means there is no sound, so we can clearly hear when we leave the cone // 0 is also the default panner.coneoutergain = 0; // increase the z position to ensure the cone has an effect // (otherwise the sound is located at the same position as the
listener) panner.positionz.setvalueattime(1, context.currenttime); having set up the pannernode, we can now schedule some updates to its y-axis rotation: // calculate the vector for no rotation // this means the sound will play at full volume const [x1, y1, z1] = yrotationtovector(0); // schedule the no-rotation vector immediately panner.orientationx.setvalueattime(x1, context.currenttime); panner.o...
PannerNode.coneOuterAngle - Web APIs
p us visualise how the orientation vector affects, we can use the right-hand rule: first, let's start by writing a utility function to figure out our orientation vector. 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. however, normally this would mean the pannernode points to the left of the
listener at 0° rotation – since `x = cos(0) = 1` and `z = sin(0) = 0`. it's more useful to offset the angle by -90°, which means the pannernode will point directly at the
listener at 0° rotation. // this utility converts amount of rotation around the y axis // (i.e. rotation in the 'horizontal plane') to an orientation vector const yrotationtovector = degrees => { // convert degrees to radians...
...` and `z = sin(0) = 0`. it's more useful to offset the angle by -90°, which means the pannernode will point directly at the
listener at 0° rotation. // this utility converts amount of rotation around the y axis // (i.e. rotation in the 'horizontal plane') to an orientation vector const yrotationtovector = degrees => { // convert degrees to radians and offset the angle so 0 points towards the
listener const radians = (degrees - 90) * (math.pi / 180); // using cosine and sine here ensures the output values are always normalised // i.e. they range between -1 and 1 const x = math.cos(radians); const z = math.sin(radians); // we hard-code the y component to 0, as y is the axis of rotation return [x, 0, z]; }; now we can create our audiocontext, an oscillator and a pannernode: ...
...ll decrease gradually panner.coneouterangle = 45; // this value determines the volume of the sound outside of both inner and outer cone // setting it to 0 means there is no sound, so we can clearly hear when we leave the cone // 0 is also the default panner.coneoutergain = 0; // increase the z position to ensure the cone has an effect // (otherwise the sound is located at the same position as the
listener) panner.positionz.setvalueattime(1, context.currenttime); having set up the pannernode, we can now schedule some updates to its y-axis rotation: // calculate the vector for no rotation // this means the sound will play at full volume const [x1, y1, z1] = yrotationtovector(0); // schedule the no-rotation vector immediately panner.orientationx.setvalueattime(x1, context.currenttime); panner.o...
PannerNode.coneOuterGain - Web APIs
p us visualise how the orientation vector affects, we can use the right-hand rule: first, let's start by writing a utility function to figure out our orientation vector. 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. however, normally this would mean the pannernode points to the left of the
listener at 0° rotation – since `x = cos(0) = 1` and `z = sin(0) = 0`. it's more useful to offset the angle by -90°, which means the pannernode will point directly at the
listener at 0° rotation. // this utility converts amount of rotation around the y axis // (i.e. rotation in the 'horizontal plane') to an orientation vector const yrotationtovector = degrees => { // convert degrees to radians...
...` and `z = sin(0) = 0`. it's more useful to offset the angle by -90°, which means the pannernode will point directly at the
listener at 0° rotation. // this utility converts amount of rotation around the y axis // (i.e. rotation in the 'horizontal plane') to an orientation vector const yrotationtovector = degrees => { // convert degrees to radians and offset the angle so 0 points towards the
listener const radians = (degrees - 90) * (math.pi / 180); // using cosine and sine here ensures the output values are always normalised // i.e. they range between -1 and 1 const x = math.cos(radians); const z = math.sin(radians); // we hard-code the y component to 0, as y is the axis of rotation return [x, 0, z]; }; now we can create our audiocontext, an oscillator and a pannernode: ...
...ll decrease gradually panner.coneouterangle = 45; // this value determines the volume of the sound outside of both inner and outer cone // setting it to 0 means there is no sound, so we can clearly hear when we leave the cone // 0 is also the default panner.coneoutergain = 0; // increase the z position to ensure the cone has an effect // (otherwise the sound is located at the same position as the
listener) panner.positionz.setvalueattime(1, context.currenttime); having set up the pannernode, we can now schedule some updates to its y-axis rotation: // calculate the vector for no rotation // this means the sound will play at full volume const [x1, y1, z1] = yrotationtovector(0); // schedule the no-rotation vector immediately panner.orientationx.setvalueattime(x1, context.currenttime); panner.o...
PannerNode.rolloffFactor - Web APIs
this value is used by all distance models.the rollofffactor property's default value is 1. syntax var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.rollofffactor = 1; value a number whose range depends on the distancemodel of the panner as follows (negative values are not allowed): "linear" the range is 0 to 1. "inverse" the range is 0 to infinity. "exponential" the range is 0 to infinity. ...
... not allowed): "linear" the range is 0 to 1. "inverse" the range is 0 to infinity. "exponential" the range is 0 to infinity. exceptions rangeerror the property has been given a value that is outside the accepted range. ...
...actor values affect how the volume of the test tone decreases with increasing distance from the
listener: const context = new audiocontext(); // all our test tones will last this many seconds const note_length = 4; // this is how far we'll move the sound const z_distance = 20; // this function creates a graph for the test tone with a given rollofffactor // and schedules it to move away from the
listener along the z (depth-wise) axis // at the given start time, resulting in a decrease in volume (decay) const scheduletesttone = (rollofffactor, starttime) => { const osc = new oscillatornode(context); const panner = new pannernode(context); panner.rollofffactor = rollofffactor; // set the initial z position, then schedule the ramp panner.positionz.setvalueattime(0, starttime); pann...
Using the Payment Request API - Web APIs
est). in the following snippet, a merchant page performs this check, and if it returns true updates the checkout button to use paymentrequest instead of legacy web forms. const checkoutbutton = document.getelementbyid('checkout-button'); if (window.paymentrequest) { let request = new paymentrequest(buildsupportedpaymentmethodnames(), buildshoppingcartdetails()); checkoutbutton.addevent
listener('click', function() { request.show().then(function(paymentresponse) { // handle successful payment }).catch(function(error) { // handle cancelled or failed payment. for example, redirect to // the legacy web form checkout: window.location.href = '/legacy-web-form-checkout'; }); // every click on the checkout button should use a new instance of // pa...
...known demo for the full code. recommending a payment app when user has no apps if you select to pay with the bobpay demo payment provider on this merchant page, it tries to call paymentrequest.show(), while intercepting the notsupportederr exception. if this payment method is not supported, it redirects to the signup page for bobpay. the code looks something like this: checkoutbutton.addevent
listener('click', function() { var request = new paymentrequest(buildsupportedpaymentmethoddata(), buildshoppingcartdetails()); request.show().then(function(paymentresponse) { // here we would process the payment. for this demo, simulate immediate success: paymentresponse.complete('success') .then(function() { // for demo purposes: intropanel.style.display =...
... .then(function(res) { if (res) { // the payment handler has pre-authorized a transaction // with some static amount, e.g., usd $1.00. } else { // pre-authorization failed or payment handler not installed. } }) .catch(function(ex1) { // unexpected error occurred. }); the payment handler would include the following code: self.addevent
listener('canmakepayment', function(evt) { // pre-authorize here. let preauthsuccess = ...; evt.respondwith(preauthsuccess); }); this payment handler would need to live in a service worker at https://example.com/preauth scope. note: see our pre-authorizing transactions demo for the full code. ...
performance.getEntriesByName() - Web APIs
if the type argument is not specified, only the name will be used to determine the entries to return. ...
...if the type argument is not specified, only the name will be used to determine the entries to return. ...
...rs (entries) can be created by making performance marks or measures (for example by calling the mark() method) at explicit points in time. note: this feature is available in web workers. syntax entries = window.performance.getentriesbyname(name, type); arguments name the name of the entry to retrieve. type optional the type of entry to retrieve such as "mark". the valid entry types are
listed in performanceentry.entrytype. return value entries a
list of performanceentry objects that have the specified name and type. if the type argument is not specified, only the name will be used to determine the entries to return. the items will be in chronological order based on the entries' starttime. if no objects meet the specified criteria, an empty
list is returned. example function...
Performance - Web APIs
lso, note that performance markers and measures are per context. if you create a mark on the main thread (or other worker), you cannot see it in a worker thread, and vice versa. properties the performance interface doesn't inherit any properties. performance.navigation read only a legacy performancenavigation object that provides useful context about the operations included in the times
listed in timing, including whether the page was a load or a refresh, how many redirections occurred, and so forth. not available in workers. performance.timing read only a legacy performancetiming object containing latency-related performance information. not available in workers. performance.memory read only a non-standard extension added in chrome, this property provides an object with ba...
...inherit any methods. performance.clearmarks() removes the given mark from the browser's performance entry buffer. performance.clearmeasures() removes the given measure from the browser's performance entry buffer. performance.clearresourcetimings() removes all performance entries with a entrytype of "resource" from the browser's performance data buffer. performance.getentries() returns a
list of performanceentry objects based on the given filter. performance.getentriesbyname() returns a
list of performanceentry objects based on the given name and entry type. performance.getentriesbytype() returns a
list of performanceentry objects of the given entry type. performance.mark() creates a timestamp in the browser's performance entry buffer with the given name. performance.measure() ...
...ely). performance.now() returns a domhighrestimestamp representing the number of milliseconds elapsed since a reference instant. performance.setresourcetimingbuffersize() sets the browser's resource timing buffer size to the specified number of "resource" type performance entry objects. performance.tojson() is a jsonizer returning a json object representing the performance object. events
listen to these events using addevent
listener() or by assigning an event
listener to the oneventname property of this interface. resourcetimingbufferfull fired when the browser's resource timing buffer is full. also available via the onresourcetimingbufferfull property. specifications specification status comment high resolution time level 2the definition of 'performanc...
PerformanceObserver.takeRecords() - Web APIs
the takerecords() method of the performanceobserver interface returns the current
list of performance entries stored in the performance observer, emptying it out. syntax var performanceentry[] = performanceobserver.takerecords(); parameters none. return value a
list of performanceentry objects. ...
... the takerecords() method of the performanceobserver interface returns the current
list of performance entries stored in the performance observer, emptying it out. syntax var performanceentry[] = performanceobserver.takerecords(); parameters none. return value a
list of performanceentry objects. ...
... the takerecords() method of the performanceobserver interface returns the current
list of performance entries stored in the performance observer, emptying it out. syntax var performanceentry[] = performanceobserver.takerecords(); parameters none. return value a
list of performanceentry objects. ...
Performance Timeline - Web APIs
the performance observer interfaces allow an application to register an observer for specific performance event types, and when one of those event types is recorded, the application is notified of the event via the observer's callback function that was specified when the observer was created. ...
...er an observer for specific performance event types, and when one of those event types is recorded, the application is notified of the event via the observer's callback function that was specified when the observer was created. when the observer (callback) is invoked, the callback's parameters include a performance observer entry
list that contains only observed performance entries. ...
... observer's callback function that was specified when the observer was created. when the observer (callback) is invoked, the callback's parameters include a performance observer entry
list that contains only observed performance entries. that is, the
list contains entries only for the event types that were specified when the observer's observe() method was invoked. the performance observer entry
list interface has the same three getentries*() methods as the performance interface. however, note there is one key difference with these methods; the performance observer entry
list versions are used to retrieve observed performance entries within the observer callback. besides the performanceobserver's interface's observe() method (which is used to register the entry types to observe), the perform...
RTCConfiguration.iceServers - Web APIs
r turn server for the ice agent to use during the connection's negotiation. each object must at least have an urls property, which is an array of one or more strings, each providing one server's url. if the array is empty, or if the iceservers option isn't specified, the ice agent will negotiate without the use of any servers, which will limit the connection to local peers. ...
...ding one server's url. if the array is empty, or if the iceservers option isn't specified, the ice agent will negotiate without the use of any servers, which will limit the connection to local peers. description how the
list of servers you provide is used is up to the implementation of the user agent. ...
...cription how the
list of servers you provide is used is up to the implementation of the user agent. while it can be useful to provide a second server as a fallback in case the first is offline,
listing too many servers can delay the user's connection being established, depending on the network's performance and how many servers get used for negotiation before a connection is established. if the
list of servers is changed while a connection is already active by calling the the rtcpeerconnection method setconfiguration(), no immediate effect occurs. however, the new
list of servers is used for any future renegotiation, such as while handling an ice restart. examples the configuration below opens a new peer connection, specifying two servers for the ice agent to use for negotiation. the first...
RTCDTMFSender.toneBuffer - Web APIs
if the string is empty, there are no tones pending. tone buffer format the tone buffer is a string which can contain any combination of the characters that are permitted by the dtmf standard. dtmf tone characters the digits 0-9 these characters represent the digit keys on a telephone keypad. ...
...if the string is empty, there are no tones pending. tone buffer format the tone buffer is a string which can contain any combination of the characters that are permitted by the dtmf standard. dtmf tone characters the digits 0-9 these characters represent the digit keys on a telephone keypad. ...
...if the string is empty, there are no tones pending. tone buffer format the tone buffer is a string which can contain any combination of the characters that are permitted by the dtmf standard. dtmf tone characters the digits 0-9 these characters represent the digit keys on a telephone keypad. ...
RTCIceCandidate.candidate - Web APIs
e property when constructing the new candidate object using rtcicecandidate(). syntax var candidate = rtcicecandidate.candidate; value a domstring describing the properties of the candidate, taken directly from the sdp attribute "candidate". the candidate string specifies the network connectivity information for the candidate. if the candidate is an empty string (""), the end of the candidate
list has been reached; this candidate is known as the "end-of-candidates" marker. the syntax of the candidate string is described in rfc 5245, section 15.1. for an a-line (attribute line) that looks like this: a=candidate:4234997325 1 udp 2043278322 192.168.0.56 44323 typ host the corresponding candidate string's value will be "candidate:4234997325 1 udp 2043278322 192.168.0.56 44323 typ host". th...
...78322 192.168.0.56 44323 typ host the corresponding candidate string's value will be "candidate:4234997325 1 udp 2043278322 192.168.0.56 44323 typ host". the user agent always prefers candidates with the highest priority, all else being equal. in the example above, the priority is 2043278322. the attributes are all separated by a single space character, and are in a specific order. ...
...on.addicecandidate(candidateobj).catch({ /* handle the error thrown by addicecandidate() */ }); } the handlenewicecandidate() function shown here passes the received candidate's sdp text into rtcicecandidate() to receive an rtcicecanddiate object in return, which represents the candidate. the new candidate is then passed into rtcpeerconnection.addicecandidate() to add the candidate to the
list of candidates for webrtc to consider using for the connection being established. this example could be simplified somewhat; you may more often see the code look something like this, taking advantage of more advanced ecmascript 2016 features: let handlenewicecandidate = candidatesdp => mypeerconnection.addicecandidate(new rtcicecandidate(candidatesdp)); specifications specification ...
RTCIceTransport: gatheringstatechange event - Web APIs
state of the connection including every rtcicetransport used by every rtcrtpsender and every rtcrtpreceiver on the entire connection. in contrast, gatheringstatechange represents changes to the candidate gathering state for a single transport. examples this example creates a handler for gatheringstatechange events on each rtcrtpsender associated with a given rtcpeerconnection. ...
...ry rtcicetransport used by every rtcrtpsender and every rtcrtpreceiver on the entire connection. in contrast, gatheringstatechange represents changes to the candidate gathering state for a single transport. examples this example creates a handler for gatheringstatechange events on each rtcrtpsender associated with a given rtcpeerconnection. ...
...statechange represents changes to the candidate gathering state for a single transport. examples this example creates a handler for gatheringstatechange events on each rtcrtpsender associated with a given rtcpeerconnection. ...
RTCPeerConnection: addstream event - Web APIs
onnection. bubbles no cancelable no interface mediastreamevent event handler property rtcpeerconnection.onaddstream you can, similarly, watch for streams to be removed from the connection by monitoring the removestream event. examples this example looks to determine if the user's browser supports the track event. if it does, a track event
listener is set up; otherwise, an addstream event
listener is set up. pc is an rtcpeerconnection. if (pc.addtrack !== undefined) { pc.ontrack = ev => { ev.streams.foreach(stream => doaddstream(stream)); } } else { pc.onaddstream = ev => { doaddstream(ev.stream); } } this calls a function doaddstream() once for each stream being added to the rtcpeerconnection, regardless of whether t...
...c is an rtcpeerconnection. ...
....addtrack !== undefined) { pc.ontrack = ev => { ev.streams.foreach(stream => doaddstream(stream)); } } else { pc.onaddstream = ev => { doaddstream(ev.stream); } } this calls a function doaddstream() once for each stream being added to the rtcpeerconnection, regardless of whether the browser sends addstream or track. you can also use the addevent
listener() method to set an event
listener: pc.addevent
listener("addstream", ev => doaddstream(ev.stream), false); ...
RTCPeerConnection.getTransceivers() - Web APIs
example the following snippet of code stops all transceivers associated with an rtcpeerconnection. ...
... example the following snippet of code stops all transceivers associated with an rtcpeerconnection. ...
... example the following snippet of code stops all transceivers associated with an rtcpeerconnection. ...
RTCPeerConnection: iceconnectionstatechange event - Web APIs
rtcpeerconnection object each time the ice connection state changes during the negotiation process. the new ice connection state is available in the object's iceconnectionstate} property. bubbles no cancelable no interface event event handler property oniceconnectionstatechange one common task performed by the iceconnectionstatechange event
listener: to trigger ice restart when the state changes to failed. see ice restart in lifetime of a webrtc session for further information. usage notes a successful connection attempt will typically involve the state starting at new, then transitioning through checking, then connected, and finally completed. however, under certain circumstances, the connected state can be skipped, causing a connecti...
...kes this determination upon receiving the end-of-candidates signal, which is provided by caling addicecandidate() with a candidate whose candidate property is an empty string (""), or by setting the rtcpeerconnection property cantrickleicecandidates to false. ...
...onstatechange property or by using addevent
listener() on the rtcpeerconnection. in this example, a handler for iceconnectionstatechange is set up to update a call state indicator by using the value of iceconnectionstate to create a string which corresponds to the name of a css class that we can assign to the status indicator to cause it to reflect the current state of the connection. ...
RTCPeerConnection: icecandidate event - Web APIs
ibility purposes and does not need to be delivered onward to the remote peer (which is why the code snippet above checks to see if event.candidate is null prior to sending the candidate along. ...
...u know that ice gathering has just ended. this is a more reliable approach than looking at the individual ice messages for one indicating that the ice session is finished. examples this example creates a simple handler for the icecandidate event that uses a function called sendmessage() to create and send a reply to the remote peer through the signaling server. ...
...g has just ended. this is a more reliable approach than looking at the individual ice messages for one indicating that the ice session is finished. examples this example creates a simple handler for the icecandidate event that uses a function called sendmessage() to create and send a reply to the remote peer through the signaling server. ...
RTCPeerConnection.onsignalingstatechange - Web APIs
atechange = errorhandler; value set this to a function which you provide that receives an event object as input; this contains the signalingstatechange event. this event object doesn't provide details about what changed, but you can examine the signalingstate property to determine what the new state is. ...
...is to a function which you provide that receives an event object as input; this contains the signalingstatechange event. this event object doesn't provide details about what changed, but you can examine the signalingstate property to determine what the new state is. ...
...t doesn't provide details about what changed, but you can examine the signalingstate property to determine what the new state is. you may also, as always, set up a handler for the signalingstatechange event using addevent
listener(): myrtcpeerconnection.addevent
listener("signalingstatechange", mysignalingstatechangehandler); or, using an anonymous (inline) handler: myrtcpeerconnection.addevent
listener("signalingstatechange", event => { /* handle the event here */ }); example this snippet shows a handler for signalingstatechange that looks for the "have-local-pranswer" signaling state—indicating that a remote offer has been received and a local description of type "pranswer" has been applied in response. pc.onsignalingstatechange = function(event) { if (pc.signalingstate === "have-...
RTCTrackEvent - Web APIs
livered to the rtcpeerconnection's ontrack handler, the new media has completed its negotiation for a specific rtcrtpreceiver (which is specified by the event's receiver property). in addition, the mediastreamtrack specified by the receiver's track is the same one specified by the event's track, and the track has been added to any associated remote mediastream objects. you can add a track event
listener to be notified when the new track is available so that you can, for example, attach its media to a <video> element, using either rtcpeerconnection.addevent
listener() or the ontrack event handler property. note: it may be helpful to keep in mind that you receive the track event when a new inbound track has been added to your connection, and you call addtrack() to add a track to the far end o...
..., using either rtcpeerconnection.addevent
listener() or the ontrack event handler property. note: it may be helpful to keep in mind that you receive the track event when a new inbound track has been added to your connection, and you call addtrack() to add a track to the far end of the connection, thereby triggering a track event on the remote peer. example this simple example creates an event
listener for the track event which sets the srcobject of the <video> element with the id videobox to the first stream in the
list passed in the event's streams array. ...
...has been added to your connection, and you call addtrack() to add a track to the far end of the connection, thereby triggering a track event on the remote peer. example this simple example creates an event
listener for the track event which sets the srcobject of the <video> element with the id videobox to the first stream in the
list passed in the event's streams array. peerconnection.addevent
listener("track", e => { let videoelement = document.getelementbyid("videobox"); videoelement.srcobject = e.streams[0]; }, false); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtctrackevent' in that specification. candidate recommendation initial specification. ...
ReadableStream.tee() - Web APIs
ng simple example, a previously-created stream is teed, then both resulting streams (contained in two members of a generated array) are passed to a function that reads the data out of the two streams and prints each stream's chunks sequentially to a different part of the ui. see simple tee example for the full code. function teestream() { const teedoff = stream.tee(); fetchstream(teedoff[0],
list2); fetchstream(teedoff[1],
list3); } function fetchstream(stream,
list) { const reader = stream.getreader(); let charsreceived = 0; // read() returns a promise that resolves // when a value has been received reader.read().then(function processtext({ done, value }) { // result objects contain two properties: // done - true if the stream has already given you all its data. ...
... processtext({ done, value }) { // result objects contain two properties: // done - true if the stream has already given you all its data. // value - some data. always undefined when done is true. ...
... objects contain two properties: // done - true if the stream has already given you all its data. // value - some data. always undefined when done is true. if (done) { console.log("stream complete"); return; } // value for fetch streams is a uint8array charsreceived += value.length; const chunk = value; let
listitem = document.createelement('li');
listitem.textcontent = 'read ' + charsreceived + ' characters so far. current chunk = ' + chunk;
list.appendchild(
listitem); // read some more, and call this function again return reader.read().then(processtext); }); } specifications specification status comment streamsthe definition of 'tee()' in that specification. living standard initial definition. ...
ReadableStreamDefaultReader.ReadableStreamDefaultReader() - Web APIs
// result objects contain two properties: // done - true if the stream has already given you all its data. // value - some data. always undefined when done is true. ...
... // done - true if the stream has already given you all its data. // value - some data. always undefined when done is true. ...
...defined when done is true. if (done) { console.log("stream complete"); para.textcontent = result; return; } // value for fetch streams is a uint8array charsreceived += value.length; const chunk = value; let
listitem = document.createelement('li');
listitem.textcontent = 'received ' + charsreceived + ' characters so far. current chunk = ' + chunk;
list2.appendchild(
listitem); result += chunk; // read some more, and call this function again return reader.read().then(processtext); }); } specifications specification status comment streamsthe definition of 'readablestreamdefaultreader()' in that specification. living standard initial definition. ...
SVGAnimatedPoints - Web APIs
svg animated points interface the svganimatedpoints interface supports elements which have a points attribute which holds a
list of coordinate values and which support the ability to animate that attribute. additionally, the points attribute on the original element accessed via the xml dom (e.g., using the getattribute() method call) will reflect any changes made to the svganimatedpoints.points attribut. ...
...nate values and which support the ability to animate that attribute. additionally, the points attribute on the original element accessed via the xml dom (e.g., using the getattribute() method call) will reflect any changes made to the svganimatedpoints.points attribut. ...
...ability to animate that attribute. additionally, the points attribute on the original element accessed via the xml dom (e.g., using the getattribute() method call) will reflect any changes made to the svganimatedpoints.points attribut. interface overview also implement none methods none properties readonly svgpoint
list points readonly svgpoint
list animatedpoints normative document svg 1.1 (2nd edition) properties name type description points svgpoint
list provides access to the base (i.e., static) contents of the points attribute. animatedpoints svgpoint
list provides access to the current animated contents of the points attribute. if the given attribute or propert...
SVGAnimationElement: endEvent event - Web APIs
stroke="black" stroke-width="1"> <animatemotion path="m 0 0 h 300 z" dur="5s" repeatcount="indefinite" /> </circle> </svg> <hr> <button>stop animation</button> <ul> </ul> ul { height: 100px; border: 1px solid #ddd; overflow-y: scroll; padding: 10px 30px; } let svgelem = document.queryselector('svg'); let animateelem = document.queryselector('animatemotion'); let
list = document.queryselector('ul'); let btn = document.queryselector('button'); animateelem.addevent
listener('beginevent', () => { let
listitem = document.createelement('li');
listitem.textcontent = 'beginevent fired';
list.appendchild(
listitem); }) animateelem.addevent
listener('endevent', () => { let
listitem = document.createelement('li');
listitem.textcontent = 'endevent fired';
list...
...ueryselector('ul'); let btn = document.queryselector('button'); animateelem.addevent
listener('beginevent', () => { let
listitem = document.createelement('li');
listitem.textcontent = 'beginevent fired';
list.appendchild(
listitem); }) animateelem.addevent
listener('endevent', () => { let
listitem = document.createelement('li');
listitem.textcontent = 'endevent fired';
list.appendchild(
listitem); }) animateelem.addevent
listener('repeatevent', (e) => { let
listitem = document.createelement('li'); let msg = 'repeatevent fired'; if(e.detail) { msg += '; repeat number: ' + e.detail; }
listitem.textcontent = msg;
list.appendchild(
listitem); }) btn.addevent
listener('click', () => { btn.disabled = true; animateelem.setattribute('repeatcount', '1'); }) event handler...
... { let
listitem = document.createelement('li'); let msg = 'repeatevent fired'; if(e.detail) { msg += '; repeat number: ' + e.detail; }
listitem.textcontent = msg;
list.appendchild(
listitem); }) btn.addevent
listener('click', () => { btn.disabled = true; animateelem.setattribute('repeatcount', '1'); }) event handler property equivalent note that you can also create an event
listener for the end event using the onend event handler property: animateelem.onend = () => { console.log('endevent fired'); } specifications specification status comment scalable vector graphics (svg) 2the definition of 'endevent' in that specification. candidate recommendation initial definition ...
SVGElement - Web APIs
these can also be defined in svg using attributes of the form data-*, where * is the key name for the pair. this works just like html's htmlelement.dataset property and html's data-* global attribute. svgelement.classname read only an svganimatedstring that reflects the value of the...
...pair. this works just like html's htmlelement.dataset property and html's data-* global attribute. svgelement.classname read only an svganimatedstring that reflects the value of the class attribute on the given element, or the empty string if class is not present. this attribute is deprecated and may be removed in a future version of this specification. authors are advised to use element.class
list instead. svgelement.ownersvgelementread only an svgsvgelement referring to the nearest ancestor <svg> element. null if the given element is the outermost <svg> element. svgelement.viewportelementread only the svgelement, which established the current viewport. often, the nearest ancestor <svg> element. null if the given element is the outermost <svg> element. methods this interface has n...
...svgelement.viewportelementread only the svgelement, which established the current viewport. often, the nearest ancestor <svg> element. null if the given element is the outermost <svg> element. methods this interface has no methods, but inherits methods from: documentandelementeventhandlers, element, elementcssinlinestyle, globaleventhandlers, htmlorforeignelement, svgelementinstance events
listen to these events using addevent
listener() or by assigning an event
listener to the equivalent on... handler property defined on globaleventhandlers or windoweventhandlers. abort fired when page loading is stopped before an svg element has been allowed to load completely. also available via the onabort property. error fired when an svg element does not load properly or when an error occurs...
SVGTextPositioningElement - Web APIs
ze="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgtextpositioningelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface also inherits properties from its parent, svgtextcontentelement. ...
...e">svgtextpositioningelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface also inherits properties from its parent, svgtextcontentelement. svgtextpositioningelement.x read only returns an svganimatedlength
list reflecting the x attribute of the given element. svgtextpositioningelement.y read only returns an svganimatedlength
list reflecting the y attribute of the given element. ...
... this interface also inherits properties from its parent, svgtextcontentelement. svgtextpositioningelement.x read only returns an svganimatedlength
list reflecting the x attribute of the given element. svgtextpositioningelement.y read only returns an svganimatedlength
list reflecting the y attribute of the given element. svgtextpositioningelement.dx read only returns an svganimatedlength
list reflecting the dx attribute of the given element. svgtextpositioningelement.dy read only returns an svganimatedlength
list reflecting the dy attribute of the given element. svgtextpositioningelement.rotate read only returns an svganimatednumber
list reflecting the rotate attribute of the given element. methods this interface doesn't provide any specific methods, but inherits methods from i...
SVGViewElement - Web APIs
each of the domstring values can be associated with the corresponding element using the getelementbyid() method call. ...
...each of the domstring values can be associated with the corresponding element using the getelementbyid() method call. ...
...each of the domstring values can be associated with the corresponding element using the getelementbyid() method call. ...
ServiceWorker - Web APIs
rker serialized script url defined as part of serviceworkerregistration. the url must be on the same origin as the document that registers the serviceworker. serviceworker.state read only returns the state of the service worker. it returns one of the following values: installing, installed, activating, activated, or redundant. event handlers serviceworker.onstatechange read only an event
listener property called whenever an event of type statechange is fired; it is basically fired anytime the serviceworker.state changes. methods the serviceworker interface inherits methods from its parent, worker, with the exception of worker.terminate — this should not be accessible from service workers. examples this code snippet is from the service worker registration-events sample (live dem...
... called whenever an event of type statechange is fired; it is basically fired anytime the serviceworker.state changes. methods the serviceworker interface inherits methods from its parent, worker, with the exception of worker.terminate — this should not be accessible from service workers. examples this code snippet is from the service worker registration-events sample (live demo). the code
listens for any change in the serviceworker.state and returns its value. if ('serviceworker' in navigator) { navigator.serviceworker.register('service-worker.js', { scope: './' }).then(function (registration) { var serviceworker; if (registration.installing) { serviceworker = registration.installing; document.queryselector('#kind').textcontent =...
...the service-worker.js file // might be unavailable or contain a syntax error. }); } else { // the current browser doesn't support service workers. } specifications specification ...
ServiceWorkerGlobalScope: message event - Web APIs
ace extendablemessageevent event handler property onmessage examples in the below example a page gets a handle to the serviceworker object via serviceworkerregistration.active, and then calls its postmessage() function. ...
... working draft ...
...eworker.addevent
listener('message', event => { // event is a messageevent object console.log(`the service worker sent me a message: ${event.data}`); }); navigator.serviceworker.ready.then( registration => { registration.active.postmessage("hi service worker"); }); } the service worker can receive the message by
listening to the message event: // in the service worker addevent
listener('message', event => { // event is an extendablemessageevent object console.log(`the client sent me a message: ${event.data}`); event.source.postmessage("hi client"); }); specifications specification status service workersthe definition of 'message' in that specification. working draft ...
ServiceWorkerGlobalScope.onpush - Web APIs
the serviceworkerglobalscope.onpush event of the serviceworkerglobalscope interface is fired whenever a push message is received by a service worker via a push server. syntax serviceworkerglobalscope.onpush = function(pushevent) { ... } self.addevent
listener('push', function(pushevent) { ... }) example the following example takes data from a pushevent and displays it on all of the service worker's clients. ...
...x serviceworkerglobalscope.onpush = function(pushevent) { ... } self.addevent
listener('push', function(pushevent) { ... }) example the following example takes data from a pushevent and displays it on all of the service worker's clients. ...
... working draft initial definition. this event is specified in the push api, but accessed through serviceworker...
Service Worker API - Web APIs
worker in waiting. it is only activated when there are no longer any pages loaded that are still using the old service worker. as soon as there are no more pages to be loaded, the new service worker activates (becoming the active worker). activation can happen sooner using serviceworkerglobalscope.skipwaiting() and existing pages can be claimed by the active worker using clients.claim(). you can
listen for the installevent; a standard action is to prepare your service worker for usage when this fires, for example by creating a cache using the built in storage api, and placing assets inside it that you'll want for running your app offline. there is also an activate event. the point where this event fires is generally a good time to clean up old caches and other things associated with the prev...
...che objects. it provides a master directory of all the named caches that a serviceworker can access, and maintains a mapping of string names to corresponding cache objects. client represents the scope of a service worker client. a service worker client is either a document in a browser context or a sharedworker, which is controlled by an active worker. clients represents a container for a
list of client objects; the main way to access the active service worker clients at the current origin. extendableevent extends the lifetime of the install and activate events dispatched on the serviceworkerglobalscope, as part of the service worker lifecycle. this ensures that any functional events (like fetchevent) are not dispatched to the serviceworker, until it upgrades database schemas, and ...
...ent interface, for consistency with other web messaging features. serviceworkerregistration represents a service worker registration. serviceworkerstate associated with its serviceworker's state. syncevent the syncevent interface represents a sync action that is dispatched on the serviceworkerglobalscope of a serviceworker. syncmanager provides an interface for registering and
listing sync registrations. windowclient represents the scope of a service worker client that is a document in a browser context, controlled by an active worker. this is a special type of client object, with some additional methods and properties available. specifications specification status comment service workers working draft initial definition. ...
SharedWorker - Web APIs
can be accessed from several browsing contexts, all those browsing contexts must share the exact same origin (same protocol, host and port). constructors sharedworker() creates a shared web worker that executes the script at the specified url. properties inherits properties from its parent, eventtarget, and implements properties from abstractworker. abstractworker.onerror is an event
listener that is called whenever an errorevent of type error bubbles through the worker. sharedworker.port read only returns a messageport object used to communicate with and control the shared worker. methods inherits methods from its parent, eventtarget, and implements methods from abstractworker. example in our basic shared worker example (run shared worker), we have two html pages, each...
...even if their pages are running inside different windows. the following code snippet shows creation of a sharedworker object using the sharedworker() constructor. both scripts contain this: var myworker = new sharedworker('worker.js'); both scripts then access the worker through a messageport object created using the sharedworker.port property. ...
...rker we use the sharedworkerglobalscope.onconnect handler to connect to the same port discussed above. the ports associated with that worker are accessible in the connect event's ports property — we then use messageport start() method to start the port, and the onmessage handler to deal with messages sent from the main threads. onconnect = function(e) { var port = e.ports[0]; port.addevent
listener('message', function(e) { var workerresult = 'result: ' + (e.data[0] * e.data[1]); port.postmessage(workerresult); }); port.start(); // required when using addevent
listener. otherwise called implicitly by onmessage setter. } specifications specification status comment html living standardthe definition of 'sharedworker' in that specification. living st...
SpeechRecognition: start event - Web APIs
the start event of the web speech api speechrecognition object is fired when the speech recognition service has begun
listening to incoming audio with intent to recognize grammars associated with the current speechrecognition. ...
...rt event of the web speech api speechrecognition object is fired when the speech recognition service has begun
listening to incoming audio with intent to recognize grammars associated with the current speechrecognition. ...
...ening to incoming audio with intent to recognize grammars associated with the current speechrecognition. bubbles no cancelable no interface event event handler property onstart examples you can use the start event in an addevent
listener method: var recognition = new webkitspeechrecognition() || new speechrecognition(); recognition.addevent
listener('start', function() { console.log('speech recognition service has started'); }); or use the onstart event handler property: recognition.onstart = function() { console.log('speech recognition service has started'); } specifications specification status comment web speech apithe definition of 'speech recognition events' in that specification. draft ...
SpeechSynthesis: voiceschanged event - Web APIs
the voiceschanged event of the web speech api is fired when the
list of speechsynthesisvoice objects that would be returned by the speechsynthesis.getvoices() method has changed (when the voiceschanged event fires.) bubbles no cancelable no interface event event handler property onvoiceschanged examples this could be used to repopulate a
list of voices that the user can choose between when the event fires. ...
...turned by the speechsynthesis.getvoices() method has changed (when the voiceschanged event fires.) bubbles no cancelable no interface event event handler property onvoiceschanged examples this could be used to repopulate a
list of voices that the user can choose between when the event fires. ...
...e voiceschanged event fires.) bubbles no cancelable no interface event event handler property onvoiceschanged examples this could be used to repopulate a
list of voices that the user can choose between when the event fires. ...
TextTrack - Web APIs
the texttrack interface—part of the api for handling webvtt (text tracks on media presentations)—describes and controls the text track associated with a particular <track> element. properties this interface also inherits properties from eventtarget. texttrack.activecues read only a texttrackcue
list object
listing the currently active set of text track cues. track cues are active if the current playback position of the media is between the cues' start and end times. thus, for displayed cues such as captions or subtitles, the active cues are currently being displayed. texttrack.cues read only a texttrackcue
list which contains all of the track's cues. texttrack.id read only a domstring which identifies the track, if it has one. if it doesn't have an id, then this value is an e...
... must adhere to the format specified in the tags for identifying languages (bcp 47) document from the ietf, just like the html lang attribute. for example, this can be "en-us" for united states english or "pt-br" for brazilian portuguese. texttrack.mode a domstring specifying the track's current mode. changing this property's value changes the track's current mode to match. permitted values are
listed under text track mode constants. the default is disabled, unless the <track> element's default boolean attribute is specified, in which case the default mode is started. events cuechange fired when cues are entered and exited. a given text cue appears when the cue is entered and disappears when the cue is exited. also available via the oncuechange property. methods this interface also...
...ecified, in which case the default mode is started. events cuechange fired when cues are entered and exited. a given text cue appears when the cue is entered and disappears when the cue is exited. also available via the oncuechange property. methods this interface also inherits methods from eventtarget. texttrack.addcue() adds a cue (specified as a texttrackcue object to the track's
list of cues. texttrack.removecue() removes a cue (specified as a texttrackcue object from the track's
list of cues. example tbd specifications specification status comment html living standardthe definition of 'texttrack' in that specification. living standard ...
TouchEvent.changedTouches - Web APIs
the changedtouches read-only property is a touch
list whose touch points (touch objects) varies depending on the event type, as follows: for the touchstart event, it is a
list of the touch points that became active with the current event. for the touchmove event, it is a
list of the touch points that have changed since the last event. for the touchend event, it is a
list of the touch points that have been removed from the surface (that is, the set of touch points corresponding to fingers no longer touching the surface). syntax var changes = touchevent.changedtouches; return value changes a touch
list whose touch objects include all the touch points that contributed to this touch event. example this example illustrates the touchevent object's touchevent.changedtouches property. ...
...set of touch points corresponding to fingers no longer touching the surface). syntax var changes = touchevent.changedtouches; return value changes a touch
list whose touch objects include all the touch points that contributed to this touch event. example this example illustrates the touchevent object's touchevent.changedtouches property. the touchevent.changedtouches property is a touch
list object that contains one touch object for each touch point which contributed to the event. ...
...include all the touch points that contributed to this touch event. example this example illustrates the touchevent object's touchevent.changedtouches property. the touchevent.changedtouches property is a touch
list object that contains one touch object for each touch point which contributed to the event. in following code snippet, the touchmove event handler iterates through the changedtouches
list and prints the identifier of each touch point that changed since the last event. someelement.addevent
listener('touchmove', function(e) { // iterate through the
list of touch points that changed // since the last event and print each touch point's identifier. for (var i=0; i < e.changedtouches.length; i++) { console.log("changedtouches[" + i + "].identifier = " + e.changedtouches[i]...
TouchEvent.touches - Web APIs
touches is a read-only touch
list listing all the touch objects for touch points that are currently in contact with the touch surface, regardless of whether or not they've changed or what their target element was at touchstart time. you can think of it as how many separate fingers are able to be identified as touching the screen. syntax var touches = touchevent.touches; return value touches a touch
list listing all the touch objects for touch points that are still in contact with the touch surface, regardless of whether or not they've changed or what their target element was at touchstart time. example this example illustrates the touchevent object's touchevent.touches property. ...
... var touches = touchevent.touches; return value touches a touch
list listing all the touch objects for touch points that are still in contact with the touch surface, regardless of whether or not they've changed or what their target element was at touchstart time. example this example illustrates the touchevent object's touchevent.touches property. the touchevent.touches property is a touch
list object and containing a
list of touch objects for every point of contact currently touching the surface. ...
...nged or what their target element was at touchstart time. example this example illustrates the touchevent object's touchevent.touches property. the touchevent.touches property is a touch
list object and containing a
list of touch objects for every point of contact currently touching the surface. in following code snippet, the touchstart event handler checks the length of the touchevent.touches
list to determine the number of touch points that were activated and then invokes different handlers depending on the number of touch points. someelement.addevent
listener('touchstart', function(e) { // invoke the appropriate handler depending on the // number of touch points. switch (e.touches.length) { case 1: handle_one_touch(e); break; case 2: handle_two_touches(e); break; ...
VisualViewport - Web APIs
e of the visual viewport relative to the initial containing block origin of the top edge in css pixels. visualviewport.width read only returns the width of the visual viewport in css pixels. visualviewport.height read only returns the height of the visual viewport in css pixels. visualviewport.scale read only returns the pinch-zoom scaling factor applied to the visual viewport. events
listen to these events using addevent
listener() or by assigning an event
listener to the relevant oneventname property of this interface. resize fired when the visual viewport is resized. also available via the visualviewport.onresize property. scroll fired when the visual viewport is scrolled. also available via the visualviewport.onscroll property. examples hiding an overlaid box on zoom ...
... the user zooms in. this is a nice way to improve the user experience when zooming in on pages. a live sample is also available. var bottombar = document.getelementbyid('bottombar'); var viewport = window.visualviewport; function resizehandler() { if (viewport.scale > 1.3) bottombar.style.display = "none"; else bottombar.style.display = "block"; } window.visualviewport.addevent
listener('resize', resizehandler); simulating position: device-fixed this example, also taken from the visual viewport readme, shows how to use this api to simulate position: device-fixed, which fixes elements to the visual viewport. a live sample is also available. var bottombar = document.getelementbyid('bottombar'); var viewport = window.visualviewport; function viewporthandler() { var layoutv...
...lientrect().height + viewport.offsettop; // you could also do this by setting style.left and style.top if you // use width: 100% instead. bottombar.style.transform = 'translate(' + offsetleft + 'px,' + offsettop + 'px) ' + 'scale(' + 1/viewport.scale + ')' } window.visualviewport.addevent
listener('scroll', viewporthandler); window.visualviewport.addevent
listener('resize', viewporthandler); note: this technique should be used with care; emulating position: device-fixed in this way can result in the fixed element flickering during scrolling. specifications specification status comment visual viewport apithe definition of 'visualviewport' in that specificatio...
WebGLRenderingContext.enableVertexAttribArray() - Web APIs
some vertex attribute indices may have predefined purposes, depending on the platform and/or the gpu. ...
...some vertex attribute indices may have predefined purposes, depending on the platform and/or the gpu. others are assigned by the webgl layer when you create the attributes. ...
...w the name of the attribute but not its index, you can get the index by calling getattriblocation(). return value undefined. errors to check for errors after calling enablevertexattribarray(), call geterror(). webglrenderingcontext.invalid_value the specified index is invalid; that is, it's greater than or equal to the maximum number of entries permitted in the context's vertex attribute
list, as indicated by the value of webglrenderingcontext.max_vertex_attribs. example this code — a snippet taken from the full example a basic 2d webgl animation example — shows the use of enablevertexarray() to activate the attribute that will be used by the webgl layer to pass individual vertexes from the vertex buffer into the vertex shader function. gl.bindbuffer(gl.array_buffer, vertexbuf...
WebGLRenderingContext.makeXRCompatible() - Web APIs
button. this is important, which we'll explore shortly. ...
...starting up graphics, switching to vr mode, and so forth looks like this: const outputcanvas = document.queryselector(".output-canvas"); const gl = outputcanvas.getcontext("webgl"); let xrsession = null; let usingxr = false; let currentscene = "scene1"; let glstartbutton; let xrstartbutton; window.addevent
listener("load", (event) => { loadsceneresources(currentscene); glstartbutton.addevent
listener("click", handlestartbuttonclick); xrstartbutton.addevent
listener("click", handlestartbuttonclick); }); outputcanvas.addevent
listener("webglcontextlost", (event) => { /* the context has been lost but can be restored */ event.canceled = true; }); /* when the gl context is reconnected, reload the resources for the current scene. */ outputcanvas.addevent
listener("webglcontextrestored",...
...ssagebox("unable to transfer the game to your xr headset.", "cancel"); break; case invalidstateerror: showsimplemessagebox("you don't appear to have a compatible xr headset available.", "cancel"); break; default: handlefatalerror(err); break; } xrsession.end(); } } async function handlestartbuttonclick(event) { if (event.target.class
list.contains("use-webxr") && navigator.xr) { try { xrsession = await navigator.xr.requestsession("immersive-vr"); usingxr = true; } catch(err) { xrsession = null; usingxr = false; } } startgame(); } function startgame() { currentscene = "scene1"; loadsceneresources(currentscene); /* and so on */ } this works by having two buttons, one which starts the...
Hello vertex attributes - Web APIs
x" id="vertex-shader"> #version 100 precision highp float; attribute float position; void main() { gl_position = vec4(position, 0.0, 0.0, 1.0); gl_pointsize = 64.0; } </script> <script type="x-shader/x-fragment" id="fragment-shader"> #version 100 precision mediump float; void main() { gl_fragcolor = vec4(0.18, 0.54, 0.34, 1.0); } </script> ;(function(){ "use strict" window.addevent
listener("load", setupwebgl, false); var gl, program; function setupwebgl (evt) { window.removeevent
listener(evt.type, setupwebgl, false); if (!(gl = getrenderingcontext())) return; var source = document.queryselector("#vertex-shader").innerhtml; var vertexshader = gl.createshader(gl.vertex_shader); gl.shadersource(vertexshader,source); gl.compileshader(vertexshader); source = doc...
...f (!gl.getprogramparameter(program, gl.link_status)) { var linkerrlog = gl.getprograminfolog(program); cleanup(); document.queryselector("p").innerhtml = "shader program did not link successfully. ...
...ray([clickxinwebglcoords]), gl.static_draw); gl.drawarrays(gl.points, 0, 1); }, false); } var buffer; function initializeattributes() { gl.enablevertexattribarray(0); buffer = gl.createbuffer(); gl.bindbuffer(gl.array_buffer, buffer); gl.bufferdata(gl.array_buffer, new float32array([0.0]), gl.static_draw); gl.vertexattribpointer(0, 1, gl.float, false, 0, 0); } window.addevent
listener("beforeunload", cleanup, true); function cleanup() { gl.useprogram(null); if (buffer) gl.deletebuffer(buffer); if (program) gl.deleteprogram(program); } function getrenderingcontext() { var canvas = document.queryselector("canvas"); canvas.width = canvas.clientwidth; canvas.height = canvas.clientheight; var gl = canvas.getcontext("webgl") || canvas.getcontext("exp...
Writing WebSocket client applications - Web APIs
he msg object as a json-formatted string. examplesocket.send(json.stringify(msg)); // blank the text input element, ready to receive the next line of text from the user. document.getelementbyid("text").value = ""; } receiving messages from the server websockets is an event-driven api; when messages are received, a message event is sent to the websocket object. to handle it, add an event
listener for the message event, or use the onmessage event handler. to begin
listening for incoming data, you can do something like this: examplesocket.onmessage = function (event) { console.log(event.data); } receiving and interpreting json objects let's consider the chat client application first alluded to in using json to transmit objects. there are assorted types of data packets the client m...
.... to begin
listening for incoming data, you can do something like this: examplesocket.onmessage = function (event) { console.log(event.data); } receiving and interpreting json objects let's consider the chat client application first alluded to in using json to transmit objects. ...
... "username": text = "<b>user <em>" + msg.name + "</em> signed in at " + timestr + "</b><br>"; break; case "message": text = "(" + timestr + ") <b>" + msg.name + "</b>: " + msg.text + "<br>"; break; case "rejectusername": text = "<b>your username has been set to <em>" + msg.name + "</em> because the name you chose is in use.</b><br>" break; case "user
list": var ul = ""; for (i=0; i < msg.users.length; i++) { ul += msg.users[i] + "<br>"; } document.getelementbyid("user
listbox").innerhtml = ul; break; } if (text.length) { f.write(text); document.getelementbyid("chatbox").contentwindow.scrollbypages(1); } }; here we use json.parse() to convert the json object back into the original object, then e...
Rendering and the WebXR frame animation callback - Web APIs
than just your code in this one function. you need to make sure that the main thread doesn't need to run for more time per frame than the duration of the frame itself. a basic renderer in this version of the webxr renderering callback, we use a very straightforward approach that works great for relatively simple projects. this pseudocode outlines that process: for each view in the pose's views
list: get the webxr gl layer's viewport set the webgl viewport to match for each object in the scene bindprogram() bindvertices() bindmatrices() binduniforms() bindbuffers() bindtextures() drawmyobject() put simply, this form of renderer is using view-first order. each of the two views making up the xr device's display are rendered back to back, where every object i...
...t eye, one by one, reconfiguring buffers for each object as you go, you can instead render each object twice in a row, once for each eye, thereby only needing to set up the buffers, uniforms, and so forth once for both eyes. the resulting pseudocode looks like this: for each object in the scene bindprogram() binduniforms() bindbuffers() bindtextures() for each view in the pose's views
list get the xrwebgllayer's viewport set the webgl viewport to match bindvertices() bindmatrices() drawmyobject() by changing things up in this way, we only bind programs, uniforms, buffers, textures, and potentially other things once per frame instead of twice for each object found in the scene. this reduces overhead by a potentially very large margin. limiting the frame rate ...
...s and sways, torsos expand and contract as the character breathes. in addition, there may be objects and structures in motion. in a sports game, there may be a ball arcing through the air, its movement needing to be simulated. in racing games there may be cars or other vehicles, with moving parts to animate including the wheels. if there's water in the scene, it needs ripples or waves to look rea
listic. parts of structures may be moving, such as doors, walls and floors (for some types of games), and so forth. another common source of motion is the player themself. after interpreting inputs from the controls (both xr-affliated and otherwise), you need to apply those changes to the scene in order to simulate the user's movement. see the article movement, orientation, and motion for details and...
Controlling multiple parameters with ConstantSourceNode - Web APIs
es. now let's look at the setup() function, which is our handler for the window's load event; it handles all the initialization tasks that require the dom to be in place. ...
...dler for the window's load event; it handles all the initialization tasks that require the dom to be in place. ...
...then we get references to the control widgets, setting playbutton to reference the play button and volumecontrol to reference the slider control that the user will use to adjust the gain on the linked pair of oscillators. then we assign a handler for the play button's click event (s...
Window: messageerror event - Web APIs
the messageerror event is fired on a window object when it receives a message that can't be deserialized. ...
... the messageerror event is fired on a window object when it receives a message that can't be deserialized. ...
... the messageerror event is fired on a window object when it receives a message that can't be deserialized. ...
Window.onbeforeinstallprompt - Web APIs
the window.onbeforeinstallprompt property is an event handler for processing a beforeinstallprompt, which is dispatched on devices when a user is about to be prompted to "install" a web application. its associated event may be saved for later and used to prompt the user at a more suitable time. syntax window.addevent
listener("beforeinstallprompt", function(event) { ... ...
...n. its associated event may be saved for later and used to prompt the user at a more suitable time. syntax window.addevent
listener("beforeinstallprompt", function(event) { ... }); window.onbeforeinstallprompt = function(event) { ...}; example the following example uses the beforeinstallprompt event to make an install button operable, by using the event inside a click handler. ...
....}; example the following example uses the beforeinstallprompt event to make an install button operable, by using the event inside a click handler. ...
Window.speechSynthesis - Web APIs
w object returns a speechsynthesis object, which is the entry point into using web speech api speech synthesis functionality. syntax var synth = window.speechsynthesis; value a speechsynthesis object. examples in our basic speech synthesiser demo, we first grab a reference to the speechsynthesis controller using window.speechsynthesis. after defining some necessary variables, we retrieve a
list of the voices available using speechsynthesis.getvoices() and populate a select menu with them so the user can choose what voice they want. inside the inputform.onsubmit handler, we stop the form submitting with preventdefault(), create a new speechsynthesisutterance instance containing the text from the text <input>, set the utterance's voice to the voice selected in the <select> element, and ...
... containing the text from the text <input>, set the utterance's voice to the voice selected in the <select> element, and start the utterance speaking via the speechsynthesis.speak() method. ...
...i = 0; i < voices.length ; i++) { var option = document.createelement('option'); option.textcontent = voices[i].name + ' (' + voices[i].lang + ')'; if(voices[i].default) { option.textcontent += ' -- default'; } option.setattribute('data-lang', voices[i].lang); option.setattribute('data-name', voices[i].name); voiceselect.appendchild(option); } } populatevoice
list(); if (speechsynthesis.onvoiceschanged !== undefined) { speechsynthesis.onvoiceschanged = populatevoice
list; } inputform.onsubmit = function(event) { event.preventdefault(); var utterthis = new speechsynthesisutterance(inputtxt.value); var selectedoption = voiceselect.selectedoptions[0].getattribute('data-name'); for(i = 0; i < voices.length ; i++) { if(voices[i].name === selected...
Window: unhandledrejection event - Web APIs
nt includes two useful pieces of information: promise the actual promise which was rejected with no handler available to deal with the rejection. reason the reason that would have been passed into the rejection handler if one had existed. see catch() for details. basic error logging this example simply logs information about the unhandled promise rejection to the console. ...
... into the rejection handler if one had existed. see catch() for details. basic error logging this example simply logs information about the unhandled promise rejection to the console. window.addevent
listener("unhandledrejection", event => { console.warn(`unhandled promise rejection: ${event.reason}`); }); you can also use the onunhandledrejection event handler property to set up the event
listener: window.onunhandledrejection = event => { console.warn(`unhandled promise rejection: ${event.reason}`); }; preventing default handling many environments (such as node.js) report unhandled promise rejections to the console by default. you can prevent that from happening by adding a handler for unhandledrejection events that—in addition to any other tasks you wish to perform—calls pre...
...) report unhandled promise rejections to the console by default. you can prevent that from happening by adding a handler for unhandledrejection events that—in addition to any other tasks you wish to perform—calls preventdefault() to cancel the event, preventing it from bubbling up to be handled by the runtime's logging code. this works because unhandledrejection is cancelable. window.addevent
listener('unhandledrejection', function (event) { // ...your code here to handle the unhandled rejection... // prevent the default handling (such as outputting the // error to the console) event.preventdefault(); }); specifications specification status comment html living standardthe definition of 'unhandledrejection' in that specification. living standard ...
WindowClient.visibilityState - Web APIs
the visibilitystate read-only property of the windowclient interface indicates the visibility of the current client. this value can be one of "hidden", "visible", or "prerender". syntax var myvisstate = windowclient.visibilitystate; value a domstring (see document.visibilitystate for values). ...
...only property of the windowclient interface indicates the visibility of the current client. this value can be one of "hidden", "visible", or "prerender". syntax var myvisstate = windowclient.visibilitystate; value a domstring (see document.visibilitystate for values). ...
...ndicates the visibility of the current client. this value can be one of "hidden", "visible", or "prerender". syntax var myvisstate = windowclient.visibilitystate; value a domstring (see document.visibilitystate for values). example event.waituntil(clients.matchall({ type: "window" }).then(function(client
list) { for (let i = 0; i < client
list.length; i++) { let client = client
list[i]; if (client.url == '/' && 'focus' in client) { if (client.visibilitystate === 'hidden') return client.focus(); } } } if (clients.openwindow) { return clients.openwindow('/'); } })); }); specifications specification status comment service workersthe definition of 'visibilitystate' in that specification. work...
WindowClient - Web APIs
ecified url into a controlled client page. properties windowclient inherits properties from its parent interface, client. windowclient.focused read only a boolean that indicates whether the current client has focus. windowclient.visibilitystate read only indicates the visibility of the current client. this value can be one of "hidden", "visible", or "prerender". ...
...client. this value can be one of "hidden", "visible", or "prerender". ...
...en", "visible", or "prerender". example self.addevent
listener('notificationclick', function(event) { console.log('on notification click: ', event.notification.tag); event.notification.close(); // this looks to see if the current is already open and // focuses if it is event.waituntil(clients.matchall({ type: "window" }).then(function(client
list) { for (var i = 0; i < client
list.length; i++) { var client = client
list[i]; if (client.url == '/' && 'focus' in client) { client.focus(); break; } } if (clients.openwindow) return clients.openwindow('/'); })); }); specifications specification status comment service workersthe definition of 'windowclient' in that specification. working draft initial...
WindowEventHandlers.onbeforeunload - Web APIs
r processing beforeunload events. these events fire when a window is about to unload its resources. at this point, the document is still visible and the event is still cancelable. note: to combat unwanted pop-ups, some browsers don't display prompts created in beforeunload event handlers unless the page has been interacted with. moreover, some don't display them at all. syntax window.addevent
listener("beforeunload", function(event) { ... }); window.onbeforeunload = function(event) { ... }; typically, it is better to use window.addevent
listener() and the beforeunload event, instead of onbeforeunload. example this example prompts the user before unloading. the html specification states that authors should use the event.preventdefault() method instead of using event.returnvalue to prompt...
...on(event) { ... }); window.onbeforeunload = function(event) { ... }; typically, it is better to use window.addevent
listener() and the beforeunload event, instead of onbeforeunload. example this example prompts the user before unloading. the html specification states that authors should use the event.preventdefault() method instead of using event.returnvalue to prompt the user. ...
...tead of using event.returnvalue to prompt the user. window.addevent
listener('beforeunload', function (e) { // cancel the event e.preventdefault(); // if you prevent default behavior in mozilla firefox prompt will always be shown // chrome requires returnvalue to be set e.returnvalue = ''; }); guarantee the browser unload by removing the returnvalue property of the event window.addevent
listener('beforeunload', function (e) { // the absence of a returnvalue property on the event will guarantee the browser unload happens delete e['returnvalue']; }); notes when your page uses javascript to render content, the javascript may stop when leaving and then navigating back to the page. you can bind to window.onbeforeunload to prevent the browser from fully caching the page. if you do so...
WindowEventHandlers.onhashchange - Web APIs
the windoweventhandlers.onhashchange property of the windoweventhandlers mixin is the eventhandler for processing hashchange events. the hashchange event fires when a window's hash changes (see window.location and htmlhyperlinkelementutils.hash). syntax using an event handler: window.onhashchange = funcref; using an html event handler: <body onhashchange="funcref();"> using an event
listener: to add an event
listener, use addevent
listener(): window.addevent
listener("hashchange", funcref, false); parameters funcref a reference to a function. examples using an event handler this example uses an event handler (window.onhashchange) to check the new hash value whenever it changes. if it equals #cool-feature, the script logs a message to the console. function locationhashchang...
...es using an event handler this example uses an event handler (window.onhashchange) to check the new hash value whenever it changes. if it equals #cool-feature, the script logs a message to the console. function locationhashchanged() { if (location.hash === '#cool-feature') { console.log("you're visiting a cool feature!"); } } window.onhashchange = locationhashchanged; using an event
listener this example uses an event
listener to log a notification whenever the hash has changed. function hashhandler() { console.log('the hash has changed!'); } window.addevent
listener('hashchange', hashhandler, false); overriding the hash this function sets a new hash dynamically, setting it randomly to one of two values. function changehash() { location.hash = (math.random() > 0.5) ? 'l...
... field type description newurl domstring the new url to which the window is navigating. oldurl domstring the previous url from which the window was navigated. ...
How to check the security state of an XMLHTTPRequest over SSL - Web APIs
me + "\n"); } let secinfo = channel.securityinfo; // print general connection security state dump("security information:\n"); if (secinfo instanceof ci.nsitransportsecurityinfo) { secinfo.queryinterface(ci.nsitransportsecurityinfo); dump("\tsecurity state of connection: "); // check security state flags if ((secinfo.securitystate & ci.nsiwebprogress
listener.state_is_secure) == ci.nsiwebprogress
listener.state_is_secure) { dump("secure connection\n"); } else if ((secinfo.securitystate & ci.nsiwebprogress
listener.state_is_insecure) == ci.nsiwebprogress
listener.state_is_insecure) { dump("insecure connection\n"); } else if ((secinfo.securitystate & ci.nsiwebprogress
listener.state_is_broken) ...
... ci.nsiwebprogress
listener.state_is_secure) { dump("secure connection\n"); } else if ((secinfo.securitystate & ci.nsiwebprogress
listener.state_is_insecure) == ci.nsiwebprogress
listener.state_is_insecure) { dump("insecure connection\n"); } else if ((secinfo.securitystate & ci.nsiwebprogress
listener.state_is_broken) == ci.nsiwebprogress
listener.state_is_broken) { dump("unknown\n"); dump("\tsecurity description: " + secinfo.shortsecuritydescription + "\n"); dump("\tsecurity error message: " + secinfo.errormessage + "\n"); } } else { dump("\tno security info available for this channel\n"); } // print ssl certificate details if (secinfo instanceof ci.nsisslstatusprovider) { var...
... + "\n"); var validity = cert.validity.queryinterface(ci.nsix509certvalidity); dump("\tvalid from " + validity.notbeforegmt + "\n"); dump("\tvalid until " + validity.notaftergmt + "\n"); } } catch(err) { alert(err); } } function test(url) { var req = cc["@mozilla.org/xmlextras/xmlhttprequest;1"].createinstance(); req.open('get', url, true); req.addevent
listener("error", function(e) { var error = createtcperrorfromfailedxhr(req); dumpsecurityinfo(req, error); }, false); req.onload = function(e) { dumpsecurityinfo(req); }; req.send(); } then test("https://addons.mozilla.org"); produced the following output in my console: connection status: succeeded security info: security state: secure co...
XRInputSourceArray.forEach() - Web APIs
the xrinputsourcearray method foreach() executes the specified callback once for each input source in the array, starting at index 0 and progressing until the end of the
list. syntax xrinputsourcearray.foreach(callback, thisarg); parameters callback a function to execute once for each entry in the array xrinputsourcearray. the callback accepts up to three parameters: currentvalue a xrinputsource object which is the value of the item from within the xrinputsourcearray which is currently being processed. currentindex optional an integer value providing the index into the array at which the element given by currentvalue is located. if you don't need to know the index number, you can omit this. source
list optional the xrinputsourcearray object which is being processed. ...
...inputsourcearray object which is being processed. if you don't need this information, you may omit this. thisarg optional the value to be used for this while executing the callback. note that if you use arrow function notation (=>) to provide the callback, you can omit thisarg, since all arrow functions lexically bind this. return value undefined. examples this example snippet gets the
list of inputs for a session and tries to handle each type of input device it supports using. let inputsources = xrsession.inputsources; inputsources.foreach((input) => { if (input.gamepad) { checkgamepad(input.gamepad); } else { if (input.targetraymode === "tracked-pointer" && input.handedness === player.handedness) { /* handle main hand controller */ handlemainhandi...
... specifications specification status comment webxr device apithe definition of 'xrinputsourcearr...
XRInputSourceArray.keys() - Web APIs
the keys() method in the xrinputsourcearray interface returns a javascript iterator which can then be used to iterate over the keys used to reference each item in the array of input sources. syntax xrinputsourcearray.keys(); parameters none. return value a javascript iterator that can be used to walk through the keys for each entry in the
list of input sources. ...
...interface returns a javascript iterator which can then be used to iterate over the keys used to reference each item in the array of input sources. syntax xrinputsourcearray.keys(); parameters none. return value a javascript iterator that can be used to walk through the keys for each entry in the
list of input sources. the values returned by the iterator are the indexes of each entry in the
list; that is, the numbers 0, 1, 2, and so forth through the index of the last item in the
list. ...
...sources. syntax xrinputsourcearray.keys(); parameters none. return value a javascript iterator that can be used to walk through the keys for each entry in the
list of input sources. the values returned by the iterator are the indexes of each entry in the
list; that is, the numbers 0, 1, 2, and so forth through the index of the last item in the
list. examples this example snippet gets the
list of inputs for a session and tries to handle each type of input device it supports using. for (const inputidx of xrsession.inputsources.keys()) { /* the keys are the indexes into the
list of inputs */ checkinput(xrsession.inputsources[inputidx]); } here, for...of is used to iterate over each of the keys. for each key, the input is retrieved using the index with array notation: xrsession.inp...
XRInputSourcesChangeEventInit.added - Web APIs
the xrinputsourceschangeeventinit property added specifies a
list of input sources, each identified using an xrinputsource object, which the represented inputsourceschange event is to indicate are newly available for use. ...
... specifications specification status comment webxr device apithe definition of 'xrinputsourceschangeeventinit.added' in that specification. working draft initi...
... specifications specification status comment webxr device apithe definition of 'xrinputsourceschangeeventinit.added' in that specification. working draft initial definition. ...
XRSession: squeeze event - Web APIs
r handheld controller with an accelerometer. bubbles yes cancelable no interface xrinputsourceevent event handler property onsqueeze for details on how the squeezestart, squeeze, and squeezeend events work, and how you should react to them, see primary squeeze actions in inputs and input sources. ...
...ses addevent
listener() to set up a handler for the squeeze event. the handler fetches the pose representing the target ray for tracked-pointer inputs and sends the pose's transform to a function called myhandlesqueezewithray(). this code treats the squeeze as an instantaneous action that doesn't involve tracking an ongoing activity. if you need to track a squeeze action that isn't instantaneous,
listen for the squeezestart and squeezeend events to sense when the squeeze action begins and ends. ...
...ray for tracked-pointer inputs and sends the pose's transform to a function called myhandlesqueezewithray(). this code treats the squeeze as an instantaneous action that doesn't involve tracking an ongoing activity. if you need to track a squeeze action that isn't instantaneous,
listen for the squeezestart and squeezeend events to sense when the squeeze action begins and ends. ...
XRSession - Web APIs
trol the session. to open a webxr session, use the xrsystem interface's requestsession() method. with xrsession methods, you can poll the viewer's position and orientation (the xrviewerpose), gather information about the user's environment, and present imagery to the user. xrsession supports both inline and immersive virtual and augmented reality modes. properties in addition to the properties
listed below, xrsession inherits properties from its parent interface, eventtarget. environmentblendmode read only returns this session's blend mode which denotes how much of the real-world environment is visible through the xr device and how the device will blend the device imagery with it. note: environmentblendmode() is part of the webxr augmented reality module, which has not been com...
...parent interface, eventtarget. environmentblendmode read only returns this session's blend mode which denotes how much of the real-world environment is visible through the xr device and how the device will blend the device imagery with it. note: environmentblendmode() is part of the webxr augmented reality module, which has not been completed. inputsources read only returns a
list of this session's xrinputsources, each representing an input device used to control the camera and/or scene. renderstate read only an xrrenderstate object which contains options affecting how the imagery is rendered. this includes things such as the near and far clipping planes (distances defining how close and how far away objects can be and still get rendered), as well as field of view info...
...jects. event description end sent to the xrsession object after the webxr session has ended and all hardware-related functions have completed. the event is represented by an object of type xrsessionevent. also available through the onend event handler property. inputsourceschange an event of type xrinputsourceschangeevent sent to the xrsession when the
list of active xr input sources has changed. also available through the oninputsourceschange event handler property. select an event of type xrinputsourceevent which is sent to the session when one of the session's input sources has successfully completed a primary action. this generally corresponds to the user pressing a trigger, touchpad, or button, speaks a command, or performs a re...
XRSessionEvent() - Web APIs
returns a new xrsessionevent object. these objects represent events announcing state changes in an xrsession representing an augmented or virtual reality session. syntax newxrsessionevent = new xrsessionevent(type, eventinitdict); parameters type a domstring indicating which of the events represented by objects of type xrsessionevent this particular object represents. see event types for a
list of the permitted values. eventinitdict an object conforming to the xrsessioneventinit dictionary which contains values to be applied to the newly-created event object. permitted values are: session the xrsession to which the event is to be delivered. return value a newly-created xrsessionevent object representing an object of the specfied type and configured as described by the eve...
...described by the eventinitdict parameter. event types the following events are represented using the xrsessionevent interface, and are permitted values for its type property. end fired at the session when it has ended, after being terminated by the application or the user agent. visibilitychange fired at the session whenever its visibility state changes. ...
... at the session whenever its visibility state changes. examples this example creates a
listiener that watches for the visibility state of the session to change. it reacts by calling a function mysessionvisible() with a boolean indicating whether or not the session is visible; this function might, for instance, spin up or reconfigure a worker that handles rendering the scene. xrsession.addevent
listener("visibilitystate", e => { switch(e.session.visibilitystate) { case "visible": case "visible-blurred": mysessionvisible(true); break; case "hidden": mysessionvisible(false); break; } }); specifications specification status comment webxr device apithe definition of 'xrsessionevent() constructor' in that specification. wor...
XRView - Web APIs
called on the xrframe being rendered. usage notes positions and number of xrviews per frame while rendering a scene, the set of views that are used to render the scene for the viewer as of the current frame are obtained by calling the xrframe object's getviewerpose() method to get the xrviewerpose representing (in essence) the position of the viewer's head. that object's views property is a
list of all of the xrview objects representing the viewpoints which can be used to construct the scene for presentation to the user. it's possible to have xrview objects which represent overlapping regions as well as entirely disparate regions; in a game, you might have views that can be presented to observe a remote site using a security camera or other device, for example. in other words, don't ass...
...n be as few as one (such as when rendering the scene in inline mode, and potentially many (especially if the field of view is very large). there might also be views representing observers watching the action, or other viewspoints not direclty associated with a player's eye. in addition, the number of views can change at any time, depending on the needs of the time. so you should process the view
list every time without making assumptions based on previous frames. all positions and orientations within the views for a given xrviewerpose are specified in the reference space that was passed to xrframe.getviewerpose(); this is called the viewer reference space. the transform property describes the position and orientation of the eye or camera represented by the xrview, given in that reference spa...
...to position the rendering into the correct half of the layer. if in the future it becomes possible for each view to render into a different layer, there would have to be changes made to the api, so it's safe for now to assume that all views will render into the same layer. examples preparing to render every view for a pose to draw eerything the user sees each frame requires iterating over the
list of views returned by the xrviewerpose object's views
list: for (let view of pose.views) { let viewport = gllayer.getviewport(view); gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height); // draw the scene; the eye being drawn is identified // by view.eye. } special view transforms there are a few special transforms that are used on the view while rendering and lighti...
msthumbnailclick - Web APIs
rk for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. the msthumbnailclick event occurs when a user clicks a button or thumbnail icon in the taskbar. this proprietary method is specific to internet explorer and microsoft edge. syntax event property object.onmsthumbnailclick = handler; addevent
listener method object.addevent
listener("msthumbnailclick", handler, usecapture) general info synchronous no bubbles no cancelable no note the onmsthumbnailclick event is available only to documents that are launched from a pinned site shortcut. parameters pevtobj [in] type: ihtmleventobj pointer to an ihtmleventobj interface for the current event. example function thumb...
...general info synchronous no bubbles no cancelable no note the onmsthumbnailclick event is available only to documents that are launched from a pinned site shortcut. parameters pevtobj [in] type: ihtmleventobj pointer to an ihtmleventobj interface for the current event. ...
...er('msthumbnailclick', thumbnailclickhandler); example 2 // adds an overlay icon on your app pinned to the taskbar window.external.mssitemodeseticonoverlay(iconuri, tooltip); // removes an overlay icon window.external.mssitemodecleariconoverlay(); // pinned icons on your taskbar can be instructed to trigger specific events on your site from the taskbar // add an event handlerdocument.addevent
listener('msthumbnailclick', onbuttonclicked, false); // add the buttons var btnplay = window.external.mssitemodeaddthumbbarbutton(iconuri, tooltip); // refresh the taskbar window.external.mssitemodeshowthumbbar(); // call a javascript function when the button is pressed function onbuttonclicked(e) { switch (e.buttonid) { case btnplay: play(); break;} } see also microsoft api ext...
Using the aria-labelledby attribute - Accessibility
this idea is similar to how the "for" attribute is used to link a label to an input. assistive technology, such as screen readers, use this attribute to catalog the objects in a document so that users can navigate between them. ...
...jects. the examples section below provides more information on how to use the attribute this way. to improve compatibility with user agents that do not support aria, you can use aria-labelledby with the <label> element (using the for attribute). this attribute can be used with any typical html form element; it is not limited to elements that have an aria role assigned. value a space-separated
list of element ids possible effects on user agents and assistive technology when user agents compute the accessible name property of elements that have both an aria-labelledby attribute and an aria-label attribute, the user agents give precedence to aria-labelledby. examples example 1: multiple labels in the example below, each input field is labelled by both its own individual label and by the...
...is described in the natural flow of the narrative is associated with the term itself using the aria-labelledby attribute: <p>the doctor explained it had been a <dfn id="placebo">placebo</dfn>, or <span role="definition" aria-labelledby="placebo"> an inert preparation prescribed more for the mental relief of the patient than for its actual effect on a disorder.</span> </p> example 6: definition
lists in the example below, the definitions in a formal definition
list are associated with the terms they define using the aria-labelledby attribute: <dl> <dt id="anathema">anathema</dt> <dd role="definition" aria-labelledby="anathema">a ban or curse solemnly pronounced by ecclesiastical authority and accompanied by excommunication</dd> ...
ARIA: feed role - Accessibility
a feed is a dynamic scrollable
list of articles in which articles are added to or removed from either end of the
list as the user scrolls. a feed enables screen readers to use the browse mode reading cursor to both read and scroll through a stream of rich content that may continue scrolling infinitely by loading more content as the user reads. <section role="feed" aria-busy="false"> ... <article aria-posinset="427" aria-setsize="-1">...</article> <article aria-posinset="428" aria-setsize="-1">...</article> <article aria-posinset="429" aria-setsize="-1">...</article> ... </section> description a feed is a page structure for a scrollable
list of articles where scrolling may cause articles to be added to the top or end of the
list. ...
...ole="feed" aria-busy="false"> ... <article aria-posinset="427" aria-setsize="-1">...</article> <article aria-posinset="428" aria-setsize="-1">...</article> <article aria-posinset="429" aria-setsize="-1">...</article> ... </section> description a feed is a page structure for a scrollable
list of articles where scrolling may cause articles to be added to the top or end of the
list. ...
...these streams can be limited or infinite, loading more content as the user scrolls. implementing the feed pattern allows a screen reader to reliably read and trigger the loading of feed content while in reading mode. a feed is a container element whose children are <article>s or have role article. ...
An overview of accessible web applications and widgets - Accessibility
since the html4 specification doesn't provide built-in tags that semantically describe these kinds of widgets, developers typically resort to using generic elements such as <div> and <span>. while this results in a widget that looks like its desktop counterpart, there usually isn't enough semantic information in the markup to be usable by an assistive technology. ...
...a much more consistent user experience than was possible in the previous generation of web applications, since assistive technology users can apply all of their knowledge of how desktop applications work when they are using web-based applications. example 3: markup for the tabs widget with aria attributes added. <!-- now *these* are tabs! --> <!-- we've added role attributes to describe the tab
list and each tab. --> <ol role="tab
list"> <li id="ch1tab" role="tab"> <a href="#ch1panel">chapter 1</a> </li> <li id="ch2tab" role="tab"> <a href="#ch2panel">chapter 2</a> </li> <li id="quiztab" role="tab"> <a href="#quizpanel">quiz</a> </li> </ol> <div> <!-- notice the role and aria-labelledby attributes we've added to describe these panels. --> <div id="ch1panel" role="...
...ate changes aria provides attributes for declaring the current state of a ui widget. examples include (but are certainly not limited to): aria-checked: indicates the state of a checkbox or radio button aria-disabled: indicates that an element is visible, but not editable or otherwise operable aria-grabbed: indicates the 'grabbed' state of an object in a drag-and-drop operation (for a full
list of aria states, consult the aria
list of states and properties.) developers should use aria states to indicate the state of ui widget elements and use css attribute selectors to alter the visual appearance based on the state changes (rather than using script to change a class name on the element). visibility changes when content visibility is changed (i.e., an element is hidden or shown), deve...
Community - Accessibility
this document provides links to mailing
lists, newsgroups, forums, and other communities related to accessbility. if you know of other useful resources, please link to them here. ...
... this document provides links to mailing
lists, newsgroups, forums, and other communities related to accessbility. if you know of other useful resources, please link to them here. ...
... this document provides links to mailing
lists, newsgroups, forums, and other communities related to accessbility. if you know of other useful resources, please link to them here. ...
HTML To MSAA - Accessibility
n/a value then it means specific elements doesn't provide own rules to calculate name but name can be computed from aria markup or @title attribute. ...
...iobutton n/a n/a state_system_ marqueed used as state checkable state_system_ checked if checked property of dom element returns true n/a "select" event_object_ statechange when state is changed label role_system_ statictext from child nodes n/a n/a n/a n/a n/a legend role_system_ statictext n/a n/a n/a label_for (0x1002), points to caption element n/a n/a li and others role_system_
listitem n/a n/a state_system_ readonly n/a n/a n/a contains child accessible for
list bullet ol, ul and others role_system_
list n/a n/a state_system_ readonly n/a n/a n/a optgroup bstr role n/a n/a n/a n/a n/a n/a option role_system_
listitem from @label attribute, from child text nodes n/a state_system_ selected if option is selected n/a "select" event_object_ selectionwithin event_objec...
...rs role_system_
list n/a n/a state_system_ readonly n/a n/a n/a optgroup bstr role n/a n/a n/a n/a n/a n/a option role_system_
listitem from @label attribute, from child text nodes n/a state_system_ selected if option is selected n/a "select" event_object_ selectionwithin event_object_ selectionadd if selected event_object_ selectionremove if unselected select @size > 1 role_system_
list n/a n/a state_system_ multiselectable if multiselectable n/a n/a n/a select @size = 1 role_system_ combobox n/a name of focused option state_system_ expanded if combobox open state_system_ collapsed if combobox is collapsed state_system_ haspopup state_system_ focusable n/a "open"/"close" depending on state event_object_ valuechange when selected option is changed table role_system_ t...
-moz-image-region - CSS: Cascading Style Sheets
this allows elements to use different pieces of the same image to improve performance. /* keyword value */ -moz-image-region: auto; /* <shape> value */ -moz-image-region: rect(0, 8px, 4px, 4px); /* global values */ -moz-image-region: inherit; -moz-image-region: initial; -moz-image-region: unset; the syntax is similar to the clip property. all four values are relative to the upper left corner of the image. note: for a system that works on any background, see -moz-image-rect(). ...
...rect() function defines a rectangle to use as shape. its parameters define the top, right, bottom, and left offsets of the edges of the image, in this order. formal definition initial valueautoapplies toxul <image> elements and :-moz-tree-image, :-moz-tree-twisty, and :-moz-tree-checkbox pseudo-elements. ...
...region only works with <image> elements where the icon is specified using
list-style-image. it will not work with xul <image src="url" />.inheritedyescomputed valueas specifiedanimation typediscrete formal syntax <shape> | autowhere <shape> = rect(<top>, <right>, <bottom>, <left>) examples clipping an image #example-button { /* display only the 4x4 area from the top left of this image */
list-style-image: url("chrome://example/skin/example.png"); -moz-image-region: rect(0px, 4px, 4px, 0px); } #example-button:hover { /* use the 4x4 area to the right of the first for the hovered button */ -moz-image-region: rect(0px, 8px, 4px, 4px); } specifications not part of any standard. ...
:has() - CSS: Cascading Style Sheets
the :has() css pseudo-class represents an element if any of the selectors passed as parameters (relative to the :scope of the given element) match at least one element. ...
...class represents an element if any of the selectors passed as parameters (relative to the :scope of the given element) match at least one element. ...
...in earlier revisions of the css selectors level 4 specification, :has had a limitation that it couldn't be used within stylesheets. instead, it could only be used with functions like document.queryselector(); this was due to performance concerns. this limitation has been removed because no browser implemented it that way. instead, browsers currently only support the use of :has() ...
:not() - CSS: Cascading Style Sheets
the :not() css pseudo-class represents elements that do not match a
list of selectors. since it prevents specific items from being selected, it is known as the negation pseudo-class. /* selects any element that is not a paragraph */ :not(p) { color: blue; } the :not() pseudo-class has a number of quirks, tricks, and unexpected results that you should be aware of before using it. syntax the :not() pseudo-class requires a comma-separated
list of one or more selectors as its argument. the
list must not contain another negation selector or a pseudo-element. the ability to
list more than one selector is experimental and not yet widely supported. ...
...ss has a number of quirks, tricks, and unexpected results that you should be aware of before using it. syntax the :not() pseudo-class requires a comma-separated
list of one or more selectors as its argument. the
list must not contain another negation selector or a pseudo-element. the ability to
list more than one selector is experimental and not yet widely supported. ...
...ks, and unexpected results that you should be aware of before using it. syntax the :not() pseudo-class requires a comma-separated
list of one or more selectors as its argument. the
list must not contain another negation selector or a pseudo-element. the ability to
list more than one selector is experimental and not yet widely supported. ...
:where() - CSS: Cascading Style Sheets
the difference between :where() and :is() is that :where() always has 0 specificity, whereas :is() takes on the specificity of the most specific selector in its arguments. examples comparing :where() and :is() this example shows how :where() works, and also illustrates the difference between :where() and :is(). take the following html: <article> <h2>:is()-styled links</h2> <section class="is-styling"> <p>here is my main content. this <a href="https://mozilla.org">contains a link</a>. ...
...r link will be overidden by our simple selector. you can see the result below (although bear in mind that currently :is() and :where() are currently only enabled by default in firefox nightly, version 77+. in other versions of firefox it is behind a pref — layout.css.is-where-selectors.enabled). note: you can also find this example on github; see is-where. ...
... simple selector. you can see the result below (although bear in mind that currently :is() and :where() are currently only enabled by default in firefox nightly, version 77+. in other versions of firefox it is behind a pref — layout.css.is-where-selectors.enabled). note: you can also find this example on github; see is-where. ...
range - CSS: Cascading Style Sheets
r alphabetic and symbolic systems, the range is 1 to positive infinity. for additive systems, the range is 0 to positive infinity. for extends systems, the range is whatever auto would produce for the extended system; if extending a complex predefined style (§7 complex predefined counter styles), the range is the style’s defined range. [ [ | infinite ]{2} ]# defines a comma-separated
list of ranges. for each individual range, the first value is the lower bound and the second value is the upper bound. a range is inclusive, that means it always contains both, the lower and upper bound numbers. if infinite is used as the first value in a range, it represents negative infinity; if it is used as the second value, it represents positive infinity. the range of the counter style is the un...
..., the first value is the lower bound and the second value is the upper bound. a range is inclusive, that means it always contains both, the lower and upper bound numbers. if infinite is used as the first value in a range, it represents negative infinity; if it is used as the second value, it represents positive infinity. the range of the counter style is the union of all the ranges defined in the
list. if the lower bound of any range is higher than the upper bound, the entire descriptor is invalid and will be ignored. description the value of the range descriptor can be either auto or a comma separated
list of lower and upper bounds specified as integers. if value is auto, then for cyclic, numeric, and fixed system, the range will be from negative infinity to positive infinity. for alphab...
...e can be used to denote infinity. if infinite is specified as the first value in a range, then it is interpreted as negative infinity. if used as upper bound, it is taken as positive infinity. formal definition related at-rule@counter-styleinitial valueautocomputed valueas specified formal syntax [ [ <integer> | infinite ]{2} ]# | auto examples setting counter style over a range <ul class="
list"> <li>one</li> <li>two</li> <li>three</li> <li>four</li> <li>five</li> <li>six</li> <li>seven</li> <li>eight</li> <li>nine</li> <li>ten</li> </ul> @counter-style range-multi-example { system: cyclic; symbols: "\25a0" "\25a1"; range: 2 4, 7 9; } .
list {
list-style: range-multi-example; } the above
list will display as follows: 1. one ā”. two ā . three ...
@import - CSS: Cascading Style Sheets
the @import css at-rule is used to import style rules from other style sheets. syntax @import url; @import url
list-of-media-queries; @import url supports( supports-query ); @import url supports( supports-query )
list-of-media-queries; where: url is a <string> or a <url> representing the location of the resource to import. the url may be absolute or relative. note that the url for a mozilla package need not actually specify a file; it can just specify the package name and part, and the appropriate file is chosen automatically (e.g. chrome://communicator/skin/). see here for more information.
list-of-media-queries is a comma-separated
list of media queries conditioning the application of the css rules defined in the linked url. if the browser does not support any these queries, it do...
...oup at-rules. so that user agents can avoid retrieving resources for unsupported media types, authors may specify media-dependent @import rules. these conditional imports specify comma-separated media queries after the url. in the absence of any media query, the import is unconditional. specifying all for the medium has the same effect. ...
...agents can avoid retrieving resources for unsupported media types, authors may specify media-dependent @import rules. these conditional imports specify comma-separated media queries after the url. in the absence of any media query, the import is unconditional. specifying all for the medium has the same effect. ...
@page - CSS: Cascading Style Sheets
hange the margins, orphans, widows, and page breaks of the document. attempts to change any other css properties will be ignored. the @page at-rule can be accessed via the css object model interface csspagerule. note: the w3c is discussing how to handle viewport-related <length> units, vh, vw, vmin, and vmax. meanwhile do not use them within a @page at-rule. ...
... breaks of the document. attempts to change any other css properties will be ignored. the @page at-rule can be accessed via the css object model interface csspagerule. note: the w3c is discussing how to handle viewport-related <length> units, vh, vw, vmin, and vmax. meanwhile do not use them within a @page at-rule. ...
...ength> units, vh, vw, vmin, and vmax. meanwhile do not use them within a @page at-rule. ...
Attribute selectors - CSS: Cascading Style Sheets
font-style: italic; } /* <a> elements whose class attribute contains the word "logo" */ a[class~="logo"] { padding: 2px; } syntax [attr] represents elements with an attribute name of attr. [attr=value] represents elements with an attribute name of attr whose value is exactly value. [attr~=value] represents elements with an attribute name of attr whose value is a whitespace-separated
list of words, one of which is exactly value. [attr|=value] represents elements with an attribute name of attr whose value can be exactly value or can begin with value immediately followed by a hyphen, - (u+002d). it is often used for language subcode matches. [attr^=value] represents elements with an attribute name of attr whose value is prefixed (preceded) by value. [attr$=value] represents el...
...e `data-lang` are purple. */ /* note: you could also use hyphenated attributes without double quotes */ div[data-lang="zh-tw"] { color: purple; } html <div lang="en-us en-gb en-au en-nz">hello world!</div> <div lang="pt">olá mundo!</div> <div lang="zh-cn">äøēęØå„½ļ¼</div> <div lang="zh-tw">äøēęØå„½ļ¼</div> <div data-lang="zh-tw">äøēęØå„½ļ¼</div> result html ordered
lists the html specification requires the type attribute to be matched case-insensitively due to it primarily being used in the <input> element, trying to use attribute selectors to with the type attribute of an ordered
list doesn't work without the case-sensitive modifier. css /*
list types require the case sensitive flag due to a quirk in how html treats the type attribute. */ ol[type="a"] { li...
...ase-insensitively due to it primarily being used in the <input> element, trying to use attribute selectors to with the type attribute of an ordered
list doesn't work without the case-sensitive modifier. css /*
list types require the case sensitive flag due to a quirk in how html treats the type attribute. */ ol[type="a"] {
list-style-type: lower-alpha; background: red; } ol[type="a" s] {
list-style-type: lower-alpha; background: lime; } ol[type="a" s] {
list-style-type: upper-alpha; background: lime; } html <ol type="a"> <li>example
list</li> </ol> result specifications specification status comment selectors level 4the definition of 'attribute selectors' in that specification. working draft adds modifier for ascii case-sensitive and ca...
Coordinate systems - CSS: Cascading Style Sheets
the mouseevent.screenx and mouseevent.screeny properties give the coordinates of a mouse event's position relative to the screen's origin. example let's take a look at an example. this simple example creates a set of nested boxes. whenever the mouse enters, moves around inside, or exits the inner box, the corresponding event is handled by updating a set of informational messages within the box,
listing out the current mouse coordinates in each of the four available coordinate systems. javascript let's look at the script in two sections. first, the code that logs the coordinates to the screen. this code will be called by the event handler for the various mouse events we watch. displaying the coordinates as we'll see in the html, the inner box (the one we're watching for events on) contain...
...tes in the given coordinate system. for example, if the value of type is "page", then idx is "pagex" and idy is "pagey". handling the mouse events setcoords() is called by the event handler for the various mouse events, named update(); this is shown below. ...
...he value of type is "page", then idx is "pagex" and idy is "pagey". handling the mouse events setcoords() is called by the event handler for the various mouse events, named update(); this is shown below. function update(e) { setcoords(e, "offset"); setcoords(e, "client"); setcoords(e, "page"); setcoords(e, "screen"); } inner.addevent
listener("mouseenter", update, false); inner.addevent
listener("mousemove", update, false); inner.addevent
listener("mouseleave", update, false); the event handler is in the update() method. it simply calls setcoords() once for each coordinate system, passing in the event that occurred. our main code sets up the event handlers on the inner box by calling addevent
listener() for each of the types mouseenter, mousemove, and mouseleave. html the html for ...
CSS Animations tips and tricks - CSS: Cascading Style Sheets
assname = "box changing"; }); }); } this looks weird, doesn't it? that's because the only way to play an animation again is to remove the animation effect, let the document recompute styles so that it knows you've done that, then add the animation effect back to the element. to make that happen, we have to be creative. here's what happens when the play() function gets called: the box's
list of css classes is reset to simply "box". this has the effect of removing any other classes currently applied to the box, including the "changing" class that handles animation. in other words, we're removing the animation effect from the box. however, changes to the class
list don't take effect until the style recomputation is complete and a refresh has occurred to reflect the change. to be sure ...
...tionframe() a second time! this time, the callback is run before the next repaint, which is after the style recomputation has occurred. this callback adds the "changing" class back onto the box, so that the repaint will start the animation once again. of course, we also need to add an event handler to our "run" button so it'll actually do something: document.queryselector(".runbutton").addevent
listener("click", play, false); result stopping an animation simply removing the animation-name applied to an element will make it jump or cut to its next state. if instead you'd like the animation to complete and then come to a stop you have to try a different approach. the main tricks are: make your animation as self-contained as possible. this means you should not rely on animation-directio...
...e: .slidein { animation-duration: 5s; animation-name: slidein; animation-iteration-count: infinite; } .stopped { animation-name: none; } @keyframes slidein { 0% { margin-left: 0%; } 50% { margin-left: 50%; } 100% { margin-left: 0%; } } <h1 id="watchme">click me to stop</h1> let watchme = document.getelementbyid('watchme') watchme.classname = 'slidein' const
listener = (e) => { watchme.classname = 'slidein stopped' } watchme.addevent
listener('click', () => watchme.addevent
listener('animationiteration',
listener, false) ) demo https://jsfiddle.net/morenoh149/5ty5a4oy/ ...
Basic Concepts of grid layout - CSS: Cascading Style Sheets
{ display: grid; grid-template-columns: 2fr 1fr 1fr; } in this final example, we mix absolute sized tracks with fraction units. the first track is 500 pixels, so the fixed width is taken away from the available space. the remaining space is divided into three and assigned in proportion to the two flexible tracks. ...
... the first track is 500 pixels, so the fixed width is taken away from the available space. the remaining space is divided into three and assigned in proportion to the two flexible tracks. .wrapper { display: grid; grid-template-columns: 500px 1fr 2fr; } track
listings with repeat() notation large grids with many tracks can use the repeat() notation, to repeat all or a section of the track
listing. for example the grid definition: .wrapper { display: grid; grid-template-columns: 1fr 1fr 1fr; } can also be written as: .wrapper { display: grid; grid-template-columns: repeat(3, 1fr); } repeat notation can be used for a part of the track
listing. in this next example i have created a grid with an initial 20-pixel track, then a repeating section of 6 1fr tracks then a final 20-...
...in this next example, my grid will consist of 10 tracks, a 1fr track, and then followed by a 2fr track. this pattern will be repeated five times. ...
Using CSS counters - CSS: Cascading Style Sheets
using the counters() function, separating text can be inserted between different levels of nested counters. example of a nested counter css ol { counter-reset: section; /* creates a new instance of the section counter with each ol ...
...ter is automatically created in child elements. using the counters() function, separating text can be inserted between different levels of nested counters. ...
... working draft no change css level 2 (revision 1)the definition of 'css counters' in that specification. recommendation initial definition ...
CSS Properties Reference - CSS: Cascading Style Sheets
for more css properties see the main css reference and mozilla css extensions. the reference articles also include examples on how to use all the properties. ...
...for more css properties see the main css reference and mozilla css extensions. the reference articles also include examples on how to use all the properties. ...
... cursor cursor display display filter filter float cssfloat font font font-family fontfamily font-size fontsize font-variant fontvariant font-weight fontweight height height left left letter-spacing letterspacing line-height lineheight
list-style
liststyle
list-style-image
liststyleimage
list-style-position
liststyleposition
list-style-type
liststyletype margin margin margin-bottom marginbottom margin-left marginleft margin-right marginright margin-top margintop overflow overflow padding padding padding...
Descendant combinator - CSS: Cascading Style Sheets
the descendant combinator — typically represented by a single space ( ) character — combines two selectors such that elements matched by the second selector are selected if they have an ancestor (parent, parent's parent, parent's parent's parent, etc) element matching the first selector. selectors that utilize a descendant combinator are called descendant selectors. /*
list items that are descendants of the "my-things"
list */ ul.my-things li { margin: 2em; } the descendant combinator is technically one or more css white space characters — the space character and/or one of four control characters: carriage return, form feed, new line, and tab characters — between two selectors in the absence of another combinator. additionally, the white space characters of which the combinator is...
... characters — the space character and/or one of four control characters: carriage return, form feed, new line, and tab characters — between two selectors in the absence of another combinator. additionally, the white space characters of which the combinator is comprised may contain any number of css comments. ...
...and/or one of four control characters: carriage return, form feed, new line, and tab characters — between two selectors in the absence of another combinator. additionally, the white space characters of which the combinator is comprised may contain any number of css comments. ...
Pagination - CSS: Cascading Style Sheets
this cookbook pattern demonstrates the navigation pattern used to display pagination, where the user can move between pages of content such as search results. requirements the pagination pattern typically displays items in a row. to ensure that the pagination is understandable by people using a screenreader, we mark the items up as a
list inside a <nav> element, and then use css to display the layout visually as a row. ...
... as a
list inside a <nav> element, and then use css to display the layout visually as a row. typically, the pagination component will be centered horizontally underneath the content. recipe download this example choices made this pattern is laid out using flexbox — one flex container nested inside another. the <nav> element is designated a flex container in order that we can center the
list inside using the justify-content property. the
list itself also becomes a flex container to lay the items out as a row. to space the items out we will use a margin on the flex items. alternative methods once the column-gap property has implementation in browsers this could be used instead of margins to space out the items. ...
...to help with this we have added aria-label="pagination" on the <nav> element. ...
background-position - CSS: Cascading Style Sheets
e difference" will be zero. you will need to offset using absolute values. formal definition initial value0% 0%applies toall elements. ...
...] && [ center | [ top | bottom ] <length-percentage>? ] ]where <length-percentage> = <l...
...] && [ center | [ top | bottom ] <length-percentage>? ] ]where <length-percentage> = <length> | <perce...
<basic-shape> - CSS: Cascading Style Sheets
e represents a shape used in the clip-path, shape-outside, and offset-path properties. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax the <basic-shape> data type is defined with one of the basic shape functions
listed below. when creating a shape, the reference box is defined by each property that uses <basic-shape> values. the coordinate system for the shape has its origin at the top-left corner of the reference box, with the x-axis running to the right and the y-axis running downwards. all the lengths expressed in percentages are resolved from the used dimensions of the reference box. shape functions th...
...r the ry value) of the reference box. the position argument defines the center of the ellipse. this defaults to center if omitted. polygon() polygon( [<fill-rule>,]? [<shape-arg> <shape-arg>]# ) <fill-rule> represents the filling rule used to determine the interior of the polygon. possible values are nonzero and evenodd. default value when omitted is nonzero. each pair argument in the
list represents xi and yi - the x and y axis coordinates of the ith vertex of the polygon. path() path( [<fill-rule>,]? <string>) the optional <fill-rule> represents the filling rule used to determine the interior of the path. possible values are nonzero and evenodd. default value when omitted is nonzero. the required <string> is an svg path string encompassed in quotes the arguments not...
... a <basic-shape> function are computed as specified, with these exceptions: omitted values are included and compute to their defaults. a <position> value in circle() or ellipse() is computed as a pair of offsets (horizontal then vertical) from the top left origin, each given as a combination of an absolute length and a percentage. a <border-radius> value in inset() is computed as an expanded
list of all eight <length> or percentage values. interpolation of basic shapes when animating between one <basic-shape> and another, the rules below are applied. the values in the shape functions interpolate as a simple
list. the
list values interpolate as <length>, <percentage>, or calc() where possible. if
list values are not one of those types but are identical, those values do interpolate. b...
font-feature-settings - CSS: Cascading Style Sheets
o more effective, predictable, understandable results than font-feature-settings, which is a low-level feature designed to handle special cases where no other way exists to enable or access an opentype font feature. in particular, font-feature-settings shouldn't be used to enable small caps. values normal text is laid out using default settings. <feature-tag-value> when rendering text, the
list of opentype feature tag value is passed to the text layout engine to enable or disable font features. the tag is always a <string> of 4 ascii characters. if it has more or less characters, or if it contains characters outside the u+20 – u+7e codepoint range, the whole property is invalid. the value is a positive integer. the two keywords on and off are synonyms for 1 and 0 respectively. if no ...
...e or disable font features. the tag is always a <string> of 4 ascii characters. if it has more or less characters, or if it contains characters outside the u+20 – u+7e codepoint range, the whole property is invalid. the value is a positive integer. the two keywords on and off are synonyms for 1 and 0 respectively. if no value is set, the default is 1. for non-boolean opentype features (e.g. sty
listic alternates), the value implies a particular glyph to be selected; for boolean values, it is a switch. formal definition initial valuenormalapplies toall elements. it also applies to ::first-letter and ::first-line.inheritedyescomputed valueas specifiedanimation typediscrete formal syntax normal | <feature-tag-value>#where <feature-tag-value> = <string> [ <integer> | on | off ]? examples ...
... candidate recommendation initial definition ...
image() - CSS: Cascading Style Sheets
image, the css image() function allows adding allows only including background colors should an image fail to load, which means you can add a fall back color should a transparent png/gif/webp not load. ...
...oad, which means you can add a fall back color should a transparent png/gif/webp not load. ...
...cing arrow on the left</li> <li dir="rtl">bullet is the same arrow, flipped to point left.</li> </ul> ul {
list-style-image: image(ltr 'https://mdn.mozillademos.org/files/16412/rightarrow.png'); } in the left-to-right
list items — those with dir="ltr" set on the element itself or inheriting the directionality from an ancestor or default value for the page — the image will be used as-is.
list items with dir="rtl" set on the <li> or inheriting the right-to-left directionality from an ancestor, such as documents set to arabic or hebrew, will have the bullet display on the right, horizontally flippled, as if transform: scalex(-1) had been set. the text will also be displayed left-to-right. displaying a section of the background image <div class="box">hover over me. what cursor do you...
mask-position - CSS: Cascading Style Sheets
| [ [ left | right ] <length-percentage> ] && [ [ top | bottom ] <length-percentage> ] ]where <length-percentage> = <length> | <percentage> examples s...
...| [ [ left | right ] <length-percentage> ] && [ [ top | bottom ] <length-percentage> ] ]where <length-percentage> = <length> | <percentage> examples setting mask pos...
... candidate recommendation initial definition ...
mask-size - CSS: Cascading Style Sheets
ion if there is one. if there is no such intrinsic dimension, use the corresponding dimension of the mask positioning area. ...
... one. if there is no such intrinsic dimension, use the corresponding dimension of the mask positioning area. ...
... candidate recommendation initial definition ...
pointer-events - CSS: Cascading Style Sheets
values auto the element behaves as it would if the pointer-events property were not specified. in svg content, this value and the value visiblepainted have the same effect. none the element is never the target of pointer events; however, pointer events may target its descendant elements if those descendants have pointer-events set to some other value. in these circumstance...
...e element behaves as it would if the pointer-events property were not specified. in svg content, this value and the value visiblepainted have the same effect. none the element is never the target of pointer events; however, pointer events may target its descendant elements if those descendants have pointer-events set to some other value. in these circumstances, pointer events will trigger event
listeners on this parent element as appropriate on their way to/from the descendant during the event capture/bubble phases. svg only (experimental for html) visiblepainted svg only (experimental for html). the element can only be the target of a pointer event when the visibility property is set to visible and e.g. when a mouse cursor is over the interior (i.e., 'fill') of the element and the fil...
... the visiblepainted value apply to svg content. in addition to indicating that the element is not the target of pointer events, the value none instructs the pointer event to go "through" the element and target whatever is "underneath" that element instead. note that preventing an element from being the target of pointer events by using pointer-events does not necessarily mean that pointer event
listeners on that element cannot or will not be triggered. if one of the element's children has pointer-events explicitly set to allow that child to be the target of pointer events, then any events targeting that child will pass through the parent as the event travels along the parent chain, and trigger event
listeners on the parent as appropriate. of course any pointer activity at a point on the scre...
repeating-linear-gradient() - CSS: Cascading Style Sheets
ich point between two color stops the gradient color should reach the midpoint of the color transition. if omitted, the midpoint of the color transition is the midpoint between two color stops. note: rendering of color stops in css gradients follows the same rules as color stops in svg gradients. ...
...s the midpoint between two color stops. note: rendering of color stops in css gradients follows the same rules as color stops in svg gradients. ...
...ows the same rules as color stops in svg gradients. ...
text-shadow - CSS: Cascading Style Sheets
each shadow is described by some combination of x and y offsets from the element, blur radius, and color. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... each shadow is specified as two or three <length> values, followed optionally by a <color> value. the first two <length> values are the <offset-x> and <offset-y> values. the third, optional, <length> value is the <blur-radius>. the<color> value is the shadow's color. when more than one shadow is given, shadows are applied front-to-back, with the first-specified shadow on top. this ...
...e to the effect of <blur-radius>. <blur-radius> optional. this is a <length> value. the higher the value, the bigger the blur; the shadow becomes wider and lighter. if not specified, it defaults to 0. formal definition initial valuenoneapplies toall elements. ...
transition-timing-function - CSS: Cascading Style Sheets
ssence, lets you establish an acceleration curve so that the speed of the transition can vary over its duration. this acceleration curve is defined using one <timing-function> for each property to be transitioned. 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. in both cases, the css declaration stays valid. syntax /* keyword values */ transition-timing-fun...
...erty: all; transition-duration: 7s; } .parent > div.box1{ width: 90vw; min-width: 24em; background-color: magenta; color: yellow; border: 1px solid orange; transition-property: all; transition-duration: 2s; } function updatetransition() { var els = document.queryselectorall(".parent > div[class]"); for(var c = els.length, i = 0; i < c; i++) { els[i].class
list.toggle("box1"); } } var intervalid = window.setinterval(updatetransition, 10000); .ease { transition-timing-function: ease; } .easein { transition-timing-function: ease-in; } .easeout { transition-timing-function: ease-out; } .easeinout { transition-timing-function: ease-in-out; } .linear { transition-timing-function: linear; } .cb { transition-timing-function: cubic-bezie...
...operty: all; transition-duration:7s; } .parent > div.box1{ width: 90vw; min-width: 24em; background-color: magenta; color: yellow; border: 1px solid orange; transition-property: all; transition-duration:2s; } function updatetransition() { var els = document.queryselectorall(".parent > div[class]"); for(var c = els.length, i = 0; i < c; i++) { els[i].class
list.toggle("box1"); } } var intervalid = window.setinterval(updatetransition, 10000); .jump-start { transition-timing-function: steps(5, jump-start); } .jump-end { transition-timing-function: steps(5, jump-end); } .jump-none { transition-timing-function: steps(5, jump-none); } .jump-both { transition-timing-function: steps(5, jump-both); } .step-start { transition-timing-function...
Content categories - Developer guides
formation. elements belonging to this category are <base>, <command>, <link>, <meta>, <noscript>, <script>, <style> and <title>. flow content elements belonging to the flow content category typically contain text or embedded content. ...
...n prior to html 5 being finalized, but is still part of the whatwg specification and is at least partially supported by most browsers. phrasing content phrasing content defines the text and the mark-up it contains. runs of phrasing content make up paragraphs. elements belonging to this category are <abbr>, <audio>, <b>, <bdo>, <br>, <button>, <canvas>, <cite>, <code>, <command>, <data>, <data
list>, <dfn>, <em>, <embed>, <i>, <iframe>, <img>, <input>, <kbd>, <keygen>, <label>, <mark>, <math>, <meter>, <noscript>, <object>, <output>, <picture>, <progress>, <q>, <ruby>, <samp>, <script>, <select>, <small>, <span>, <strong>, <sub>, <sup>, <svg>, <textarea>, <time>, <var>, <video>, <wbr> and plain text (not only consisting of white spaces characters). a few other elements belong to this cate...
...rm-associated content form-associated content comprises elements that have a form owner, exposed by a form attribute. a form owner is either the containing <form> element or the element whose id is specified in the form attribute. <button> <fieldset> <input> <keygen> <label> <meter> <object> <output> <progress> <select> <textarea> this category contains several sub-categories:
listed elements that are
listed in the form.elements and fieldset.elements idl collections. contains <button>, <fieldset>, <input>, <keygen>, <object>, <output>, <select>, and <textarea>. labelable elements that can be associated with <label> elements. contains <button>, <input>, <keygen>, <meter>, <output>, <progress>, <select>, and <textarea>. submittable elements that can be used for constru...
Block-level elements - HTML: Hypertext Markup Language
set of content categories. while the "inline" category roughly corresponds to the category of phrasing content, the "block-level" category doesn't directly correspond to any html5 content category, but "block-level" and "inline" elements combined together correspond to the flow content in html5. there are also additional categories, e.g. interactive content. elements the following is a complete
list of all html "block-level" elements (although "block-level" is not technically defined for elements that are new in html5). <address> contact information. <article> article content. <aside> aside content. <blockquote> long ("block") quotation. <details> disclosure widget. <dialog> dialog box. <dd> describes a term in a description
list. <div> document division. <dl> descriptio...
...f all html "block-level" elements (although "block-level" is not technically defined for elements that are new in html5). <address> contact information. <article> article content. <aside> aside content. <blockquote> long ("block") quotation. <details> disclosure widget. <dialog> dialog box. <dd> describes a term in a description
list. <div> document division. <dl> description
list. <dt> description
list term. ...
...on
list. <dt> description
list term. <fieldset> field set label. <figcaption> figure caption. <figure> groups media content with a caption (see <figcaption>). <footer> section or page footer. <form> input form. <h1>, <h2>, <h3>, <h4>, <h5>, <h6> heading levels 1-6. <header> section or page header. <hgroup> groups header information. <hr> horizontal rule (dividing line). <li>
list item. <main> contains the central content unique to this document. <nav> contains navigation links. <ol> ordered
list. <p> paragraph. <pre> preformatted text. <section> section of a web page. <table> table. <ul> unordered
list. see also inline elements display block and inline layout in normal flow ...
<bdi>: The Bidirectional Isolate element - HTML: Hypertext Markup Language
supports the global attributes, except that the dir attribute behaves differently than normal: it defaults to auto, meaning its value is never inherited from the parent element. this means that unless you specify a value of either rtl or ltr for dir, the user agent will determine the correct directionality to use based on the contents of the <bdi>. examples no <bdi> with only ltr this example
lists the winners of a competition using <span> elements only. when the names only contain ltr text the results look fine: <ul> <li><span class="name">henrietta boffin</span> - 1st place</li> <li><span class="name">jerry cruncher</span> - 2nd place</li> </ul> body { border: 1px solid #3f87a6; max-width: calc(100% - 40px - 6px); padding: 20px; width: calc(100% - 40px - 6px); border-wid...
...in this case the "- 1", which consists of characters with neutral or weak directionality, will adopt the directionality of the rtl text, and the result will be garbled: <ul> <li><span class="name">Ų§ŁŁŲ£ŁŲ¹ŁŲ“ŁŁ</span> - 1st place</li> <li><span class="name">jerry cruncher...
...these elements instruct the browser to treat the name in isolation from its embedding context, so the example output is properly ordered: <ul> <li><bdi class="name">Ų§ŁŁŲ£ŁŲ¹ŁŲ“ŁŁ</bdi> - 1st place</li> <li><bdi class="name">jerry cruncher</bdi> - 2nd place</li> </ul> body { border: 1px solid #3f87a6; max-width: calc(100% - 40p...
<input type="checkbox"> - HTML: Hypertext Markup Language
ipe name's checkbox is set to indeterminate. if all three are checked, the recipe name's checkbox is set to checked. so in this case the indeterminate state is used to state that collecting the ingredients has started, but the recipe is not yet complete. ...
...e indeterminate state is used to state that collecting the ingredients has started, but the recipe is not yet complete. ...
... living standard html5the definition ...
<source>: The Media or Image Source element - HTML: Hypertext Markup Language
cture> element, and it must be placed before the <img> element. implicit aria role no corresponding role permitted aria roles no role permitted dom interface htmlsourceelement attributes this element includes the global attributes. media media query of the resource's intended media; this should be used only in a <picture> element. sizes is a
list of source sizes that describes the final rendered width of the image represented by the source. each source size consists of a comma-separated
list of media condition-length pairs. this information is used by the browser to determine, before laying the page out, which image defined in srcset to use. please note that sizes will have its effect only if width dimension descriptors are provided with ...
...escriptors are provided with srcset instead of pixel ratio values (200w instead of 2x for example). the sizes attribute has an effect only when the <source> element is the direct child of a <picture> element. src required for <audio> and <video>, address of the media resource. the value of this attribute is ignored when the <source> element is placed inside a <picture> element. srcset a
list of one or more strings separated by commas indicating a set of possible images represented by the source for the browser to use. each string is composed of: one url specifying an image. a width descriptor, which consists of a string containing a positive integer directly followed by "w", such as 300w. the default value, if missing, is the infinity. a pixel density descriptor, that is a p...
...he browser to use. each string is composed of: one url specifying an image. a width descriptor, which consists of a string containing a positive integer directly followed by "w", such as 300w. the default value, if missing, is the infinity. a pixel density descriptor, that is a positive floating number directly followed by "x". the default value, if missing, is 1x. each string in the
list must have at least a width descriptor or a pixel density descriptor to be valid. among the
list, there must be only one string containing the same tuple of width descriptor and pixel density descriptor. the browser chooses the most adequate image to display at a given point of time. the srcset attribute has an effect only when the <source> element is the direct child of a <picture> element. ...
<tbody>: The Table Body element - HTML: Hypertext Markup Language
more than one <tbody> per table as long as they are all consecutive. this lets you divide the rows in large tables into sections, each of which may be separately formatted if so desired. examples below are some examples showing the use of the <tbody> element. for more examples of this tag in use, see the examples for <table>. basic example in this relatively simple example, we create a table
listing information about a group of students with a <thead> and a <tbody>, with a number of rows in the body. html the table's html is shown here. note that all of the body cells including information about students are contained within a single <tbody> element. <table> <thead> <tr> <th>student id</th> <th>name</th> <th>major</th> </tr> </thead> <tbody> <tr> ...
...ultiple bodies you can create multiple sections within a table by using multiple <tbody> elements. each may potentially have its own header row or rows; however, there can be only one <thead> per table! because of that, you need to use a <tr> filled with <th> elements to create headers within each <tbody>. let's see how that's done. let's take the previous example, add some more students to the
list, and update the table so that instead of
listing each student's major on every row, the students are grouped by major, with heading rows for each major. result first, the resulting table, so you know what we're building: html the revised html looks like this: <table> <thead> <tr> <th>student id</th> <th>name</th> </tr> </thead> <tbody> <tr> <th colspan="...
...pan="2">astrophysics</th> </tr> <tr> <td>4100332</td> <td>petrov, alexandra</td> </tr> <tr> <td>8892377</td> <td>toyota, hiroko</td> </tr> </tbody> </table> notice that each major is placed in a separate <tbody> block, the first row of which contains a single <th> element with a colspan attribute that spans the entire width of the table. that heading
lists the name of the major contained within the <tbody>. then each remaining row in each major's <tbody> consists of two cells: the first for the student's id and the second for their name. css table { border: 2px solid #555; border-collapse: collapse; font: 16px "lucida grande", "helvetica", "arial", sans-serif; } th, td { border: 1px solid #bbb; padding: 2px 8px 0; text-align: left...
Preloading content with rel="preload" - HTML: Hypertext Markup Language
resource to be embedded inside an <object> element. script: javascript file. style: css stylesheet. track: webvtt file. worker: a javascript web worker or shared worker. video: video file, as typically used in <video>. note: there's more detail about these values and the web features they expect to be consumed by in the preload spec — see link element extensions. also note that the full
list of values the as attribute can take is governed by the fetch spec — see request destinations. including a mime type <link> elements can accept a type attribute, which contains the mime type of the resource the element points to. this is especially useful when preloading resources — the browser will use the type attribute value to work out if it supports that resource, and will only downloa...
... live example): <head> <meta charset="utf-8"> <title>responsive preload example</title> <link rel="preload" href="bg-image-narrow.png" as="image" media="(max-width: 600px)"> <link rel="preload" href="bg-image-wide.png" as="image" media="(min-width: 601px)"> <link rel="stylesheet" href="main.css"> </head> <body> <header> <h1>my site</h1> </header> <script> var mediaquery
list = window.matchmedia("(max-width: 600px)"); var header = document.queryselector('header'); if (mediaquery
list.matches) { header.style.backgroundimage = 'url(bg-image-narrow.png)'; } else { header.style.backgroundimage = 'url(bg-image-wide.png)'; } </script> </body> we include media attributes on our <link> elements so that a narrow image is preloaded if the user has...
...ist.matches) { header.style.backgroundimage = 'url(bg-image-narrow.png)'; } else { header.style.backgroundimage = 'url(bg-image-wide.png)'; } </script> </body> we include media attributes on our <link> elements so that a narrow image is preloaded if the user has a narrow viewport, and a wider image is loaded if they have a wide viewport. we use window.matchmedia / mediaquery
list to do this (see testing media queries for more). this makes it much more likely that the font will be available for the page render, cutting down on fout (flash of unstyled text). this doesn't have to be limited to images, or even files of the same type — think big! you could perhaps preload and display a simple svg diagram if the user is on a narrow screen where bandwidth and cpu is potentia...
HTML: Hypertext Markup Language
g content to the internet and linking it to pages created by other people, you become an active participant in the world wide web. html uses "markup" to annotate text, images, and other content for display in a web browser. html markup includes special "elements" such as <head>, <title>, <body>, <header>, <footer>, <article>, <section>, <p>, <div>, <span>, <img>, <aside>, <audio>, <canvas>, <data
list>, <details>, <embed>, <nav>, <output>, <progress>, <video>, <ul>, <ol>, <li> and many others. an html element is set off from other text in a document by "tags", which consist of the element name surrounded by "<" and ">". the name of an element inside a tag is case insensitive. that is, it can be written in uppercase, lowercase, or a mixture. for example, the <title> tag can be written as <tit...
...res that they are made available earlier and are less likely to block the page's first render, leading to performance improvements. this article provides a basic guide to how preload works. references html reference html consists of elements, each of which may be modified by some number of attributes. html documents are connected to each other with links. html element reference browse a
list of all html elements. html attribute reference elements in html have attributes. these are additional values that configure the elements or adjust their behavior in various ways. global attributes global attributes may be specified on all html elements, even those not specified in the standard. this means that any non-standard elements must still permit these attributes, even though those ele...
...in others. similarly, each has a set of other content categories they can contain and elements that can or can't be used in them. this is a guide to these categories. quirks mode and standards mode historical information on quirks mode and standards mode. related topics applying color to html elements using css this article covers most of the ways you use css to add color to html content,
listing what parts of html documents can be colored and what css properties to use when doing so. includes examples, links to palette-building tools, and more. view all... ...
Reason: CORS header 'Access-Control-Allow-Origin' does not match 'xyz' - HTTP
w-origin header. this error can also occur if the response includes more than one access-control-allow-origin header. if the service your code is accessing using a cors request is under your control, make sure that it's configured to include your origin in its access-control-allow-origin header, and that only one such header is included in responses. the header itself accepts a comma-delineated
list of origins, so adding a new origin is not difficult. for example, in apache, add a line such as the following to the server's configuration (within the appropriate <directory>, <location>, <files>, or <virtualhost> section). the configuration is typically found in a .conf file (httpd.conf and apache.conf are common names for these), or in an .htaccess file. header set access-control-allow-origi...
...s, so adding a new origin is not difficult. ...
...he server's configuration (within the appropriate <directory>, <location>, <files>, or <virtualhost> section). ...
Feature-Policy: display-capture - HTTP
the http feature-policy header display-capture directive controls whether or not the document is permitted to use screen capture api, i.e.,getdisplaymedia() to capture the screen's contents. if display-capture is disabled in a document, the document will not be able to initiate screen capture via getdisplaymedia(). syntax feature-policy: display-capture <allow
list>; <allow
list> an allow
list is a
list of origins that takes one or more of the following values, separated by spaces: *: the feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin. 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. 'src': (in an iframe allow attribute only) the feature will be allo...
...is disabled in top-level and nested browsing contexts. <origin(s)>: the feature is allowed for specific origins (for example, https://example.com). origins should be separated by a space. the values * (enable for all origins) or 'none' (disable for all origins) may only be used alone, while 'self' and 'src' may be used with one or more origins. features are each defined to have a default allow
list, which is one of: *: the feature is allowed by default in top-level browsing contexts and all nested browsing contexts (iframes). 'self': the feature is allowed by default in top-level browsing contexts and in nested browsing contexts (iframes) in the same origin. the feature is not allowed in cross-origin documents in nested browsing contexts. 'none': the feature is disabled in top-level an...
...op-level browsing contexts and all nested browsing contexts (iframes). 'self': the feature is allowed by default in top-level browsing contexts and in nested browsing contexts (iframes) in the same origin. the feature is not allowed in cross-origin documents in nested browsing contexts. 'none': the feature is disabled in top-level and nested browsing contexts. default policy the default alow
list is 'self'. specifications specification status comment feature policy editor's draft initial definition. screen capturethe definition of 'display-capture' in that specification. working draft feature policy directive definition. ...
Feature-Policy: encrypted-media - HTTP
the http feature-policy header encrypted-media directive controls whether the current document is allowed to use the encrypted media extensions api (eme). when this policy is enabled, the promise returned by navigator.requestmediakeysystemaccess() will reject with a domexception. syntax feature-policy: encrypted-media <allow
list>; <allow
list> an allow
list is a
list of origins that takes one or more of the following values, separated by spaces: *: the feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin. 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. 'src': (in an iframe allow attribute only) the feature will be allowed in this iframe, as long as the...
...is disabled in top-level and nested browsing contexts. <origin(s)>: the feature is allowed for specific origins (for example, https://example.com). origins should be separated by a space. the values * (enable for all origins) or 'none' (disable for all origins) may only be used alone, while 'self' and 'src' may be used with one or more origins. features are each defined to have a default allow
list, which is one of: *: the feature is allowed by default in top-level browsing contexts and all nested browsing contexts (iframes). 'self': the feature is allowed by default in top-level browsing contexts and in nested browsing contexts (iframes) in the same origin. the feature is not allowed in cross-origin documents in nested browsing contexts. 'none': the feature is disabled in top-level an...
...t in top-level browsing contexts and all nested browsing contexts (iframes). 'self': the feature is allowed by default in top-level browsing contexts and in nested browsing contexts (iframes) in the same origin. the feature is not allowed in cross-origin documents in nested browsing contexts. 'none': the feature is disabled in top-level and nested browsing contexts. default policy the allow
list is 'self'. specifications specification status comment feature policy editor's draft initial definition. encrypted media extensionsthe definition of 'feature policy integration' in that specification. recommendation ...
Feature-Policy: midi - HTTP
the http feature-policy header midi directive controls whether the current document is allowed to use the web midi api. when this policy is enabled, the promise returned by navigator.requestmidiaccess() will reject with a domexception. syntax feature-policy: midi <allow
list>; <allow
list> an allow
list is a
list of origins that takes one or more of the following values, separated by spaces: *: the feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin. 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. 'src': (in an iframe allow attribute only) the feature will be allowed in this iframe, as long as the document loaded into it comes from the same origin as th...
...is disabled in top-level and nested browsing contexts. <origin(s)>: the feature is allowed for specific origins (for example, https://example.com). origins should be separated by a space. the values * (enable for all origins) or 'none' (disable for all origins) may only be used alone, while 'self' and 'src' may be used with one or more origins. features are each defined to have a default allow
list, which is one of: *: the feature is allowed by default in top-level browsing contexts and all nested browsing contexts (iframes). 'self': the feature is allowed by default in top-level browsing contexts and in nested browsing contexts (iframes) in the same origin. the feature is not allowed in cross-origin documents in nested browsing contexts. 'none': the feature is disabled in top-level an...
...t in top-level browsing contexts and all nested browsing contexts (iframes). 'self': the feature is allowed by default in top-level browsing contexts and in nested browsing contexts (iframes) in the same origin. the feature is not allowed in cross-origin documents in nested browsing contexts. 'none': the feature is disabled in top-level and nested browsing contexts. default policy the allow
list is 'self'. specifications specification status comment feature policy editor's draft initial definition. ...
Feature-Policy: payment - HTTP
the http feature-policy header field's payment directive controls whether the current document is allowed to use the payment request api. when this policy is disabled, the paymentrequest() constructor will throw a syntaxerror. syntax feature-policy: payment <allow
list>; <allow
list> an allow
list is a
list of origins that takes one or more of the following values, separated by spaces: *: the feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin. 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. 'src': (in an iframe allow attribute only) the feature will be allowed in this iframe, as long as the document loaded into it comes from the same origin as ...
...is disabled in top-level and nested browsing contexts. <origin(s)>: the feature is allowed for specific origins (for example, https://example.com). origins should be separated by a space. the values * (enable for all origins) or 'none' (disable for all origins) may only be used alone, while 'self' and 'src' may be used with one or more origins. features are each defined to have a default allow
list, which is one of: *: the feature is allowed by default in top-level browsing contexts and all nested browsing contexts (iframes). 'self': the feature is allowed by default in top-level browsing contexts and in nested browsing contexts (iframes) in the same origin. the feature is not allowed in cross-origin documents in nested browsing contexts. 'none': the feature is disabled in top-level an...
...ontexts and all nested browsing contexts (iframes). 'self': the feature is allowed by default in top-level browsing contexts and in nested browsing contexts (iframes) in the same origin. the feature is not allowed in cross-origin documents in nested browsing contexts. 'none': the feature is disabled in top-level and nested browsing contexts. default policy the payment feature's default allow
list value is 'self'. specifications specification status comment payment request api candidate recommendation see section 16. feature policy integration. feature policy editor's draft initial definition. ...
Feature-Policy: picture-in-picture - HTTP
the http feature-policy header picture-in-picture directive controls whether the current document is allowed to play a video in a picture-in-picture mode via the corresponding api. syntax feature-policy: picture-in-picture <allow
list>; <allow
list> an allow
list is a
list of origins that takes one or more of the following values, separated by spaces: *: the feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin. 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. 'src': (in an iframe allow attribute only) the feature will be allowed in this iframe, as long as the document loaded into it comes from the same origin as the url in the iframe's src attribute. 'no...
...is disabled in top-level and nested browsing contexts. <origin(s)>: the feature is allowed for specific origins (for example, https://example.com). origins should be separated by a space. the values * (enable for all origins) or 'none' (disable for all origins) may only be used alone, while 'self' and 'src' may be used with one or more origins. features are each defined to have a default allow
list, which is one of: *: the feature is allowed by default in top-level browsing contexts and all nested browsing contexts (iframes). 'self': the feature is allowed by default in top-level browsing contexts and in nested browsing contexts (iframes) in the same origin. the feature is not allowed in cross-origin documents in nested browsing contexts. 'none': the feature is disabled in top-level an...
...ontexts (iframes). 'self': the feature is allowed by default in top-level browsing contexts and in nested browsing contexts (iframes) in the same origin. the feature is not allowed in cross-origin documents in nested browsing contexts. 'none': the feature is disabled in top-level and nested browsing contexts. default policy as of june 2019, the spec draft and google chrome set default allow
list to *. specifications specification status comment feature policy editor's draft initial definition. ...
Feature-Policy: publickey-credentials-get - HTTP
he http feature-policy header publickey-credentials-get directive controls whether the current document is allowed to access web authentcation api to create new public-key credentials, i.e, via navigator.credentials.get({publickey: ..., ...}). when this policy is enabled, any attempt to query public key credentials will result in an error. syntax feature-policy: publickey-credentials-get <allow
list>; <allow
list> an allow
list is a
list of origins that takes one or more of the following values, separated by spaces: *: the feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin. 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. 'src': (in an iframe allow attrib...
...is disabled in top-level and nested browsing contexts. <origin(s)>: the feature is allowed for specific origins (for example, https://example.com). origins should be separated by a space. the values * (enable for all origins) or 'none' (disable for all origins) may only be used alone, while 'self' and 'src' may be used with one or more origins. features are each defined to have a default allow
list, which is one of: *: the feature is allowed by default in top-level browsing contexts and all nested browsing contexts (iframes). 'self': the feature is allowed by default in top-level browsing contexts and in nested browsing contexts (iframes) in the same origin. the feature is not allowed in cross-origin documents in nested browsing contexts. 'none': the feature is disabled in top-level an...
...p-level browsing contexts and all nested browsing contexts (iframes). 'self': the feature is allowed by default in top-level browsing contexts and in nested browsing contexts (iframes) in the same origin. the feature is not allowed in cross-origin documents in nested browsing contexts. 'none': the feature is disabled in top-level and nested browsing contexts. default policy the default allow
list is 'self'. specifications specification status comment feature policy editor's draft initial definition. web authentication level 2 editor's draft. definition of publickey-credentials-get directive, default allow
list. ...
Feature-Policy: screen-wake-lock - HTTP
eloped and available only behind a flag on select browsers and platforms. the http feature-policy header screen-wake-lock directive controls whether the current document is allowed to use screen wake lock api to indicate that device should not dim or turn off the screen. note: in earlier specification drafts this directive was called wake-lock. syntax feature-policy: screen-wake-lock <allow
list>; <allow
list> an allow
list is a
list of origins that takes one or more of the following values, separated by spaces: *: the feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin. 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. 'src': (in an iframe allow attrib...
...is disabled in top-level and nested browsing contexts. <origin(s)>: the feature is allowed for specific origins (for example, https://example.com). origins should be separated by a space. the values * (enable for all origins) or 'none' (disable for all origins) may only be used alone, while 'self' and 'src' may be used with one or more origins. features are each defined to have a default allow
list, which is one of: *: the feature is allowed by default in top-level browsing contexts and all nested browsing contexts (iframes). 'self': the feature is allowed by default in top-level browsing contexts and in nested browsing contexts (iframes) in the same origin. the feature is not allowed in cross-origin documents in nested browsing contexts. 'none': the feature is disabled in top-level an...
... top-level browsing contexts and all nested browsing contexts (iframes). 'self': the feature is allowed by default in top-level browsing contexts and in nested browsing contexts (iframes) in the same origin. the feature is not allowed in cross-origin documents in nested browsing contexts. 'none': the feature is disabled in top-level and nested browsing contexts. default policy default allow
list for screen-wake-lock is 'self'. specifications specification status comment feature policy editor's draft initial definition. screen wake lock api editor's draft initial definition of screen-wake-lock feature directive. ...
Feature-Policy: wake-lock - HTTP
actively being developed and available only behind a flag on select browsers and platforms. the http feature-policy header wake-lock directive controls whether the current document is allowed to use wake lock api to indicate that device should not enter power-saving mode. note: latest drafts of screen wake lock api defines screen-wake-lock directive. syntax feature-policy: wake-lock <allow
list>; <allow
list> an allow
list is a
list of origins that takes one or more of the following values, separated by spaces: *: the feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin. 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. 'src': (in an iframe allow attrib...
...is disabled in top-level and nested browsing contexts. <origin(s)>: the feature is allowed for specific origins (for example, https://example.com). origins should be separated by a space. the values * (enable for all origins) or 'none' (disable for all origins) may only be used alone, while 'self' and 'src' may be used with one or more origins. features are each defined to have a default allow
list, which is one of: *: the feature is allowed by default in top-level browsing contexts and all nested browsing contexts (iframes). 'self': the feature is allowed by default in top-level browsing contexts and in nested browsing contexts (iframes) in the same origin. the feature is not allowed in cross-origin documents in nested browsing contexts. 'none': the feature is disabled in top-level an...
... top-level browsing contexts and all nested browsing contexts (iframes). 'self': the feature is allowed by default in top-level browsing contexts and in nested browsing contexts (iframes) in the same origin. the feature is not allowed in cross-origin documents in nested browsing contexts. 'none': the feature is disabled in top-level and nested browsing contexts. default policy default allow
list for wake-lock is 'self'. specifications specification status comment feature policy editor's draft initial definition. wake lock api 1 candidate recommendation initial definition of wake-lock feature directive. ...
Feature-Policy: xr-spatial-tracking - HTTP
hether the current document is allowed to use the webxr device api. this policy controls whether navigator.xr.requestsession() can return xrsession that requires spatial tracking and whether user agent can indicate support for sessions supporting spatial tracking via navigator.xr.issessionsupported() and devicechange event on navigator.xr object. syntax feature-policy: xr-spatial-tracking <allow
list>; <allow
list> an allow
list is a
list of origins that takes one or more of the following values, separated by spaces: *: the feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin. 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. 'src': (in an iframe allow attrib...
...is disabled in top-level and nested browsing contexts. <origin(s)>: the feature is allowed for specific origins (for example, https://example.com). origins should be separated by a space. the values * (enable for all origins) or 'none' (disable for all origins) may only be used alone, while 'self' and 'src' may be used with one or more origins. features are each defined to have a default allow
list, which is one of: *: the feature is allowed by default in top-level browsing contexts and all nested browsing contexts (iframes). 'self': the feature is allowed by default in top-level browsing contexts and in nested browsing contexts (iframes) in the same origin. the feature is not allowed in cross-origin documents in nested browsing contexts. 'none': the feature is disabled in top-level an...
...p-level browsing contexts and all nested browsing contexts (iframes). 'self': the feature is allowed by default in top-level browsing contexts and in nested browsing contexts (iframes) in the same origin. the feature is not allowed in cross-origin documents in nested browsing contexts. 'none': the feature is disabled in top-level and nested browsing contexts. default policy the default allow
list is 'self'. specifications specification status comment webxr device apithe definition of 'permissions policy' in that specification. working draft ...
Feature-Policy - HTTP
o change at any time. be wary of this when implementing it on your website. the header has now been renamed to permissions-policy in the spec, and this article will eventually be updated to reflect that change. for more information, see the main feature policy article. header type response header forbidden header name yes syntax feature-policy: <directive> <allow
list> <directive> the feature policy directive to apply the allow
list to. see directives below for a
list of the permitted directive names. <allow
list> an allow
list is a
list of origins that takes one or more of the following values, separated by spaces: *: the feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin. 'self': the feature...
...is disabled in top-level and nested browsing contexts. <origin(s)>: the feature is allowed for specific origins (for example, https://example.com). origins should be separated by a space. the values * (enable for all origins) or 'none' (disable for all origins) may only be used alone, while 'self' and 'src' may be used with one or more origins. features are each defined to have a default allow
list, which is one of: *: the feature is allowed by default in top-level browsing contexts and all nested browsing contexts (iframes). 'self': the feature is allowed by default in top-level browsing contexts and in nested browsing contexts (iframes) in the same origin. the feature is not allowed in cross-origin documents in nested browsing contexts. 'none': the feature is disabled in top-level an...
... whether or not the current document is allowed to use the webxr device api to interact with a webxr session. example securecorp inc. wants to disable microphone and geolocation apis in its application. it can do so by delivering the following http response header to define a feature policy: feature-policy: microphone 'none'; geolocation 'none' by specifying the 'none' keyword for the origin
list, the specified features will be disabled for all browsing contexts (this includes all iframes), regardless of their origin. specifications specification permissions policy ...
Upgrade - HTTP
rade a connection from http 1.1 to http 2.0, or an http or https connection into a websocket. http/2 explicitly disallows the use of this mechanism/header; it is specific to http/1.1. header type request header, response header forbidden header name yes overview the upgrade header field may be used by clients to invite a server to switch to one (or more) of the
listed protocols, in descending preference order. for example, the client might send a get request as shown,
listing the preferred protocols to switch to (in this case "example/1" and "foo/2"): get /index.html http/1.1 host: www.example.com connection: upgrade upgrade: example/1, foo/2 note: connection: upgrade must be set whenever upgrade is sent. the server can choose to ignore the request, f...
...l, but might do so if the protocol is changed. the client can then request a protocol change using the process above. more detail and examples are provided in the topic protocol upgrade mechanism. syntax connection: upgrade upgrade: protocol_name[/protocol_version] notes: the connection header with type upgrade must always be sent with the upgrade header (as shown above). ...
...grade upgrade: protocol_name[/protocol_version] notes: the connection header with type upgrade must always be sent with the upgrade header (as shown above). protocols are
listed, comma-separated, in order of descending preference. protocol version is optional. for example: connection: upgrade upgrade: a_protocol/1, example ,another_protocol/2.2 directives any comma-separated
list protocol names (each with optional protocol version) one or more protocol names with optional version ("/" separated). the protocols are
listed in order of descending preference. examples connection: upgrade upgrade: http/2.0, shttp/1.3, irc/6.9, rta/x11 connection: upgrade upgrade: websocket specifications specification hypertext transfer protocol (http/1.1): message syntax and r...
Want-Digest - HTTP
the responder to use to create the digest. the sender may use quality values to indicate its preference ordering among the choices it offers. if want-digest does not include any digest algorithms that the server supports, the server may respond with: a digest calculated using a different digest algorithm, or a 400 bad request error, and include another want-digest header with that response,
listing the algorithms that it does support. see the page for the digest header for more information. header type general header forbidden header name no syntax want-digest: <digest-algorithm> // multiple algorithms, weighted with the quality value syntax: want-digest: <digest-algorithm><q-value>,<digest-algorithm><q-value> directives <digest-algorithm> support...
...30 and rfc 5843, and include sha-256 and sha-512. some of the supported algorithms, including unixsum and md5 are subject to collisions and are thus not suitable for applications in which collision-resistance is important. <q-value> the quality value to apply to that option. ...
... unsupported digests the server does not support any of the requested digest algorithms, so uses a different algorithm: request: get /item want-digest: sha;q=1 response: http/1.1 200 ok digest: sha-256=x48e9qookqqrvdts8nojrjn3owduoywxbf7kbu9dbpe= the server does not support any of the requested digest algorithms, so responds with a 400 error and includes another want-digest header,
listing the algorithms that it does support: request: get /item want-digest: sha;q=1 response: http/1.1 400 bad request want-digest: sha-256, sha-512 specifications specification title draft-ietf-httpbis-digest-headers-latest resource digests for http this header was originally defined in rfc 3230, but the definition of "selected representation...
Closures - JavaScript
which has a variable with changing values (item). this is because the variable item is declared with var and thus has function scope due to hoisting. the value of item.help is determined when the onfocus callbacks are executed. because the loop has already run its course by that time, the item variable object (shared by all three closures) has been left pointing to the last entry in the helptext
list. one solution in this case is to use more closures: in particular, to use a function factory as described earlier: function showhelp(help) { document.getelementbyid('help').innerhtml = help; } function makehelpcallback(help) { return function() { showhelp(help); }; } function setuphelp() { var helptext = [ {'id': 'email', 'help': 'your e-mail address'}, {'id': 'name', ...
... } } setuphelp(); if you don't want to use more closures, you can use the let keyword introduced in es2015 : function showhelp(help) { document.getelementbyid('help').innerhtml = help; } function setuphelp() { var helptext = [ {'id': 'email', 'help': 'your e-mail address'}, {'id': 'name', 'help': 'your...
... helptext.length; i++) { let item = helptext[i]; document.getelementbyid(item.id).onfocus = function() { showhelp(item.help); } } } setuphelp(); this example uses let instead of var, so every closure binds the block-scoped variable, meaning that no additional closures are required. ...
Concurrency model and the event loop - JavaScript
nd pushed on top of the first one containing foo's arguments and local variables. when foo returns, the top frame element is popped out of the stack (leaving only bar's call frame). when bar returns, the stack is empty. heap objects are allocated in a heap which is just a name to denote a large (mostly unstructured) region of memory. queue a javascript runtime uses a message queue, which is a
list of messages to be processed. each message has an associated function which gets called in order to handle the message. at some point during the event loop, the runtime starts handling the messages on the queue, starting with the oldest one. to do so, the message is removed from the queue and its corresponding function is called with the message as an input parameter. as always, calling a functio...
...ng to complete, the web application is unable to process user interactions like click or scroll. the browser mitigates this with the "a script is taking too long to run" dialog. a good practice to follow is to make message processing short and if possible cut down one message into several messages. adding messages in web browsers, messages are added anytime an event occurs and there is an event
listener attached to it. if there is no
listener, the event is lost. so a click on an element with a click event handler will add a message—likewise with any other event. the function settimeout is called with 2 arguments: a message to add to the queue, and a time value (optional; defaults to 0). the time value represents the (minimum) delay after which the message will actually be pushed into the ...
...ge" // "this is the end" // "callback 1: this is a msg from call back" // "callback 2: this is a msg from call back" several runtimes communicating together a web worker or a cross-origin iframe has its own stack, heap, and message queue. two distinct runtimes can only communicate through sending messages via the postmessage method. this method adds a message to the other runtime if the latter
listens to message events. never blocking a very interesting property of the event loop model is that javascript, unlike a lot of other languages, never blocks. handling i/o is typically performed via events and callbacks, so when the application is waiting for an indexeddb query to return or an xhr request to return, it can still process other things like user input. legacy exceptions exist like a...
Functions - JavaScript
ut. to use a function, you must define it somewhere in the scope from which you wish to call it. 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. a
list of parameters to the function, enclosed in parentheses and separated by commas. the javascript statements that define the function, enclosed in curly brackets, {...}. for example, the following code defines a simple function named square: function square(number) { return number * number; } the function square takes one parameter, called number. the function consists of one statement that ...
... of arguments actually passed to the function, and then access each argument using the arguments object. for example, consider a function that concatenates several strings. the only formal argument for the function is a string that specifies the characters that separate the items to concatenate. ...
...basil. oregano. pepper. parsley. " myconcat('. ...
Loops and iteration - JavaScript
is omitted entirely, the condition is assumed to be true.) the statement executes. to execute multiple statements, use a block statement ({ ... }) to group those statements. if present, the update expression incrementexpression is executed. control returns to step 2. example in the example below, the function contains a for statement that counts the number of selected options in a scrolling
list (a <select> element that allows multiple selections). the for statement declares the variable i and initializes it to 0. it checks that i is less than the number of options in the <select> element, performs the succeeding if statement, and increments i by after each pass through the loop. <form name="selectform"> <p> <label for="musictypes">choose some music types, then click the button be...
... a do...while statement looks as follows: do statement while (condition); statement is always executed once before the condition is checked. (to execute multiple sta...
...ment iterates a specified variable over all the enumerable properties of an object. for each distinct property, javascript executes the specified statements. a for...in statement looks as follows: for (variable in object) statement example the following function takes as its argument an object and the object's name. it then iterates over all the object's properties and returns a string that
lists the property names and their values. function dump_props(obj, obj_name) { let result = ''; for (let i in obj) { result += obj_name + '.' + i + ' = ' + obj[i] + '<br>'; } result += '<hr>'; return result; } for an object car with properties make and model, result would be: car.make = ford car.model = mustang arrays although it may be tempting to use this as a way to iterate ov...
Groups and ranges - JavaScript
ng array's elements ([1], ..., [n]) or from the predefined regexp object's properties ($1, ..., $9). ...
...lence after this, and alice could only hear whispers now and then."; var regexpvowels = /[aeiouy]/g; console.log("number of vowels:", aliceexcerpt.match(regexpvowels).length); // number of vowels: 25 using groups let person
list = `first_name: john, last_name: doe first_name: jane, last_name: smith`; let regexpnames = /first_name: (\w+), last_name: (\w+)/mg; let match = regexpnames.exec(person
list); do { console.log(`hello ${match[1]} ${match[2]}`); } while((match = regexpnames.exec(person
list)) !== null); using named groups let person
list = `first_name: john, last_name: doe first_name: jane, last_name: smith`; let regexpnames = /first_name: (?<firstname>\w+), last_name: (?<lastname>\w+)/mg; let match = regexpnames.exec(person
list); do { console.log(`hello ${match.groups.firstname...
... = regexpnames.exec(person
list)) !== null); using named groups let person
list = `first_name: john, last_name: doe first_name: jane, last_name: smith`; let regexpnames = /first_name: (?<firstname>\w+), last_name: (?<lastname>\w+)/mg; let match = regexpnames.exec(person
list); do { console.log(`hello ${match.groups.firstname} ${match.groups.lastname}`); } while((match = regexpnames.exec(person
list)) !== null); note: not all browsers support this feature; refer to the compatibility table. specifications specification ecmascript (ecma-262)the definition of 'regexp: ranges' in that specification. ...
TypeError: Reduce of empty array with no initial value - JavaScript
no initial value is provided, it will use the first element of the array or typedarray as the initial value. this error is raised when an empty array is provided because no initial value can be returned in that case. examples invalid cases this problem appears frequently when combined with a filter (array.prototype.filter(), typedarray.prototype.filter()) which will remove all elements of the
list. ...
...totype.filter()) which will remove all elements of the
list. thus leaving none to be used as the initial value. var ints = [0, -1, -2, -3, -4, -5]; ints.filter(x => x > 0) // removes all elements .reduce((x, y) => x + y) // no more elements to use for the initial value. similarly, the same issue can happen if there is a typo in a selector, or an unexpected number of elements in a
list: var names = document.getelementsbyclassname("names"); var name_
list = array.prototype.reduce.call(names, (acc, name) => acc + ", " + name); valid cases these problems can be solved in two different ways. one way is to actually provide an initialvalue as the neutral element of the operator, such as 0 for the addition, 1 for a multiplication, or an empty string for a concatenation. var ints...
... var ints = [0, -1, -2, -3, -4, -5]; ints.filter(x => x > 0) // removes all elements .reduce((x, y) => x + y, 0) // the initial value is the neutral element of the addition another way would be two to handle the empty case, either before calling reduce, or in the callback after adding an unexpected dummy initial value. var names = document.getelementsbyclassname("names"); var name_
list1 = ""; if (names1.length >= 1) name_
list1 = array.prototype.reduce.call(names, (acc, name) => acc + ", " + name); // name_
list1 == "" when names is empty. var name_
list2 = array.prototype.reduce.call(names, (acc, name) => { if (acc == "") // initial value return name; return acc + ", " + name; }, ""); // name_
list2 == "" when names is empty. ...
Array.prototype.sort() - JavaScript
nature, this may yield a high overhead. the more work a comparefunction does and the more elements there are to sort, it may be more efficient to use map for sorting. the idea is to traverse the array once to extract the actual values used for sorting into a temporary array, sort the temporary array, and then traverse the temporary array to achieve the right order. ...
...ay be more efficient to use map for sorting. the idea is to traverse the array once to extract the actual values used for sorting into a temporary array, sort the temporary array, and then traverse the temporary array to achieve the right order. ...
...with position and sort-value var mapped =
list.map(function(el, i) { return { index: i, value: el.tolowercase() }; }) // sorting the mapped array containing the reduced values mapped.sort(function(a, b) { if (a.value > b.value) { return 1; } if (a.value < b.value) { return -1; } return 0; }); // container for the resulting order var result = mapped.map(function(el){ return
list[el.index]; }); there is an open source library available called mapsort which applies this approach. specifications specification ecmascript (ecma-262)the definition of 'array.prototype.sort' in that specification. ...
Operator precedence - JavaScript
ng (2 ** 3) ** 2 changes the order and results in the 64 seen in the table above. remember that precedence comes before associativity. so, mixing division and exponentiation, the exponentiation comes before the division. for example, 2 ** 3 / 3 ** 2 results in 0.8888888888888888 because it is the same as (2 ** 3) / (3 ** 2). note on grouping and short-circuiting in the table below, grouping is
listed as having the highest precedence. however, that does not always mean the expression within the grouping symbols ( … ) is evaluated first, especially when it comes to short-circuiting. short-circuiting is jargon for conditional evaluation. for example, in the expression a && (b + c), if a is falsy, then the sub-expression (b + c) will not even get evaluated, even if it is in parentheses. we c...
...arentheses makes things clear: (3 > 2) > 1. table the following table is ordered from highest (21) to lowest (1) precedence. precedence operator type associativity individual operators 21 grouping n/a ( … ) 20 member access left-to-right … . ...
...iativity individual operators 21 grouping n/a ( … ) 20 member access left-to-right … . … computed member access left-to-right … [ … ] new (with argument
list) n/a new … ( … ) function call left-to-right … ( … ) optional chaining left-to-right ?. ...
categories - Web app manifests
like search engines and meta keywords, catalogs and stores are free to ignore them. ...
...like search engines and meta keywords, catalogs and stores are free to ignore them. ...
...like search engines and meta keywords, catalogs and stores are free to ignore them. ...
Web audio codec guide - Web media technologies
cs for their encoding and decoding of media, and may support additional codecs as well, for optimal cross-platform support of video and audio conferencing, and to integrate better with legacy telecommunication solutions. see codecs used by webrtc for details. for information about the fundamental concepts behind how digital audio works, see the article digital audio concepts. common codecs the
list below denotes the codecs most commonly used on the web and which containers (file types) support them. if all you need to know is which codecs are even possible to use, this is for you. of course, individual browsers may or may not choose to support all of these codecs, and their support for which container types can use them may vary as well. in addition, browsers may choose to support additiona...
... commonly used on the web and which containers (file types) support them. if all you need to know is which codecs are even possible to use, this is for you. of course, individual browsers may or may not choose to support all of these codecs, and their support for which container types can use them may vary as well. in addition, browsers may choose to support additional codecs not included on this
list. codec name (short) full codec name container support aac advanced audio coding mp4, adts, 3gp alac apple lossless audio codec mp4, quicktime (mov) amr adaptive multi-rate 3gp flac free lossless audio codec mp4, ogg, flac g.711 pulse code modulation (pcm) of voice frequencies rtp / webrtc g.722...
...e more closely the sampled sound will match the source material. the effect of source audio format on encoded audio output because encoded audio inherently uses fewer bits to represent each sample, the source audio format may actually have less impact on the encoded audio size than one might expect. however, a number of factors do still affect the encoded audio quality and size. the table below
lists a number of key source audio file format factors and their impact on the encoded audio. the effect of source audio format and contents on the encoded audio quality and size feature effect on quality effect on size channel count the number of channels affects only the perception of directionality, not the quality. each channel may substantially increase the enc...
Media container formats (file types) - Web media technologies
t streams the encoded audio and video tracks directly from one peer to another using mediastreamtrack objects to represent each track. see codecs used by webrtc for information about codecs commonly used for making webrtc calls, as well as browser compatibility information around codec support in webrtc. common container formats while there are a vast number of media container formats, the ones
listed below are the ones you are most likely to encounter. some support only audio while others support both audio and video. the mime types and extensions for each are
listed.the most commonly used containers for media on the web are probably mpeg-4 (mp4), quicktime movie (mov), and the wavefile audio file format (wav). however, you may also encounter mp3, ogg, webm, avi, and other formats. not all ...
...d in a unique fashion. a good example of this is the mp3 audio file, which is in fact an mpeg-1 container with a single audio track encoded using mpeg-1 audio layer iii encoding. these files use the audio/mp3 mime type and the .mp3 extension, even though their containers are just mpeg. index of media container formats (file types) to learn more about a specific container format, find it in this
list and click through to the details, which include information about what the container is typically useful for, what codecs it supports, and which browsers support it, among other specifics. codec name (short) full codec name browser compatibility1 3gp third generation partnership firefox for android adts audio data transport stream firefox2 ...
...support is also implied only for the container itself, not for any specific codecs. [2] available only if available on the underlying operating system's media framework. [3] requires web media extensions to be installed. 3gp the 3gp or 3gpp media container is used to encapsulate audio and/or video that is specifically intended for transmission over cellular networks for consumption on...
Image file type and format guide - Web media technologies
in this guide, we'll cover the image file types generally supported by web browsers, and provide insights that will help you select the most appropriate formats to use for your site's imagery. common image file types there are many image file formats in the world. however, the ones
listed below are generally recognized as usable on the web, though bmp is generally not recommended as browser support is potentially constrained; it should usually be avoided for web content. abbreviation file format mime type file extension(s) browser compatibility apng animated portable network graphics image/apng .apng chrome, edge, firefox, opera, safari bmp bitmap file image/bmp .bmp chrome, edge, firefox, internet explorer, opera, safari ...
...p icons of windows systems. however, early versions of internet explorer introduced the ability for a web site to provide a ico file named favicon.ico in a web site's root directory to specify a favicon — an icon to be displayed in the favorites menu, and other places where an iconic representation of the site would be useful. an ico file can contain multiple icons, and begins with a directory
listing details about each. following the directory comes the data for the icons. each icon's data can be either a bmp image without the file header, or a complete png image (including the file header). if you use ico files, you should use the bmp format, as support for png inside ico files wasn't added until windows vista and may not be well supported. ico files should not be used in web content. a...
... 4 and 8 each pixel consists of a single d-bit value indicating the brightness of the greyscale pixel. true color 8 all true color rgb images are stored using 8-bits each of red, green, and blue. indexed color 4 and 8 each pixel is an index into a colormap record, which defines the colors used in the image. the color map
lists all of the red values, then all of the green values, then all of the blue values (rather than rgb, rgb, rgb...). greyscale with alpha 4 and 8 alpha information is added by specifying that there are more than 3 samples per pixel in the samplesperpixel field, and indicating the type of alpha (1 for an associated, pre-multiplied alpha component, and 2 for unassoci...
Web video codec guide - Web media technologies
ces the video codecs you're most likely to encounter or consider using on the web, summaries of their capabilities and any compatibility and utility concerns, and advice to help you choose the right codec for your project's video. common codecs the following video codecs are those which are most commonly used on the web. for each codec, the containers (file types) that can support them are also
listed. each codec provides a link to a section below which offers additional details about the codec, including specific capabilities and compatibility issues you may need to be aware of. codec name (short) full codec name container support av1 aomedia video 1 mp4, webm avc (h.264) advanced video coding 3gp, mp4, webm h.263 h.263 video ...
... cannot be represented without visible stepping of the colors. depending on the codec, higher color depths may result in larger compressed file sizes. the determining factor is what internal storage format is used for the compressed data. frame rate primarily affects the perceived smoothness of the motion in the image. to a point, the higher the frame rate, the smoother and more rea
listic the motion will appear. eventually the point of diminishing returns is reached. see frame rate below for details. assuming the frame rate is not reduced during encoding, higher frame rates cause larger compressed video sizes. motion compression of video typically works by comparing frames, finding where they differ, and constructing records containing enough information to update...
...ured to record av1 video using bt.2100 hdr in 12-bit color with 4:4:4 chroma subsampling and flac for lossless audio. the resulting file will use a bit rate of no more than 800 mbps shared between the video and audio tracks. you will likely need to adjust these values depending on hardware performance, your requirements, and the specific codecs you choose to use. this bit rate is obviously not rea
listic for network transmission and would likely only be used locally. breaking down the value of the codecs parameter into its dot-delineated properties, we see the following: value desccription av01 the four-character code (4cc) designation identifying the av1 codec. 2 the profile. a value of 2 indicates the professional profile. a value of 1 is the high pro...
Web Performance
ce budgets marketing, design, and sales needs, and developer experience, often ad bloat, third-party scripts, and other features that can slow down web performance. to help set priorities, it is helpful to set a performance budget: a set of restrictions to not exceed during the development phase. in this article, we'll discuss creating and sticking to a performance budget. ...
...sign, and sales needs, and developer experience, often ad bloat, third-party scripts, and other features that can slow down web performance. to help set priorities, it is helpful to set a performance budget: a set of restrictions to not exceed during the development phase. in this article, we'll discuss creating and sticking to a performance budget. ...
...is article, we'll discuss creating and sticking to a performance budget. web performance check
list a performance check
list of features to consider when developing applications with links to tutorials on how to implement each feature, include service workers, diagnosing performance problems, font loading best practices, client hints, creating performant animations, etc. mobile performance check
list a concise check
list of performance considerations impacting mobile network users on hand-held, battery operated devices. ...
Add to Home screen - Progressive web apps (PWAs)
ound_color": "purple", "description": "shows random fox pictures. hey, at least it isn't cats.", "display": "fullscreen", "icons": [ { "src": "icon/fox-icon.png", "sizes": "192x192", "type": "image/png" } ], "name": "awesome fox pictures", "short_name": "foxes", "start_url": "/pwa-examples/a2hs/index.html" } appropriate icon as shown in the above manifest
listing, we are including a 192 x 192 px icon for use in our app. you can include more sizes if you want; android will choose the most appropriate size for each different use case. you could also decide to include different types of icons so devices can use the best one they are able to (e.g., chrome already supports the webp format). note that the type member in each icon's object specifies the icon...
...initially: let deferredprompt; const addbtn = document.queryselector('.add-button'); addbtn.style.display = 'none'; we hide the button initially because the pwa will not be available for install until it follows the a2hs criteria. when this happens, supporting browsers will fire a beforeinstallprompt event. ...
...use a handler like the one below to handle the installation: window.addevent
listener('beforeinstallprompt', (e) => { // prevent chrome 67 and earlier from automatically showing the prompt e.preventdefault(); // stash the event so it can be triggered later. ...
How to make PWAs installable - Progressive web apps (PWAs)
llow the app to work offline (this is required only by chrome for android currently) currently, only the chromium-based browsers such as chrome, edge, and samsung internet require the service worker. if developing your app using firefox, be aware that you will need a service worker to be compatible with chromium-based browsers. the manifest file the key element is a web manifest file, which
lists all the information about the website in a json format. it usually resides in the root folder of a web app. it contains useful information, such as the app’s title, paths to different-sized icons that can be used to represent the app on an os (such as an icon on the home screen, an entry in the start menu, or an icon on the desktop), and a background color to use in loading or splash screens.
...app manifests, and many use manifest.json for web manifests as the contents are organized in a json structure. however, the .webmanifest file format is explicitly mentioned in the w3c manifest specification, so that's what we'll use here. the content of the file looks like this: { "name": "js13kgames progressive web app", "short_name": "js13kpwa", "description": "progressive web app that
lists games submitted to the a-frame category in the js13kgames 2017 competition.", "icons": [ { "src": "icons/icon-32.png", "sizes": "32x32", "type": "image/png" }, // ... { "src": "icons/icon-512.png", "sizes": "512x512", "type": "image/png" } ], "start_url": "/pwa-examples/js13kpwa/index.html", "display": "fullscreen", "theme_color":...
...'s default background, used during install and on the splash screen. a minimal web manifest must have at least a name and an icons field with at least one icon defined; that icon must have at least the src, sizes, and type sub-fields as well. beyond that, everything is optional, though the description, short_name, and start_url fields are recommended. there are even more fields you can use than
listed above — be sure to check the web app manifest reference for details. add to home screen "add to home screen" (or a2hs for short) is a feature implemented by mobile browsers that takes the information found in an app's web manifest and uses them to represent the app on the device's home screen with an icon and name. this only works if the app meets all the necessary requirements, as describe...
Introduction to progressive web apps - Progressive web apps (PWAs)
or new users. given their profit increase, and the relatively low amount of work required for the conversion of these apps to pwas, the advantage is clear. early stage emerging startups like couponmoto have also started using progressive web apps to drive more consumer engagement, showing that they can help small as well as big companies to (re-)engage users more effectively. you can check the
list at pwa.rocks for more examples. particularly worth mentioning is the hnpwa.com page—this
lists an example implementation of the hacker news website (instead of the usual todomvc app), in which you can see the use of various front-end frameworks. you can even generate pwas online using the pwabuilder website. for service worker and push specific information, be sure to check the service worke...
...nabled on certain web-based platforms by proprietary technologies like open graph, which provides a format for specifying similar metadata in the html <head> block using <meta> tags. the relevant web standard here is the web app manifest, which defines features of an app such as name, icon, splash screen, and theme colors in a json-formatted manifest file. this is for use in contexts such as app
listings and device home screens. installability a core part of the web app experience is for users to have app icons on their home screen, and be able to tap to open apps into their own native container that feels nicely integrated with the underlying platform. modern web apps can have this native app feel via properties set inside the web app manifest, and via a feature available in modern smar...
...senting a trusted website with a good performance is a consequence of using these enhancements; this in turn means building web apps which follow better practices. this way everybody will be able to use the app, but those with modern browsers will benefit from pwa features even more. an example application in this series of articles we will examine the source code of a super simple website that
lists information about games submitted to the a-frame category in the js13kgames 2017 competition. you don't have to think about what the actual content on the website is; the main point is to learn how to use pwa features in your own projects. you can see this app in action online, and the source code is available on github. we'll be examining this code carefully over the course of this series of a...
How to make PWAs re-engageable using Notifications and Push - Progressive web apps (PWAs)
ful when combined with them. let’s look at them in isolation to begin with. request permission to show a notification, we have to request permission to do so first. instead of showing the notification immediately though, best practice dictates that we should show the popup when the user requests it by clicking on a button: var button = document.getelementbyid("notifications"); button.addevent
listener('click', function(e) { notification.requestpermission().then(function(result) { if(result === 'granted') { randomnotification(); } }); }); this shows a popup using the operating system’s own notifications service: when the user confirms to receive notifications, the app can then show them. the result of the user action can be default, granted or denie...
...ed with public and private keys for security reasons — allowing everyone to send push messages unsecured using your app would be a terrible idea. see the web push data encryption test page for detailed information about securing the server. the server stores all the information received when the user subscribed, so the messages can be sent later on when needed. to receive push messages, we can
listen to the push event in the service worker file: self.addevent
listener('push', function(e) { /* ... */ }); the data can be retrieved and then shown as a notification to the user immediately. this, for example, can be used to remind the user about something, or let them know about new content being available in the app. push example push needs the server part to work, so we're not able to inclu...
...req.body.ttl }; settimeout(function() { webpush.sendnotification(subscription, payload, options) .then(function() { res.sendstatus(201); }) .catch(function(error) { console.log(error); res.sendstatus(500); }); }, req.body.delay * 1000); }); }; service-worker.js the last file we will look at is the service worker: self.addevent
listener('push', function(event) { const payload = event.data ? event.data.text() : 'no payload'; event.waituntil( self.registration.shownotification('serviceworker cookbook', { body: payload, }) ); }); all it does is add a
listener for the push event, create the payload variable consisting of the text taken from the data (or create a string to use if data is e...
Progressive web apps (PWAs)
ils necessary to transform the website into an app-like format. pwa advantages pwas should be discoverable, installable, linkable, network independent, progressive, re-engageable, responsive, and safe. to find out more about what these mean, read progressive web app advantages. to find out how to implement pwas, read through our pwa developer guide. documentation <-- the temporary automatic
list below will be replaced soon --> add to home screenadd to home screen (or a2hs for short) is a feature available in modern browsers that allows a user to "install" a web app, ie. add a shortcut to their home screen representing their favorite web app (or site) so they can subsequently access it with a single tap. this guide explains how a2hs is used, and what you need to do as a developer to...
...and push. in this article we will go even further and improve the performance of the app by progressively loading its resources.progressive web app structurenow that we know the theory behind pwas, let's look at the recommended structure of an actual app. we will start with analyzing the js13kpwa application, why it is built that way, and what benefits it brings.pwa developer guidein the articles
listed here, you'll find guides about every aspect of development specific to the greation of progressive web applications (pwas).structural overview of progressive web appsin this structural overview, we'll look at the features that make up a standard web application, as well as some design patterns you can follow when building your pwa. everything below this point is left over from the old ve...
...llent service worker/push recipes, showing how to implement an offline app, but also much more. pwa vs code extension - a collection of all essential code snippets you need to build progressive web apps right there in your vs code environment. progressive web apps on google developers. progressive web apps: escaping tabs without losing our soul by alex russell. progressive web apps check
list. the lighthouse tool by google. tools for building progressive web apps with angular. react pwa guide kit. offline-capable pokédex web site. hacker news readers as progressive web apps. progressive web app: advantages in a nutshell why progressive web apps are the future of mobile web (2019 research). progressive web apps: everything you need to know collection of resources, codelabs an...
media - SVG: Scalable Vector Graphics
if not specified, the style sheet is applied unconditionally. specifications specification status comment scalable vector graphics (svg) 2the definition of 'media' in that specific...
... if not specified, the style sheet is applied unconditionally. specifications specification status comment scalable vector graphics (svg) 2the definition of 'media' in that specification. candidate recommendation changed the value definition from different med...
...s to match in order for the style sheet to be applied. if not specified, the style sheet is applied unconditionally. specifications specification status comment scalable vector graphics (svg) 2the definition of 'media' in that specification. candidate recommendation changed the value definition from different media types as defined in css 2 to <media-query-
list>. scalable vector graphics (svg) 1.1 (second edition)the definition of 'media' in that specification. recommendation initial definition ...
points - SVG: Scalable Vector Graphics
each point is defined by a pair of number representing a x and a y coordinate in the user coordinate system. if the attribute contains an odd number of coordinates, the last one will be ignored. ...
...,90"/> <!-- polygon is a closed shape --> <polygon stroke="black" fill="none" transform="translate(100,0)" points="50,0 21,90 98,35 2,35 79,90"/> <!-- it is usualy considered best practices to separate a x and y coordinate with a comma and a group of coordinates by a space. it makes things more readable for human beings. --> </svg> polyline for <polyline>, points defines a
list of points, each representing a vertex of the line to be drawn. each point is define by a x and y coordinate in the user coordinate system. note: a polyline is an open shape, meaning the last point is not connected to the first point. value [ <number>+ ]# default value none animatable yes example html,body,svg { height:100% } <svg viewbox="-10 -10 1...
...ed to the first point. value [ <number>+ ]# default value none animatable yes example html,body,svg { height:100% } <svg viewbox="-10 -10 120 120" xmlns="http://www.w3.org/2000/svg"> <!-- polyline is an open shape --> <polyline stroke="black" fill="none" points="50,0 21,90 98,35 2,35 79,90"/> </svg> polygon for <polygon>, points defines a
list of points, each representing a vertex of the shape to be drawn. each point is define by a x and y coordinate in the user coordinate system. note: a polygon is a closed shape, meaning the last point is connected to the first point. value [ <number>+ ]# default value none animatable yes example html,body,svg { height:100% } <svg viewbox="-10 -10 120 ...
visibility - SVG: Scalable Vector Graphics
recommendation css definition of the prope...
... recommendation css definition of the property scalable vector graphics (svg) 2the definition of 'visibility' in that specif...
... recommendation css definition of the property scalable vector graphics (svg) 2the definition of 'visibility' in that specification. candidate recommendation mainly refers to css 2.1 scalabl...
widths - SVG: Scalable Vector Graphics
if too many widths are provided, the extras are ignored. ...
...if too many widths are provided, the extras are ignored. ...
...if too many widths are provided, the extras are ignored. ...
Scripting - SVG: Scalable Vector Graphics
one can override default browser behaviors with the evt.preventdefault( ) method, add event
listeners to objects with the syntax element.addevent
listener(event, function, usecapture), and set element properties with syntax svgelement.style.setproperty("fill-opacity", "0.0", ""). note the existence of all three arguments setting properties. preventing default behavior in event code when writing drag and drop code, sometimes you'll find that text on the page gets accidently selected while dragging. or if you want to use the backspace key in your code, you want to override the browser's default behavior when the backspace key is pressed, which is to go back to the previous page. ...
...ting default behavior in event code when writing drag and drop code, sometimes you'll find that text on the page gets accidently selected while dragging. or if you want to use the backspace key in your code, you want to override the browser's default behavior when the backspace key is pressed, which is to go back to the previous page. the evt.preventdefault() method lets you do this. using event
listeners with objects the methods addevent
listener() and removeevent
listener() are very useful when writing interactive svg. you can pass an object that implements the handleevent interface as the second parameter to these methods. function myrect(x,y,w,h,message){ this.message=message this.rect=document.createelementns("http://www.w3.org/2000/svg","rect") this.rect.setattributens(null,"x",x) ...
...he second parameter to these methods. function myrect(x,y,w,h,message){ this.message=message this.rect=document.createelementns("http://www.w3.org/2000/svg","rect") this.rect.setattributens(null,"x",x) this.rect.setattributens(null,"y",y) this.rect.setattributens(null,"width",w) this.rect.setattributens(null,"height",h) document.documentelement.appendchild(this.rect) this.rect.addevent
listener("click",this,false) this.handleevent= function(evt){ switch (evt.type){ case "click": alert(this.message) break; } } } inter-document scripting: referencing embedded svg when using svg within html, adobe's svg viewer 3.0 automatically includes a window property called svgdocument that points to the svg document. this is not the case for mozilla's native svg imp...
Same-origin policy - Web security
ccess the same-origin policy controls interactions between two different origins, such as when you use xmlhttprequest or an <img> element. these interactions are typically placed into three categories: cross-origin writes are typically allowed. examples are links, redirects, and form submissions. some http requests require preflight. cross-origin embedding is typically allowed. (examples are
listed below.) cross-origin reads are typically disallowed, but read access is often leaked by embedding. for example, you can read the dimensions of an embedded image, the actions of an embedded script, or the availability of an embedded resource. here are some examples of resources which may be embedded cross-origin: javascript with <script src="…"></script>. error details for syntax errors ...
...t forgery (csrf) token. you must prevent cross-origin reads of pages that require this token. to prevent cross-origin reads of a resource, ensure that it is not embeddable. it is often necessary to prevent embedding because embedding a resource always leaks some information about it. to prevent cross-origin embeds, ensure that your resource cannot be interpreted as one of the embeddable formats
listed above. browsers may not respect the content-type header. for example, if you point a <script> tag at an html document, the browser will try to parse the html as javascript. when your resource is not an entry point to your site, you can also use a csrf token to prevent embedding. cross-origin script api access javascript apis like iframe.contentwindow, window.parent, window.open, and window.o...
... web storage and indexeddb are separated by origin. each origin gets its own separate storage, and javascript in one origin cannot read from or write to the storage belonging to another origin. cookies use a separate definition of origins. a page can set a cookie for its own domain or any parent domain, as long as the parent domain is not a public suffix. firefox and chrome use the public suffix
list to determine if a domain is a public suffix. internet explorer uses its own internal method to determine if a domain is a public suffix. the browser will make a cookie available to the given domain including any sub-domains, no matter which protocol (http/https) or port is used. when you set a cookie, you can limit its availability using the domain, path, secure, and httponly flags. when you read...
<xsl:number> - XSLT: Extensible Stylesheet Language Transformations
tes none. optional attributes count specifies what in the source tree should be numbered sequentially. it uses an xpath expression. level defines how levels of the source tree should be considered in generating sequential numbers. it has three valid values: single, multiple, and any. the default value is single: single numbers sibling nodes sequentially, as in the items in a
list. the processor goes to the first node in the ancestor-or-self axis that matches the count attribute and then counts that node plus all its preceding siblings (stopping when it reaches a match to the from attribute, if there is one) that also match the count attribute.if no match is found, the sequence will be an empty
list. multiple numbers nodes as a composite sequence that reflec...
... any (not supported at this time.) numbers all matching nodes, regardless of level, sequentially. the ancestor, self, and preceding axes are all considered. ...
...at attribute, e.g. a.1.1). the processor looks at all ancestors of the current node and the current node itself, stopping when it reaches a match for the from attribute, if there is one. for each node in this
list that matches the count attribute, the processor counts how many preceding matching siblings it has, and adds one for the node itself. if no match is found, the sequence will be an empty
list. any (not supported at this time.) numbers all matching nodes, regardless of level, sequentially. the ancestor, self, and preceding axes are all considered. the processor starts at the current node and proceeds in reverse document order, stopping if it reaches a match to any from attribute. if no match to the count attribute is found, the sequence will be an empty
list. this level ...
self - Archive of obsolete content
ion for port. methods the self object has four methods, which enable the content script to send messages to, and receive messages from, the main add-on code. this is an older api than the api provided by port, and for most purposes the port api is a better choice. the exception is the context-menu module, which still uses postmessage. postmessage() send a message from a content script to a
listener in the main add-on code: self.postmessage(contentscriptmessage); this takes a single parameter, the message payload, which may be any json-serializable value. on() start
listening to messages from the main add-on code: self.on("message", function(addonmessage) { // handle the message }); this takes two parameters: the name of the event, and the handler function. the handler function i...
...e); this takes a single parameter, the message payload, which may be any json-serializable value. on() start
listening to messages from the main add-on code: self.on("message", function(addonmessage) { // handle the message }); this takes two parameters: the name of the event, and the handler function. the handler function is passed the message payload. once() exactly like on(), but stop
listening after the first message is received. remove
listener() remove a
listener to an event. this takes two parameters: the name of the event to stop
listening to, and the
listener function to remove. ...
Modules - Archive of obsolete content
download. the module system is implemented using a loader object, which is actually provided as a module itself. it is defined in the module “toolkit/loader”: const { loader } = require('toolkit/loader') the loader constructor allows you to create your own custom loader objects. it takes a single argument, which is a named options object. for instance, the option paths is used to specify a
list of paths to be used by the loader to resolve relative urls: let loader = loader({ paths: ["./": "http://www.foo.com/"] }); commonjs also defines the notion of a main module. the main module is always the first to be loaded, and differs from ordinary modules in two respects. firstly, since they do not have a requiring module. instead, the main module is loaded using a special function, calle...
...er, main } = require('toolkit/loader'); let loader = loader({ paths: ["./": "http://www.foo.com/"], resolve: function (id, requirer) { // your code here return id; } }); main(loader, "./main.js"); cuddlefish uses a custom resolve function to implement a form of access control: modules can only require modules for which they have been explicitly granted access. a white
list of modules is generated statically when the add-on is linked. it is possible to pass a
list of predefined modules as an option to the loader constructor. this is useful if the api to be exposed does not have a corresponding js file, or is written in an incompatible format. cuddlefish uses this option to expose the components object as a module called chrome, in a way similar to the code here belo...
passwords - Archive of obsolete content
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. oncomplete is called when the operation has completed successfully and onerror is called when the function encounters an error. because the search function is expected to return a
list of matching credentials, its oncomplete option is mandatory. because the other functions don't return a value in case of success their oncomplete options are optional. for all functions, onerror is optional. globals functions search(options) this function is used to retrieve a credential, or a
list of credentials, stored in the password manager. you pass it any subset of the possible proper...
...tials.foreach(function(credential) { console.log(credential.username); console.log(credential.password); }); } }); } parameters options : object required options: name type oncomplete function the callback function that is called once the function completes successfully. it is passed all the matching credentials as a
list. this is the only mandatory option. optional options: name type username string the username for the credential. password string the password for the credential. url string the url associated with the credential. formsubmiturl string the url an html form credential is submi...
request - Archive of obsolete content
ay specify a collection of headers and content to send alongside the request and a callback which will be executed once the request completes. once a request object has been created a get request can be executed by calling its get() method, a post request by calling its post() method, and so on. when the server completes the request, the request object emits a "complete" event. registered event
listeners are passed a response object. each request object is designed to be used once. attempts to reuse them will throw an error. since the request is not being made by any particular website, requests made here are not subject to the same-domain restriction that requests made in web pages are subject to. with the exception of response, all of a request object's properties correspond with the op...
...en rate limited!"); } } }).get(); methods get() make a get request. head() make a head request. post() make a post request. put() make a put request. delete() make a delete request. properties url headers content contenttype response events complete the request object emits this event when the request has completed and a response has been received. arguments response :
listener functions are passed the response to the request as a response object. response the response object contains the response to a network request issued using a request object. it is returned by the get(), head(), post(), put() or delete() method of a request object. all members of a response object are read-only. properties url the url of the response content. text the content of the re...
system - Archive of obsolete content
code 0. to exit with failure use 1. var system = require("sdk/system"); system.exit(); parameters code : integer to exit with failure, set this to 1. to exit with success, omit this argument. pathfor(id) firefox enables you to get the path to certain "special" directories, such as the desktop or the profile directory. this function exposes that functionality to add-on authors. for the full
list of "special" directories and their ids, see "getting_files in special directories". for example: // get firefox profile path var profilepath = require('sdk/system').pathfor('profd'); // get os temp files directory (/tmp) var temps = require('sdk/system').pathfor('tmpd'); // get os desktop path for an active user (~/desktop on linux // or c:\documents and settings\username\desktop on windows). v...
...th is set"); } you can set a variable by setting the property: var system = require("sdk/system"); system.env.foo = "bar"; console.log(system.env.foo); you can unset a variable by deleting the property: var system = require("sdk/system"); delete system.env.foo; you can't enumerate environment variables. platform the type of operating system you're running on. this will be one of the values
listed as os_target, converted to lower case. var system = require("sdk/system"); console.log("platform = " + system.platform); architecture the type of processor architecture you're running on. this will be one of: "arm"``,"ia32", or"x64"`. var system = require("sdk/system"); console.log("architecture = " + system.architecture); compiler the type of compiler used to build the host application. ...
High-Level APIs - Archive of obsolete content
unless the documentation explicitly says otherwise, all these modules are "stable": we'll avoid making incompatible changes to them. addon-page create a page that does not contain navigational elements. base64 data encoding and decoding using base64 algorithms. clipboard interact with the system clipboard, setting and getting its contents. context-menu adds items, submenus, and menu separators to the page's context menu. hotkeys assign hotkey combinations to functions in your add-on. indexed-db exposes the indexeddb api to add-ons. l10n localize strings appearing in the add-on's javascript code. ...
...cess arguments passed to it. tabs open, manipulate, and access tabs, and receive tab events. timers set one-off and periodic timers. ui provides access to button, toolbar, and sidebar ui objects. url construct, validate, and parse urls. widget create a simple user interface for an add-on in firefox's add-on bar. windows enumerate and examine open browser windows, open new windows, and
listen for window events. ...
/loader - Archive of obsolete content
ich is then resolved to its location url using the mapping provided in the paths option. if this option is not provided, the loader will use plain path resolution. this feature may also be used to implement specific security constraints. for example, the sdk generates a manifest file at build time representing a dependency graph of all modules used by an add-on. ...
...to unload specific loader instance and undo changes made by modules loaded into it. unload takes loader as a first argument and optionally a reason string identifying the reason why this loader was unloaded. for example in the sdk reason may be one of: shutdown, disable, uninstall. unload(loader, 'disable'); calls to this function will dispatch the unload observer notification that modules can
listen to as described above. other utilities the loader module exposes several other utility functions that are used internally and can also be handy while bootstrapping the loader itself. they are low level helpers and should be used only during loader bootstrap. module() the module() function takes a module id and uri and creates a module instance object that is exposed as the module variable i...
io/file - Archive of obsolete content
e. returns boolean : true if the file exists and false otherwise. join(...) takes a variable number of strings, joins them on the file system's path separator, and returns the result. parameters ... : strings a variable number of strings to join. the first string must be an absolute path. returns string : a single string formed by joining the strings on the file system's path separator.
list(path) returns an array of file names in the given directory. parameters path : string the path of the directory. returns array : an array of file names. each is a basename, not a full path. mkpath(path) makes a new directory named by the given path. any subdirectories that do not exist are also created. mkpath can be called multiple times on the same path. parameters path : string the ...
...ove directories, use rmdir. parameters path : string the path of the file to remove. rmdir(path) removes a directory from the file system. if the directory is not empty, an exception is thrown. parameters path : string the path of the directory to remove. isfile(path) returns true only if this path specifies a file. const fileio = require("sdk/io/file"); let path = "/users/work/"; let
list = fileio.
list(path); for (i = 0; i <
list.length; i++) { let item = fileio.join(path,
list[i]); if (fileio.isfile(item)) { console.log(item + " is a file"); } else { console.log(item + " is a directory"); } } parameters path : string the path of the object. ...
lang/functional - Archive of obsolete content
fer(fn) takes a function and returns a wrapped version of the function. calling the wrapped version will call the original function during the next event loop. this is similar to calling settimeout with no wait (i.e. settimeout(function () { ... }, 0)), except that the wrapped function may be reused and does not need to be repeated each time. this also enables you to use these functions as event
listeners. let { defer } = require("sdk/lang/functional"); let fn = defer(function myevent (event, value) { console.log(event + " : " + value); }); fn("click", "#home"); console.log("done"); // this will print 'done' before 'click : #home' since // we deferred the execution of the wrapped `myevent` // function, making it non-blocking and executing on the // next event loop parameters fn : funct...
... require("sdk/lang/functional"); let add = function add (x, y) { return x + y; } let addone = partial(add, 1); addone(5); // 6 addone(10); // 11 partial(add, addone(20))(2); // 23 parameters fn : function function on which partial application is to be performed. arguments... : mixed additional arguments returns function : the partial function. compose(fn...) returns the composition of a
list of functions, where each function consumes the return value of the function that follows. in math terms, composing the functions f(), g(), and h() produces f(g(h())). let { compose } = require("sdk/lang/functional"); let welcome = compose(exclaim, greet); welcome('moe'); // "hi: moe!"; function greet (name) { return "hi: " + name; } function exclaim (statement) { return statement + "!"; } pa...
places/bookmarks - Archive of obsolete content
e database from the same add-on, other add-ons, or the user. ...
... completed. arguments string : a string indicating the error that occurred. bookmark|group|separator|object : only in save error events. the initial instance of the item that was used for the save request. end the end event is called when all bookmark items and dependencies have been saved, or an aggregate of all items returned from a search query. arguments array : the array is an ordered
list of the input bookmark items, replaced with their updated, latest snapshot instances (the first argument in the data handler), or in the case of an error, the initial instance of the item that was used for the save request (the second argument in the data or error handler). see also using xpcom without chrome - bookmark observer ...
window/utils - Archive of obsolete content
g with browser windows. usage private windows with this module your add-on will see private browser windows even if it has not explicitly opted into private browsing, so you need to take care not to store any user data derived from private browser windows. the exception is the windows() function which returns an array of currently opened windows. private windows will not be included in this
list if your add-on has not opted into private browsing. to learn more about private windows, how to opt into private browsing, and how to support private browsing, refer to the documentation for the private-browsing module. globals functions getmostrecentbrowserwindow() get the topmost browser window, as an nsidomwindow instance. returns nsidomwindow: the topmost browser window. getinnerid(...
...you can set, see the window.opendialog documentation. optional, defaults to: 'chrome,all,dialog=no'. args object extra argument(s) to be attached to the new window as the window.arguments property. returns nsidomwindow windows() returns an array of all currently opened windows. note that these windows may still be loading. in order to see private windows in this
list, your add-on must have opted into private browsing and you must include the includeprivate key in the
list of options: var allwindows = window_utils.windows(null, {includeprivate:true}); parameters type : string string identifying the type of window to return. this is passed directly into nsiwindowmediator.getenumerator(), so its possible values are the same as those expected by that functio...
Low-Level APIs - Archive of obsolete content
cripts in them. net/url enables you to read content from a uri. net/xhr provides access to xmlhttprequest functionality. places/bookmarks create, modify, and retrieve bookmarks. places/favicon helper functions for working with favicons. places/history access the user's browsing history. platform/xpcom implement xpcom objects, factories, and services. preferences/event-target
listen to changes to the preferences system in firefox. preferences/service access the preferences system in firefox. remote/child enables an sdk module loaded into a child process to access web content in the child process and communicate with modules in the main process. remote/parent enables you to load modules, and privileged parts of your add-on in general, into child processes. stylesheet...
...e button to the firefox user interface. ui/frame create html iframes, using bundled html, css and javascript, that can be added to a designated area of the firefox user interface. ui/id create ui component ids. ui/sidebar enables you to create sidebars. ui/toolbar add a toolbar to the firefox user interface. util/array helper functions for working with arrays. util/collection a simple
list-like class and utilities for using it. util/deprecate functions to deprecate code. util/
list building blocks for composing
lists. util/match-pattern test strings containing urls against simple patterns. util/object functions for working with objects. util/uuid generate or parse uuids. window/utils functions for working with browser windows. ...
package.json - Archive of obsolete content
ect describing the set of permissions that the add-on needs. private-browsing: a boolean indicating whether or not the add-on supports private browsing. if this value is not true or is omitted, then the add-on will not see any private windows or objects, such as tabs, that are associated with private windows. see the documentation for the private-browsing module. cross-domain-content: a
list of domains for which content scripts are given cross-domain privileges to access content in iframes or to make xmlhttprequests. see the documentation for enabling cross-domain content scripts. multiprocess: a boolean value declaring whether this add-on is, or is not, compatible with multiprocess firefox. note the multiprocess permission is not supported by cfx. pr...
...rences-branch use this to specify an alternative branch for your add-on's simple-prefs. see "simple-prefs in the preferences system" for more details. title the human-readable title of the package; this can contain spaces. if this key is present, its value will be used as the add-on's em:name element in its install.rdf. translators an array of strings
listing the people who contributed to the localization of this add-on. these values will be used as the add-on's em:translator elements in its install.rdf. note: jpm supports nodejs people fields. unpack same as the unpack in an install.rdf file. useful when the extension contains binaries. updatekey same as the updatekey in an install.rdf file.
Displaying annotations - Archive of obsolete content
cular, for a simple button, try the action button or toggle button apis, and for a more complex widget try the toolbar or sidebar apis. in this chapter we'll use a page-mod to locate elements of web pages that have annotations associated with them, and a panel to display the annotations. ...
...script for the matcher page-mod is initialized with a
list of all the annotations that the user has created. when a page is loaded the matcher searches the dom for elements that match annotations. if it finds any it binds functions to that element's mouseenter and mouseleave events to send messages to the main module, asking it to show or hide the annotation. like the selector, the matcher also
listens for the window's unload event and on unload sends a detach message to the main module, so the add-on can clean it up. the complete content script is here: self.on('message', function onmessage(annotations) { annotations.foreach( function(annotation) { if(annotation.url == document.location.tostring()) { createanchor(annotation); } }); $('.annotated').css('borde...
Overview - Archive of obsolete content
. meanwhile the main module contains the application logic and mediates interactions between the different sdk objects. we could represent the basic interactions between the main module and the various content scripts like this: user interface the annotator's main user interface consists of a widget and three panels. the widget is used to switch the annotator on and off, and to display a
list of all the stored annotations. the annotation-editor panel enables the user to enter a new annotation. the annotation-
list panel shows a
list of all stored annotations. the annotation panel displays a single annotation. additionally, we use the notifications module to notify the user when the add-on's storage quota is full. working with the dom we'll use two page-mods to interact with the ...
...age-mods to interact with the doms of pages that the user has opened. the selector enables the user to choose an element to annotate. it identifies page elements which are eligible for annotation, highlights them on mouseover, and tells the main add-on code when the user clicks a highlighted element. the matcher is responsible for finding annotated elements: it is initialized with the
list of annotations and searches web pages for the elements they are associated with. it highlights any annotated elements that are found. when the user moves the mouse over an annotated element the matcher tells the main add-on code, which displays the annotation panel. working with data we'll use the simple-storage module to store annotations. because we are recording potentially sensitive inf...
Chrome Authority - Archive of obsolete content
nts object should not be accessed from modules. the sdk tools will emit a warning if it sees module code which references components directly. your modules should refrain from using chrome privileges unless they are absolutely necessary. chrome-authority-using modules must receive extra security review, and most bugs in these modules are security-critical. manifest generation the manifest is a
list, included in the generated xpi, which specifies which modules have requested require() access to which other modules. it also records which modules have requested chrome access. this
list is generated by scanning all included modules for require(xyz) statements and recording the particular "xyz" strings that they reference. when the manifest implementation is complete the runtime loader will act...
...likewise, it will prevent modules from getting chrome authority unless the manifest indicates that they have asked for it. ...
Display a Popup - Archive of obsolete content
on require("sdk/ui/button/action").actionbutton({ id: "show-panel", label: "show panel", icon: { "16": "./icon-16.png", "32": "./icon-32.png", "64": "./icon-64.png" }, onclick: handleclick }); // show the panel when the user clicks the button. function handleclick(state) { text_entry.show(); } // when the panel is displayed it generated an event called // "show": we will
listen for that event and when it happens, // send our own "show" event to the panel's script, so the // script can prepare the panel for display. text_entry.on("show", function() { text_entry.port.emit("show"); }); //
listen for messages called "text-entered" coming from // the content script. the message payload is the text the user // entered. // in this implementation we'll just log the text to...
...ation we'll just log the text to the console. text_entry.port.on("text-entered", function (text) { console.log(text); text_entry.hide(); }); the content script "get-text.js" looks like this: // when the user hits return, send the "text-entered" // message to main.js. // the message payload is the contents of the edit box. var textarea = document.getelementbyid("edit-box"); textarea.addevent
listener('keyup', function onkeyup(event) { if (event.keycode == 13) { // remove the newline. text = textarea.value.replace(/(\r\n|\n|\r)/gm,""); self.port.emit("text-entered", text); textarea.value = ''; } }, false); //
listen for the "show" event being sent from the // main add-on code. it means that the panel's about // to be shown. // // set the focus to the text area so the us...
Modifying Web Pages Based on URL - Archive of obsolete content
ruleset</h1>");' }); note, though, that you can't load a script from a web site. the script must be loaded from data. communicating with the content script your add-on script and content scripts can't directly access each other's variables or call each other's functions, but they can send each other messages. to send a message from one side to the other, sender calls port.emit() and receiver
listens using port.on(). in the content script, port is a property of the global self object. in the add-on script, you need to
listen for the onattach event to get passed a worker object that contains port. let's rewrite the example above to pass a message from the add-on to the content script. the message will contain the new content to insert into the document. the content script now needs t...
...self.port.on("replacepage", function(message) { document.body.innerhtml = "<h1>" + message + "</h1>"; }); in the add-on script, we'll send the content script a message inside onattach. ...
Troubleshooting - Archive of obsolete content
check your firefox jpm searches well known locations on your system for firefox. jpm may not have found an installation, or if you have multiple installations, jpm may have found the wrong one. in those cases you need to use jpm's --binary option. see the jpm guide for more information. when you run jpm to test your add-on or run unit tests, it prints out the location of the firefox or xulrunner binary that it found, so you can check its output to be sure. ...
...er binary that it found, so you can check its output to be sure. check your text console when errors are generated in the sdk's apis and your code, they are logged to the text console. this should be the same console or shell from which you ran the jpm command. search for known issues someone else might have experienced your problem, too. other users often post problems to the project mailing
list. you can also browse the
list of known issues or search for specific keywords. contact the project team and user group sdk users and project team members discuss problems and proposals on the project mailing
list. someone else may have had the same problem you do, so try searching the
list. you're welcome to post a question, too. you can also chat with other sdk users in #jetpack on mozilla's ...
Using XPCOM without chrome - Archive of obsolete content
ce and one of its optional interface methods (onitemchanged). we can then create an object from it and add it as an observer to the bookmarks service. ...
...nt most often handles all events onitemchanged: function(bid, prop, an, nv, lm, type, parentid, aguid, aparentguid) { console.log("onitemchanged", "bid: "+bid, "property: "+prop, "isanno: "+an, "new value: "+nv, "lastmod: "+lm, "type: "+type, "parentid:"+parentid, "aguid:"+aguid);0 // code to handle the event here } }); //we just have a class, but need an object. notice the small l var bm
listener = bm
listener(); placesutils.bookmarks.addobserver(bm
listener, false); ...
File I/O - Archive of obsolete content
is nsilocalfile. uses services.jsm. // 1. write path to prefs var prefs = services.prefs.getbranch("extensions.myext."); prefs.setcomplexvalue("filename", components.interfaces.nsifile, file); // 2. ...
... relative path (nsirelativefilepref) to store paths relative to one of the predefined folders
listed above, for example file relative to profile folder, use the following code: // 1. write to prefs var relfile = components.classes["@mozilla.org/pref-relativefile;1"]. createinstance(components.interfaces.nsirelativefilepref); relfile.relativetokey = "profd"; // or any other string
listed above relfile.file = file; // |file| is nsilocalfile prefs.setcomplexvalue("filename", components.interfaces.nsirelativefilepref, relfile); // 2. read from prefs var value = prefs.getcomplexvalue("filename", components.interfaces.nsirelativefilepref); // |value.file| is the file. navigating with nsifile get a file in given directory let us assume an nsifile file is po...
Forms related code snippets - Archive of obsolete content
document.attachevent("onmousedown", ondocclick) : (document.onmousedown = ondocclick); })(); </script> <style type="text/css"> table.zdp-ca...
...nov", "dec"], sdays = ["m", "t", "w", "t", "f", "s", "s"], bzeroismonday = true, /* internal usage */ ainstances = [], amonthlengths = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], rbgnnan = /^\d+/, rbgnandend = /^\d+|\d+\d+$/g, rmonth = /\-month\-/, rdecrease = /\-decr\-/; var /* customizable by user */ nzindex = 1000; window.addevent
listener ? addevent
listener("load", buildcalendars, false) : window.attachevent ? attachevent("onload", buildcalendars) : (onload = buildcalendars); document.addevent
listener ? document.addevent
listener("mousedown", ondocclick, false) : document.attachevent ? document.attachevent("onmousedown", ondocclick) : (document.onmousedown = ondocclick); })(); </script> <style type="text/css"> table.zdp-calendar { border: ...
JS XPCOM - Archive of obsolete content
every xpcom object must implement the nsisupports interface. ...
...ilable on a component, but in most cases you will have to explicitly check for an interface. with the preferences service from the previous example we can do the following: var preferences = preferences.queryinterface(components.interfaces.nsiprefbranch2); this allows you to use the methods in the nsiprefbranch2 interface. determining which interfaces an xpcom component supports to display a
list of all interfaces that an xpcom component supports, do the following: // |c| is the xpcom component instance for each (i in components.interfaces) { if (c instanceof i) { alert(i); } } in this context, instanceof is the same as queryinterface except that it returns false instead of throwing an exception when |c| doesn't support interface |i|. another difference is that queryinterface returns a...
JavaScript Debugger Service - Archive of obsolete content
t acts as a jsdifilter factory. function createfilter(pattern, pass) { var jsdifilter = components.interfaces.jsdifilter; var filter = { globalobject: null, flags: pass ? (jsdifilter.flag_enabled | jsdifilter.flag_pass) : jsdifilter.flag_enabled, urlpattern: pattern, startline: 0, endline: 0 }; return filter; }, we then add the filters we want. ...
...ilter("*/firefox/components/*")); jsd.appendfilter(createfilter("*/firefox/modules/*")); jsd.appendfilter(createfilter("xstringbundle")); jsd.appendfilter(createfilter("chrome://*")); jsd.appendfilter(createfilter("x-jsd:ppbuffer*")); jsd.appendfilter(createfilter("xpcsafejsobjectwrapper.cpp")); jsd.appendfilter(createfilter("file://*")); note that appendfilter adds the filter to the end of the
list. you can use insertfilter (jsdifilter filter, jsdifilter after) to insert the filter after a particular filter; you can pass null for jsdifilter after to insert at the head of the
list. you can also use swapfilters (jsdifilter filter_a, jsdifilter filter_b) to swap filters, and removefilter(jsdifilter filter) to remove a filter. learning more a quick and dirty introduction by lei venkman jav...
Code snippets - Archive of obsolete content
many of these samples can also be used in xulrunner applications, as well as in actual mozilla code itself. these examples demonstrate how to accomplish basic tasks that might not be immediately obvious. general examples and demos from mdn articles a collection of examples and demos from articles. window code opening and manipulating windows toolbar toolbar related code sidebar sidebar related code forms forms related code xml code used to parse, write, manipulate, etc. ...
...ramming languages (i.e., creating compilers). this snippets shows a possible way to start from. browser-oriented code tabbed browser code (firefox/seamonkey) basic operations, such as page loading, with the tabbed browser, which is the heart of mozilla's browser applications cookies reading, writing, modifying, and removing cookies page loading code used to load pages, reload pages, and
listen for page loads interaction between privileged and non-privileged code how to communicate from extensions to websites and vice-versa. downloading files code to download files, images, and to monitor download progress password manager code used to read and write passwords to/from the integrated password manager bookmarks code used to read and write bookmarks javascript debugger service ...
Communication between HTML and your extension - Archive of obsolete content
n many different ways. some of the events only apply to certain types of elements so i included trying to modify the result of the ajax request to be of the appropriate element type (img, which supports "onload," rather than span, which doesn't, for example). the problem with the events is the timing. i wasn't sure about the difference between the capture or bubbling flag that you pass to addevent
listener but every time i would catch the event in the extension, the element from the ajax request wasn't fully updated into the html page. what that meant is that everytime the extension went looking for the element, it wasn't there yet. as a last ditch effort i tried setting a timeout using settimeout when i got the event in the extension to wait a few milliseconds before looking for the desired el...
...dy.dispatchevent(event); in the code of the extension that catches the loading of a new page i added this code: var doc = aevent.originaltarget; // doc is document that triggered "onload" event // do something with the loaded page. // doc.location is a location object (see below for a link). // you can use it to make your code executed on certain pages only. if (doc && doc.addevent
listener) doc.addevent
listener("my-custom-event", myextension.customreceived, false); since the event is dispatched after the element in the html is updated by the statuschanged function, the element that extension is looking for is there to find. ...
Migrating from Internal Linkage to Frozen Linkage - Archive of obsolete content
all these functions are now available via the new string api - appendutf16toutf8(srcstring, deststring); + deststring.append(ns_convertutf16toutf8(srcstring)); the signatures of the find methods differ between the two apis. if you are only finding a single character, prefer the findchar method. the (lossy)copy(asc...
...ing for information about the correct libraries to link to when using frozen linkage, see xpcom glue. the nsmsgutils.h header for developing core mail/news code, the nsmsgutils.h header is being enhanced to fill in some of the gaps caused by the differences between the internal and external apis. these enhancements make it easier to write code that will transparently compile using either api. the
list of enhancements fall in to three categories. changes to internal apis to make them compatible with the external api. #define caseinsensitivecompare pr_true this allows you to use caseinsensitivecompare as the parameter to various string methods that normally accept pr_true under the internal api. #define tointeger(prv, radix) tointeger(reinterpret_cast<print32*>(prv), radix) this allows you to p...
Adding menus and submenus - Archive of obsolete content
set on the menupopup to avoid code duplication, since now the 3 items call the same function. another example of a menu like this is the view > sidebars menu. only one sidebar is visible at any given moment, and you can pick from several. menus with images to add an icon to a menu or menuitem, set its class to "menu-iconic" or "menuitem-iconic" respectively, and set the image attribute or the
list-style-image css property. menu icons are typically 16px by 16px. menus on mac os x as mentioned earlier, menus are very different on mac os x. this is because menus on mac are located in a single menu bar which is controlled by the operating system, as opposed to menus in other systems, which are entirely controlled by firefox. mac os x also has menu standards, such as the positioning of certai...
...6px by 16px. menus on mac os x as mentioned earlier, menus are very different on mac os x. this is because menus on mac are located in a single menu bar which is controlled by the operating system, as opposed to menus in other systems, which are entirely controlled by firefox. mac os x also has menu standards, such as the positioning of certain items that are not used in other systems. here's a
list of the known issues we've run into when handling menus on mac: the about, preferences and quit menu items are located under the "firefox" menu, not the usual places you would find them. you can access these items by id through the dom, but their parent menu is not easily accessible. we've run into bugs when adding, removing, enabling and disabling menu items dynamically, specially the root me...
Promises - Archive of obsolete content
data to check modification time. let info = yield os.file.stat(configpath); if (info.lastmodificationdate <= timestamp) return; timestamp = info.lastmodificationdate; // read the file as a utf-8 string, parse as json. let config = json.parse( yield os.file.read(configpath, { encoding: "utf-8" })); let files = []; // get the directory contents from a
list of directories. for (let dir of config.directories) { // iterate over the contents of the directory. let iter = new os.file.directoryiterator(dir); yield iter.foreach(entry => { if (!entry.isdir) files.push(entry.path); }); iter.close(); } // read the files as binary blobs and process them. let processor = new fi...
...tative example usage components.utils.import("resource://gre/modules/downloads.jsm"); task.spawn(function* () { // fetch a file in the background. let download_1 = downloads.fetch(url_1, path_1); // fetch a file visible in the download manager. let download_2 = yield downloads.createdownload({ source: url_2, target: path_2, }); // add it to the downloads
list used by the download manager ui. let
list = yield downloads.get
list(downloads.all);
list.add(download_2); // start the second download, and wait for both // downloads to complete. // this will raise an error if either download fails. yield promise.all([download_1, download_2.start()]); // do something with the saved files. dostuffwith(path_...
Using Dependent Libraries In Extension Components - Archive of obsolete content
}; // component.dll on windows, libcomponent.so on linux static char krealcomponent[] = moz_dll_prefix "component" moz_dll_suffix; nsresult nsgetmodule(nsicomponentmanager* acompmgr, nsifile* alocation, nsimodule* *aresult) { nsresult rv; // this is not the real component. we want to load the dependent libraries // of the real component, then the componen...
...raries. #include <mach-o/loader.h> #include <mach-o/dyld.h> static char const *const kdependentlibraries[] = { // dependent1.dll on windows, libdependent1.so on linux, libdependent1.dylib on mac moz_dll_prefix "dependent1" moz_dll_suffix, moz_dll_prefix "dependent2" moz_dll_suffix, nsnull // note: if the dependent libs themselves depend on other libs, the subdependencies // should be
listed first. }; // component.dll on windows, libcomponent.so on linux, libcomponent.dylib on mac static char krealcomponent[] = moz_dll_prefix "component" moz_dll_suffix; // forward declaration of a convienience method to look up a function symbol. static void* lookupsymbol(const mach_header* alib, const char* asymbolname); extern "c" ns_export nsresult nsgetmodule(nsicomponentmanager* acompmgr, n...
Inner-browsing extending the browser navigation paradigm - Archive of obsolete content
ynamically loads news headlines into the current web page. this implementation uses xmlhttprequest. extending traditional hypertext navigation the hypertext approach to developing web pages, in which developers format text layouts into pages and link those pages to related content, is analogous to a book or a magazine: readers view pages, go to other pages for more information, and view resources
listed as references on that page. html and web standards have evolved and now offer flexible and fine-grained control to layout as well supporting dhtml, powerful programming languages like javascript, and additional media through embeddable third-party resources like flash, java, vrml, etc. additionally, server-side technologies have also evolved, supporting and connecting different resources to dif...
...he browsing device during the experience, and the user is "immersed" in that browsing device. what does this mean, practically speaking? what does it look like? good candidates for inner-browsing include a spell check application, in which the text entered in a web page is checked as it is typed; a webmail application that uses the inner-browsing model to display the separate messages and message
lists in an integrated way, much like a client mail app; and a stock ticker that spools the information across the web page. see the table below for a description of how applications like this exemplify inner-browsing and how they might be implemented using the inner-browsing approach. some examples: web page with ticker it is common to see web pages with a ticker element, often used to rotate news or...
Source code directories overview - Archive of obsolete content
standalone applications. this will be covered below. tools contains c code for the linux-only leaky tool. leaky can help detect memory leaks and xpcom reference counting problems. uriloader contains c interfaces and code for invoking the correct viewer for the content contained at a certain url. for example, if this code determines that the content is a mail message, it looks up the appropriate
listener (probably netscape messenger) and passes the mail message to it for display. it is generic and can hand the content off to internal components (like messenger), to plug-ins or helper apps. view contains c interfaces and code for different types of views (e.g. scrolling view). a view contains content but does not contain the title bar, borders or other decorations (which are contained by fram...
...re to draw according the scroll bar thumbs. webshell contains c interfaces, c code, linux shell scripts and other files for embedding mozilla in other programs on various different platforms in various different ways (e.g. as plug-in, as activex component, as xpcom classes). widget contains c interfaces and code for platform independent controls (widgets), such as scroll bars, radio buttons and
list boxes. xpcom contains the low-level c interfaces, c code, c code, a bit of assembly code and command line tools for implementing the basic machinery of xpcom components (which stands for "cross platform component object model"). xpcom is the mechanism that allows mozilla to export interfaces and have them automatically available to javascript scripts, to microsoft com and to regular mozilla c co...
Creating a Microsummary - Archive of obsolete content
warning: microsummary support was removed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) a microsummary generator is a set of instructions for creating a microsummary from the content of a page. web pages can reference generators via <link rel="microsummary"> elements in their <head> elements. generators can also be independently downloaded and installed by users if they include a
list of pages to which they apply. in this tutorial we're going to create a microsummary generator for the spread firefox home page that displays the current firefox download count along with the label fx downloads; for example: 174475447 fx downloads. we'll build the xslt transform sheet that converts that page into its microsummary, learn how to specify that the generator applies to that page, and...
...specifying the pages to which a generator does and doesn't apply, respectively. to make a generator apply to a page, add an <include> element whose content is a regular expression matching the page. to make the generator not apply to a page, add an <exclude> element whose content is a regular expression matching the page. by default, generators don't apply to any page, so you have to explicitly
list the pages they apply to, and you don't have to exclude any pages unless you've previously included them. add an <include> element matching the spread firefox home page: <?xml version="1.0" encoding="utf-8"?> <generator xmlns="http://www.mozilla.org/microsummaries/0.1" name="firefox download count"> <template> <transform xmlns="http://www.w3.org/1999/xsl/transform" version="1.0"> <ou...
Embedding FAQ - Archive of obsolete content
nformation on adding new protocols here how to embedding mozilla inside of java there hasn't been any good code examples found. however, there is a stripped down, uncommented code with eclipse libraries in this thread. ...
...dgets.shell; import org.mozilla.xpcom.nsidomdocument; public class test { public static void main(string args[]) { display display = new display(); shell shell = new shell(display); final mozillabrowser browser = new mozillabrowser(shell,wt.border); browser.seturl("http://www.google.com"); browser.addprogress
listener(new progress
listener() { public void changed(progressevent event) { } public void completed(progressevent event) { nsidomdocument doc = browser.getdocument(); system.out.println(doc); } }); while (!shell.i...
Content states and the style system - Archive of obsolete content
that node and all of its descendants. this is an expensive operation, however, so the style system tries to minimize the number of style reresolves it does. to this end, when a <code>contentstateschanged</code> notification is dispatched for a content node the first thing that's done is to is to check whether the content state change something could affect any styles. this is done by walking the
list of all css2.1 simple selectors in all style sheets applied to the page that have a state-dependent pseudo-class as part of the selector. this
list is created during the parsing of the stylesheets involved. for each selector in this
list we check whether it might have stopped matching the node or started matching it. if that has happened, then the style could depend on the state that changed and w...
... ...
Using microformats - Archive of obsolete content
ject and its api make finding and reading microformats easy to do. loading the microformats api the microformats object is created using the new javascript script loader added to firefox 3. to use the api, you need to first load the object: components.utils.import("resource://gre/modules/microformats.js"); once you've loaded the microformats api, you can manage microformats using the methods
listed here; for information about parsing microformats, see parsing microformats in javascript. predefined microformats firefox 3 provides definitions implementing several common microformats: adr represents an address (such as a street or mailing address). geo represents a geographical location using latitude and longitude. hcard represents contact information for a person. hcalendar rep...
...mode is in use; otherwise, specify false. the default is false. targetarray optional. if provided, this is an array of microformat objects to which the search results are added. return value a new array of microformat objects matching the search criteria, or the array specified by microformats with the newly found microformat objects added. getnamesfromnode() returns a space-delineated
list of microformat names that correspond to the specified microformat node. var name
list = microformats.getnamesfromnode(node); parameters node the node for which to retrieve a
list of microformat names. return value if the specified node is a microformat, the result is a space-delineated string
listing all the microformat names that correspond to the node. if the node isn't a microformat, ...
Code snippets - Archive of obsolete content
you like. envelope.payload = json.stringify(payload); r.put(json.stringify(envelope)); generate new keys // clients always wipe the server when they generate new keys. components.utils.import("resource://services-sync/main.js"); weave.service._freshstart(); // if you want to do it without wiping the server (which will cause corruption!): weave.service.generatenewsymmetrickeys(); print out a
list of large bookmark records // change '1000' as appropriate. components.utils.import("resource://services-sync/engines.js"); components.utils.import("resource://services-sync/engines/bookmarks.js"); let bme = weave.service.enginemanager.get("bookmarks"); let ids = object.keys(bme._store.getallids()); for each (let id in ids) { let record = bme._store.createrecord(id, "bookmarks"); let len = re...
...urce://services-sync/engines/bookmarks.js"); let bme = weave.service.enginemanager.get("bookmarks"); let ids = object.keys(bme._store.getallids()); for each (let id in ids) { let record = bme._store.createrecord(id, "bookmarks"); let len = record.tostring().length; if (len > 1000) { console.log("id: " + id + ", len = " + len + ", " + record.title); } } print an alphabetically sorted
list of members of a collection components.utils.import("resource://services-sync/main.js"); components.utils.import("resource://services-sync/resource.js"); let ids = json.parse(new resource(weave.service.storageurl + "bookmarks").get()); for each (let id in ids.sort()) { console.log(" " + id); } get a count of the number of members of a collection on the server let collection = "passwords"; com...
Java in Firefox Extensions - Archive of obsolete content
ackages (note that per this thread, although the new documentation for the liveconnect reimplementation states that these globals will be deprecated (in the context of applets), "firefox and the java plug-in will continue to support the global java/packages keywords, in particular in the context of firefox extensions."). these 2 objects let you make use of the standard jdk classes, e.g., var ajava
list = new java.util.linked
list(); if you want to load your own jars, then you can create your own java class loader. the following technique only works in javascript code linked from or contained in xul files. if you wish to call java code from within javascript code that implements some xpcom components, at this time, you need a different technique (refer to the complete java firefox extension). a...
...d indicate the number of items in following array paramtypes[0] = java.io.file; var envconfigclass = loader.loadclass('com.sleepycat.db.environmentconfig'); paramtypes[1] = envconfigclass; // get the constructor var constructor = envclass.getconstructor(paramtypes); // now that we have the constructor with the right parameter types, we can build the specific arguments we wish to pass to it var arg
list = reflect.array.newinstance(java.lang.object, 2); // 2nd argument should indicate the number of items in the following array var mydir = new java.io.file(dirurl); // a file url arg
list[0] = mydir; var envconfig = envconfigclass.newinstance(); arg
list[1] = envconfig; // call our constructor with our arguments var env = constructor.newinstance(arg
list); be aware that liveconnect, while now activel...
Enabling Experimental Jetpack Features - Archive of obsolete content
an call from __future__ import foo which adds the functionality that foo yields to the script. in jetpack, we propse adding a new function to the base namespace called importfromfuture. methods import(stringmountpath string)imports the requested experimental feature into the script. stringmountpathstring that enumerates where, starting from the jetpack base, the feature will be mounted. to get a
list of mount paths that are available, see the method below. string here is an example of how to import a feature (the clipboard) from the future. jetpack.future.import("clipboard"); the goal here is to be able to remove the jetpack.future.import() call when the feature has been formally accepted into the core without additionally changing the script (barring any other changes made during integrati...
...ount paths that are available, see the method below. string here is an example of how to import a feature (the clipboard) from the future. jetpack.future.import("clipboard"); the goal here is to be able to remove the jetpack.future.import() call when the feature has been formally accepted into the core without additionally changing the script (barring any other changes made during integration).
list() arrayreturns an array of the set of potential stringmountpath as used in jetpack.future.import(). this is an example of how to get this array. a quick way of displaying the
list is to write it to the console.log. var
list = jetpack.future.
list();console.log(
list); open the firebug console to view. ...
Enabling - Archive of obsolete content
can call from __future__ import foo which adds the functionality that foo yields to the script. in jetpack, we propse adding a new function to the base namespace called importfromfuture. methods import(stringmountpath string)imports the requested experimental feature into the script. stringmountpathstring that enumerates where, starting from the jetpack base, the feature will be mounted. to get a
list of mount paths that are available, see the method below. string here is an example of how to import a feature (the clipboard) from the future. jetpack.future.import("clipboard"); the goal here is to be able to remove the jetpack.future.import() call when the feature has been formally accepted into the core without additionally changing the script (barring any other changes made during integrat...
...unt paths that are available, see the method below. string here is an example of how to import a feature (the clipboard) from the future. jetpack.future.import("clipboard"); the goal here is to be able to remove the jetpack.future.import() call when the feature has been formally accepted into the core without additionally changing the script (barring any other changes made during integration).
list()returns an array of the set of potential stringmountpath as used in jetpack.future.import(). this is an example of how to get this array. a quick way of displaying the
list is to write it to the console.log. var
list = jetpack.future.
list(); console.log(
list); open the firebug console to view. ...
Menu - Archive of obsolete content
ay of the item's menu is retrieved. it must return a non-function menuitem. if the item belongs to a context menu, the function is called as function(context) and otherwise function(). context is an object describing the context in which the menu was shown. string a simple menuitem with the given string label. object a menuitem with specific properties. the object may define any of the properties
listed below. properties property type description command function a function that will be called when the menuitem is clicked. if the menu property is present, command will instead be called when any of the item's descendants is clicked. in that case, the commands of descendants will be invoked first. in either case, it is called as co...
...include the children of nodes they match. for example, jetpack.menu.context.page.on("a[href]") does not match images contained in links. to match links and all elements contained in links, use jetpack.menu.context.page.on("a[href], a[href] *"). a future version of jetpack may change this behavior; see bug 527924. what do you think? leave a comment on that bug or send a message to the mailing
list. parameters selector one or more css selectors. a string. examples: "a[href]", "a[href] > img", "a[href], img". return value a new contextmenuset object. jetpack.menu.context the feature's context menu. all of the feature's context menus are exposed through jetpack.menu.context, including slidebar, panel, toolbar, and status bar item context menus. a contextmenuset object. jetpa...
Enabling Experimental Jetpack Features - Archive of obsolete content
can call from __future__ import foo which adds the functionality that foo yields to the script. in jetpack, we propse adding a new function to the base namespace called importfromfuture. methods import(stringmountpath string)imports the requested experimental feature into the script. stringmountpathstring that enumerates where, starting from the jetpack base, the feature will be mounted. to get a
list of mount paths that are available, see the method below. string here is an example of how to import a feature (the clipboard) from the future. jetpack.future.import("clipboard"); the goal here is to be able to remove the jetpack.future.import() call when the feature has been formally accepted into the core without additionally changing the script (barring any other changes made during integrat...
...unt paths that are available, see the method below. string here is an example of how to import a feature (the clipboard) from the future. jetpack.future.import("clipboard"); the goal here is to be able to remove the jetpack.future.import() call when the feature has been formally accepted into the core without additionally changing the script (barring any other changes made during integration).
list() arrayreturns an array of the set of potential stringmountpath as used in jetpack.future.import(). this is an example of how to get this array. a quick way of displaying the
list is to write it to the console.log. var
list = jetpack.future.
list(); console.log(
list); open the firebug console to view. ...
PyDOM - Archive of obsolete content
the globals are 'bound' to the global object (i.e., the window), instead of to a module's __dict__ as you expect in the python world. ...
.... this means that if you set the script-type to python for the window, python is the default script type for all child elements in the window. xul use a script-type attribute on your elements. for example, <window script-type="application/x-python" .../> html <meta http-equiv="content-script-type" content="application/x-python" /> should work (but possibly doesn't - see bug 100924). but addevent
listener within a <script type="application/x-python"> block does. almost python code can not be secured - so it will only run from trusted sources. this means you can only have python code in chrome. content loaded from anywhere other than a chrome:// url can not host python. it should be obvious why you don't want to run http://evil.com/something_evil.py in your browser! inside chrome, you can use p...
Remote XUL - Archive of obsolete content
how to use xul delivered from a webserver, not as part of chrome. note: support for remote xul has long been a potential security concern; support for it was disabled in gecko 2.0. this also means you can't load xul using file:// urls unless you set the preference dom.allow_xul_xbl_for_file to true. however, there is a white
list that lets you specify sites that can still use remote xul. ...
...art of chrome. note: support for remote xul has long been a potential security concern; support for it was disabled in gecko 2.0. this also means you can't load xul using file:// urls unless you set the preference dom.allow_xul_xbl_for_file to true. however, there is a white
list that lets you specify sites that can still use remote xul. the remote xul manager extension lets you manage this white
list, which is maintained using nsipermissionmanager, by creating entries of type "allowxulxbl", like this: components.classes["@mozilla.org/permissionmanager;1"] .getservice(components.interfaces.nsipermissionmanager) .add(uri, 'allowxulxbl', components.interfaces.nsipermissionmanager.allow_action); see using remote xul. oreillynet article, part 1 oreillyn...
Running Tamarin acceptance tests - Archive of obsolete content
ndows you must install windows python and invoke runtests using that python executable in cygwin. the locations of avm, asc, builtinabc and shellabc must also be defined using windows paths (replace backslashes [\] with forward slashes [/]): export avm=c:/location/of/avmshell.exe export asc=c:/location/of/asc.jar ... c:/python26/python.exe ./runtests.py --threads=3 other flags of interest (for a
list of all flags, run runtests.py with -h/--help) --nohtml : will suppress the creation of an html output file --rebuildtests : will only rebuild test .abc's, will not attempt to run them. can also be using in conjunction with --threads -f --forcerebuild force rebuild all test files -q --quiet : will print a period (.) for each test run regardless of results, then print the test run summary when fin...
...script mentioned on the tamarin build documentation page you should already be pathed to the adb executable in the public sdk/ndk, but if not it exists at /android-public/android-sdk-mac_86/platform-tools. adb supports ssh-like commands to an android device. adb automatically connects to a phone if connected by usb. adb shell "ls /" is a good test to see if connected. the command: $ adb devices
lists the device id of each phone. if you have more than 1 phone connected to usb, use "adb -s " for each phone. if this fails, do you have a dev os installed? under settings->applications->development, is usb debugging enabled? testsuite setup example commands: copy avmshell to /data/local/tamarin. the shell can be named variously in the build but on the phone the executable must be 'avmshell' $ ...
Tamarin build documentation - Archive of obsolete content
te a copy of the tamarin repository: $ hg clone http://hg.mozilla.org/tamarin-central tamarin-central tips for working with mercurial can be found here. building tamarin building tamarin will create all the libraries for the avmplus and garbage collector (mmgc), and create a standalone executable (shell) for executing files in the abc file format. running the shell without any arguments will
list the available options. note that additional command-line arguments are only available in the debug configuration. the tamarin codebase contains a cross-platform build system for mozilla developers. the cross-platform build system is used for daily automated build testing so it is the most reliable system. the tamarin codebase has the ability to build additional code which supports debugging hoo...
...preferences >> c/c++ >> indexer, then select 'use active build configuration' in the 'build configuration for the indexer' section. ...
The Download Manager schema - Archive of obsolete content
source text the source uri for the download. target text the destination uri for the download. temppath text the path of the temporary file being used for the download. starttime integer the download's start time. endtime integer the download's end time. state integer the download's current state. see the constants
list in the nsidownloadmanager documentation. referrer text the referrer for the download. entityid text the entity id from the nsiresumablechannel used to implement the download channel. this information is used to resume the download after it's been paused. currbytes integer the current number of bytes that have been downloaded. defaults to 0, may not be ...
... preferredaction integer the action constant from nsimimeinfo representing the action to take upon completing the download. default 0 (save to disk); may not be null. autoresume integer 0 if the file should not automatically resume downloading, 1 if it should. defaults to 0, and may not be null. see also nsidownloadmanager nsidownloadmanagerui nsidownloadprogress
listener ...
Using cross commit - Archive of obsolete content
d the mozilla_1_8_branch by default. details cross-commit accepts the following options: all cvs options (those to the left of the specific cvs command) and cvs commit options (those to the right of a commit command), although the -r and -f cvs options need to be specified as --cvs-r and --cvs-f to avoid conflict with the similarly named (but different in meaning) cvs commit options. you can
list the files/directories you want it to commit on the command line or leave them out and let it recursively troll the current directory. --verbose=[0|1] makes the script output more text as it runs. this defaults to 1. --trunk makes cross-commit land the patch on head in addition to any other branches specified. this is equivalent to --branch head. --moz18 makes cross-commit land the patch on moz...
...kes the script output more text as it runs. this defaults to 1. --trunk makes cross-commit land the patch on head in addition to any other branches specified. this is equivalent to --branch head. --moz18 makes cross-commit land the patch on mozilla_1_8_branch in addition to any other branches specified. this is equivalent to --branch mozilla_1_8_branch. --branch=branch-tag adds a branch to the
list of branches to land the patch on. this may be specified multiple times, each time with a different branch name. this may also be used in combination with --trunk and --moz18. if no branches are specified, cross-commit will default to landing on head and mozilla_1_8_branch. ...
DOM Interfaces - Archive of obsolete content
the nsidomdocumentxbl interface the nsidomdocumentxbl interface contains methods for manipulating xbl bindings. the interface is implemented by all dom documents. ...
...g attrname, in domstring attrvalue); element getbindingparent(in node node); void loadbindingdocument(in domstring documenturl); }; methods getanonymousnodes the getanonymousnodes method retrieves the anonymous children of the specified element. parameters elt - the element to retrieve anonymous children for. return value node
list - the return value of getanonymousnodes is a node
list that represents the children of an element after insertion points from its own binding have been applied. this means that, depending on the details regarding the insertion points of the binding, it's possible that some non-anonymous nodes appear in the
list. see "not so anonymous nodes" on mozilla.dev.platform for some discussion about this. ...
XBL - Archive of obsolete content
ies on bound elements. xbl 2.0 (w3c candidate recommendation) was developed to address problems found in xbl 1.0 and to allow for implementations in a broader range of web browsers. in 2009 mozilla announced plans to implement xbl2 in future versions of gecko. some differences between sxbl and xbl2 are
listed in an article by anne van ke ( seesteren (november, 2005). an overview of differences between mozilla xbl and xbl2 is in a newsgroup posting by jonas sicking (april, 2007). still living "shadow dom" related specs shadow dom (editor's draft) css scoping » shadow encapsulation ...
... from the xul school tutorial for add-on developers xbl chapter of "rapid application development with mozilla" xbl 2.0 primer (draft) xbl 2.0 cross-browser implementation in javascript more xbl resources... community view mozilla forums... mailing
list newsgroup rss feed ...
Introduction - Archive of obsolete content
e'll see later. for xml datasources, use a querytype of xml. the datasources attribute should be the url of an xml file, which can be either the location of a web site or a file on the local file system, using its file or chrome url. this file will be loaded and the resulting xml document will be used as the datasource when the template builder generates results and creates content. ...
... the url of an xml file, which can be either the location of a web site or a file on the local file system, using its file or chrome url. this file will be loaded and the resulting xml document will be used as the datasource when the template builder generates results and creates content. for example: <
listbox datasources="http://www.xulplanet.com/ds/sample.xml" querytype="xml"> <template> <
listitem label="?name"/> </template> </
listbox> this template uses an xml datasource to generate a
listbox. although we'll look at the details of this later, the simple result here is that a
listitem will be generated for each child node in the xml data, setting the label to the name attribute for each xml node. for sqlite datasources, the datasources attribute specifies the uri of a database file.
Multiple Rule Example - Archive of obsolete content
icular result has a property that others do not. for instance, in an earlier example, one of the photos had a description and the other photos did not. in this case, you might wish to display the photo with a description in a different manner. this is useful if you wish to hide any content that would be needed to display the description. the next example shows how we can do this. ...
...is that the container and member variables (those that are referred to in the uri attributes), must be the same in all rules. in this example, the container variable is ?start and the member variable is ?photo. if different variables were used for these, the rules would not work properly. the reason for this is due to the manner in which the builder processes the data. looking back at the results
listed above, the palace photo appears twice so the second one will be removed, leaving only three matches. although the builder actually generates mutliple matches for one resource, in many cases it isn't necessary to be aware of this detail when creating templates. it is usually sufficient to assume that earlier rules are used to filter results much like an if-else construct in a programming languag...
Multiple Rules - Archive of obsolete content
d all folders, then the remaining rules can assume that any results that get past the first rule are not folders. this allows the conditions can be simpler. it also allows a common technique where the last rule in a template has no conditions, allowing all remaining results that didn't match earlier rules to match this last rule. ...
...tle"/> </query> <rule> <where subject="?title" rel="equals" value="canal"/> <action> <button uri="?photo" image="?photo" label="view" orient="vertical"/> </action> </rule> <rule> <action> <image uri="?photo" src="?photo"/> </action> </rule> </template> </hbox> this template contains a query with two rules. the query generates a
list of the photos and assigns the title of each photo to the variable '?title'. note that the full query syntax must be used to use conditions within rules. the first rule contains a new element, where which is used to define a condition. the second rule does not contain a where element, so it matches results unconditionally, or any result that wasn't matched by a previous rule. in this example, the ...
RDF Modifications - Archive of obsolete content
ul aspects of using templates with rdf datasources is that when the rdf datasource changes, for instance a new triple is added, or a triple is removed, the template updates accordingly, adding or removing result output as needed. no extra code needs to be written to do this; it happens automatically. this involves a third type of observer involved in a template builder, an nsirdfobserver, used to
listen for modifications to the rdf datasource. naturally, this only applies to rdf queries. when the datasource is modified, the datasource will notify any observers of the change. the template builder uses these notifcations to update the template as necessary based on the new or removed information. you don't need to implement this observer yourself, although you may add an observer to the datasour...
..."http://purl.org/dc/elements/1.1/title" object="?title"/> <triple subject="?photo" predicate="http://purl.org/dc/elements/1.1/description" object="?description"/> </query> these query statements will cause any photos with both a title and a description to be displayed. assuming that the 'obelisk' photo doesn't have a description already, adding the triple
listed above should cause a new result to be available for this photo. the builder scans through the query statements one by one. the content tag can safely be skipped at this part of the process, so the builder moves onto the member statement. this type of statement can only cause a change when an item is being added or removed from a container. since this is a new rdf triple that isn't an addition o...
Result Generation - Archive of obsolete content
ward. or, you could start at d and follow two arrows back (and only following arrows backwards). this will get one result, a. look at the graph to see if you can see why one result would be generated in this case. in xul template terminology, the starting point is called the container or reference point and the endpoint is called the member. it is so called because it is most common to gather the
list of the members, or children, of a container. but this doesn't have to be the case. any starting point and ending points will do. nodes in rdf are identified by a string value. there are two types of nodes in rdf, resources which usually represent 'things', and literals which are values like the names, dates or sizes of those things, and so on. a literal's value is, for example, the name of the th...
...e rdf graph. rather than rebuild the entire template, the algorithm allows only specific parts of the network of information to be re-examined. a similar method can be used when removing rdf statements. while the information network created by the template builder contains a number of different pieces of necessary information, for the purposes of this discussion, we will only be interested in the
list of possible results. the builder begins with a single possible result, called the seed. the builder processes each of a query's statements in sequence. to do this for a particular statement, the builder iterates over the possible results found so far and either accepts each result or rejects each result. for the first statement, only the seed will be available as a possible result. at each step, ...
Template Builder Interface - Archive of obsolete content
es both when an element is created when the window is loaded and when an element is inserted dynamically. templates can only be used in xul documents, however, there is no requirement that the templates generate xul elements. they could also be used, for example, to generate html elements. this isn't a very common technique, however, here is an example of how this can be used: <html:div id="photos
list" datasources="template-guide-photos5.rdf" ref="http://www.xulplanet.com/rdf/myphotos" xmlns:html="http://www.w3.org/1999/xhtml"> <html:h1>my photos</html:h1> <template> <html:p uri="rdf:*"><textnode value="rdf:http://purl.org/dc/elements/1.1/title"/></html:p> </template> </html:div> this example generates three paragraphs. some static content before the <template> el...
...f the datasources attribute on the root element. changing this attribute causes the new datasource to be retrieved and the template to be rebuilt. the rdf datasource associated with the template can be retrieved using the element's 'database' property. it implements the nsirdfcompositedatasource interface. since this is a composite datasource, it may contain more than one datasource. these may be
listed in the datasources attribute separated by spaces. for example: <vbox datasources="template-guide-photos5.rdf template-guide-streets.rdf"> sometimes, you will want to calculate the datasource to be used and attach it to the template later. you can do this using the composite datasource's adddatasource method. you can add as many datasources as you wish, and you can remove them using the removed...
Template Logging - Archive of obsolete content
doesn't have any content. however, no other query overrides it. no changes to the content will occur. template errors the second type of template error is a syntax error is the template rules, for example, a missing attribute or a tag out of place. these types of errors are also logged to the console, however, these types of errors are logged whether the logging flag is set or not. the following
lists the errors that can occur and an explanation of what the problem is. querytype attribute doesn't specify a valid query processor this error indicates that the querytype attribute is set to an unrecognized value. only the 'rdf', 'xml' and 'storage' values are provided by default. if you are using a custom query processor, it may indicate that it is not installed or set up properly. unexpected <q...
... generally indicates an error in the logic of the template. common errors are misspelled variable names or <member> and <triple> elements placed in the wrong order. note that this error does not occur simply because, for example, a particular container has no children; it means that a logic error in the query implies that a variable could never be computed properly. an example is given below this
list of errors. neither subject or object variables of <triple> has a value similar to the previous error but for the <triple> element. either the subject or object variables could never be set to a value for a result. xpath expression in query could not be parsed for xml datasources, a query attribute has an xpath expression that is not valid. xpath expression in <assign> could not be parsed </assign...
Using Recursive Templates - Archive of obsolete content
th the rdf and xml datasource types support recursion. for example, using this xml datasource: <people> <group name="male"> <person name="napoleon bonaparte"/> <person name="julius caesar"/> <person name="ferdinand magellan"/> </group> <group name="female"> <person name="cleopatra"/> <person name="laura secord"/> </group> </people> we could display this data in a flat
list by using the right query: <query expr="group/person/"> or, we could display one level for the two groups, and use another level for each person. <groupbox type="menu" datasources="people.xml" ref="*" querytype="xml"> <template> <query expr="*"/> <action> <vbox uri="?" class="indent"> <label value="?name"/> </vbox> </action> </template> </groupbox> in this sim...
.../"> or, we could display one level for the two groups, and use another level for each person. <groupbox type="menu" datasources="people.xml" ref="*" querytype="xml"> <template> <query expr="*"/> <action> <vbox uri="?" class="indent"> <label value="?name"/> </vbox> </action> </template> </groupbox> in this simplified example, the xpath expression just gets the
list of child elements of the reference node. for the outermost iteration, a vbox is created with a child label. since the initial reference node is the root of the xml source document, the results are two elements, one for each group element. however, a further step is done to retrieve an additional level of nodes. as each group has children itself, each result (in this case, each group) becomes the ...
SeaMonkey - making custom toolbar (SM ver. 1.x) - Archive of obsolete content
not need. save the file. explanation: this xul file adds the button to the toolbars. it also links to the stylesheet and javascript code that the button uses. the last section specifies details of the button. 7. create a plain text file named button.css. copy the following content, making sure that you scroll to get all of it. ...
...p" chrome:author="yours truly" chrome:name="myapp" chrome:localeversion="1.8" chrome:skinversion="1.5" chrome:extension="true"/> </rdf:rdf> replace the fields in bold with your xul file name and change the displayname, description, and author attributes as suits you. save the file as contents.rdf and navigate to seamonkey\chrome again, following steps 2 and 3 as
listed above. restart seamonkey and type the chrome url: chrome://myapp/content/myapp.xul, the browser should show you the content of the xul file. note: you may have to restart the machine, as seamonkey often is configured to keep portions of code in memory. this may not be the most relevant spot for this addition, i posted this here because the above approach proved successful after hours of unsucce...
Toolbars - Archive of obsolete content
illa applications. custom toolbar button another example of how to create a toolbar button, complete with a sample extension you can download and try. code snippets: toolbar code snippets that are helpful when working with toolbars. community view mozilla extension development forums... mailing
list newsgroup rss feed #extdev irc channel mozillazine forum about:addons newsletter mozilla's web-tech blog mozdev project owners planet mozilla other community links... tools dom inspector edit the live dom (firefox and thunderbird) mozilla labs add-on builder extensi...
...llazine forum about:addons newsletter mozilla's web-tech blog mozdev project owners planet mozilla other community links... tools dom inspector edit the live dom (firefox and thunderbird) mozilla labs add-on builder extension developer's extension a suite of development tools chrome
list view files in chrome:// (firefox, thunderbird) extension wizard a web-based extension skeleton generator (firefox and thunderbird) ... more tools ... related topics xul, themes, developing mozilla ...
Tree Widget Changes - Archive of obsolete content
work. that means that the ids can be left out, although it's probably a good idea to use them anyway. instead of identifying columns by id, a new column object is used. this object implements the nsitreecolumn interface and holds information about a single column in the tree. a tree will have one of these objects for each column (each treecol element) in the tree. the columns are grouped into a
list which implements the nsitreecolumns interface. both the nsitreecolumn and nsitreecolumns interfaces can be found at layout/xul/base/src/tree/public/nsitreecolumns.idl. the column objects are created automatically, so you don't have to write any extra code. you can get the columns object which implements the nsitreecolumns interface for a tree using the tree's columns property. from there you can...
...e attribute to true, or leaving out the attribute. note that it's the value attribute you use, not the label attribute. <treecell/> <treecell value="true"/> you need to specify the checkbox image with css for the checkbox to display. (do not set id of the column to be 'checked' it will cause problems with the css) treechildren::-moz-tree-checkbox(checked) { /* css for checked cells */
list-style-image: url("chrome://global/skin/checkbox/cbox-check.gif"); } in addition, checkmark columns support editing: <tree editable="true"> <treecols> <treecol type="checkbox" editable="true"> ... </treecol> </treecols> </tree> if the column is editable, the user can click the cell to change the state of the checkbox. when the user clicks the cell, the view's setcellvalue me...
Adding Buttons - Archive of obsolete content
hat the button appears in. in this case the value dialog is used. in most cases, you will not use a class for a button. label the label that will appear on the button. for example, ok or cancel. if this is left out, no text appears. image the url of the image to appear on the button. if this is attribute is left out, no image appears. you can also specify the image in a stylesheet using the
list-style-image property. disabled if this attribute is set to true, the button is disabled. this is usually drawn with the text in grey. if the button is disabled, the function of the button cannot be performed. if this attribute is left out entirely, the button is enabled. you can switch the disabled state of the button using javascript. accesskey this should be set to a letter that is used a...
... state of the button using javascript. accesskey this should be set to a letter that is used as a shortcut key. this letter should appear in the label text and will typically be drawn underlined. when the user presses alt (or a similar key that varies on each platform) and the access key, the button will be focused from anywhere in the window. note: buttons support more attributes than those
listed above. others will be discussed later. some examples of buttons example 1 : source view <button label="normal"/> <button label="disabled" disabled="true"/> the examples above will generate the buttons in the image. the first button is a normal button. the second button is disabled so it appears greyed out. we'll start by creating a simple find button for the find files utility. the exam...
Creating an Installer - Archive of obsolete content
tep by step below. create a web page from which the user can download the software to be installed. this page will contain an install trigger which is a small piece of script which launches the install. the user is presented with a dialog which indicates the package being installed. it is possible for the install trigger to launch multiple installers. in this case, they will be presented in a
list. the user may choose to continue or cancel. if the user chooses to continue, the installer xpi file is downloaded. a progress bar is displayed to the user during this process. the file install.js is extracted from the install archive and executed. this script will call install functions which will indicate which files from the archive should be installed. once the script is complete, the new p...
...es the use of the special global object installtrigger. it contains a number of methods which can be used to start an installation. you can use this object in local or remote content, meaning that it is suitable for a download from a web site. let's create an example install trigger. this involves the use of the function installtrigger.install(). this function takes two arguments, the first is a
list of packages to install, and the second is a callback function which will be called when the installation is complete. here is an example: function donefn ( name , result ){ alert("the package " + name + " was installed with a result of " + result); } var xpi = new object(); xpi["calendar"] = "calendar.xpi"; installtrigger.install(xpi,donefn); first, we define a callback function donefn() wh...
Cross Package Overlays - Archive of obsolete content
plication uses overlays to add content to the browser window. for example, if mail is not installed, there will be no new message command. however, if mail is installed, an overlay will be applied to the menu to add the new message command. below, we'll add a find files toolbar to the browser. it probably wouldn't be useful to have this feature, but we'll do it anyway. mozilla allows you to add a
list of overlays to the contents.rdf file that you use to
list chrome packages, skins and locales. once you have created an overlay, you can add it to the contents.rdf file. then add items, one for each window that you want the overlay to apply to. our find files example first, let's create a simple overlay. it will just have a few elements for entering a filename and directory to search. call th...
...ly overlays to by adding additional li nodes. next, we add a node for each overlay to apply to the window. in this case, we only have one, but we could apply others also. add these lines just after the previous lines. <rdf:seq about="chrome://navigator/content/navigator.xul"> <rdf:li>chrome://findfile/content/foverlay.xul</rdf:li> </rdf:seq> mozilla reads this information and builds a
list of overlays that are applied to other windows. it stores this information in the chrome/overlayinfo directory. you do not need to manually modify the files in this directory. it is automatically generated and modified when mozilla is first run or when new packages are installed. however, you can force the data to be rebuilt by deleting this directory and the chrome.rdf file. as a side note, you c...
Custom Tree Views - Archive of obsolete content
be created which is used to indicate the value of each cell, the total number of rows plus other optional information. the tree will call methods of the view to get the information that it needs to display. 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. three methods that you should implement are
listed below. rowcount this property should be set to the total number of rows in the tree. getcelltext( row , column ) this method should return the text contents at the specified row and column. this will be called to display data for each cell. the rows are supplied as numeric values starting at 0. the columns are treecolumn objects. in the older versions of mozilla (before firefox 1.5 or ...
... are displayed, the last only partially, so getcelltext() will be called only 14 times, one for each row and column. it is called for other rows when the user scrolls through them. this makes the tree much more efficient. note that the view object is also available for trees using the built-in content view. you can use this to get the cell labels and other information. the nsitreeview interface
lists all of the properties and methods that you can implement for the tree view. we'll look at more of these in the next section. next, we'll look at more features of tree views. « previousnext » ...
Install Scripts - Archive of obsolete content
and only update it if necessary. the component registry works somewhat like the windows registry does. it consists of a hierarchy of keys and values. you don't need to know much about it to create xul applications unless you are creating your own xpcom components. what you do need to know for an installation is that the registry stores a set of information about your application, such as the file
list and versions. all of this information is stored in a key (and within subkeys) that you provide in the installation script (in step 1 mentioned above). this key is structured as directory-like path of the following form: /author/package name replace the word author with your name and replace the package name with the name of the package that you are installing. for example: /xulplanet/find files ...
...where though.) the setpackagefolder() takes one argument, the directory to install to. for maximum portability, you can't specify a string name for the directory. instead, you specify an identifier of a known directory and get subdirectories of it. thus, if your application needed to install some system libraries, you don't need to know the name of those directories. the directory identifiers are
listed on this page. for the chrome directory, the directory identifier is 'chrome'. the getfolder() function can be used to get one of these special directories. this function takes two arguments, the first is the identifier and the second is a subdirectory. for example: finddir = getfolder("chrome","findfile"); setpackagefolder(finddir); here, we get findfile folder in the chrome folder and pass it...
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. each item in the tree has a level starting at 0. the topmost items in the tree will have a level of 0, the children of those items will have a level of 1, the children below that will have a level of 2, and so on. the tree will query the view for the level of each item in order to determine how to draw the rows. ...
...rry" /> <treecell label="hodge" /> </treerow> </treeitem> </treechildren> </treeitem> </treechildren> </tree> this has created a hierarchical tree. as can be seen in the image, a small plus or minus sign (often called a twisty) has appeared next to the first row, indicating that it contains child rows. by clicking the row, the user can open and close the
list. the child rows are indented. notice how the guys row only needs one column as it is a placeholder item for its children. the outer treeitem element contains a single treerow element and a treechildren element. the former creates the data for the parent row and the latter contains the child items. you can nest rows deeper as well. remember that you must use the container attribute on rows which c...
Open and Save Dialogs - Archive of obsolete content
odeopen which is used for an open dialog. you can also use modegetfolder and modesave for the other two modes. these modes are constants of the nsifilepicker interface. default directory and filters there are two features you can set of the dialog before it is displayed. the first is the default directory that is displayed when the dialog is opened. the second is a filter that indicates the
list of file types that are displayed in the dialog. this would be used, for example, to hide all but .html files. you can set the default directory by setting the displaydirectory property of the file picker object to a directory. the directory should be an nsilocalfile object. if you do not set this, a suitable default will be selected for you. to add filters, call the appendfilters() function to ...
...terxul to filter for xml and xul files respectively. if you would like to filter for custom files, you can use the appendfilter() function to do this: fp.appendfilter("all files" ,"*.*"); fp.appendfilter("audio files (*.wav, *.mp3)","*.wav; *.mp3"); this line will add a filter for wave and mp3 audio files. the first argument is the title of the file type and the second is a semicolon-seperated
list of file masks. you can add more masks or fewer masks as needed. you can call appendfilter as many times as necessary to add additional filters. the order you add them determines their priority. typically, the first one added is selected by default. getting the selected file finally, you can show the dialog by calling the show() function. it takes no arguments but returns a status code that indi...
Simple Menu Bars - Archive of obsolete content
r of different ways of creating menus. the most basic way is to add a menu bar with a row of menus on it like many applications have. you can also create popup menus. the menu features of xul consist of a number of different elements which allow you to create menu bars or popup menus. the items on the menus can be customized quite easily. we've already seen part of how to make menus using the menu
list. this section will build on that. menu bars are usually created much like a toolbar. the menu bar can optionally be placed inside a toolbox and the menu would work just like any other toolbar. xul does have some special elements which provide special functionality typical of menus. there are five elements associated with creating a menu bar and its menus, which are explained briefly here and in...
...th creating a menu bar and its menus, which are explained briefly here and in detail afterwards: menubar the container for the row of menus. menu despite the name, this is actually only the title of the menu on the menubar. this element can be placed on a menubar or can be placed separately. menupopup the popup box that appears when you click on the menu title. this box contains the
list of menu commands. menuitem an individual command on a menu. this would be placed in a menupopup. menuseparator a separator bar on a menu. this would be placed in a menupopup. you can customize the menus on the menubar to have whatever you want on them on all platforms except the macintosh. this is because the macintosh has its own special menu along the top of the screen controlled b...
Skinning XUL Files by Hand - Archive of obsolete content
, and then load only the new stylesheet to get all styles in both the global skin and in your own stylesheet. creating a new stylesheet unlike a xul file, a css file does not need any particular structure or preamble information at the top. css can define styles for elements in a hierarchy, but it is not itself hierarchical, as you saw in the global skin. instead, a css file is usually simply a
list of style definitions that are applied to their respective elements and classes by the rendering engine. here is a very short (but complete!) cascading stylesheet that might be referenced and used by a xul file: toolbar.nav-bar { background-image: url("chrome://navigator/skin/navbar-bg.gif"); padding: 0px; padding-bottom: 2px; } box#navbar { background-color: lightblue; } a:link { co...
...ax for creating all this information with text -- added to the distributed nature and the sheer volume of text required to define a single chrome -- can sometimes make the progress seem slow. but the advantages of using xul so far outweigh those of using the standard c++ toolkits that xul authoring should rightfully be considered in a separate category of development. xul represents, as one evange
list put it, the "democratization" of interface design and ofapplications development, about which we will have more to say in a later article. in short, xul provides the tools for anybody to create interfaces as complex and as attractive as any c++/mfc/visual ide/templates toolkit user's, and it does so in a way that makes these interfaces available on any platform. you don't have to know the vaguer...
The Chrome URL - Archive of obsolete content
<file.xul> is simply the filename. example: chrome://messenger/content/messenger.xul the example here refers to the messenger window. you could point to a file that is part of a skin by replacing 'content' with 'skin' and changing the filename. similarly, you can point to a file that is part of a locale by using 'locale' instead of 'content'. when you open a chrome url, mozilla looks through its
list of installed packages and tries to locate the jar file or directory that matches the package name and part. the mapping between chrome urls and jar files are specified in the manifest files stored in the chrome directory. if you were to move the file messenger.jar somewhere else and update the manifest file accordingly, thunderbird will still work since it doesn't rely on its specific installed l...
...e how none of the urls specify which theme or locale is used and none specify a specific directory. chrome://messenger/content/messenger.xul chrome://messenger/content/attach.js chrome://messenger/skin/icons/folder-inbox.gif chrome://messenger/locale/messenger.dtd to refer to subdirectories, you can just add them to the end of the chrome url. the following url will refer to the bookmarks window,
listed for firefox: chrome://browser/content/bookmarks/bookmarksmanager.xul you can enter chrome urls anywhere normal urls can be used. you can even enter them directly into the url bar in a firefox browser window. if you enter the url mentioned above into the browser's address bar, you should see that window appear like a web page might do and for the most part will function as if it was a separate ...
Trees and Templates - Archive of obsolete content
f:*"> <treerow> <treecell label="rdf:http://home.netscape.com/nc-rdf#name"/> <treecell label="rdf:http://home.netscape.com/web-rdf#lastmodifieddate"/> </treerow> </treeitem> </treechildren> </rule> </template> </tree> here, a tree is created with two columns, for the name and date of a file. the tree should display a
list of the files in the root directory. only one rule is used, but you may add others if needed. like with other templates, the uri attribute on an element indicates where to start generating content. the two cells grab the name and date from the datasource and place the values in the cell labels. this example shows why the uri attribute becomes useful. notice how it has been placed on the treeitem i...
...eresting part of rdf datasources is that the resource values are only determined when the data is needed. this means that values that are deeper in the resource hierarchy are not determined until the user navigates to that node in the tree. this becomes useful for certain datasources where the data is determined dynamically. sorting columns if you try the previous example, you might note that the
list of files is not sorted. trees which generate their data from a datasource have the optional ability to sort their data. you can sort either ascending or descending on any column. the user may change the sort column and direction by clicking the column headers. this sorting feature is not available for trees with static content, although you can write a script to sort the data. sorting involves th...
XUL Tutorial - Archive of obsolete content
this tutorial describes xul, the xml user-interface language. this language was created for the mozilla application and is used to describe its user interface. ...
... tabboxes grids content panels splitters toolbars and menus toolbars simple menu bars more menu features popup menus scrolling menus events and scripts adding event handlers more event handlers keyboard shortcuts focus and selection commands updating commands broadcasters and observers document object model document object model modifying a xul interface manipulating
lists box objects xpcom interfaces xpcom examples trees trees more tree features tree selection custom tree views tree view details tree box objects rdf and templates introduction to rdf templates trees and templates rdf datasources advanced rules persistent data skins and locales adding style sheets styling a tree modifying the default skin creating a skin skinning xul...
Using spell checking in XUL - Archive of obsolete content
var suggestions = {}; gspellcheckengine.suggest("kat", suggestions, {}); if (suggestions.value) { // suggestions.value is a javascript array of strings // there were suggestions.value.length suggestions fou...
... var suggestions = {}; gspellcheckengine.suggest("kat", suggestions, {}); if (suggestions.value) { // suggestions.value is a javascript array of strings // there were suggestions.value.length suggestions found } ...
XUL Changes for Firefox 1.5 - Archive of obsolete content
this
lists the most notable changes to xul in firefox 1.5 (gecko 1.8). for other changes you should be aware of, see adapting xul applications for firefox 1.5. <scrollcorner> a <scrollcorner> element is added which is used to create the small box in the intersection of the horizontal and vertical scrollbars. <rich
listbox> and <rich
listitem> the <rich
listbox> and <rich
listitem> elements are used for creating
lists containing arbitrary content. this element works similarly to the <
listbox> which is designed primarily for
lists of textual items. the <rich
listbox> supports much of the same api as the <
listbox> and single items, created with the <rich
listitem> element may be selected. see xul:rich
listbox for more information. preferences system several elements have been added which m...
...perty on a button may be used to set stock icons on a button, used on some platforms. for instance <button icon="help"> will create a button with a help icon. this is used typically on gnome systems where possible values are: accept, cancel, help, open, save, find, clear, yes, no, apply, close, print, add, remove, refresh, go-forward, go-back, properties, select-font, select-color, network. <menu
list> items in a <menu
list> support the description attribute to allow for extra descriptive text to appear beside an item's label. the menu
list modification methods appenditem and insertitemat take an extra description argument when creating items this way. <
listbox> the removeitemat method was sometime non zero-based due to a bug (bug 236068). this has been fixed in firefox 1.5 and all code depen...
XULBrowserWindow - Archive of obsolete content
the xulbrowserwindow object provides methods and properties that let the browser update the user interface of the enclosing xul window. in order to do so it implements the following interfaces: nsisupports nsixulbrowserwindow nsiwebprogress
listener nsiwebprogress
listener2 nsisupportsweakreference note: this page is not complete at this time. see the linked interfaces for the definition of the implemented methods. you may also wish to refer to the implementation of xulbrowserwindow in browser/base/content/browser.js. method overview boolean hidechromeforlocation(in string alocation); attributes attribute type description incontentwhite
list string[] an array of url strings for which chrome is automatically hidden. defaults to abo...
...you can augment the functionality of this method using chaining in order to hide chrome for other locations. see hiding browser chrome for details and an example. boolean hidechromeforlocation( in string alocation ); parameters alocation the url to check to see if chrome should be hidden while that location is displayed. ...
XUL Coding Style Guidelines - Archive of obsolete content
ace. it could contain xul specific element types for ui controls, html4 markups for content data, and even javascript for user event handling. to make xul files easy to read and maintain, localization friendly, and portable across user agents, we need to have a set of coding style guidelines to ensure our objectives are achievable. the author has collected a set of guidelines from various sources
listed in the references section. while some of the guidelines are recommended practices, the others are mandatory. xml, xul, html, and xhtml guidelines the following are considered good coding style for xml/xul documents. disobeying them might not cause any parsing error for now, however, it might cause future maintenance headache: convert html files to xul files. use the xml declaration. use name...
...k at the rest of the file. references xul is discussed in depth in xul language spec and xul window language. ...
action - Archive of obsolete content
allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
assign - Archive of obsolete content
llowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
bbox - Archive of obsolete content
llowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
binding - Archive of obsolete content
allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related tbd ...
bindings - Archive of obsolete content
llowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related tbd ...
box - Archive of obsolete content
llowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements vbox, hbox ...
broadcaster - Archive of obsolete content
llowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
broadcasterset - Archive of obsolete content
llowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
column - Archive of obsolete content
llowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements grid, columns, rows, row ...
columns - Archive of obsolete content
llowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
... ...
conditions - Archive of obsolete content
llowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
content - Archive of obsolete content
s. uri type: ? used to specify the variable name for the content. when a rule is evaluated, it scans through each resource in the rdf datasource looking for a match. each resource is placed in the variable specified in the uri attribute in turn. then, the other rules are evaluated for a match. this attribute should always be present. ...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata relacionados tbd ...
datepicker - Archive of obsolete content
1 to 12. set this property to change the selected date. year type: integer the currently selected year from 1 to 9999. set this property to change the selected year. yearleadingzero type: boolean a read only value indicating whether a leading zero should be displayed before the year when it is less than 1000. ...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related interfaces nsidomxulcontrolelement ...
deck - Archive of obsolete content
llowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related stack ...
dialogheader - Archive of obsolete content
llowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements dialog, window ...
editor - Archive of obsolete content
gethtmleditor( window ) return type: nsihtmleditor returns the html editing interface for the editor which contains methods for manipulating an html document. pass the editor's contentwindow as the argument. makeeditable( editortype, waitforload ) return type: no return value this function enables editing for an editor. specify text or html as the editortype. ...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related interfaces nsiaccessibleprovider ...
grippy - Archive of obsolete content
llowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
groupbox - Archive of obsolete content
llowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related interfaces nsiaccessibleprovider ...
hbox - Archive of obsolete content
llowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements box, vbox ...
keyset - Archive of obsolete content
llowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
member - Archive of obsolete content
llowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
menubar - Archive of obsolete content
llowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements menu, menuitem, menu
list, menupopup, menuseparator interfaces nsiaccessibleprovider ...
page - Archive of obsolete content
llowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
param - Archive of obsolete content
llowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
popupset - Archive of obsolete content
llowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements popup, menupopup ...
promptBox - Archive of obsolete content
ll you how many prompts a given tab has. note: this is largely an implementation detail; if you're developing an add-on, you shouldn't need to tinker with this. you should use the window.alert() method or the nsiprompt interface instead. see using tab-modal prompts for details. method overview nsidomelement appendprompt(args, onclosecallback); void removeprompt(nsidomelement aprompt); node
list listprompts(nsidomelement aprompt); methods appendprompt() creates a new prompt, adding it to the tab. nsidomelement appendprompt( args, onclosecallback ); parameters args arguments for the prompt. onclosecallback the callback routine to be called when the prompt is closed. return value an nsidomelement object representing the new prompt. removeprompt() removes an existing prompt. void ...
...ng it to the tab. nsidomelement appendprompt( args, onclosecallback ); parameters args arguments for the prompt. onclosecallback the callback routine to be called when the prompt is closed. return value an nsidomelement object representing the new prompt. removeprompt() removes an existing prompt. void removeprompt( nsidomelement aprompt ); parameters aprompt the prompt to dispose of.
listprompts() returns a
list of all the prompts on the tabbrowser. node
list listprompts( nsidomelement aprompt ); parameters aprompt this parameter isn't used; i don't know why it's even there. return value a node
list containing all of the prompt elements on the tabbrowser. ...
query - Archive of obsolete content
llowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
queryset - Archive of obsolete content
llowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
resizer - Archive of obsolete content
llowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
row - Archive of obsolete content
llowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
... ...
rows - Archive of obsolete content
llowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
... ...
rule - Archive of obsolete content
llowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
script - Archive of obsolete content
llowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
scrollbar - Archive of obsolete content
llowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
scrollbox - Archive of obsolete content
llowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
scrollcorner - Archive of obsolete content
llowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
separator - Archive of obsolete content
llowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
...these classes should be used instead of changing the style of the element directly since they will fit more naturally with the user's selected theme. groove a grooved separator. groove-thin a thin grooved...
spacer - Archive of obsolete content
llowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements separator, splitter ...
spinbuttons - Archive of obsolete content
llowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
splitter - Archive of obsolete content
llowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
...these classes should be used instead of changing the style of the element directly since they will fit more naturally with the user's selected theme. tree-splitter this splitter is intended to be used in tree...
stack - Archive of obsolete content
llowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related deck ...
statusbar - Archive of obsolete content
allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements statusbarpanel interfaces nsiaccessibleprovider ...
stringbundleset - Archive of obsolete content
llowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
tabpanel - Archive of obsolete content
llowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
... ...
tabpanels - Archive of obsolete content
this property. by assigning -1 to this property, all items will be deselected. returns -1 if no items are selected selectedpanel type: element holds a reference to the currently selected panel within a <tabbox> element. assigning a value to this property will modify the selected panel. a select event will be sent when the selected panel is changed. ...
... ...
template - Archive of obsolete content
llowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
textnode - Archive of obsolete content
llowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
timepicker - Archive of obsolete content
boolean a read only value indicating whether a leading zero should be displayed before the second when it is less than 10. tabindex type: integer gets and sets the value of the tabindex attribute. value type: string the currently entered time of the form hh:mm:ss. set this property to change the time. ...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related interfaces nsidomxulcontrolelement ...
titlebar - Archive of obsolete content
llowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
toolbargrippy - Archive of obsolete content
llowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements toolbar, toolbarbutton, toolbaritem, toolbarpalette, toolbarseparator, toolbarset, toolbarspacer, toolbarspring, toolbox interfaces nsiaccessibleprovider ...
toolbarseparator - Archive of obsolete content
allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements toolbar, toolbarbutton, toolbargrippy, toolbaritem, toolbarpalette, toolbarset, toolbarspacer, toolbarspring, toolbox ...
toolbarset - Archive of obsolete content
allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements toolbar, toolbarbutton, toolbargrippy, toolbaritem, toolbarpalette, toolbarseparator, toolbarspacer, toolbox ...
toolbarspacer - Archive of obsolete content
llowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements toolbar, toolbarbutton, toolbargrippy, toolbaritem, toolbarpalette, toolbarseparator, toolbarset, toolbarspring, toolbox interfaces nsiaccessibleprovider ...
toolbarspring - Archive of obsolete content
allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements toolbar, toolbarbutton, toolbargrippy, toolbaritem, toolbarpalette, toolbarseparator, toolbarset, toolbarspacer, toolbox interfaces nsiaccessibleprovider ...
treechildren - Archive of obsolete content
llowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata example <tree flex="1"> <treecols> <treecol id="sender" label="sender" flex="1"/> <treecol id="subject" label="subject" flex="2"/> </treecols> <treechildren> <treeitem> <treerow> <treecell label="joe@somewhere.com"/> <treecell label="top se...
treecols - Archive of obsolete content
llowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
... interfaces nsiaccessibleprovider ...
treeitem - Archive of obsolete content
llowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
... ...
triple - Archive of obsolete content
llowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
vbox - Archive of obsolete content
llowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements box, hbox ...
where - Archive of obsolete content
llowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addevent
listener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasat...
...me(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeevent
listener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
Debugging a XULRunner Application - Archive of obsolete content
bugger to debug your xulrunner apps. add the following code to your xul app: components.utils.import('resource://gre/modules/devtools/dbg-server.jsm'); if (!debuggerserver.initialized) { debuggerserver.init(); // don't specify a window type parameter below if "navigator:browser" // is suitable for your app. ...
... debuggerserver.addbrowseractors("myxulrunnerappwindowtype"); } debuggerserver.open
listener(6000); for xulrunner version 37+ the code to enable the debugger has changed: components.utils.import('resource://gre/modules/devtools/dbg-server.jsm'); if (!debuggerserver.initialized) { debuggerserver.init(); debuggerserver.addbrowseractors(); debuggerserver.allowchromeprocess = true; } let dbg
listener=debuggerserver.create
listener(); dbg
listener.portorpath=6000; dbg
listener.open(); add the following to your prefs.js: (in recent ffox, edit about:config instead) pref("devtools.debugger.remote-enabled", true); in firefox, go to tools > web developer > connect... and you should be able to point the debugger to your app. happy debugging :) venkman follow these instructions to install ven...
calIFileType - Archive of obsolete content
methods none. related interfaces caliimporter caliexporter example code see calhtmlexport.js. ...
...ltextension; readonly attribute astring extensionfilter; readonly attribute astring description; }; attributes defaultextension the default extension that should be associated with files of this type. extensionfilter the extension filter to use in the filepicker's filter
list. separate multiple extensions with semicolon and space. description the description to show to the user in the filter
list. methods none. related interfaces caliimporter caliexporter example code see calhtmlexport.js. ...
nsIContentPolicy - Archive of obsolete content
at implementers of this method must not do any of the following: modify the dom in any way (e.g., setting attributes is a no-no). query any dom properties that depend on layout (e.g., offset* properties). query any dom properties that depend on style (e.g., computed style). query any dom properties that depend on the current state of the dom outside the "context" node (e.g., lengths of node
lists). [javascript implementations only] access properties of any sort on any object without using xpcnativewrapper (either explicitly or implicitly). due to various dom0 things, this leads to item 4. if you do any of these things in your shouldload() implementation, expect unpredictable behavior, possibly including crashes, content not showing up, content showing up doubled, etc. if you need to d...
... in the above case depends on the precedence of installation. short shouldload( in unsigned long acontenttype, in nsiuri acontentlocation, in nsiuri arequestorigin, in nsisupports acontext, in acstring amimetypeguess, in nsisupports aextra, in nsiprincipal arequestprincipal ); parameters acontenttype the type of content being tested. this will be one one of the content types
listed above. acontentlocation the uri of the content being checked; must not be null. arequestorigin {optional_inline}} the location of the resource that initiated this load request; can be null if inapplicable. acontext {optional_inline}} the nsidomnode or nsidomwindow that initiated the request, or something that can queryinterface() to one of those; can be null if inapplicable. note: ac...
Mozilla.dev.apps.firefox-2006-09-29 - Archive of obsolete content
niversity students working on cache distribution project - looking for help for how to tap the http requests. there have been no responses so far. can't view keith olbermann videos a user inability to launch videos, worked fine for others, ended up being a flash version problem. firefox 2 on windows vista discussion about the "state of affairs" of firefox 2 on windows vista rc1 - update for rc1
listed in update history as 'install pending' right-click "copy email address" - bug 353102 a proposed bug fix to the 'copy email address' bug how to use the rss feeds discovery & parsing tool in another open source project? a user looking to be pointed in the right direction of how to use the rss feeds discovery & parsing tool. meetings none this week. authors sara minchella (sara) dave m...
...ing' right-click "copy email address" - bug 353102 a proposed bug fix to the 'copy email address' bug how to use the rss feeds discovery & parsing tool in another open source project? a user looking to be pointed in the right direction of how to use the rss feeds discovery & parsing tool. meetings none this week. authors sara minchella (sara) dave manley (senemanley) back to summary
list ...
2006-09-29 - Archive of obsolete content
niversity students working on cache distribution project - looking for help for how to tap the http requests. there have been no responses so far. can't view keith olbermann videos a user inability to launch videos, worked fine for others, ended up being a flash version problem. firefox 2 on windows vista discussion about the "state of affairs" of firefox 2 on windows vista rc1 - update for rc1
listed in update history as 'install pending' right-click "copy email address" - bug 353102 a proposed bug fix to the 'copy email address' bug how to use the rss feeds discovery & parsing tool in another open source project? a user looking to be pointed in the right direction of how to use the rss feeds discovery & parsing tool. meetings none this week. authors sara minchella (sara) dave m...
...ing' right-click "copy email address" - bug 353102 a proposed bug fix to the 'copy email address' bug how to use the rss feeds discovery & parsing tool in another open source project? a user looking to be pointed in the right direction of how to use the rss feeds discovery & parsing tool. meetings none this week. authors sara minchella (sara) dave manley (senemanley) back to summary
list ...
Monitoring plugins - Archive of obsolete content
ssive number of alert boxes are displayed. also note that in the example above an if statement first checks to see that the arriving notification's topic is the correct one. this is useful in cases where your class is registered to receive notifications for more than one topic with the observer service. ...
...tifications - your class must include an unregister method that contains the following code: var observerservice = components.classes["@mozilla.org/observer-service;1"] .getservice(components.interfaces.nsiobserverservice); observerservice.removeobserver(this, "experimental-notify-plugin-call"); skeleton observer class below is a skeleton class that you may use to
listen to runtime notifications: function pluginobserver() { this.registered = false; this.register(); //takes care of registering this class with observer services as an observer for plugin runtime notifications } pluginwatcherobserver.prototype = { observe: function(subject, topic, data) { if (topic == "experimental-notify-plugin-call") //in case your class is registered to li...
NPN_RequestRead - Archive of obsolete content
« gecko plugin api reference « plug-in side plug-in api summary requests a range of bytes from a seekable stream. this initiates a read operation; the actual data is received through subsequent calls to npp_writeready() and npp_write(). syntax #include <npapi.h> nperror npn_requestread(npstream* stream, npbyterange* range
list); parameters the function has the following parameters: stream stream of type np_seek from which to read bytes. range
list range of bytes in the form of a linked
list of npbyterange objects, each of which specifies a request for a range of bytes. returns if successful, the function returns nperr_no_error. if unsuccessful, the function returns an error code. for possible values, see error codes. description for ...
...es. description for a seekable stream, the browser sends data only in response to requests by the plug-in. the plug-in calls npn_requestread() to request data from a seekable stream. the plug-in can use this function to make one or more requests for ranges of bytes. these requests result in subsequent calls to npp_writeready() and npp_write(). for multiple requests, the function creates a linked
list of npbyterange structures, each of which represents a separate request. if the plug-in requests multiple ranges (either through a
list of npbyterange objects in a single call to npn_requestread(), or multiple calls to npn_requestread()), the browser can write individual ranges in any order, and with any number of npp_writeready() and npp_write() calls. the plug-in must allocate npbyterange object...
NPP_HandleEvent - Archive of obsolete content
npp_handleevent(npp instance, void* event); parameters the function has the following parameters: instance pointer to the current plug-in instance. event platform-specific value representing the event handled by the function. values: ms windows: pointer to npevent structure mac os: pointer to a standard mac os eventrecord unix/x11: pointer to a standard xlib xevent for a
list of possible events, see npevent. returns if the plug-in handles the event, the function should return true. if the plug-in ignores the event, the function returns false. description the browser calls npp_handleevent to tell the plug-in when events take place in the plug-in's window or drawable area. the plug-in either handles or ignores the event, depending on the value given in the even...
...returns if the plug-in handles the event, the function should return true. if the plug-in ignores the event, the function returns false. description the browser calls npp_handleevent to tell the plug-in when events take place in the plug-in's window or drawable area. the plug-in either handles or ignores the event, depending on the value given in the event parameter of this function. for a
list of event types the application is responsible for delivering to the plug-in, see the npevent structure. ms windows the browser gives each windowed plug-in its own native window, often a child window of the browser window, to draw into. the plug-in has complete control over drawing and event handling within that window. mac os the browser does not give a windowed plug-in a native window, becau...
Plugins - Archive of obsolete content
so set to be phased out in the future. note: plugins are now a legacy technology. they are not available on most mobile devices. mozilla encourages website developers to avoid using plugins wherever possible and use standard web apis instead. if there are plugin features which are not available in the web platform, we encourage developers to post their use cases to mozilla.dev.platform project
list, so that mozilla can prioritize web platform work to make those use cases possible. for more information about plugin roadmap, see non-archived plugin information. plugins are shared libraries that users can install to display content that the browser can't display natively. for example, the adobe reader plugin lets the user open pdf files directly inside the browser, and the quicktime and rea...
...ed extension for mozilla plugins recent versions of mozilla on *nix-based systems include an extension for writing plugins that use xembed instead of using the old xt-based main loop that most plugins have been using since the netscape 3.x days. categories interwiki language links join the plugin development community choose your preferred method for joining the discussion: mailing
list newsgroup rss feed ...
What is RSS - Archive of obsolete content
in you rss feed in almost any way they see fit. they can read it. they can make local copies of it. they can share that local copy. they can put it on their website. they can even re-syndicate it. and more. if you don't want any of that done, then don't put it in a non-password-protected rss feed, and, of course, don't make the password public. news web sites use rss to provide everyone with a
list of their newest articles. for example: <?xml version="1.0"?> <rss version="2.0"> <channel> <title>example news site</title> <description>this is an example news site.</description> <lastbuilddate>wed, 27 jul 2005 00:30:30 -0700</lastbuilddate> <link>http://news.example.com/</link> <item> <title>news flash: i like bread</title> <...
...for example: <?xml version="1.0"?> <rss version="2.0"> <channel> <title>joe blow's blog</title> <description>this is the weblog of joe blow</description> <lastbuilddate>sun, 15 may 2005 13:02:08 -0500</lastbuilddate> <link>http://joe-blow.example.net/</link> <item> <title>i be blogging...</title> <gui...
Why use RSS - Archive of obsolete content
ny reasons to use rss, but the two biggest reasons can be broadly dictated by: #1 (obviously only use it if) it fits your needs and #2 it has a huge amount of momentum -- everyone is using it. rss has a huge amount of momentum. people are using it to syndicate all sorts of things: news articles, blogs, bookmarks, internet radio shows, internet television shows, software updates, e-mails, mailing
lists, music play
lists, and more. if it is episodic, it can be syndicated with rss. software that reads and can make use of rss is also everywhere. mozilla firefox has some support for rss (with it's live bookmark technology.). there are too many desktop and web-based rss aggregators out there to
list them all. also, custom-made software is also making use of rss. rss aggregators are everywhere one...
...ywhere. mozilla firefox has some support for rss (with it's live bookmark technology.). there are too many desktop and web-based rss aggregators out there to
list them all. also, custom-made software is also making use of rss. rss aggregators are everywhere one reason to use rss to syndicate is because there are an enormous amount of desktop and web-based rss aggregators out there. (too many to
list.) and if you syndicate using rss, then all those desktop and web-based rss aggregators will be able to make use of and read your rss feed. ...
0.90 - Archive of obsolete content
is today.) rss 0.90 is an rdf-based format. when rss 0.90 was created, the rss initialization stood for rich site summary and not really simple syndication. (see rss - what is in a name for more info on rss's naming history.) note: rss 0.90 has been deprecated. producers of rssshould not be creating rss 0.90 feeds, andshould instead use a newer non-deprecated rss format. (see the rss versions
list for a
list of non-deprecated rss formats.) consumers of rssshould still be able to accept rss 0.90 feeds though. examples rss 0.90 looked something like this: <?xml version="1.0"?> <rdf:rdf xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://my.netscape.com/rdf/simple/0.9/" > <channel> <title>mozilla dot org</title> ...
...rather than for syndication. specification the original rss 0.90 specification has disappeared from its original location: http://my.netscape.com/publish/help/quickstart.html copies of it have been saved, and can be viewed at the following locations: http://www.purplepages.ie/rss/netscape/rss0.90.html http://web.archive.org/web/*/http://...uickstart.html ...
Vulnerabilities - Archive of obsolete content
malicious character strings and overly long values associated with known attacks. another example is a race condition error that allows the attacker to perform a specific action with elevated privileges. a security configuration setting is an element of a software’s security that can be altered through the software itself. examples of settings are an operating system offering access to control
lists that set the privileges that users have for files, and an application offering a setting to enable or disable the encryption of sensitive data stored by the application. a security configuration issue vulnerability involves the use of security configuration settings that negatively affect the security of the software. a software feature is a functional capability provided by software. a softwa...
...rability and, if a vulnerability is exploited, what the possible impact would be. website vulnerabilities owasp or open web security project is a non-profit charitable organization focused on improving the security of software and web applications. according to the open web application security project, xss was the seventh most common web app vulnerability in 2017. the organization publishes a
list of top web security vulnerabilities based on the data from various security organizations. the web security vulnerabilities are prioritized depending on exploitability, detectability and impact on software which can be any cms such as wordpress, joomla, magento, wocommerce and more. here are six of the most common website vulnerabilities you must protect yourself against. 1. sql injections 2.
Theme changes in Firefox 3 - Archive of obsolete content
theme to work properly in firefox 3. note: we could use an article called updating themes for firefox 3 that would serve as a how-to guide for updating themes. if anyone with theming experience would like to write one, please do! browser changes requiring theme updates there are a number of changed and deleted files in the browser that may require you to make changes to your theme. ...
...e, please do! browser changes requiring theme updates there are a number of changed and deleted files in the browser that may require you to make changes to your theme. the table
lists both the changed xul file and the theme's corresponding css file that you might need to update. filename css file details changes to the default theme the table below
lists changes made in the default theme for firefox 3; you can use this information as a starting point for figuring out the changes you need to make. all file
list all platforms file description of change browser/themes/*/browser/browser.css the width of the drag and drop indicator is no longer calculated during the drag (tabbrowser.xml). instead a '-moz-margin-start' prope...
References - Archive of obsolete content
<- previous section: summary of changes you can learn more on using web standards from these sites (
listed in no particular order): what are web standards and why should i use them? what are the advantages of using web standards? ...
...the webpage explains and proposes with small examples the best coding practices and most recommendable ways of developing problem-free javascript code. from matt kruse debugging html and css is a well designed website explaining well the how, why and where of html validation, css validation ...
-moz-border-bottom-colors - Archive of obsolete content
/* single <color> value */ -moz-border-bottom-colors: #f0f0f0; /* multiple <color> values */ -moz-border-bottom-colors: #f0f0f0 #a0a0a0 #505050 #000000; /* global values */ -moz-border-bottom-colors: inherit; -moz-border-bottom-colors: initial; -moz-border-bottom-colors: unset; when an element has a border that is larger than a single css pixel, each line of pixels uses the next color specified in this property, from the outside in. this eliminates the need for nested boxes. ...
...ed for nested boxes. if the border is wider than the number of specified colors, the remaining part of the border is the innermost color specified. initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete it does not apply if border-style is dashed or dotted. to tables with border-collapse: collapse. syntax values accepts a white-space separated
list of color values. <color> specifies the color of a line of pixels of the bottom border. transparent is valid. see <color> values for possible units. none default, no colors are drawn or border-color is used, if specified. formal syntax <color>+ | nonewhere <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>where <rgb()...
-moz-border-left-colors - Archive of obsolete content
/* single <color> value */ -moz-border-left-colors: #f0f0f0; /* multiple <color> values */ -moz-border-left-colors: #f0f0f0 #a0a0a0 #505050 #000000; /* global values */ -moz-border-left-colors: inherit; -moz-border-left-colors: initial; -moz-border-left-colors: unset; when an element has a border that is larger than a single css pixel, each line of pixels uses the next color specified in this property, from the outside in. this eliminates the need for nested boxes. ...
...ed for nested boxes. if the border is wider than the number of specified colors, the remaining part of the border is the innermost color specified. initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete it does not apply if border-style is dashed or dotted. to tables with border-collapse: collapse. syntax values accepts a white-space separated
list of color values. <color> specifies the color of a line of pixels of the left border. transparent is valid. see <color> values for possible units. none default, no colors are drawn or border-color is used, if specified. formal syntax <color>+ | nonewhere <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>where <rgb()> ...
-moz-border-right-colors - Archive of obsolete content
/* single <color> value */ -moz-border-right-colors: #f0f0f0; /* multiple <color> values */ -moz-border-right-colors: #f0f0f0 #a0a0a0 #505050 #000000; /* global values */ -moz-border-right-colors: inherit; -moz-border-right-colors: initial; -moz-border-right-colors: unset; when an element has a border that is larger than a single css pixel, each line of pixels uses the next color specified in this property, from the outside in. this eliminates the need for nested boxes. ...
...ed for nested boxes. if the border is wider than the number of specified colors, the remaining part of the border is the innermost color specified. initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete it does not apply if border-style is dashed or dotted. to tables with border-collapse: collapse. syntax values accepts a white-space separated
list of color values. <color> specifies the color of a line of pixels of the right border. transparent is valid. see <color> values for possible units. none default, no colors are drawn or border-color is used, if specified. formal syntax <color>+ | nonewhere <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>where <rgb()>...
-moz-border-top-colors - Archive of obsolete content
/* single <color> value */ -moz-border-top-colors: #f0f0f0; /* multiple <color> values */ -moz-border-top-colors: #f0f0f0 #a0a0a0 #505050 #000000; /* global values */ -moz-border-top-colors: inherit; -moz-border-top-colors: initial; -moz-border-top-colors: unset; when an element has a border that is larger than a single css pixel, each line of pixels uses the next color specified in this property, from the outside in. this eliminates the need for nested boxes. ...
...ed for nested boxes. if the border is wider than the number of specified colors, the remaining part of the border is the innermost color specified. initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete it does not apply if border-style is dashed or dotted. to tables with border-collapse: collapse. syntax values accepts a white-space separated
list of color values. <color> specifies the color of a line of pixels of the top border. transparent is valid. see <color> values for possible units. none default, no colors are drawn or border-color is used, if specified. formal syntax <color>+ | nonewhere <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>where <rgb()> =...
Descendants and Filters - Archive of obsolete content
<dogs> <fido color="red"/> <spike color="blue"/> </dogs> </pets>; element..fido.@color = "green"; element..spike.@color = "purple"; changes the colors of both of our pet dogs. the same rules that apply to the . operator apply to the .. operator. that is, if there are multiple descendants of the requested type, an xml
list is returned, instead of the normal element. the * selector returns all descendants in an xml
list. filters in many cases, especially with the * selector, you don't want to work with all of the nodes that would be returned by the . or .. operator. to work with only a specific subset, place a conditional in parentheses after the operator. consider var element = <dogs> <fido color="b...
...y cases, especially with the * selector, you don't want to work with all of the nodes that would be returned by the . or .. operator. to work with only a specific subset, place a conditional in parentheses after the operator. consider var element = <dogs> <fido color="brown"/> <spike color="black"/> <killer color="brown"/> </dogs>; var
list = element.*.(@color == "brown"); originally, elements.* returns a
list with all 3 dogs in it. however, only fido and killer have their color attributes as brown. the filtering conditional therefore creates a
list with just fido and killer as members. « previousnext » ...
The global XML object - Archive of obsolete content
« previous the global xml object e4x-capable javascript engines put a new property on the global object. the xml object has several properties that allow you to customize parsing and serialization of e4x. xml elements will remember the settings of the xml object from the time of their creation. extending xml.prototype xml.prototype and xml
list.prototype (xml
list.prototype is actually just xml.prototype) cannot be extended in the same conventional way as other constructors such as object. you can only define methods in xml.prototype and not fields. to add a method to xml.prototype, define xml.prototype.function::methodname or xml.prototype.function::[methodnamestring]. the following example defines the foocount() method, which returns the amount of <foo> elements in the xml: xml.
...ple defines the foocount() method, which returns the amount of <foo> elements in the xml: xml.prototype.function::foocount = function foocount() { return this..foo.length(); }; <foobar><foo/><foo/><foo/></foobar>.foocount() // returns 3 ignorecomments true by default. this property tells e4x to ignore comment nodes when serializing and filtering. this means that if ignorecomments is true, the
list returned by .comments() will be empty. observe: var element = <foo> <!-- my comment --> <bar/> </foo>; element.comments().length(); // returns 0 element.toxmlstring(); // returns <foo><bar/></foo> xml.ignorecomments = false; element = <foo> <!-- my comment --> <bar/> </foo>; element.comments().length(); // returns 1...
ECMAScript 2016 to ES.Next support in Mozilla - Archive of obsolete content
after ecmascript 2015. new versions of ecmascript specifications are released yearly. so far, es2016, es2017, and es2018 have been released. this year, the es2019 specification will be released and es2020 is the current ecmascript draft specification. you can see the latest proposals on the tc39/ecma262 github repository. a channel for feedback on ecmascript standards is es-discuss. below is a
list of features in es2016+ and what version of firefox they were implemented in. 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.getownp...
... 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 58) global_objects/regexp/dotall (not yet implemented; in other browsers) regexp lookbehind assertions (not yet implemented; in other browsers) regexp unicode property escap...
Object.observe() - Archive of obsolete content
the object.observe() method was used for asynchronously observing the changes to an object. it provided a stream of changes in the order in which they occur. however, this api has been deprecated and removed from browsers. you can use the more general proxy object instead. syntax object.observe(obj, callback[, accept
list]) parameters obj the object to be observed. callback the function called each time changes are made, with the following argument: changes an array of objects each representing a change. the properties of these change objects are: name: the name of the property which was changed. object: the changed object after the change was made. type: a string indicating the type of change taking place. one of "add", "update", or "delete". oldvalue: ...
...n array of objects each representing a change. the properties of these change objects are: name: the name of the property which was changed. object: the changed object after the change was made. type: a string indicating the type of change taking place. one of "add", "update", or "delete". oldvalue: only for "update" and "delete" types. the value before the change. accept
list the
list of types of changes to be observed on the given object for the given callback. if omitted, the array ["add", "update", "delete", "reconfigure", "setprototype", "preventextensions"] will be used. return value the object to be observed. description callback is called each time a change is made to obj, with an array of all changes in the order in which they occurred. examples loggin...
Styling the Amazing Netscape Fish Cam Page - Archive of obsolete content
ter now. </p> </div> basically, that's all that was needed. the reason for the class value being card is that the original idea was to style each fish's description like a trading card. although this design approach was abandoned fairly quickly, the class name stuck, kind of like a barnacle. giving the fish some style with the markup all set, it was time to style. the idea was to have the fish
listed in a side-by-side arrangement, sort of like a two-column table, only without the table. this was most easily accomplished by floating the div elements themselves. since i wanted them to be side by side, it was important to be sure the total width of the element boxes (including margins) was less than 50%, so the first step was this: div.card {float: left; width: 45%; margin: 1em 2% 0 2%;} b...
...ffects, if you weren't already. with just the few elements i had available in this example, there were any number of possibilities for design effects, and i think you'll find the same to be true for your own designs if you just give this sort of approach a try. - fin. - related links the amazing netscape fish cam page original document information author(s): eric meyer, standards evange
list, netscape communications last updated date: published 25 apr 2003 copyright information: copyright © 2001-2003 netscape. all rights reserved. note: this reprinted article was originally part of the devedge site. ...
Archived open Web documentation - Archive of obsolete content
znerd 04 august 2009 browser detection and cross browser support improper browser detection can lead to web maintenance nightmares. rethinking the basics of when and how to detect user agents is crucial to creating maintainable, cross browser web content. ...
... znerd 04 august 2009 browser detection and cross browser support improper browser detection can lead to web maintenance nightmares. rethinking the basics of when and how to detect user agents is crucial to creating maintainable, cross browser web content. ...
RDF in Mozilla FAQ - Archive of obsolete content
dublin core metadata vocabulary and the dmoz taxonomy. see their rdf pages for more information. if you have problems with the dmoz and chefmoz data, it's best to contact those projects directly. but if you do something interesting with this content (eg. have mozilla use it, eg. by loading chunks of it into a xul ui from a remote site), don't forget to let mozilla-rdf and the rdf interest group
lists know. those
lists would probably also be interested in tools for cleaning / re-processing / storing the dmoz data too. see the sites using odp data pages for some directories based on the odp rdf dumps. what is a datasource? rdf can generally be viewed in two ways: either as a graph with nodes and arcs, or as a "soup" of logical statements. a datasource is a subgraph (or collection of statemen...
...y, you must of course be able to express your information in terms of the rdf datasource api, either by using the built-in memory datasource, using rdf/xml to store your information, or writing your own implementation (possibly in javascript) of nsirdfdatasource. what gets loaded when i specify "datasources=" the datasources attribute on the "root" of a template specifies a whitespace-separated
list of datasource uris to load. but what is a "datasource uri"? it is either: an abbreviated contractid for a locally installed component. by specifying rdf:name, you instruct the template builder to load the xpcom component with the contractid @mozilla.org/rdf/datasource;1?name=name. the url of an rdf/xml file. for example, file:///tmp/foo.rdf chrome://mycomponent/content/component-data.rdf ht...
The Business Benefits of Web Standards - Archive of obsolete content
t, applying the markup, and adding the style. looked at in that light it may seem surprising how clean, elegant and simple the web development process really is. in a multi headed and possibly commercial environment such as a web development agency, this approach also lends itself to a very strict demarcation, between disciplines within a common framework. the content creator - who may be a journa
list, a music producer, or may come from any one of a number of disciplines; need not become involved in the actual process of publishing that content at all. and the person applying the markup need not necessarily, know (or care) how it is going to be styled. that has been the real impact of the zen garden, in helping to demonstrate the stunning results which are possible without altering the markup,...
... in 6 weeks time. furthermore by strictly marking the production process, time, budgets, and resources for both the initial development and the ongoing publishing of emerging content can be measured and controlled. this is a very powerful management tool. this is the power of web standards. it supplies a far better development framework, for content providers, for web developers, and for css sty
lists alike. it is simply not possible for everybody not to gain and share in the huge benefits of standards. customers, developers, digital media creators, can be freed from the tyranny of graphics led development, code generators, and incomprehensible markup. but the real value is at the bottom line. the message to accountants, executives and shareholders alike should be irresistible. benefits of...
XUL Parser in Python - Archive of obsolete content
warning: the content of this article may be out of date. this article is from 2000. v.00001 to celebrate activestate's recent announcement about support for perl and python in mozilla, i have put together this little python script that parses your local xul and builds a
list of all the xul elements and their attributes in an html page. with new widgets and attributes landing all the time, i wanted to get some quicker way of looking at the xul--at particular builds, at particular widgets, at which elements had which attributes, etc. the script writes out all the attributes and none of the values, but the parser itself is seeing the elements, their attributes, and the values of those attributes, and you just have to ask for them if you want them. for example, you could easily adapt...
...e filename from the calling method p.feed(data) and create a condition that only gets the elements specified in sys.argv[1]. or, since the dictionary is already storing the values of all the attributes it finds, you can write the values of a particular attribute (e.g., id) to the results file by checking the attribute in sys.argv[1]: for attr in a.keys(): if strip(attr) == sys.argv[1]: el_
list[name][strip(attr)] = strip(a[attr]) and writing thevalues to the html results file instead of thekeys: for item in elements: w.write('<tr><td class="head">' + item + '</td></tr>\n') for a in el_
list[item].values(): w.write('<tr><td class="at">' + a + '</td>') with these modifications, the script creates an output more like a periodic table of xul elements. until i spruce it up a litt...
Community - Extensions
if you know of useful mailing
lists, newsgroups, forums, or other communities related to extension development, please link to them here. ...
... if you know of useful mailing
lists, newsgroups, forums, or other communities related to extension development, please link to them here. ...
Examples - Game development
free/demo games beloola webvr platform to connect passionate people. experience both available on 2d screens and on vr hmds (settings / switch to vr mode). tanx a multiplayer tank battle game, created with playcanvas. hyper vanguard force a neat vertically scrolling space shooter. swooop a plane flying game: control your plane and collect the jewels. again, created with playcanvas. ...
...eaves, with light source shining through. created using three.js. fire walk with me billowing fire cloud effect. rainbow firestorm rainbow-coloured particles, falling like rain, bouncing around on a terrain of orbs. crowd simulation simulation of a bustling crowd of people all trying to reach their opposite positions. svg masking experiment an xray machine, creating using an svg mask. rea
listic water simulation flowing water, like the waves on the ocean. dungeon demo haxor-based dungeon scene with walkable character. massive assault tech demo rendered archipelago with futuristic military vehicles. flight stream 3d globe with simulated flight paths. webgl filters demo showing webgl filters being used to add effects to html elements. svg isometic tiles generating isometric ti...
Index - Game development
f the above, or none of them, could be best for your game. the correct decision entirely depends on the trade-offs that you are willing (and unwilling) to make. the concern is mostly with switching to another option. fortunately, i do not have any experience with this, but i have heard it is an excruciating game of whack-a-mole. 3 examples demos, example, games, web this page
lists a number of impressive web technology demos for you to get inspiration from, and generally have fun with. a testament to what can be done with javascript, webgl, and related technologies. 4 index meta found 74 pages: 5 introduction to html5 game development (summary) firefox os, games, html5, mobile games built with html5 work on smartphones, tablets, pc...
...our game is good. you have a whole lot of options to chose from with most of them being free, so it's only about your enthusiasm and available time. sometimes you have to spend more time promoting a game than actually developing it. remember that it's no use to have the best game in the world if no one knows it exists. 11 techniques for game development games, guide this page
lists essential core techniques for anyone wanting to develop games using open web technologies. 12 2d collision detection 2d, games, javascript, collision detection one of the simpler forms of collision detection is between two rectangles that are axis aligned — meaning no rotation. the algorithm works by ensuring there is no gap between any of the 4 sides of the rectangles. an...
2D collision detection - Game development
tection using the separating axis theorem sat (separating axis theorem) separating axis theorem collision performance while some of these algorithms for collision detection are simple enough to calculate, it can be a waste of cycles to test *every* entity with every other entity. usually games will split collision into two phases, broad and narrow. ...
...lit collision into two phases, broad and narrow. broad phase broad phase should give you a
list of entities that *could* be colliding. this can be implemented with a spacial data structure that will give you a rough idea of where the entity exists and what exist around it. some examples of spacial data structures are quad trees, r-trees or a spacial hashmap. narrow phase when you have a small
list of entities to check you will want to use a narrow phase algorithm (like the ones
listed above) to provide a certain answer as to whether there is a collision or not. ...
Building up a basic demo with the PlayCanvas engine - Game development
built for modern browsers, playcanvas is a fully-featured 3d game engine with resource loading, an entity and component system, advanced graphics manipulation, collision and physics engine (built with ammo.js), audio, and facilities to handle control inputs from various devices (including gamepads). that's quite an impressive
list of features — let's see some in action. we will try putting together a simple demo first — a cube rendered on the screen. if you have already worked through our building up a basic demo with three.js article (or you are familiar with other 3d libraries) you'll notice that playcanvas works on similar concepts: camera, light and objects. environment setup to start developing with playcanvas, you don't need much. you should start off by: making sure...
... beside rotation and scaling we can also move objects around the scene. add the following code to achieve that. cone.setposition(2, math.sin(timer*2), 0); this will move the cone up and down by applying the sin value to the y axis on each frame, with a little bit of adjustment to make it look cooler. try changing the value to see how it affects the animation. conclusion here's the final code
listing, along with a viewable live example: you can also see it on github and fork the repository if you want to play with it yourself locally. now you know the basics of playcanvas engine; happy experimentation! summary now you can continue reading the playcanvas editor article, go back to the building up a basic demo with playcanvas page, or go back a level higher to the main 3d games on the w...
Building up a basic demo with PlayCanvas - Game development
lished that showcase its possibilities. tanx is a multiplayer tank game where you can drive your tank around, shooting at other players as you go. swooop is a flying game where you pilot your plane around a magical island, collecting jewels and fuel as you go. visualizations like the star lord and bmw i8 also take advantage of the engine and showcase what's possible. note: check out the
list of featured demos to find more examples. engine vs editor the engine itself can be used as a standard library by including its javascript file directly in your html, so you can start coding right away; in addition the playcanvas toolset comes with an online editor that you can use to drag and drop components onto the scene — a great way to create games and other apps requiring scenes if you'...
...ut work equally well regarding achieving end goals. playcanvas engine built for modern browsers, playcanvas is a fully-featured 3d game engine with resource loading, an entity and component system, advanced graphics manipulation, collision and physics engine (built with ammo.js), audio, and facilities to handle control inputs from various devices (including gamepads). that's quite an impressive
list of features — let's see some in action, check out the building up a basic demo with playcanvas engine for details. playcanvas editor instead of coding everything from the beginning you can also use the online editor. this can be a more pleasant working environment if you are not someone who likes to code. see the building up a basic demo with playcanvas editor for details. summary of course...
Implementing controls using the Gamepad API - Game development
yout: buttons: [ 'dpad-up','dpad-down','dpad-left','dpad-right', 'start','back','axis-left','axis-right', 'lb','rb','power','a','b','x','y', ], this can be different for other types of gamepads like the ps3 controller (or a no-name, generic one), so you have to be careful and not just assume the button you're expecting will be the same button you'll actually get. next, we set up two event
listeners to get the data: window.addevent
listener("gamepadconnected", gamepadapi.connect); window.addevent
listener("gamepaddisconnected", gamepadapi.disconnect); due to security policy, you have to interact with the controller first while the page is visible for the event to fire. if the api worked without any interaction from the user it could be used to fingerprint them without their knowledge. ...
...ed; // return buttons for debugging purposes return pressed; }, on every frame, update() saves buttons pressed during the previous frame to the buttonscache array and takes fresh ones from the gamepadapi.controller object. then it loops through buttons and axes to get their actual states and values. detecting button presses the buttonpressed() method is also placed in the main game loop to
listen for button presses. it takes two parameters — the button we want to
listen to and the (optional) way to tell the game that holding the button is accepted. without it you'd have to release the button and press it again to have the desired effect. buttonpressed: function(button, hold) { var newpress = false; // loop through pressed buttons for(var i=0,s=gamepadapi.buttonsstatus.length; i...
MIME type - MDN Web Docs Glossary: Definitions of Web-related terms
ith a file indicating the type of the file (describing the content format, for example, a sound file might be labeled audio/ogg, or an image file image/png). it serves the same purpose as filename extensions traditionally do on windows. ...
... file image/png). it serves the same purpose as filename extensions traditionally do on windows. the name originates from the mime standard originally used in e-mail. ...
Request header - MDN Web Docs Glossary: Definitions of Web-related terms
re request headers. for example, the content-length appearing in a post request is actually an entity header referring to the size of the body of the request message. however, these entity headers are often called request headers in such a context. in addition, cors defines a subset of request headers as simple headers, request headers that are always considered authorized and are not explicitly
listed in responses to preflight requests. a few request headers after a get request: get /home.html http/1.1 host: developer.mozilla.org user-agent: mozilla/5.0 (macintosh; intel mac os x 10.9; rv:50.0) gecko/20100101 firefox/50.0 accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 accept-language: en-us,en;q=0.5 accept-encoding: gzip, deflate, br referer: https://developer.mozi...
..."c561c68d0ba92bbeb8b0fff2a9199f722e3a621a" cache-control: max-age=0 strictly speaking, the content-length header in this example is not a request header like the others, but an entity header: post /myform.html http/1.1 host: developer.mozilla.org user-agent: mozilla/5.0 (macintosh; intel mac os x 10.9; rv:50.0) gecko/20100101 firefox/50.0 content-length: 128 learn more technical knowledge
list of all http headers ...
MDN Web Docs Glossary: Definitions of Web-related terms
this glossary provides definitions of words and abbreviations you need to know to successfully understand and build for the web. ...
... cipher cipher suite ciphertext class client hints closure cms code splitting codec compile compile time computer programming conditional constant constructor continuous media control flow cookie copyleft cors cors-safe
listed request header cors-safe
listed response header crawler crlf cross axis cross-site scripting crud cryptanalysis cryptographic hash function cryptography csp csrf css css object model (cssom) css pixel css preprocessor d data structure ...
Mobile accessibility - Learn web development
kback off: navigate back to the talkback menu screen (using the different gestures that are currently enabled.) navigate to the slider switch and activate it to turn it off. note: you can get to your home screen at any time by swiping up and left in a smooth motion. if you have more than one home screen, you can move between them by swiping two fingers left and right. for a more complete
list of talkback gestures, see use talkback gestures. unlocking the phone when talkback is turned on, unlocking the phone is a bit different. you can do a two-finger swipe up from the bottom of the lock screen. if you've set a passcode or pattern for unlocking your device, you will then be taken to the relevant entry screen to enter it. you can also explore by touch to find the unlock button at th...
...ll stay sharp regardless of whatever size is being displayed (see adding vector graphics to the web for more details). note: we won't provide a full discussion of responsive design techniques here, as they are covered in other places around mdn (see above links). specific mobile considerations there are other important issues to consider when making sites more accessible on mobile. we have
listed a couple here, but we will add more when we think of them. not disabling zoom using viewport, it is possible to disable zoom. always ensure resizing is enabled, and set the width to the device's width in the <head>: <meta name="viewport" content="width=device-width; user-scalable=yes"> you should never set user-scalable=no if at all possible — many people rely on zoom to be able to see th...
Test your skills: WAI-ARIA - Learn web development
e interactive editors below, however it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks. if you get stuck, then ask us for help — see the assessment or further help section at the bottom of this page. wai-aria 1 in our first aria task, we present you with a section of non-semantic markup, which is obviously meant to be a
list. assuming you are not able to change the elements used, how can you allow screenreader users to recognize this as a
list? try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor. wai-aria 2 in our second wai-aria task, we present a simple search form, and we want you to add in a couple o...
...el, without explicitly adding a visible text label to the dom? try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor. wai-aria 3 for this final wai-aria task, we return to an example we previously saw in the css and javascript skilltest. as before, we have a simple app that presents a
list of animal names. clicking one of the animal names causes a further description of that animal to appear in a box below the
list. here, we are starting with a mouse- and keyboard-accessible version. the problem we have now is that when the dom changes to show a new decription, screenreaders cannot see what has changed. can you update it so that description changes are annouced by the screenread...
Backgrounds and borders - Learn web development
er the whole box, and a radial gradient with a set size, which therefore repeats. multiple background images it is also possible to have multiple background images — you specify multiple background-image values in a single property value, separating each one with a comma. when you do this you may end up with background images overlapping each other. the backgrounds will layer with the last
listed background image at the bottom of the stack, and each previous image stacking on top of the one that follows it in the code. note: gradients can be happily mixed with regular background images. the other background-* properties can also have comma-separated values in the same way as background-image: background-image: url(image1.png), url(image2.png), url(image3.png), url(image4.png); back...
...y two background-position values. the first two position values will be applied to the first two images, then they will cycle back around again — image3 will be given the first position value, and image4 will be given the second position value. let's play. in the example below i have included two images. to demonstrate the stacking order, try switching which background image comes first in the
list. or play with the other properties to change the position, size, or repeat values. background attachment another option we have available for backgrounds is specifying how they scroll when the content scrolls. this is controlled using the background-attachment property, which can take the following values: scroll: it causes the element's background to scroll when the page is scrolled. if t...
Combinators - Learn web development
nator the child combinator (>) is placed between two css selectors. it matches only those elements matched by the second selector that are the direct children of elements matched by the first. descendent elements further down the hierarchy don't match. for example, to select only <p> elements that are direct children of <article> elements: article > p in this next example, we have an unordered
list, nested inside of which is an ordered
list. i am using the child combinator to select only the <li> elements which are a direct child of a <ul>, and have given them a top border. if you remove the > that designates this as a child combinator, you end up with a descendant selector and all <li> elements will get a red border. adjacent sibling combinator the adjacent sibling selector (+) is use...
...ts, we'd do this: p ~ img in the example below we are selecting all <p> elements that come after the <h1>, and even though there is a <div> in the document as well, the <p> that comes after it is selected. using combinators you can combine any of the selectors that we discovered in previous lessons with combinators in order to pick out part of your document. for example if we want to select
list items with a class of "a", which are direct children of a <ul>, i could use the following. ul > li[class="a"] { } take care however when creating big
lists of selectors that select very specific parts of your document. it will be hard to reuse the css rules as you have made the selector very specific to the location of that element in the markup. it is often better to create a simple class a...
CSS selectors - Learn web development
1, or a class such as .special. in css, selectors are defined in the css selectors specification; like any other part of css they need to have support in browsers for them to work. the majority of selectors that you will come across are defined in the level 3 selectors specification, which is a mature specification, therefore you will find excellent browser support for these selectors. selector
lists if you have more than one thing which uses the same css then the individual selectors can be combined into a selector
list so that the rule is applied to all of the individual selectors. for example, if i have the same css for an h1 and also a class of .special, i could write this as two separate rules. h1 { color: blue; } .special { color: blue; } i could also combine these into a sele...
... h1, .special { color: blue; } white space is valid before or after the comma. you may also find the selectors more readable if each is on a new line. ...
The box model - Learn web development
r inline boxes. examples of different display types let's move on and have a look at some examples. below we have three different html elements, all of which have an outer display type of block. the first is a paragraph, which has a border added in css. the browser renders this as a block box, so the paragraph begins on a new line, and expands to the full width available to it. the second is a
list, which is laid out using display: flex. this establishes flex layout for the items inside the container, however, the
list itself is a block box and — like the paragraph — expands to the full container width and breaks onto a new line. below this, we have a block-level paragraph, inside which are two <span> elements. these elements would normally be inline, however, one of the elements has a...
...nk. you see this fairly frequently in navigation bars. the navigation below is displayed in a row using flexbox and we have added padding to the <a> element as we want to be able to change the background-color when the <a> is hovered. the padding appears to overlap the border on the <ul> element. this is because the <a> is an inline element. add display: inline-block to the rule with the .links-
list a selector, and you will see how it fixes this issue by causing the padding to be respected by other elements. test your skills! we have covered a lot in this article, but can you remember the most important information? you can find some further tests to verify that you've retained this information before you move on — see test your skills: the box model. summary that's most of what you...
Test your skills: Flexbox - Learn web development
you might use flexbox to create, your task is to build them. note: you can try out solutions in the interactive editors below, however it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks. if you get stuck, then ask us for help — see the assessment or further help section at the bottom of this page. flex layout one these
list items are the navigation for a site. they should be laid out as a row, with an equal amount of space between each item. the finished example should look like the image below. try updating the live code below to recreate the finished example: for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor. flex layout tw...
...e the navigation for a site. they should be laid out as a row, with an equal amount of space between each item. the finished example should look like the image below. try updating the live code below to recreate the finished example: for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor. flex layout two these
list items are all different sizes, but we want them to be displayed as three equal sized columns, no matter what content is in each item. try updating the live code below to recreate the finished example: additional questions: can you now make the first item twice the size of the other items? for assessment or further work purposes, download the starting point for this task to work in you...
Introduction to CSS layout - Learn web development
the elements that appear one below the other are described as block elements, in contrast to inline elements, which appear one beside the other, like the individual words in a paragraph. note: the direction in which block element contents are laid out is described as the block direction. the block direction runs vertically in a language such as english, which...
...he other is due to the fact that they are styled with display: block. if you create a link around some text inside a paragraph, that link remains inline with the rest of the text, and doesn’t break onto a new line. this is because the <a> element is display: inline by default. you can change this default display behavior. for example, the <li> element is display: block by default, meaning that
list items display one below the other in our english document. if we change the display value to inline they now display next to each other, as words would do in a sentence. the fact that you can change the value of display for any element means that you can pick html elements for their semantic meaning, without being concerned about how they will look. the way they look is something that you can cha...
Typesetting a community school homepage - Learn web development
age. make it so that links are underlined by default, but when you hover or focus them, the underline disappears. remove the default focus outline from all the links on the page. give the active state a noticeably different styling so it stands out nicely, but make it still fit in with the overall page design. make it so that external links have the external link icon inserted next to them.
lists: make sure the spacing of your
lists and
list items works well with the styling of the overall page. each
list item should have the same line-height as a paragraph line, and each
list should have the same spacing at its top and bottom as you have between paragraphs. give your
list items a nice bullet, appropriate for the design of the page. it is up to you whether you choose a custom bullet ...
... help with, in an online shareable editor (as mentioned in step 1 above). ...
Styling text - Learn web development
with the basics of the css language covered, the next css topic for you to concentrate on is styling text — one of the most common things you'll do with css. here we look at text styling fundamentals including setting font, boldness, italics, line and letter spacing, drop shadows, and other text features. we round off the module by looking at applying custom fonts to your page, and styling
lists and links. looking to become a front-end web developer? we have put together a course that includes all the essential information you need to work towards your goal. get started prerequisites before starting this module, you should already have basic familiarity with html, as discussed in the introduction to html module, and be comfortable with css fundamentals, as discussed in introduction t...
...epen or glitch. guides this module contains the following articles, which will teach you all of the essentials behind styling html text content. fundamental text and font styling in this article we go through all the basics of text/font styling in detail, including setting font weight, family and style, font shorthand, text alignment and other effects, and line and letter spacing. styling
lists
lists behave like any other text for the most part, but there are some css properties specific to
lists that you need to know about, and some best practices to consider. this article explains all. styling links when styling links, it is important to understand how to make use of pseudo-classes to style link states effectively, and how to style links for use in common varied interface features...
How do you make sure your website works properly? - Learn web development
possibly you) added a script to the page and made a mistake. this will not prevent the page from loading but you will feel something went wrong. open the console (tools ⤠web developer ⤠web console) and reload the page: in this example, we learn (quite clearly) what the error is, and we can go fix it (we will cover javascript in another series of articles). more things to check we have
listed a few simple ways to check that your website works properly, as well as the most common errors you may run across and how to fix them. you can also test if your page meets these criteria: how's the performance? does the page load fast enough? resources like webpagetest.org or browser add-ons like yslow can tell you a few interesting things: grades go from a to f. our page is just small and...
...4 time=147.857 ms ^c --- mozilla.org ping statistics --- 4 packets transmitted, 4 packets received, 0.0% packet loss round-trip min/avg/max/stddev = 147.857/148.468/148.741/0.362 ms just keep in mind a handy keyboard shortcut: ctrl+c. ctrl+c sends an “interrupt” signal to the runtime and tells it to stop. if you don't stop the runtime, ping will ping the server indefinitely. a simple check
list check for 404s make sure all webpages are behaving as you expect check your website in several browsers to make sure it renders consistently next steps congratulations, your website is up and running for anyone to visit. that's a huge achievement. now, you can start digging deeper into various subjects. since people can come to your website from all over the world, you should consider ...
How do I use GitHub Pages? - Learn web development
, rather than clicking inside a user interface. it will look something like this: note: you could also consider using a git graphical user interface to do the same work, if you feel uncomfortable with the command line. every operating system comes with a command line tool: windows: command prompt can be accessed by pressing the windows key, typing command prompt, and choosing it from the
list that appears. note that windows has its own command conventions differing from linux and os x, so the commands below may vary on your machine. os x: terminal can be found in applications > utilities. linux: usually you can pull up a terminal with ctrl + alt + t. if that doesn't work, look for terminal in an app bar or menu. this may seem a bit scary at first, but don't worry — you'll soon g...
..., for example my-repository. also fill in a description to say what your repository is going to contain. your screen should look like this: click create repository; this should bring you to the following page: uploading your files to github on the current page, you are interested in the section …or push an existing repository from the command line. you should see two lines of code
listed in this section. copy the whole of the first line, paste it into the command line, and press enter. the command should look something like this: git remote add origin https://github.com/chrisdavidmills/my-repository.git next, type the following two commands, pressing enter after each one. these prepare the code for uploading to github, and ask git to manage these files. git add --all gi...
What software do I need to build a website? - Learn web development
ng the website. all desktop operating systems come with a basic text editor. these editors are all straightforward, but lack special features for webpage coding. if you want something a bit fancier, there are plenty of third-party tools available. third-party editors often come with extra features, including syntax coloring, auto-completion, collapsible sections, and code search. ...
...ashioned, and other uploading systems are starting to become popular, such as rsync and git/github. note: ftp is inherently insecure. you should make sure your hosting provider allows use of a secure connection, e.g. sftp or rsync over ssh. uploading files to a web server is a very important step while creating a website, so we cover it in detail in a separate article. ...
Basic native form controls - Learn web development
t. in the case of checkable items, their values are sent only if they are checked. if they are not checked, nothing is sent, not even their name. if they are checked but have no value, the name is sent with a value of on. note: you can find the examples from this section on github as checkable-items.html (see it live also). for maximum usability/accessibility, you are advised to surround each
list of related items in a <fieldset>, with a <legend> providing an overall description of the
list. each individual pair of <label>/<input> elements should be contained in its own
list item (or similar). the associated <label> is generally placed immediately after the radio button or checkbox, with the instructions for the group of radio button or checkboxes generally being the content of the <legen...
...e so: <input type="file" accept="image/*;capture=camera"> <input type="file" accept="video/*;capture=camcorder"> <input type="file" accept="audio/*;capture=microphone"> common attributes many of the elements used to define form controls have some of their own specific attributes. however, there is a set of attributes common to all form elements. you've met some of these already, but below is a
list of those common attributes, for your reference: attribute name default value description autofocus false this boolean attribute lets you specify that the element should automatically have input focus when the page loads. only one form-associated element in a document can have this attribute specified. disabled false this boolean attribute indicate...
Styling web forms - Learn web development
we describe how to handle these more specific features in the article advanced form styling. the ugly some elements can't be styled thoroughly using css. these include: <input type="color"> date-related controls such as <input type="datetime-local"> <input type="range"> <input type="file"> elements involved in creating dropdown widgets, including <select>, <option>, <optgroup> and <data
list>. <progress> and <meter> again, we'll describe what can be done in terms of styling these elements in advanced form styling. the real problem with all these controls is that they have a very complex structure, and beyond some basic styling (such as changing the width or margin of the control) you generally don't have the ability to style the controls' internal components (such as the date pic...
...in terms of styling these elements in advanced form styling. the real problem with all these controls is that they have a very complex structure, and beyond some basic styling (such as changing the width or margin of the control) you generally don't have the ability to style the controls' internal components (such as the date picker calendar, or the button on the <select> that causes the options
list to display) making up those widgets. if you want to thoroughly customize those widgets, you really have to create your own using html, css, and javascript. this is beyond the scope of the core form articles, but we do look at this in an advanced article how to build custom form controls. note: there are some proprietary css pseudo-elements available that allow you to style internal components ...
Test your skills: Other controls - Learn web development
ate the finished example: download the starting point for this task to work in your own editor or in an online editor. other controls 2 now it's time to have a go at implementing a drop-down select menu, to allow a user to pick their favourite food from the choices provided. create your basic select box structure. associate it semantically with the provided "comment" label. inside the
list, split the choices up into 2 subgroups — "mains" and "snacks". try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor. other controls 3 in our final task of this set, we start with much the same
list of food choices. however, this time we want to do things differently: create a ba...
...to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor. other controls 3 in our final task of this set, we start with much the same
list of food choices. however, this time we want to do things differently: create a basic text input that is semantically associated with the provided label. put the food choices into a
list that can be associated with a form input. associate the
list with your text input, so that when you type characters, any of the
list options that match the character sequence are given in a dropdown
list as autocomplete suggestions. try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor.
Web forms — Working with user data - Learn web development
this module provides a series of articles that will help you master the essentials of web forms. web forms are a very powerful tool for interacting with users — most commonly they are used for collecting data from users, or allowing them to control a user interface. however, for historical and technical reasons it's not always obvious how to use them to their full potential. in the articles
listed below, we'll cover all the essential aspects of web forms including marking up their html structure, styling form controls, validating form data, and submitting data to the server. looking to become a front-end web developer? we have put together a course that includes all the essential information you need to work towards your goal. get started prerequisites before starting this module, y...
...tory guides easy to understand, and also be able to make use of our basic native form controls guide. mastering forms however requires more than just html knowledge — you also need to learn some specific techniques to style form controls, and some scripting knowledge is required to handle things like validation and creating custom form controls. therefore, before you look at the other sections
listed below we'd recommend that you go away and learn some css and javascript first. the above text is a good indicator as to why we've put web forms into its own standalone module, rather than trying to mix bits of it into the html, css, and javascript topic areas — form elements are more complex than most other html elements, and they also require a close marriage of related css and javascript t...
Getting started with the Web - Learn web development
p the tools you need to construct a simple webpage and publish your own simple code. the story of your first website it's a lot of work to create a professional website, so if you're new to web development, we encourage you to start small. you won't build another facebook right away, but it's not hard to get your own simple website online, so we'll start there. by working through the articles
listed below in order, you will go from nothing to getting your first webpage online. let's begin our journey! installing basic software when it comes to tools for building a website, there's a lot to pick from. if you're just starting out, you might be confused by the array of code editors, frameworks, and testing tools out there. in installing basic software, we show you step-by-step how to instal...
...emble these files into a sensible structure and make sure they can talk to one another. dealing with files explains how to set up a sensible file structure for your website and what issues you should be aware of. html basics hypertext markup language (html) is the code that you use to structure your web content and give it meaning and purpose. for example, is my content a set of paragraphs or a
list of bullet points? do i have images inserted on my page? do i have a data table? without overwhelming you, html basics provides enough information to make you familiar with html. css basics cascading stylesheets (css) is the code that you use to style your website. for example, do you want the text to be black or red? where should content be drawn on the screen? what background images and colors...
Use JavaScript within a webpage - Learn web development
t usually, you'll be writing scripts in their own .js files. if you want to execute a .js script from your webpage, just use <script> with an src attribute pointing to the script file, using its url: <script src="path/to/my/script.js"></script> writing javascript within html you may also add javascript code between <script> tags rather than providing an src attribute. ...
...ork in your favor, it's worth knowing about certain best practices for adding javascript: make all content available as (structured) text. rely on html for your content as much as possible. for example, if you've implemented a nice javascript progress bar, make sure to supplement it with matching text percentages inside the html. likewise, your drop-down menus should be structured as unordered
lists of links. make all functionality accessible from the keyboard. let users tab through all controls (e.g., links and form input) in a logical order. if you use pointer events (like mouse events or touch events), duplicate the functionality with keyboard events. test your site using a keyboard only. don't set nor even guess time limits. it takes extra time to navigate with the ke...
Creating hyperlinks - Learn web development
lly styled in a different color and underlined (this convention generally shouldn't be broken, as users are used to it). keep your link label as short as possible — this is helpful because screen readers need to interpret the entire link text. minimize instances where multiple copies of the same text are linked to different places. this can cause problems for screen reader users, if there's a
list of links out of context that are labeled "click here", "click here", "click here". use relative links wherever possible from the description above, you might think that it's a good idea to just use absolute links all the time because they don't break when a page is moved like relative links. however, you should use relative links wherever possible when linking to other locations within the sam...
...ti-page website. this is one common way in which a website is created — the same page structure is used on every page, including the same navigation menu, so when links are clicked it gives the impression that you are staying in the same place, and different content is being brought up. you'll need to make local copies of the following four pages, all in the same directory. for a complete file
list, see the navigation-menu-start directory: index.html projects.html pictures.html social.html you should: add an unordered
list in the indicated place on one page that includes the names of the pages to link to. a navigation menu is usually just a
list of links, so this is semantically ok. change each page name into a link to that page. copy the navigation menu across to each page. o...
Document and website structure - Learn web development
n>, with various content subsections represented by <article>, <section>, and <div> elements. sidebar: <aside>; often placed inside <main>. footer: <footer>. active learning: exploring the code for our example our example seen above is represented by the following code (you can also find the example in our github repository). we'd like you to look at the example above, and then look over the
listing below to see what parts make up what section of the visual. <!doctype html> <html> <head> <meta charset="utf-8"> <title>my page title</title> <link href="https://fonts.googleapis.com/css?family=open+sans+condensed:300|sonsie+one" rel="stylesheet" type="text/css"> <link rel="stylesheet" href="style.css"> <!-- the below three lines are a fix to get html5 semantic element...
...ontact information available in the footer on each page. note down what you want to have common to every page. next, draw a rough sketch of what you might want the structure of each page to look like (it might look like our simple website above). note what each block is going to be. now, brainstorm all the other (not common to every page) content you want to have on your website — write a big
list down. next, try to sort all these content items into groups, to give you an idea of what parts might live together on different pages. this is very similar to a technique called card sorting. now try to sketch a rough sitemap — have a bubble for each page on your site, and draw lines to show the typical workflow between pages. the homepage will probably be in the center, and link to most if n...
Adding vector graphics to the Web - Learn web development
h: 98%; } body { margin: 10px; background: #f5f9fa; } const textarea = document.getelementbyid('code'); const reset = document.getelementbyid('reset'); const solution = document.getelementbyid('solution'); const output = document.queryselector('.output'); let code = textarea.value; let userentry = textarea.value; function updatecode() { output.innerhtml = textarea.value; } reset.addevent
listener('click', function() { textarea.value = code; userentry = textarea.value; solutionentry = htmlsolution; solution.value = 'show solution'; updatecode(); }); solution.addevent
listener('click', function() { if(solution.value === 'show solution') { textarea.value = solutionentry; solution.value = 'hide solution'; } else { textarea.value = userentry; solution.value = ...
...ution.value = 'show solution'; updatecode(); }); solution.addevent
listener('click', function() { if(solution.value === 'show solution') { textarea.value = solutionentry; solution.value = 'hide solution'; } else { textarea.value = userentry; solution.value = 'show solution'; } updatecode(); }); const htmlsolution = ''; let solutionentry = htmlsolution; textarea.addevent
listener('input', updatecode); window.addevent
listener('load', updatecode); // stop tab key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { const scrollpos = textarea.s...
From object to iframe — other embedding technologies - Learn web development
h: 98%; } body { margin: 10px; background: #f5f9fa; } const textarea = document.getelementbyid('code'); const reset = document.getelementbyid('reset'); const solution = document.getelementbyid('solution'); const output = document.queryselector('.output'); let code = textarea.value; let userentry = textarea.value; function updatecode() { output.innerhtml = textarea.value; } reset.addevent
listener('click', function() { textarea.value = code; userentry = textarea.value; solutionentry = htmlsolution; solution.value = 'show solution'; updatecode(); }); solution.addevent
listener('click', function() { if(solution.value === 'show solution') { textarea.value = solutionentry; solution.value = 'hide solution'; } else { textarea.value = userentry; solution.value = ...
...ame src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d37995.65748333395!2d-2.273568166412784!3d53.473310471916975!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x487bae6c05743d3d%3a0xf82fddd1e49fc0a1!2sthe+lowry!5e0!3m2!1sen!2suk!4v1518171785211" width="600" height="450" frameborder="0" style="border:0" allowfullscreen>\n</iframe>'; let solutionentry = htmlsolution; textarea.addevent
listener('input', updatecode); window.addevent
listener('load', updatecode); // stop tab key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { const scrollpos = textarea.s...
Video and audio content - Learn web development
on about them. ...
...g <source> elements—by calling the element's load() method: const mediaelem = document.getelementbyid("my-media-element"); mediaelem.load(); detecting track addition and removal you can monitor the track
lists within a media element to detect when tracks are added to or removed from the element's media. for example, you can watch for the addtrack event being fired on the associated audiotrack
list object (retrieved via htmlmediaelement.audiotracks) to be informed when audio tracks are added to the media: const mediaelem = document.queryselector("video"); mediaelem.audiotracks.onaddtrack = function(event) { audiotrackadded(event.track); } you'll find more information about this in our trackevent documentation. displaying video text tracks now we'll discuss a slightly more advanced co...
Object prototypes - Learn web development
you will however also see some other members — tostring, valueof, etc — these are defined on person1's prototype object's prototype object, which is object.prototype. what happens if you call a method on person1, which is actually defined on object.prototype? for exa...
...ct. for example, try person1.__proto__ and person1.__proto__.__proto__ to see what the chain looks like in code! since ecmascript 2015, you can access an object's prototype object indirectly via object.getprototypeof(obj). the prototype property: where inherited members are defined so, where are the inherited properties and methods defined? if you look at the object reference page, you'll see
listed in the left hand side a large number of properties and methods — many more than the number of inherited members we saw available on the person1 object. some are inherited, and some aren't — why is this? as mentioned above, the inherited ones are the ones defined on the prototype property (you could call it a sub-namespace) — that is, the ones that begin with object.prototype., and not th...
Implementing feature detection - Learn web development
ue, then check to see if the value is retained. see dive into html5 <input> types detection test. note: the double not in the above example (!!) is a way to force a return value to become a "proper" boolean value, rather than a truthy/falsy value that may skew the results. the dive into html5 detecting html5 features page has a lot more useful feature detection tests besides the ones
listed above, and you can generally find a feature detection test for most things by searching for "detect support for your-feature-here" in your favorite search engine. bear in mind though that some features, however, are known to be undetectable — see modernizr's
list of undetectables. matchmedia we also wanted to mention the window.matchmedia javascript feature at this point too. this is a prop...
...e blobconstructor blob-constructor cookies cors ...and loads more values!> it now contains a large number of classes that indicate the support status of different technology features. as an example, if the browser didn't support flexbox at all, <html> would be given a class name of no-flexbox. if it did support modern flexbox, it would get a class name of flexbox. if you search through the class
list, you'll also see others relating to flexbox, like: flexboxlegacy for the old flexbox spec (2009). flexboxtweener for 2011 in between syntax supported by ie10. flexwrap for the flex-wrap property, which isn't present in some implementations. note: you can find a
list of what all the class names mean — see features detected by modernizr. moving on, let's update our css to use modernizr ...
Package management basics - Learn web development
ce to shine. 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". this makes a lot of sense as we want to reduce file size and thus make our app load as quickly as possible. different tooling will let you tree shake in different ways. although the
list grows by the month, there are three main offerings for tools that generate bundles from our source code: webpack, rollup, and parcel. there will be more available than this, but these are popular ones: the rollup tool offers tree shaking and code splitting as it’s core features. webpack requires some configuration (though “some” might be understating the complexity of some developers’...
...ortant lesson is to learn what the tool you select is capable of. a rough guide to package manager clients this tutorial installed the parcel package using npm, but as mentioned earlier on there are some alternatives and it's worth at least knowing they exist and having some vague idea of the common commands across the tools. you've already seen some in action, but lets look at the others. the
list will grow over time, but at time of writing, the following main package managers are available: npm at npmjs.org pnpm at pnpm.js.org yarn at yarnpkg.com npm and pnpm are similar from a command line point of view — in fact pnpm aims to have full parity over the argument options that npm offers. it differs in that it uses a different method for downloading and storing the packages on your ...
Learn web development
b development, our common questions section may have something to help you. random glossary entry semantics in programming, semantics refers to the meaning of a piece of code — for example "what effect does running that line of javascript have?", or "what purpose or role does that html element have" (rather than "what does it look like?".) topics covered the following is a
list of all the topics we cover in the mdn learning area. getting started with the web provides a practical introduction to web development for complete beginners. html — structuring the web html is the language that we use to structure the different parts of our content and define what their meaning or purpose is. this topic teaches html in detail. css — styling the web css is the languag...
...e scripting language used to add dynamic functionality to web pages. this topic teaches all the essentials needed to become comfortable with writing and understanding javascript. web forms — working with user data web forms are a potent tool for interacting with users — most commonly, they are used for collecting data from users, or allowing them to control a user interface. in the articles
listed below, we'll cover all the essential aspects of structuring, styling, and interacting with web forms. accessibility — make the web usable by everyone accessibility is the practice of making web content available to as many people as possible regardless of disability, device, locale, or other differentiating factors. this topic gives you all you need to know. web performance — making webs...
CSUN Firefox Materials
of intrusions such as popup ads and spyware. the simple, uncluttered user interface is simply more pleasant. as a result, nearly everyone who tries firefox finds themselves hooked.. assistive technology support on windows "i am a full firefox convert with the release of 1.5. at my next opportunity, i intend to convert my family over to it too. " -- darren paskell, from window-eyes beta testing
list firefox works with popular screen readers, with the best support currently coming from gw micro's window-eyes 5.5. jaws support is quickly catching up as well. in recent articles from both afb's access world and nfb's voice of the nation's blind, reviewers found no significant roadblocks in moving to firefox from internet explorer for screen reader users. in fact, the same keyboard commands are ...
...pieces of text to the clipboard. the f7 key toggles this feature on/off. tabbed browsing helps keyboard users by putting all of the browsed documents in one firefox application window rather than cluttering the alt+tab order which makes keyboard navigation within the entire windows os much simpler. both history and bookmarks can be searched with a "quick search" field that quickly narrows the
list down via a substring search. bookmarks can have a keyword assigned to them which can be typed into the address bar to bring up the bookmark. a "smart keywords" feature enhances this even further by allowing custom searches from the command line such as "word punditry" to look up the word "punditry" in an online dictionary. these smart keywords can be setup via the context menu for the search fi...
Accessibility and Mozilla
ch as possible, convenient to use for people with disabilities. mozilla strives to make its software accessible; the documents below cover the ways in which we do so. these articles provide mozilla-specific details about accessibility. accessibility api cross-referencethis cross-reference helps us see the difference between today's accessibility api's. all accessibility apis to date define a
list of possible object roles, or general types, such as button, menu item, text, etc. they also define a
list of possible object states, such as focused, read-only, checked, etc.accessibility features in firefoxfirefox works with popular screen readers, with the best support currently coming from gw micro's window-eyes 5.5. we are optimistic that jaws support will catch up this year. in recent articl...
...urrently under construction. this developer's guide lays out general guidelines that assistive technology (at) developers can use in developing live region support. this guide was written from an atk/at-spi point of view as part of the orca live region support project. however, many of the concepts were also used during the development of firevox, an at using iaccessible2.accessible toolkit check
listplease contact the mozilla accessibility community with questions or feedback.csun firefox materialsfirefox 1.5 is a fast, free, standards compliant web browser which is rapidly gaining recognition for its fresh, streamlined approach to browsing the web. in addition to winning major awards such as pc world product of the year, firefox has attracted a huge following among savvy users who simply car...
Application cache implementation overview
to a redirect, the update fails and completely rollbacks any changes made (i.e. all files downloaded are deleted and the new cache version is discarded.) an md5 hash is then calculated from the manifest content we download from the server to be compared to existing md5 (in case of an “update”). during the load, manifest is parsed according the “parsing the cache manifest” html5 spec, and
lists of entries and namespaces are collected. after the manifest fetch is done, nsofflinecacheupdate::loadcompleted() is called. nsofflinecacheupdate::loadcompleted() is called for each finished entry load, including the manifest and is the main place handling each update state as following: on checking state, a state the update is at after manifest parsing has been done, loadcompleted checks...
...for each finished entry load, including the manifest and is the main place handling each update state as following: on checking state, a state the update is at after manifest parsing has been done, loadcompleted checks whether the new hash, i.e. the manifest content, differs or this is just “first download”. if so, the update switches to downloading state and fetches in parallel items
listed in the manifest by call to nsofflinecacheupdate::processnexturi(). if the new hash is identical, update invokes onnoupdate event and is 'finished'. then it associates any documents waiting for this update to finish with the current existing nsiapplicationcache. if the manifest load failed, onerror event is invoked and the update 'finishes'. the parallel load is implemented by asynch...
Continuous Integration
one of several actions, including backing out a patch which caused the problem and closing the tree (i.e., preventing any additional commits). results in treeherder are ordered by mercurial pushes. each taskcluster job is represented by a colored label; green means a job has succeeded, while other colors represent different kinds of problems. the label text indicates the job type. for a full
list of job types, see the help menu in treeherder's upper-right corner. below is a
list of the most common. builds b - normal build jobs; these jobs perform compilation and some compiled-code tests (e.g., 'make check'). be - b2g build jobs for engineering builds; user builds are denoted with b, the same as for desktop and android builds. n and ne - nightly build jobs; these jobs are similar to...
...ly be expanded with support for android. post-job analysis and alerts there is some analysis of test data that occurs out-of-band after jobs complete. perfherder alerts we track changes to talos and other performance frameworks inside perfherder, and try to automatically alert when there is a sustained change exceeding a certain magnitude (specified per test). performance sheriffs review the
list of alerts on a regular basis and file bugs if appropriate. you can view the current set of alerts on the perfherder alerts dashboard. intermittent failures after functional tests complete, test log data are combined with treeherder's failure classification data. the result is the treeherder intermittent failures view. the "orange factor" is the average number of intermittent test failures that ...
Eclipse CDT Manual Setup
roject with existing code". in the "import existing code" window that opens, enter a meaningful project name that identifies your mozilla source tree, set the code location to the root of your source tree, select an appropriate toolchain (e.g., "macosx gcc"), and click finish. the status bar at the bottom right of the window should now show that eclipse is "refreshing the workspace" (gathering a
list of all the files in the source tree). click on the little green button beside this message to open the "progress" tab, and keep an eye on the "refreshing workspace" item as you continue with the steps below. (if an "indexing" item starts after the "refreshing the workspace" item has finished, click the little red box beside that item to cancel it, since we want to configure the project before the...
...for a full rebuild of the index. once the indexer has finished (keep an eye on the progress tab), sanity check that everything went as it should have by right-clicking the project in the project explorer tab and selecting "index > search for unresolved includes". if you get many more than 2000 unresolved includes (as of may 2012), then things have gone pretty wrong. you should be able to use the
list of unresolved includes to help figure out what the problem is (see also the parser errors section for more troubleshooting tips). assuming everything went as expected, you should now find that eclipse's code assistance works a whole lot better. :-) to test out the code assistance, see the code assistance subsection of the usage tips section below. to improve code assistance even more, see the h...
Commenting IDL for better documentation
the middle of the definitions of apis. if an interface is used as a parameter or as the type of the value returned by a method, please use the full name of the interface in the description of the method. this will help the tools generate proper links to help make the documentation easier to read and browse through. special commands you can use special commands in your doxygen comments; the ones
listed below are interpreted by our tools. using these will help generate much higher quality documentation, faster, with less human intervention required. command details @brief description please only use this to provide a brief description of the interface, keep it short and to the point. do not include more than one brief per interface. @param parameter description every parameter of a meth...
...to be included in the remarks section of the documentation. note: this is not yet supported by our documentation tool. using it will make it easier for documenters. @see description either an interface or a html link. note: this is not yet supported by our documentation tool. using it will make it easier for documenters. - or . used at the beginning of a comment line to indicate an unordered
list item. there must be a space between the
list marker and the item. nested
lists should be indented from the previous level by two spaces. -# used at the beginning of a comment line to indicate an ordered
list item. there must be a space between the
list marker and the item. nested
lists should be indented from the previous level by two spaces. other tips some other helpful writing style tips ...
Limitations of frame scripts
frame scripts run with system privileges and have access to the components object, enabling them to use xpcom objects and jsms. many privileged apis will just work in a content process. anything that just manipulates data structures will just work. xhr and workers will work. however, some apis that work in the chrome process will not work in a frame script. this article
lists the most important of these apis. file i/o you should not write to or read from the disk from a frame script, in particular, the profile directory. even if this is possible, you should not do it and may expect that it could stop working at any time. file i/o should all be done in the chrome process. for example: nsifileinputstream nsifileoutputstream constructing a file from a string or nsifile (but file ob...
...xhr, for example). there is a shim for this that makes the content of about: pages registered by the add-on transparently available in the content process. to avoid the shim: if you need to access the content of your about page from the content process, you need to register the nsiaboutmodule in the content process as well as the chrome process. by default, about: pages (except for a small white
list) are loaded in the chrome process when browsed to from the awesomebar. javascript code modules (jsms) in multiprocess firefox, a jsm loaded into the content process does not share any state with the same jsm loaded into the chrome process. see the entry in the limitations on chrome scripts page. ...
Tracking Protection
ou can access console output using the remote debugger. click the ā symbol in the address bar to view information about the currently loaded page. the popup that appears will notify you when content has been blocked. you will also be able to disable tracking protection entirely if you choose by accessing the tracking settings. if tracking cookies were present, you would be able to view the
list by clicking on "blocking tracking cookies" in the above image to view the following popup: you can click "manage content blocking" to change the blocking settings: how does firefox choose what to block? content is blocked based on the domain from which it is to be loaded. firefox ships with a
list of sites which have been identified as engaging in cross-site tracking of users. when tracki...
... sites that track users are most commonly third-party advertising and analytics sites. ...
mozbrowsericonchange
read only boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. details read only object a custom object. details the details property returns an anonymous javascript object with the following properties: href a domstring representing the path to the new icon. ...
... href a domstring representing the path to the new icon. sizes a domstring
listing the sizes the new icon is available in, e.g. "16x16" or "16x16 32x32". the any keyword can also be used, to represent "any size." rel a domstring representing the rel attribute value from the <link> element used to link to the icon. ...
mozbrowserloadend
and reload (r), as appropriate. in addition, the background of the controls ui bar is changed to the background color of the site that has just loaded, to provide a more integrated experience. when the front page of https://developer.mozilla.org is loaded, for example, the e.detail.backgroundcolor value reported is rgb(0, 83, 159). ...
...when the front page of https://developer.mozilla.org is loaded, for example, the e.detail.backgroundcolor value reported is rgb(0, 83, 159). ...
mozbrowserloadstart
boolean whether the event normally bubbles or not. cancelable read only boolean whether the event is cancellable or not. example in this example the mozbrowserloadend and mozbrowserloadstart events are used to change the icon shown on the stop/reload button between stop (x) and reload (r), as appropriate. ...
... whether the event is cancellable or not. example in this example the mozbrowserloadend and mozbrowserloadstart events are used to change the icon shown on the stop/reload button between stop (x) and reload (r), as appropriate. ...
Chrome-only CSS reference
-moz-window-draggingthe -moz-window-dragging css property specifies whether a window is draggable or not. ...
... -moz-window-draggingthe -moz-window-dragging css property specifies whether a window is draggable or not. ...
Geckoview-Junit Tests
written for geckoview. by default, tests are from org.mozilla.geckoview.test. these tests run on an android device, controlled by a host (typically linux) using mozdevice (adb). in automation, tests normally run in an android emulator. running tests locally if desired, connect an android device to your computer, or start an emulator, and make sure your device is visible to adb: $ adb devices
list of devices attached emulator-5554 device if no device is found, 'mach geckoview-junit' will offer to start an emulator. before running tests, install the androidtest apk on your device; otherwise, 'mach geckoview-junit' will offer to install it. mozilla-central$ mach install --app org.mozilla.geckoview.test to run all tests: mozilla-central$ mach geckoview-junit to run just one class of...
...note that unlike robocop tests, <class> needs to be specified using the fully qualified class name including the package, e.g. org.mozilla.geckoview.test.contentdelegatetest. to run just one test: mozilla-central$ mach geckoview-junit <class>#<test> to run more than one test: mozilla-central$ mach geckoview-junit <class1>#<test1> <class2>#<test2> mach geckoview-junit also supports running a
list of tests that are specified in a text file. each test must be
listed on its own line. for example: <class1>#<test1> <class2> <class3>#<test2> <class3>#<test3> to run the tests specified in the file: mozilla-central$ mach geckoview-junit --test-filters-file <path-to-filter-file> disabling one failing test there is no manifest
listing the geckoview junit tests. to disable a single test, ed...
How to get a stacktrace for a bug report
requirements you need a binary build of firefox from mozilla.org. seamonkey and thunderbird also support crash reporting. mozilla's crash report server currently only has debug information for mozilla builds and thus the crash reporter cannot work if you use a build from a linux distribution or if you compile from source code. in these cases you will need to use one of the alternative methods
listed below. note: when filing a crash report, it is important to know whether the crash occurs with firefox safe mode. this helps engineers determine whether a particular extension or plugin is the cause of the crash. how to get a crash id with the mozilla crash reporter 1. crash and submit a report to the system. the mozilla crash reporter window should automatically come up a...
...er should now submit the crash report and firefox should open again. the "details" button gives additional data about the incident, however this is not useful in a bug report. 2. tell us the id of the report you submitted. to access all of your submitted reports type "about:crashes" into the firefox address bar and press enter. firefox should open a
list of ids for your submitted crash reports. copy two or three of the ids for the appropriate crashes and paste them into your bugzilla report. please check the
listed times to avoid copying the id of an unrelated crash report. you can prefix a "bp-" to the beginning of an id to make bugzilla turn it into a link: bp-a70759c6-1295-4160-aa30-bc4772090918 how to get the cras...
IPDL Tutorial
orts built-in and custom primitive types, as well as unions and arrays. the built-in simple types include the c++ integer types (bool, char, int, double) and xpcom string types (nsstring, nscstring). ipdl imports these automatically because they are common, and because the base ipc library knows how to serialize and deserialize these types. see ipc/ipdl/ipdl/builtin.py for the most up-to-date
list of automatically imported types. actors may be passed as parameters. the c++ signature will accept a pprotocolparent* on one side and convert it to a pprotocolchild* on the other. maybe types if you want to pass a potentially undefined argument, you can add ? postfix after the type name. then you can pass a mozilla::maybe object instead of a concrete value. protocol pmaybe { child: async ma...
...ing a plugin instance, the browser should block until instance creation is finished, and needs some information returned from the plugin: sync protocol pplugininstance { child: sync init() returns (bool windowless, bool ok); }; we added two new keywords to the plugin protocol, sync and returns. sync marks a message as being sent synchronously. the returns keyword marks the beginning of the
list of values that are returned in the reply to the message. async message return values bug 1313200 introduced the ability to use returns with async messages: protocol pplugininstance { child: async asyncinit() returns (bool windowless, bool ok); async otherfunction() returns (bool ok); }; for the caller side, each async message messagename with a returns block will generate two overloa...
JavaScript-DOM Prototypes in Mozilla
me (function) text_node (number property, constant) ... all those properties come from the interfaces that the c++ image object (nshtmlimageelement) implements and chooses to expose to xpconnect through the object's class info. one of these interfaces is nsidomhtmlimageelement, others are nsidomnshtmlimageelement (netscape extensions to the standard interface), nsidomeventtarget, nsidomevent
listener, nsidom3node, and so on. the prototype object that xpconnect creates for the classes that have class info are shared within a scope (window). because of this, the following holds true (assuming img1 and img2 are two different image objects in the same document): img1.__proto__ === img2.__proto__ if img1 would come from one document and img2 from another document, then the above would not ...
...pecial meaning to the dom code. the two types of "global names" are class constructor names and class prototype names. what's the difference? class constructor names are names of real classes, and class prototype names are names of "classes" that are inherited by real classes, but are not real classes. a few examples of class constructor names would be htmlimageelement, htmldocument, element, node
list, and two examples of class prototype names would be node and characterdata. this registration is done with the nsscriptnamespacemanager, which is in charge of keeping track of what names are registered in the global namespace, and what kinds of names those names are (i.e. class constructor name, class prototype name). when a class constructor name is registered (nsglobalnamestruct::etypeclasscon...
Code Samples
add-on components.utils.import("resource://gre/modules/addonmanager.jsm"); addonmanager.getaddonbyid("youraddon@youraddon.com", function(addon) { addon.uninstall(); }); disable an add-on components.utils.import("resource://gre/modules/addonmanager.jsm"); addonmanager.getaddonbyid("youraddon@youraddon.com", function(addon) { if (addon.isactive) addon.userdisabled = addon.isactive; });
listening for add-on uninstall this example sets a variable beinguninstalled that you can check when you get a profile-before-change message to do cleanup for your add-on on uninstall. var beinguninstalled; let
listener = { onuninstalling: function(addon) { if (addon.id == "youraddon@youraddon.com") { beinguninstalled = true; } }, onoperationcancelled: function(addon) { if (...
...ction(addon) { if (addon.id == "youraddon@youraddon.com") { beinguninstalled = true; } }, onoperationcancelled: function(addon) { if (addon.id == "youraddon@youraddon.com") { beinguninstalled = (addon.pendingoperations & addonmanager.pending_uninstall) != 0; } } } try { components.utils.import("resource://gre/modules/addonmanager.jsm"); addonmanager.addaddon
listener(
listener); } catch (ex) {} ...
Add-on Repository
the add-on repository is responsible for finding available add-ons; it provides an interface for interacting with the addons.mozilla.org (amo) site. its api provides urls that can be visited to browse the repository's add-ons. the api also offers two ways to search for and retrieve an array of addon instances: retrieverecommendedaddons(), which returns a
list of recommended add-ons, and searchaddons(), which performs a search of the repository. these searches are asynchronous; results are passed to the provided searchcallback object when the search is completed. results passed to the searchcallback object only include add-ons that are compatible with the current application and are not already installed or in the process of being installed. addonrepository can only process one search at a ti...
...earchterms ); parameters searchterms search terms used to search the repository. return value the url of the search results page for the specified search terms. cancelsearch() cancels the search in progress. does nothing if there is no search in progress. void cancelsearch(); parameters none. retrieverecommendedaddons() begins a search for recommended add-ons in the repository. the
list of recommended add-ons frequently changes. results will be passed to the given searchcallback callback. void retrieverecommendedaddons( in integer maxresults, in searchcallback callback ); parameters maxresults the maximum number of results to return. callback the searchcallback callback to which results will be delivered. searchaddons() begins a search for add-ons in this reposito...
Download
a new download object can be created using the downloads.createdownload() function. ...
... the application to be used to launch the target file, or null if the file should be launched with the default application associated with the contenttype property or the extension of the target file. onchange function this can be set to a function that is called after other properties change. warning: this property cannot be used if the download is part of a download
list. progress read only number progress percent, from 0 to 100. intermediate values are reported only if hasprogress is true. note: you shouldn't rely on this property being equal to 100 to determine whether the download is completed. you should use the individual state properties (for example, the succeeded property) instead. saver read only downlo...
FxAccountsOAuthClient.jsm
izationendpoint ); parameters client_id - oauth id returned from client registration. state - oauth state value that will be returned to the client as-is upon redirection. oauth_uri - the fxa oauth api server uri, versioned. example: "https://oauth.accounts.firefox.com/v1" content_uri - the fxa content server uri. example: "https://accounts.firefox.com" [optional] scope - a colon-separated
list of scopes that the user has authorized. [optional] action - if provided, should be either "signup" or "signin". parameters set of parameters to initialize the firefox accounts oauth flow. authorizationendpoint optional optional authorization endpoint for the oauth server. default: /authorization return value a newly created fxaccountsoauthclient object implementing the methods...
...parameters to initialize the firefox accounts oauth flow. authorizationendpoint optional optional authorization endpoint for the oauth server. default: /authorization return value a newly created fxaccountsoauthclient object implementing the methods described in this article. methods launchwebflow() opens a new tab at the firefox accounts oauth authorization url. registers a webchannel
listener and sets up a callback if needed. parameters none teardown() call this function to manually release all channels and callbacks that are in use by this client. parameters none examples using the fxaccountsoauthclient chrome code let parameters = { oauth_uri: oauth_server_endpoint, client_id: oauth_client_id, content_uri: content_server_url, state: oauth_state } let clien...
Services.jsm
le, to obtain a reference to the preferences service: var prefsservice = services.prefs; provided service getters service accessor service interface service name androidbridge nsiandroidbridge 1 appinfo nsixulappinfo nsixulruntime application information service appshell nsiappshellservice application shell service block
list nsiblock
listservice block
list service cache nsicacheservice cache service cache2 nsicachestorageservice cache storage service clipboard nsiclipboard clipboard console nsiconsoleservice error console service contentprefs nsicontentprefservice content preferences service cookies nsicookiemanager2 cookie ...
...er.jsm dirsvc nsidirectoryservice nsiproperties directory service domstoragemanager nsidomstoragemanager dom storage manager domrequest nsidomrequestservice domrequest service downloads nsidownloadmanager download manager droppedlinkhandler nsidroppedlinkhandler dropped link handler service els nsievent
listenerservice event
listener service etld nsieffectivetldservice effectivetld service focus nsifocusmanager focus manager io nsiioservice nsiioservice2 i/o service locale nsilocaleservice locale service logins nsiloginmanager password manager service metro nsiwinmetroutils 2 mm nsimessagebroa...
Webapps.jsm
vitiesforapps: function(aappstoregister, arunupdate) _registeractivities: function(amanifest, aapp, arunupdate) _createactivitiestounregister: function(amanifest, aapp, aentrypoint) _unregisteractivitiesforapps: function(aappstounregister) _unregisteractivities: function(amanifest, aapp) _processmanifestforids: function(aids, arunupdate) observe: function(asubject, atopic, adata) addmessage
listener: function(amsgnames, aapp, amm) removemessage
listener: function(amsgnames, amm) formatmessage: function(adata) receivemessage: function(amessage) getappinfo: function getappinfo(aappid) broadcastmessage: function broadcastmessage(amsgname, acontent) registerupdatehandler: function(ahandler) unregisterupdatehandler: function(ahandler) notifyupdatehandlers: function(aapp, amanifest, azi...
...mes, amm) formatmessage: function(adata) receivemessage: function(amessage) getappinfo: function getappinfo(aappid) broadcastmessage: function broadcastmessage(amsgname, acontent) registerupdatehandler: function(ahandler) unregisterupdatehandler: function(ahandler) notifyupdatehandlers: function(aapp, amanifest, azippath) _getappdir: function(aid) _writefile: function(apath, adata) doget
list: function() doexport: function(amsg, amm) doimport: function(amsg, amm) doextractmanifest: function(amsg, amm) dolaunch: function (adata, amm) launch: function launch(amanifesturl, astartpoint, atimestamp, aonsuccess, aonfailure) close: function close(aapp) canceldownload: function canceldownload(amanifesturl, aerror) startofflinecachedownload: function(amanifest, aapp, aprofiledir, aisup...
JavaScript code modules
xtensions, in order to avoid code duplication. general topics using javascript code modules an introduction to how to use javascript code modules. components.utils.import how to import a javascript code module. components.utils.unload how to unload a javascript code module. code snippets: modules examples of how to use code modules. mozilla labs js modules this page features a
list of javascript modules, along with download links and documentation, that extension developers can use in their code. standard code modules addonmanager.jsm an interface to install, manage, and uninstall add-ons. addonrepository.jsm provides a search of add-ons in the repository. assert.jsm implements the commonjs unit testing specification version 1.1, which provides a basic standar...
...itor and lets you interact with it. sqlite.jsm a promise-based api to mozistorage/sqlite. task.jsm implements a subset of task.js to make sequential, asynchronous operations simple, using the power of javascript's yield operator. timer.jsm a pure js implementation of window.settimeout. webapps.jsm provides an interface to manage open web apps. webrequest.jsm provides an api to add event
listeners for the various stages of making an http request. the event
listener receives detailed information about the request, and can modify or cancel the request. xpcomutils.jsm contains utilities for javascript components loaded by the js component loader. ...
Application Translation with Mercurial
ra this should proceed pretty fast. on windows, you can paste the url by calling the paste command from the window menu in the upper left corner of the window. configuring your mercurial user settings still in the command prompt, go to your home directory in the file system, e.g. for a windows user, it looks like c:\users\myname , depending on your windows version: cd /c/users/myname now
list all the files here: ls -a if there is no file called .hgrc , create it with > .hgrc this file stores your general mercurial settings (mercurial is the tool which manages the source code and its history of changes). now go in the file system to the file and open it in your favorite text editor. windows users can use e.g. notepad++. paste the following content into the file: [ui] username = ...
...he localization status page and click on the '<number> missing' label of the firefox branch on which you want to translate, e.g. fx_aurora. the page which opens has a bar holding information about how many texts (strings) have already been translated, how many there are in english and your locale and have the same text, and how many are missing in your local. the interesting part follows below as
list of missing texts. the first line shows the locale for which the texts are being translated (in this example: de - german). with the second line start the file paths of the files which require changes. the file paths follow the directory structure of the locale repository downloaded for translation. in this example, the file aboutdialog can be found in the folder browser/chrome/browser/. the te...
Localization content best practices
or 'the file' works well in english but is likely to cause severe headaches for localizers if the placeholders cannot be inflected. use proper plural forms firefox supports proper plural forms. as a native english speaker, you might find it natural to use delete-cookie = delete cookie delete-cookies = delete cookies in firefox this should be # localization note (delete-cookies): semi-colon
list of plural forms. # see: http://developer.mozilla.org/en/docs/localization_and_plurals # #1 is the number of cookies to delete # example: delete-cookies = delete #1 cookie;delete #1 cookies important: always include the localization note with this format if you use a plural form in firefox. this comment is used by tools to identify strings with plural forms. one last advice: never use plural f...
...o identify bugs, involving new strings, that will land late in the cycle, typically after soft string freeze in firefox os. alias :l10n the :l10n alias on bugzilla (community@localization.bugs) is followed by some localizers and it could be cc'd to gather opinions from the wider l10n community (no point in opening needinfo or requiring actions from this alias). there is also a dev-l10n mailing
list and a l10n-community chat room on matrix; they might be a good place to ask questions. ...
Localizing extension metadata on addons.mozilla.org
each extension. this data describes the extension, and doesn't necessarily change with each revision (but it can). the localizable data fields of an extension are: name homepage summary description eula privacy policy version notes developer comments when you submit a new extension to amo, the process is divided into several steps. in step 2, you'll be asked to provide the attributes
listed above in the add-on's default locale (selected in step 1). the values you provide here are used as fallback values if someone requests a language that doesn't exist. step 4 allows you to translate any of the above fields into any other language amo supports. remember, all fields are optional when localizing. any field that is blank will just show up in the default locale. getting translation ...
......
Patching a Localization
existing localization. the steps below are fairly generic; for the most part they apply to creating l10n patches for firefox, thunderbird, seamonkey, or calendar. i'll use firefox in the example below to help you understand the general steps to creating a l10n patch. prerequisites if you are to the point that you are patching existing localizations, we assume that you have the basic set of tools
listed on the l10n prerequisites wiki page. if you do not have these tools, take a few steps back, grab a cookie (because, let's face it, you deserve it for all of your work), and visit the l10n prerequisites page. there you'll learn what tools you need, where to find them, and how to install them. get the source first, you need to get the source for the localization in question using its two or three...
...a-aurora/gl now that you have the code and your working directory, edit the dtd and properties files to make your necessary changes. creating a l10n patch you've made your changes, now create your patch. navigate to your working localization directory. cd ~/localization-workdir/gl create a patch (also known as a diff) using the diff command. hg diff this command creates a patch and
lists your modifications through displaying the differences in a unified patch's files. these modifications are printed to stdout (standard output). visually inspect your modifications. a good patch only contains those changes that you intended to make. if it contains more, you'll likely regress something else. alternatively, you can select specific files for diff to evaluate and print (see b...
Release phase
mit, outgoing, and push you should try to commit your work regularly as you progress through the localization files. keep in mind that the hg commit command will save your changes locally (in the local clone). with the hg push command you can send the changesets to the remote server. here's how that's done: run this command to see recent commits in your local clone: $ hg log -l 3 you should a
list of the most recent commits, similar to this one: changeset: 0:7c543e8f3a6a tag: tip user: your name <email@example.com> date: mon nov 23 18:08:25 2009 +0100 summary: added search bar strings now run the hg outgoing command to compare the local repository on your machine with the remote repository on hg.mozilla.org. the hg outgoing command compares the two reposito...
...ost recent commits, similar to this one: changeset: 0:7c543e8f3a6a tag: tip user: your name <email@example.com> date: mon nov 23 18:08:25 2009 +0100 summary: added search bar strings now run the hg outgoing command to compare the local repository on your machine with the remote repository on hg.mozilla.org. the hg outgoing command compares the two repositories and
lists all changesets that are present locally, but not in the remote repository. these changesets will need to be pushed to the remote repository. the output will look something like this: comparing with ssh://hg.mozilla.org/releases/l10n-central/x-testing searching for changes changeset: 0:7c543e8f3a6a tag: tip user: your name <email@example.com> date: mon nov 23 18:08:25 200...
Localization technical reviews
directory doesn't contain garbage. compare-locale we run the compare-locales tool on the new locale to get the statistics on translation of strings and report basic errors. defines.inc the file for each app (like browser/defines.inc) contains the names of all contributors that a localization team would like to credit the work to. localizers can specify the team responsible for the work by
listing the name just after the moz_langpack_creator. the team can also wrap contributors with <em:contributor> tags just after the moz_langpack_contributors section. make sure that the the text content is wrapped with emptylines. leading comments are ok, but watch out for #filter emptylines #define ... # comment #define ... #unfilter emptylines in toolkit/defines.inc, the native name of the lang...
...lkit/defines.inc, the native name of the language is specified, which is used as description for the built language packs. region.properties though locales might like to specify changes from the beginning, the region.properties files will be reverted to en-us. changes will be discussed in productization bugs filed for each locale. search plugins similar to the region.properties files, the
list.txt file should be reverted to en-us and amended accordingly as the search plugin productization bugs are completed. for this initial review, all xml files should be removed. string lengths in pipnss.properties there are some character limits in the security/manager/chrome/pipnss/pipnss.properties file that you should be aware of. it is best to look into each of these files to see if the local...
Fonts for Mozilla's MathML engine
re that the fonts are known by your system. typically, use a fontconfig configuration /etc/fonts/conf.avail/09-texlive-fonts.conf that points to the opentype directory of texlive, such as: <?xml version="1.0"?> <!doctype fontconfig system "fonts.dtd"> <fontconfig> <dir>/your/path/to/texmf-dist/fonts/opentype</dir> </fontconfig> finally, add this configuration file to the system font location
list and regenerate the fontconfig cache: ln -sf /etc/fonts/conf.avail/09-texlive-fonts.conf /etc/fonts/conf.d/ fc-cache -sf android you must use the mathml-fonts add-on. note: there is an enhancement request opened on the noto bug tracker to improve math support. firefox os you must use the mathml-fonts add-on. note: we plan to bundle a math font in the default installation. other system...
...ll pages with mathml content. a better alternative on unix systems is to install the otf files for latin modern math and stix into some local font folder and (if necessary) to run fc-cache on it. on os x and linux, the standard paths are ~/library/fonts/ and ~/.fonts. fonts with a math table you can actually render mathml using any font with a math table and related open font format features. a
list of such math fonts is provided below. you can use the advanced font preference menu to configure the default font for mathematics. alternatively, you can try the mathml-fontsettings add-on. asana math cambria math dejavu math tex gyre garamond math (under development) latin modern math libertinus math lucida bright math minion math stix math tex gyre bonum math tex gyre pagella math ...
Using the viewport meta tag to control layout on mobile browsers
web developers control the viewport's size and scale. many other mobile browsers now support this tag, although it is not part of any web standard. apple's documentation does a good job explaining how web developers can use this tag, but we had to do some detective work to figure out exactly how to implement it in fennec. for example, safari's documentation says the content is a "comma-delimited
list," but existing browsers and web pages use any mix of commas, semicolons, and spaces as separators. learn more about viewports in different mobile browsers in a tale of two viewports at quirksmode.org. viewport basics a typical mobile-optimized site contains something like the following: <meta name="viewport" content="width=device-width, initial-scale=1"> the width property controls the size ...
...-scale values to 0.86. the result is horizontal scroll is suppressed in any orientation and the user can zoom in if they want to. <meta name="viewport" content="width=device-width, initial-scale=0.86, maximum-scale=3.0, minimum-scale=0.86"> common viewport sizes for mobile and tablet devices if you want to know what mobile and tablet devices have which viewport widths, there is a comprehensive
list of mobile and tablet viewport sizes here. this gives information such as viewport width on portrait and landscape orientation as well as physical screen size, operating system and the pixel density of the device. specifications specification status comment css device adaptationthe definition of '<meta name="viewport">' in that specification. working draft non-n...
Mozilla Port Blocking
ult port blocking rules, you can either change the port of your service to a unblocked value (recommended if possible) or ask your mozilla users to enable the port. for details on which ports are blocked and how to override the blocking see below. modifying mozilla's port blocking at run time users can modify the default port blocking through the addition of preferences containing comma delimited
lists of port numbers to the user.js file (for single users with the user_pref(…) command) in the user's profile directory. see the example below. additionaly administrators can edit the all.js file (for multi-user systems with pref(…) ) in the defaults/pref/ sub-directory in the installation directory. enabling ports user_pref("network.security.ports.banned.override, "port1,port2"); disabling po...
...ings to do allow user preference to override default port blocking. currently you need to add preferences to either user.js or all.js. see bug 85601. per protocol port blocking/enabling preferences. better user interface allow the user to decide if the blocking is really required. some kind of way to manage the ports which are blocked. more information nsioservice.cpp gbadport
list bug 83401 vulnerability note vu#476267 dougt@netscape.com original document information author(s): doug turner last updated date: august 15, 2007 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Mozilla projects on GitHub
there are a number of tools and services whose code is hosted on github. this article offers a quick guide for getting started with mozilla code on github. it also
lists some interesting github repositories containing mozilla project code. getting started you can look at code on github without an account. that is the first thing to know. to do more—to contribute to the code, or to fork it and start your own project based on mozilla-related code—you need a github account. to learn more about setting up a github account, visit the github website. ...
...at is the first thing to know. to do more—to contribute to the code, or to fork it and start your own project based on mozilla-related code—you need a github account. to learn more about setting up a github account, visit the github website. most mozilla project code is located in repositories within the mozilla github organization. this is a great place to start looking for any projects not
listed below. projects this
listing covers the larger-scale and more important mozilla projects on github. it does not include everything since it's hard to keep track of all the smaller projects. look to github for the most complete
list of mozilla projects on github. project name description pdf.js a portable document format (pdf) reader written entirely in javascript.
Activity Monitor, Battery Status Menu and top
brid proxy measure of power consumption. careful investigation indicates that on mac os 10.10 and 10.11 it is computed with a formula that is machine model-specific, and includes the following factors: cpu usage, wakeup frequency, quality of service class usage, and disk, gpu, and network activity. the weightings of each factor can be found in one of the the files in /usr/share/pmenergy/mac-<id>.p
list, where <id> can be determined with the following command. ioreg -l | grep board-id in contrast, on mac os 10.9 it is computed via a simpler machine model-independent formula that only factors in cpu usage and wakeup frequency. in both cases "energy impact" often correlates poorly with actual power consumption and should be avoided in favour of direct measurements that have clear physical meani...
...cate that it is almost certainly using the same "energy impact" formula to compute the "average energy impact", using measurements from the past 8 hours of wake time (i.e. if a laptop is closed for several hours and then reopened, those hours are not included in the calculation.) battery status menu when you click on the battery icon in the os x menu bar you get a drop-down menu that includes a
list of “apps using significant energy”. this is crude but prominent, and therefore worth understanding — even though it's not much use for profiling applications. when you open this menu for the first time in a while it says “collecting power usage information” for a few seconds, and if you have top open during that time you'll see that, once again, systemstats is running and using a lot...
Gecko Profiler FAQ
mstange and ehsan tried to respond to some of the questions in advance in writing, and you can find the answers below. is it possible to locate hot spots occurring within a single function? the gecko profiler currently doesn’t have the ability to show you information about line numbers, neither for js code nor for native code. for js code, the profiler platform doesn’t capture any information about lines. it only knows what function was executed and what line this function starts at. for native code, the profiler captures the necessary information but doesn’t have a way to display it. ...
...actually means the percentage of the running time? the percentage of samples with stacks under this stack. how you identify a user action in the main thread we’re missing ui for this at the moment. the profile contains markers for dom events, and those include user-generated events like mouse clicks, but these markers are only exposed as a huge unsearchable
list in the markers tab. 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. what is a suggested comprehensive performance analysis workflow for code changes that impact ui? [mstange] i don’t know if anybody has written down such a workflow. ...
Profiling with Xperf
fault, in c:\program files\microsoft windows performance toolkit. either run these commands from there, or add the directory to your path. you will need to use an elevated command prompt to start or stop profiling. start recording data: xperf -on latency -stackwalk profile "latency" is a special provider name that turns on a few predefined kernel providers; run "xperf -providers k" to view a full
list of providers and groups. you can combine providers, e.g., "xperf -on diageasy+file_io". "-stackwalk profile" tells xperf to capture a stack for each profile event; you could also do "-stackwalk profile+file_io" to capture a stack on each cpu profile tick and each file io completion event. stop: xperf -d out.etl view: xperfview out.etl the msdn "quickstart" page goes over this in more detail, and ...
...te main.etl and heap.etl. note that it's possible to capture even more data for the non-heap profile; for example, you might want to be able to correlate heap events with performance data, so you can do "xperf -on base -stackwalk profile". in the viewer, when summary data is viewed for heap events (heap allocations outstanding, etc. all lead to the same summary graphs), 3 types of allocations are
listed -- aifi, aifo, aofi. this is shorthand for "allocated inside, freed inside", "allocated inside, freed outside", "allocated outside, freed inside". these refer to the time range that was selected for the summary graph; for example, something that's in the aofi category was allocated before the start of the selected time range, but the free event happened inside. tips in the summary views, th...
Patches and pushes
now that you've made your productization selections, you may be interested in learning the technical aspects behind productization by creating a productization patch. below you'll find instructions on creating a patch and pushing it to your repository. patchify search plugins are found in browser/searchplugins. each plugin is stored as an xml file, with
list.txt containing the names of each plugin. here is an example search plugin file using french yahoo. <searchplugin xmlns="http://www.mozilla.org/2006/browser/search/"> <shortname>yahoo</shortname> <description>yahoo search</description> <inputencoding>utf-8</inputencoding> <image width="16" height="16">data:image/x-icon;base64,r0lgodlheaaqajecap8aaaaaap///waaach5baeaaaialaaaaaaqabaaaaipli+py+0nogquybdened2khkffwuamezmpzsfmaihphrrg...
...ference following the above example. for references on how each tag functions, visit the opensearch wiki page and the mozsearch wiki page. the pages are old (i mean, firefox 2???), but still accurate. each plugin has an icon image which is linked within the xml file as an uri id. upload your plugins icon image to data kitchen to obtain its uri id and add to the xml file within the image tag. in
list.txt, add the search plugin's xml filename (without extensions) on a new line and save. note that if your team selects a local version of an already default plugin (e.g., wikipedia), the xml filename should include the locale code (e.g., wikipedia-es). create a patch of the searchplugins directory by entering the following command in your command-line tool, where mypatch.diff is where you give yo...
Nonblocking IO In NSPR
mode of a socket is committed, it cannot be changed. 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. so at that point we must determine whether to associate the socket with the i/o completion or not, and that decision cannot be changed later. there is a second constraint, due to the use of nt asynchronous i/o and the recycling of used sockets: the new socket returned by <tt>pr...
... the nt i/o completion port. so at that point we must determine whether to associate the socket with the i/o completion or not, and that decision cannot be changed later. there is a second constraint, due to the use of nt asynchronous i/o and the recycling of used sockets: the new socket returned by <tt>pr_accept()</tt> or <tt>pr_acceptread()</tt> inherits the blocking/nonblocking io mode of the
listening socket and this cannot be changed. the socket returned by <tt>pr_accept()</tt> or <tt>pr_acceptread()</tt> on a blocking,
listening socket may be a recycled socket previously used in a <tt>pr_transmitfile()</tt> call. since <tt>pr_transmitfile()</tt> only operates in blocking mode, this recycled socket can only be reused in blocking mode, hence the above constraint. because these constraints...
Optimizing Applications For NSPR
verflow on win16. make sure all possible values of your printn variables are within 2^16. win-95 the win-95 version of nspr should really be labeled win-32. the same library will work on either win-nt or win-95. win-95 nspr uses native threads as nspr threads. generally speaking, the native threads (on nt or '95) are quite functional. however, having lots of them (100s or even 1000s) is unrea
listic. <tt>pr_interrupt()</tt> is not implemented. win-nt the win-nt port of nspr takes advantage of some of the features of nt that are not available in win-95, such as fibers and asynch i/o. the implementation is well suited for high performance application, such as a server, but clients may find the win-95 version more suited (and adequate) for interactive applications such as are prevalent on...
...fiber abstraction as the locally scheduled threads. the fibers are nice because much of the nt api understands them. but they are not really preemptable, and that can lead to problems, depending on the needs of your application. the mode (blocking or nonblocking) of a socket cannot be changed at will once the socket has been used. also, the new socket created by an <tt>pr_accept()</tt> call on a
listening socket inherits the mode of the
listening socket, and cannot be changed. a file descriptor is not usable after an io operation on it fails with either <tt>pr_io_timeout_error</tt> or <tt>pr_io_interrupt_error</tt>. the only thing you can do is to close the file descriptor. see the faq article for more info. there is no current workaround. you must write your program with this restriction in...
NSS 3.30 release notes
.g. only an ecdsa certificate) is configured. rsa-pss signatures produced by key pairs with a modulus bit length that is not a multiple of 8 are now supported. the pk12util tool now supports importing and exporting data encrypted in the aes based schemes defined in pkcs#5 v2.1. bugs fixed in nss 3.30 this bugzilla query returns all the bugs fixed in nss 3.30: https://bugzilla.mozilla.org/bug
list.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.30 compatibility nss 3.30 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.30 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis...
...xed&classification=components&query_format=advanced&product=nss&target_milestone=3.30 compatibility nss 3.30 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.30 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions
listed in nss public functions will remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with bugzilla.mozilla.org (product nss). ...
NSS 3.32 release notes
1c:d8:59:77:c4:59:fb:5a:f9:6a:3d:f0:54:08:20:d0:f4:b8:60:78:75:e5:8f bugs fixed in nss 3.32 nss versions 3.28.x, 3.29.x. 3.30.x and 3.31.x contained a bug in function cert_comparename, which caused the first rdn to be ignored. nss version 3.32 fixed this bug. (cve-2018-5149, bug 1361197) this bugzilla query returns all the bugs fixed in nss 3.32: https://bugzilla.mozilla.org/bug
list.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.32 compatibility nss 3.32 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.32 shared libraries, without recompiling, or relinking. furthermore, applications that restrict their use of nss ap...
...d&classification=components&query_format=advanced&product=nss&target_milestone=3.32 compatibility nss 3.32 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.32 shared libraries, without recompiling, or relinking. furthermore, applications that restrict their use of nss apis to the functions
listed in nss public functions will remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with bugzilla.mozilla.org (select the product 'nss'). ...
NSS 3.36.1 release notes
a, was increased to one million iterations. that change had caused an interoperability regression with operating systems that are limited to 600 k iterations. nss 3.36.1 has been changed to use the same 600 k limit. bugs fixed in nss 3.36.1 certain smartcard operations could result in a deadlock. this bugzilla query returns all the bugs fixed in nss 3.36.1: https://bugzilla.mozilla.org/bug
list.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.36.1 compatibility nss 3.36.1 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.36.1 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of ns...
...assification=components&query_format=advanced&product=nss&target_milestone=3.36.1 compatibility nss 3.36.1 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.36.1 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions
listed in nss public functions will remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with bugzilla.mozilla.org (product nss). ...
NSS 3.36.2 release notes
lity is introduced in this release. this is a patch release to fix regression bugs. bugs fixed in nss 3.36.2 bug 1462303 - connecting to a server that was recently upgraded to tls 1.3 would result in a ssl_rx_malformed_server_hello error. bug 1460673 - fix a rare bug with pkcs#12 files. this bugzilla query returns all the bugs fixed in nss 3.36.2: https://bugzilla.mozilla.org/bug
list.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.36.2 compatibility nss 3.36.2 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.36.2 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of ns...
...assification=components&query_format=advanced&product=nss&target_milestone=3.36.2 compatibility nss 3.36.2 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.36.2 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions
listed in nss public functions will remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with bugzilla.mozilla.org (product nss). ...
NSS 3.36 release notes
illa.org/pub/mozilla.org/security/nss/releases/nss_3_36_rtm/src/ (make a link) new in nss 3.36 new functionality experimental apis for tls session cache handling. notable changes in nss 3.36 replaced existing vectorized chacha20 code with verified hacl* implementation. bugs fixed in nss 3.36 this bugzilla query returns all the bugs fixed in nss 3.36: https://bugzilla.mozilla.org/bug
list.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.36 compatibility nss 3.36 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.36 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis...
...xed&classification=components&query_format=advanced&product=nss&target_milestone=3.36 compatibility nss 3.36 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.36 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions
listed in nss public functions will remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with bugzilla.mozilla.org (product nss). ...
NSS 3.37.1 release notes
lity is introduced in this release. this is a patch release to fix regression bugs. bugs fixed in nss 3.37.1 bug 1462303 - connecting to a server that was recently upgraded to tls 1.3 would result in a ssl_rx_malformed_server_hello error. bug 1460673 - fix a rare bug with pkcs#12 files. this bugzilla query returns all the bugs fixed in nss 3.37.1: https://bugzilla.mozilla.org/bug
list.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.37.1 compatibility nss 3.37.1 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.37.1 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of ns...
...assification=components&query_format=advanced&product=nss&target_milestone=3.37.1 compatibility nss 3.37.1 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.37.1 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions
listed in nss public functions will remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with bugzilla.mozilla.org (product nss). ...
NSS 3.38 release notes
e asn.1 code. nss automatically enables caching for sql database storage on linux, if it is located on a network filesystem that's known to benefit from caching. when repeatedly importing the same certificate into an sql database, the existing nickname will be kept. bugs fixed in nss 3.38 this bugzilla query returns all the bugs fixed in nss 3.38: https://bugzilla.mozilla.org/bug
list.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.38 compatibility nss 3.38 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.38 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis...
...xed&classification=components&query_format=advanced&product=nss&target_milestone=3.38 compatibility nss 3.38 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.38 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions
listed in nss public functions will remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with bugzilla.mozilla.org (product nss). ...
NSS 3.40 release notes
d environments. the following ca certificates were removed: cn = visa ecommerce root sha-256 fingerprint: 69fac9bd55fb0ac78d53bbee5cf1d597989fd0aaab20a25151bdf1733ee7d122 bugs fixed in nss 3.40 bug 1478698 - ffdhe key exchange sometimes fails with decryption failure this bugzilla query returns all the bugs fixed in nss 3.40: https://bugzilla.mozilla.org/bug
list.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.40 compatibility nss 3.40 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.40 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis...
...xed&classification=components&query_format=advanced&product=nss&target_milestone=3.40 compatibility nss 3.40 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.40 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions
listed in nss public functions will remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with bugzilla.mozilla.org (product nss). ...
NSS 3.41.1 release notes
ew functionality is introduced in this release. this is a patch release to fix bugs. 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. thanks to hanno böck and damian poddebniak for the discovery and fixes. (cve-2018-18508) this bugzilla query returns all bugs fixed in 3.41.1: https://bugzilla.mozilla.org/bug
list.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.41.1 compatibility nss 3.41.1 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.41.1 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of ns...
...assification=components&query_format=advanced&product=nss&target_milestone=3.41.1 compatibility nss 3.41.1 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.41.1 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions
listed in nss public functions will remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with bugzilla.mozilla.org (product nss). ...
NSS 3.41 release notes
a program linked with older nss 3.x shared libraries will work with nss 3.41 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis...
...xed&classification=components&query_format=advanced&product=nss&target_milestone=3.41 compatibility nss 3.41 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.41 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions
listed in nss public functions will remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with bugzilla.mozilla.org (product nss). ...
NSS 3.42.1 release notes
nss 3.42.1 bug 1507135 and bug 1507174 - add additional null checks to several cms functions to fix a rare cms crash. thanks to hanno böck and damian poddebniak for the discovery and fixes. this was originally announced in nss 3.42, but was mistakenly not included in the release. (cve-2018-18508) this bugzilla query returns all the bugs fixed in nss 3.42.1: https://bugzilla.mozilla.org/bug
list.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.42.1 compatibility nss 3.42.1 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.42.1 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of ns...
...assification=components&query_format=advanced&product=nss&target_milestone=3.42.1 compatibility nss 3.42.1 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.42.1 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions
listed in nss public functions will remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with bugzilla.mozilla.org (product nss). ...
NSS 3.42 release notes
ons to fix a rare cms crash. thanks to hanno böck and damian poddebniak for the discovery and fixes. note: this was mistakenly not in release 3.42, and is instead in nss 3.42.1. bug 1513913 - a fix for solaris where firefox 60 core dumps during start when using profile from version 52 this bugzilla query returns all the bugs fixed in nss 3.42: https://bugzilla.mozilla.org/bug
list.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.42 compatibility nss 3.42 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.42 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis...
...xed&classification=components&query_format=advanced&product=nss&target_milestone=3.42 compatibility nss 3.42 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.42 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions
listed in nss public functions will remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with bugzilla.mozilla.org (product nss). ...
NSS 3.43 release notes
for nss-policy-check bug 1531074 - fix a deref after a null check in seckey_setpublicvalue bug 1517714 - properly handle esni with hrr bug 1529813 - expose hkdf-expand-label with mechanism bug 1535122 - align tls 1.3 hkdf trace levels bug 1530102 - use getentropy on compatible versions of freebsd. this bugzilla query returns all the bugs fixed in nss 3.43: https://bugzilla.mozilla.org/bug
list.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.43 compatibility nss 3.43 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.43 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis...
...xed&classification=components&query_format=advanced&product=nss&target_milestone=3.43 compatibility nss 3.43 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.43 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions
listed in nss public functions will remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with bugzilla.mozilla.org (product nss). ...
NSS 3.44.2 release notes
44_2_rtm/src/ other releases are available in nss releases. new in nss 3.44.2 no new functionality is introduced in this release. bugs fixed in nss 3.44.2 bug 1582343 - soft token mac verification not constant time bug 1577953 - remove arbitrary hkdf output limit by allocating space as needed this bugzilla query returns all the bugs fixed in nss 3.44.2: https://bugzilla.mozilla.org/bug
list.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.44.2 compatibility nss 3.44.2 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.44.2 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of ns...
...assification=components&query_format=advanced&product=nss&target_milestone=3.44.2 compatibility nss 3.44.2 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.44.2 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions
listed in nss public functions will remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with bugzilla.mozilla.org (product nss). ...
NSS 3.44.3 release notes
leases are available in nss releases. new in nss 3.44.3 no new functionality is introduced in this release. bugs fixed in nss 3.44.3 bug 1579060 - don't set the constructed bit for issueruniqueid and subjectuniqueid in mozilla::pkix cve-2019-11745 - encryptupdate should use maxout, not block size this bugzilla query returns all the bugs fixed in nss 3.44: https://bugzilla.mozilla.org/bug
list.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.44 compatibility nss 3.44.3 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.44.3 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss ...
...classification=components&query_format=advanced&product=nss&target_milestone=3.44 compatibility nss 3.44.3 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.44.3 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions
listed in nss public functions will remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with bugzilla.mozilla.org (product nss). ...
NSS 3.56 release notes
ot_istokenpresent. bug 1653975 - fix 3.53 regression by setting "all" as the default makefile target. bug 1659792 - fix broken libpkix tests with unexpired paypal cert. bug 1659814 - fix interop.sh failures with newer tls-interop commit and dependencies. bug 1656519 - update nspr dependency to 4.28. this bugzilla query returns all the bugs fixed in nss 3.56: https://bugzilla.mozilla.org/bug
list.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.56 compatibility nss 3.56 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.56 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis...
...xed&classification=components&query_format=advanced&product=nss&target_milestone=3.56 compatibility nss 3.56 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.56 shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions
listed in nss public functions will remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with bugzilla.mozilla.org (product nss). ...
nss tech note2
several modes of operation: 1. only display the sequence of pkcs #11 calls. to enable this mode, set: nspr_log_modules=nss_mod_log:1 nspr_log_file=<logfile> the output format is: osthreadid[nsprthreadid]: c_xxx osthreadid[nsprthreadid]: rv = 0xyyyyyyyy for example, 1024[805ef10]: c_initialize 1024[805ef10]: rv = 0x0 1024[805ef10]: c_getinfo 1024[805ef10]: rv = 0x0 1024[805ef10]: c_getslot
list 1024[805ef10]: rv = 0x0 2. display the sequence of pkcs #11 calls, and the parameters given to them. to enable this mode, set: nspr_log_modules=nss_mod_log:3 nspr_log_file=<logfile> the output format is: osthreadid[nsprthreadid]: c_xxx osthreadid[nsprthreadid]: arg1 = 0xaaaaaaaa ... osthreadid[nsprthreadid]: argn = 0xaaaaaaaa osthreadid[nsprthreadid]: rv = 0xyyyyyyyy for example, 1024[...
...rmat is: osthreadid[nsprthreadid]: c_xxx osthreadid[nsprthreadid]: arg1 = 0xaaaaaaaa ... osthreadid[nsprthreadid]: argn = 0xaaaaaaaa osthreadid[nsprthreadid]: rv = 0xyyyyyyyy for example, 1024[805ef10]: c_initialize 1024[805ef10]: pinitargs = 0x4010c938 1024[805ef10]: rv = 0x0 1024[805ef10]: c_getinfo 1024[805ef10]: pinfo = 0xbffff340 1024[805ef10]: rv = 0x0 1024[805ef10]: c_getslot
list 1024[805ef10]: tokenpresent = 0x0 1024[805ef10]: pslot
list = 0x0 1024[805ef10]: pulcount = 0xbffff33c 1024[805ef10]: *pulcount = 0x2 1024[805ef10]: rv = 0x0 note that when a pkcs #11 function takes a pointer argument for which it will set a value (c_getslot
list above), this mode will display the value upon return. 3. display verbose information, including template values, array values,...
nss tech note4
); example code to illustrate access to the info is given below. background on cert extensions an extension has the following attributes object id (oid) : a unique oid represents an algorithm, a mechanism, a piece of information, etc. examples: x500 rsa encryption, certificate basic constraints, pkcs#7 digested data, etc. there is a long
list of pre-defined oids, and new ones can be added dynamically by an application. the oid data structure contains an array of identifier bytes (each byte is a "level" in a hierarchical namespace), a text description, and some other things. critical : indicates whether the extension is critical value : the value of the extension looping through all extensio...
...t 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 get a specific extension from the
list of extensions, given the extension tag secstatus cert_findcertextension (certcertificate *cert, int tag, secitem *value); get a specific extension from the issuer's cert secstatus cert_findissuercertextension (certcertificate *cert, int tag, secitem *value); get the value of an extension with the given oid secstatus cert_findcertextensionb...
NSS Tools sslstrength
the letter in the first column of the output is used to identify the cipher preferences in the ciphers= command. ...
...affect which ciphers are available. firstly, you can set policy to be either domestic or export. this restricts the available ciphers to the same set used by communicator. in addition to this, the ciphers command can be used to further restrict the ciphers available. the argument to the ciphers command is a string of characters, where each single character represents a cipher. you can obtain this
list of character->cipher mappings by doing 'sslstrength ciphers'. for example, ciphers=bfi will turn on these cipher preferences and turn off all others. policy=export or policy=domestic will set your policies appropriately. policy will default to domestic if not specified. step-up step up is a mode where the connection starts out with 40-bit encryption, but due to a 'change-cipher-spe...
NSS release notes template
ality is introduced in this release. this is a patch release to fix ... or: ... new functions in ___.h function - description new types in ___.h type - description. new macros in ___.h macro - description notable changes in nss 3.xx ... bugs fixed in nss 3.xx this bugzilla query returns all the bugs fixed in nss 3.xx: https://bugzilla.mozilla.org/bug
list.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.xx (make a link) acknowledgements the nss development team would like to thank ... for responsibly disclosing the issue by providing advance copies of their research. compatibility nss 3.xx.y shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with old...
...for responsibly disclosing the issue by providing advance copies of their research. compatibility nss 3.xx.y shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries will work with nss 3.xx.y shared libraries without recompiling or relinking. furthermore, applications that restrict their use of nss apis to the functions
listed in nss public functions will remain compatible with future versions of the nss shared libraries. feedback bugs discovered should be reported by filing a bug report with bugzilla.mozilla.org (product nss). ...
NSS PKCS11 Functions
would normally specify tokens=<0x4=[configdir='./mybackup' tokendescription='backup']> to softoken if you at init time, then you could specify "configdir='./mybackup' tokendescription='backup'" as your module spec here to open the database ./mybackup on the fly. the slot id will be calculated for you by secmod_openuserdb(). typical parameters here are configdir, tokendescription and flags. a full
list is below: configdir the location of the databases for this token. if configdir is not specified, and nocertdb and nokeydb is not specified, the load will fail. certprefix cert prefix for this token. keyprefix prefix for the key database for this token. (if not specified, certprefix will be used). tokendescription the label value for this token returned in the ck_token_info structure with an inter...
...lotdescription the slotdescription value for this token returned in the ck_slot_info structure with an internationalize string (utf8). this value will be truncated at 64 bytes (no null, partialutf8 characters dropped). this name will not change after thedatabase is closed. it should have some number to make this unique. minpwlen then minimum password length for this token. flags a comma separated
list of flag values, parsed case-insensitive. valid flags are: readonly - databases should be opened read only. nocertdb - don't try to open a certificate database. nokeydb - don't try to open a key database. forceopen - don't fail to initialize the token if thedatabases could not be opened. passwordrequired - zero length passwords are not acceptable(valid only if there is a keydb). optimizespace - a...
PKCS 7 functions
the mozilla cross reference (mxr) link for each function provides access to the function definition, prototype definition, and source code references. the nss version column indicates which versions of nss support the function. ...
... 3.3 and later sec_pkcs7encodeitem mxr 3.9.3 and later sec_pkcs7encoderabort mxr 3.9 and later sec_pkcs7encoderfinish mxr 3.2 and later sec_pkcs7encoderstart mxr 3.2 and later sec_pkcs7encoderupdate mxr 3.2 and later sec_pkcs7getcertificate
list mxr 3.2 and later sec_pkcs7getcontent mxr 3.2 and later sec_pkcs7getencryptionalgorithm mxr 3.2 and later sec_pkcs7getsignercommonname mxr 3.4 and later sec_pkcs7getsigneremailaddress mxr 3.4 and later sec_pkcs7getsigningtime mxr 3.4 and later ...
NSS tools : vfychain
name vfychain — vfychain [options] [revocation options] certfile [[options] certfile] ... synopsis vfychain description the verification tool, vfychain, verifies certificate chains. modutil can add and delete pkcs #11 modules, change passwords on security databases, set defaults,
list module contents, enable or disable slots, enable or disable fips 140-2 compliance, and assign default providers for cryptographic operations. this tool can also create certificate, key, and module security database files. the tasks associated with security module database management are part of a process that typically also involves managing key databases and certificate databases. options -a the following certfile is base64 encoded -b yymmddhhmmz validate date (default: now) -d directory database direc...
...ts revocation flags for the method it follows. possible types are "donotuse", "forbidfetching", "ignoredefaultsrc", "requireinfo" and "failifnoinfo". additional resources for information about nss and other tools related to nss (like jss), check out the nss project wiki at [1]http://www.mozilla.org/projects/security/pki/nss/. the nss site relates directly to nss code changes and releases. mailing
lists: https://
lists.mozilla.org/
listinfo/dev-tech-crypto irc: freenode at #dogtag-pki authors the nss tools were written and maintained by developers with netscape, red hat, and sun. authors: elio maldonado <emaldona@redhat.com>, deon lackey <dlackey@redhat.com>. copyright (c) 2010, red hat, inc. licensed under the gnu public license version 2. references visible links 1. http://www.mozilla.org/proje...
gtstd.html
that follow assume you are using the certificate database tool to set up both the server and client databases for testing purposes. you can use the security module database tool, a command-line utility that comes with nss, to manage pkcs #11 module information within secmod.db files. the security module database tool allows you to add and delete pkcs #11 modules, change passwords, set defaults,
list module contents, enable or disable slots, enable or disable fips-140-1 compliance, and assign default providers for cryptographic operations. setting up the certificate and key databases before you can run the sample programs (server.c and client.c) that come with nss, you must set up certificate, key, and security module databases for both the client and the server and populate them with v...
...-v -d server_db -u v -n myco.mcom.org certutil: certificate is valid >certutil -v -d client_db -u c -n "joe client" certutil: certificate is valid building nss programs on unix, use the gnu utility gmake to run the makefile. on windows nt, use the nmake utility that comes with visual c++. if you create your own makefiles, be sure to include the libraries in the same order that they are
listed in the sample makefiles. in addition, you must use the following compiler flags: solaris flags: -c -o -kpic -dsvr4 -dsysv -d__svr4 -d__svr4__ -dsolaris -d_reentrant -dsolaris2_5 -d_svid_gettod -dxp_unix -udebug -dndebug windows nt flags: -c -o2 -md -w3 -nologo -d_x86_ -gt -dwinnt -dxp_pc -udebug -u_debug -dndebug -dwin32 -d_windows ...
NSS Tools cmsutil
using cmsutil newsgroup: mozilla.dev.tech.crypto the cmsutil command-line utility uses the s/mime toolkit to perform basic operations, such as encryption and decryption, on cryptographic message syntax (cms) messages. syntax to run cmsutil, type the command cmsutil option [arguments] where option and arguments are combinations of the options and arguments
listed in the following section. each command takes one option. each option may take zero or more arguments. to see a usage string, issue the command without options. options and arguments options specify an action. option arguments modify an action. the options and arguments for the cmsutil command are defined as follows: options -ddecode a message. -c encrypt a message. -e envelope a message. -o c...
...infile use infile as a source of data (default is stdin). -n nickname specify nickname of certificate to sign with (sign only). -n suppress output of contents (decode only). -o outfile use outfile as a destination of data (default is stdout). -p include an s/mime capabilities attribute. -p password use password as key database password. -r recipient1,recipient2, . . . specify
list of recipients (email addresses) for an encrypted or enveloped message. for certificates-only message,
list of certificates to send. -t suppress content in cms message (sign only). -u certusage set type of cert usage (default is <tt>certusageemailsigner)</tt>. <-y ekprefnick specify an encryption key preference by nickname. usage cmsutil -c [-i infile] [-o outfile] [-d dbdir] [-p ...
NSS Tools sslstrength
the letter in the first column of the output is used to identify the cipher preferences in the ciphers= command. ...
...affect which ciphers are available. firstly, you can set policy to be either domestic or export. this restricts the available ciphers to the same set used by communicator. in addition to this, the ciphers command can be used to further restrict the ciphers available. the argument to the ciphers command is a string of characters, where each single character represents a cipher. you can obtain this
list of character->cipher mappings by doing 'sslstrength ciphers'. for example, ciphers=bfi will turn on these cipher preferences and turn off all others. policy=export or policy=domestic will set your policies appropriately. policy will default to domestic if not specified. step-up step up is a mode where the connection starts out with 40-bit encryption, but due to a 'change-cipher-sp...
NSS tools : signver
shared database and working around the access issues. still, nss requires more flexibility to provide a truly shared security database. in 2009, nss introduced a new set of databases that are sqlite databases rather than berkleydb. these new databases provide more accessibility and performance: o cert9.db for certificates o key4.db for keys o pkcs11.txt, which is
listing of all of the pkcs #11 modules contained in a new subdirectory in the security databases directory because the sqlite databases are designed to be shared, these are the shared database type. the shared database type is preferred; the legacy format is included for backward compatibility. by default, the tools (certutil, pk12util, modutil) assume that the given security d...
...db_howto o engineering and technical information about the shared nss database https://wiki.mozilla.org/nss_shared_db additional resources for information about nss and other tools related to nss (like jss), check out the nss project wiki at [1]http://www.mozilla.org/projects/security/pki/nss/. the nss site relates directly to nss code changes and releases. mailing
lists: https://
lists.mozilla.org/
listinfo/dev-tech-crypto irc: freenode at #dogtag-pki authors the nss tools were written and maintained by developers with netscape, red hat, and sun. authors: elio maldonado <emaldona@redhat.com>, deon lackey <dlackey@redhat.com>. copyright (c) 2010, red hat, inc. licensed under the gnu public license version 2. references visible links ...
NSS tools : vfychain
name vfychain — vfychain [options] [revocation options] certfile [[options] certfile] ... synopsis vfychain description the verification tool, vfychain, verifies certificate chains. modutil can add and delete pkcs #11 modules, change passwords on security databases, set defaults,
list module contents, enable or disable slots, enable or disable fips 140-2 compliance, and assign default providers for cryptographic operations. this tool can also create certificate, key, and module security database files. the tasks associated with security module database management are part of a process that typically also involves managing key databases and certificate databases. options -a the following certfile is base64 encoded -b yymmdd...
...llows. possible types are "donotuse", "forbidfetching", "ignoredefaultsrc", "requireinfo" and "failifnoinfo". additional resources for information about nss and other tools related to nss (like jss), check out the nss project wiki at [1]http://www.mozilla.org/projects/security/pki/nss/. the nss site relates directly to nss code changes and releases. mailing
lists: https://
lists.mozilla.org/
listinfo/dev-tech-crypto irc: freenode at #dogtag-pki authors the nss tools were written and maintained by developers with netscape, red hat, and sun. authors: elio maldonado <emaldona@redhat.com>, deon lackey <dlackey@redhat.com>. copyright (c) 2010, red hat, inc. licensed under the gnu public license version 2. references visible links ...
Necko Architecture
however, a protocol handler implementation also might "cache" the underlying transports so channels it creates can reuse them later. the channel does the true work of protocol interpretation and data movement (if any). although the protocol handler creates channels, protocol interpretation doesn't begin until the user initiates the transaction using the nsichannel api. ...
...e protocol handler creates channels, protocol interpretation doesn't begin until the user initiates the transaction using the nsichannel api. receiving data & nsistream
listener you can read or write, from or to a channel using either the synchronous api, or the asynchronous api. if you want to move data asynchronously you need to be able to receive callbacks using an implementation of nsistream
listener. an nsistream
listener is told when the uri transaction has "started," when data is available (in the case of reading data), and when it has "stopped." it is up to the nsistream
listener implementation to decide what to do with these various notifications. the ondataavailable() notification provides a chance for the nsistream
listener to actually retrieve data that the channel has acquired. one ...
Multithreading in Necko
ckground threads to improve performance. for example, the http protocol handler has code that runs on the socket transport thread to kick off pending requests well before the main thread would get around to doing so. socket transport thread (1) socket connections are processed on a single background thread. this thread is controlled by the nssockettransportservice. it sits in a loop, polling a
list of sockets. when a socket can be read, the socket's
listener is notified either synchronously (on the same thread) or asynchronously via a nsistream
listenerproxy impl. file transport threads (1-4) file i/o is processed via a thread pool that has between 1 and 4 threads. these threads are controlled by the nsfiletransportservice. each file transport object is given time on one of the file trans...
... thread pool that has between 1 and 4 threads. these threads are controlled by the nsfiletransportservice. each file transport object is given time on one of the file transport threads. during which it reads (writes) until its buffers are full (empty). once at the limit of its buffers, it yields the thread to another pending file transport object. as with the socket transport thread, the nsistream
listener passed to a file transport's asyncread method can operate partially on the file transport's thread before proxying data to the main thread. the file transport is confusingly named since it is not restricted to loading files. it simply promises to read from a nsiinputstream (or write to a nsioutputstream) on a background thread. the implementation of the stream should be blocking; however, the...
Bytecode Descriptions
constants undefined stack: ⇒ undefined push undefined. null stack: ⇒ null push null. false, true stack: ⇒ true/false push a boolean constant. int32 operands: (int32_t val) stack: ⇒ val push the int32_t immediate operand as an int32value. jsop::zero, jsop::one, jsop::int8, jsop::uint16, and jsop::uint24 are all compact encodings for jsop::int32. zero stack: ⇒ 0 push the number 0. one stack: ⇒ 1 push the number 1. int8 operands: (int8_t val) stack: ⇒ val push the int8_t immediate operand as an int32value. uint16 operands: (uint16_t val) stack: ⇒ val push the uint16_t immediate operand as an int32value. ...
...r-of loops. if the body of the loop throws an exception, we catch it, close the iterator, then use jsop::throw to rethrow. throwmsg operands: (throwmsgkind msgnumber) create and throw an error object. sometimes we know at emit time that an operation always throws. for example, delete super.prop; is allowed in methods, but always throws a referenceerror. msgnumber must be one of the error codes
listed in js/src/js.msg; it determines the .message and [[prototype]] of the new error object. the number of arguments in the error message must be 0. throwsetconst operands: (uint32_t nameindex) throws a runtime typeerror for invalid assignment to a const binding. format: jof_atom, jof_name try operands: (int32_t jumpatendoffset) no-op instruction that marks the top of the bytecode for a trysta...
Tracing JIT
egister allocator. this is a local register allocator, meaning that it does not allocate registers across basic blocks. it is correspondingly very simple: register allocation is done immediately, step-by-step as code is being generated. a running tally is kept of assignments between registers and lir operands, and any time a new lir operand is required in a register a new one is assigned from the
list of free registers. when all registers are in use, the least-often-used register currently in use is spilled. nanojit/native*.* the files nativei386.h, nativei386.cpp, nativearm.h, nativearm.cpp, etc. each define architecture-specific methods within the assembler class. only one architecture-specific variant is included into any given build of the assembler; the architecture is selected and fixe...
...record, the recorder may choose to abort the recording. aborting a recording is always an option in tracemonkey, and on abort the monitor simply discards the recorder and its fragment and returns to monitoring mode. the monitor also keeps track of how many times it has attempted to record a trace starting at each pc value, so if a particular pc causes too many aborted recordings, the monitor black
lists the pc and will not attempt recording it any longer. if the recorder completes recording at a backward branch back to the initial pc value that triggered recording mode, it is said to have successfully closed the loop. a closed loop is passed through the nanojit assembler and thereby compiled to native machine code. the associated fragment is placed in the monitor's fragment table and the monit...
Self-hosted builtins in SpiderMonkey
e specified in the ecmascript language specification. throwtypeerror, throwrangeerror, throwsyntaxerror, which self-hosted code should use instead of throw so that the error message is specified in js.msg and can be localized. the makeconstructible function described above. the file utilities.js provides some additional, js-implemented helper functions. of note, it provides implementations of
list and record, types defined in the ecmascript specifications that are similar to array and object, but can't be modified by application code. the selfhostingdefines.h header contains adding self-hosted functions to host objects first, the code has to be embedded into spidermonkey. the easiest way to accomplish that is to add the code to a pre-existing .js file in builtin/. if it doesn't fit into...
...bject, but can't be modified by application code. the selfhostingdefines.h header contains adding self-hosted functions to host objects first, the code has to be embedded into spidermonkey. the easiest way to accomplish that is to add the code to a pre-existing .js file in builtin/. if it doesn't fit into any of those, create a new .js file in that directory and add it to the selfhosted.inputs
list in moz.build. to add a self-hosted function as a method to a host object, add it to that host object's jsfunctionspec array using the js_self_hosted_fn macro. example: js_self_hosted_fn("foreach", "arrayforeach", 1,0) this causes the self-hosted function arrayforeach to be installed as the host object's method foreach. making jsnatives available to self-hosted code for a jsnative to ...
Introduction to the JavaScript shell
rce distribution. it is the javascript equivalent of python's interactive prompt, the lisp read-eval-print loop, or ruby's irb. this article explains how to use the shell to experiment with javascript code and run javascript programs. to get the spidermonkey javascript shell, see the spidermonkey build documentation or download a compiled binary for your platform from the nightly builds. for a
list of other javascript shells, see javascript shells. note: starting with spidermonkey 44 (firefox 44 / thunderbird 44 / seamonkey 2.41), the standard, web-compatible javascript version is used by default (and not js1.7+ anymore). the version() shell builtin is still there for testing legacy features. running the javascript shell the shell offers two modes of operation. you can use it as an int...
...messages. environment options there are some environment variables that can be set to alter js shell behavior. js_stdout=file redirect stdout to file. js_stderr=file redirect stderr to file. 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. note: this
list is incomplete and overlaps with shell global objects. see js/src/shell/js.cpp (around shell_functions) for more. build() returns the date and time at which the javascript shell was built. note: clear() with no parameters really clears everything. this includes all these built-in functions. clone(function, [scope]) clones the specified function object. if scope isn't specified, the new objec...
JS_ConvertArgumentsVA
obsolete since jsapi 38this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. converts a series of js values, passed in a va_
list, to their corresponding jsapi types. syntax bool js_convertargumentsva(jscontext *cx, const js::callargs &args, const char *format, va_
list ap); bool js_convertargumentsva(jscontext *cx, unsigned argc, jsval *argv, const char *format, va_
list ap); name type description cx jscontext * pointer to a js context from which to derive runtime information. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. args const js::callarg...
...llargs & reference to the arguments to convert. added in spidermonkey 31 argc unsigned the number of arguments to convert. obsolete since jsapi 30 argv jsval * pointer to the vector of arguments to convert. obsolete since jsapi 30 format const char * character array containing the recognized format to which to convert. ap va_
list the
list of pointers into which to store the converted types. there should be one pointer for each converted value. the type va_
list is a standard feature of the c programming language. it is defined in <stdarg.h>. description js_convertargumentsva is to js_convertarguments as vprintf is to printf. see js_convertarguments for further information. if js_convertargumentsva successfully ...
Parser API
ord, e.g., function::id. note: function-qualified identifiers are spidermonkey-specific. interface xmlattributeselector <: expression { type: "xmlattributeselector"; attribute: expression; } an e4x attribute selector expression, i.e., an @ expression. interface xmlfilterexpression <: expression { type: "xmlfilterexpression"; left: expression; right: expression; } an e4x
list filter expression, i.e., an expression of the form expr.(expr). interface xmlelement <: xml, expression { type: "xmlelement"; contents: [ xml ]; } an e4x literal representing a single xml element. interface xml
list <: xml, expression { type: "xml
list"; contents: [ xml ]; } an e4x literal representing a
list of xml elements. xml interface xml <: node { } xml data. interf...
...alifiedidentifier(right, iscomputed[, loc]) right: customidentifier | customexpression iscomputed: boolean loc: sourcelocation returns: customxml/customexpression callback to produce a custom xml function-qualified identifier node. xmlelement(contents[, loc]) contents: [ customxml ] loc: sourcelocation returns: customxml/customexpression callback to produce a custom xml element node. xml
list(contents[, loc]) contents: [ customxml ] loc: sourcelocation returns: customxml/customexpression callback to produce a custom xml
list node. xml xmlescape(expr[, loc]) expr: customexpression loc: sourcelocation returns: customxml callback to produce a custom xml escape node. xmltext(text[, loc]) text: string loc: sourcelocation returns: customxml callback to produce a custom xml te...
SpiderMonkey: The Mozilla JavaScript runtime
javascript tests how to run the javascript test suites. creating javascript tests how to add tests to the javascript test suites. reference jsapi reference spidermonkey api reference. js debugger api reference api reference for the debugger object introduced in spidermonkey 1.8.6, which corresponds to gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5). bytecode descriptions
listing of spidermonkey's bytecodes. parser api reflection of the spidermonkey parser, made available as a javascript api. tips, tricks and philosophy future directions future directions for functionality, design, and coding practices. spidermonkey internals a design overview and a file-by-file walkthrough of the implementation. bytecode reference spidermonkey bytecode reference. spidermo...
...erence spidermonkey bytecode reference. ...
ROLE_CELL
« gecko roles page represents a cell within a table. also, see role_table. ...
...nts a cell within a table. also, see role_table. ...
ROLE_OUTLINEITEM
« gecko roles page represents an item in an outline or tree structure. ...
... « gecko roles page represents an item in an outline or tree structure. ...
Gecko states
disabled. applied to: all roles. state_selected the object is selected, i.e. indicates this object is the child of an object that allows its children to be selected and that this child is one of those children that has been selected. ...
...ivates the menu. because objects with this state are not available to users, client applications should not communicate information about the object to users. however, if client applications find an object with this state, they should check to see if state_offscreen is also set. if this second state is defined, then clients can communicate the information about the object to users. for example, a
list box can have both state_invisible and state_offscreen set. in this case, the client application can communicate all items in the
list to users. state_offscreen scrolled off state_sizeable the object can be resized. for example, a user could change the size of a window by clicking the border with a mouse and dragging the mouse. state_moveable indicates that the object can be moved. for examp...
AT APIs Support
page to see how gecko supports interesting at api. there you will find information how at api interfaces, roles, states and etc are mapped into gecko accessibility api and visa versa. keyboard user interface and api fortunately, gecko uses the standard keyboard api's for each supported platform. the mozilla keyboard shortcuts for content are similar to what is used in other browsers. here is a
list of firefox keyboard shortcuts. test tools here you will find a
list of tools to test accessibility gecko-based applications. msaa msaa sdk tools - version 1.3 is recommended instead of 2.0 because it includes source code for the tools iaccessible2 accessibility probe -- includes msaa support as well atk/at-spi accerciser - interactive python accessibility explor...
...recommended instead of 2.0 because it includes source code for the tools iaccessible2 accessibility probe -- includes msaa support as well atk/at-spi accerciser - interactive python accessibility explorer for the gnome desktop gecko dom inspector has an ability to test gecko accessibility layer, supports base features. firebug screen readers here's a
list of screen readers we are oriented to in the first place. windows platform jaws windows eyes nvda linux/unix platform orca os x platform voiceover contacts please discuss accessibility issues on the mozilla accessibility groups or on the mozilla accessibility irc channel. ...
The Places database
olders, separators and tags, and defines the hierarchy. the hierarchy is defined via the parent column, which points to the moz_bookmarks record which is the parent. the position column numbers each of the peers beneath a given parent starting with 0 and incrementing higher with each addition. the fk column provides the id number of the corresponding record in moz_places. moz_bookmarks_roots:
lists special folders that are the root folders of certain content types in the bookmarks system. the records in this table are mapped to records in the moz_bookmarks table. bookmarks, folders and separators are descendants of the bookmarks root, while tags and tagged uris are descendants of the tag root. moz_keywords: this table is a unique
list of keywords. the moz_bookmarks table has a keyword_...
...page (reference to moz_places) and an annotation name (reference to moz_anno_attributes) to the value of the annotation. moz_items_annos: contains the values of bookmark item annotations. it maps a bookmark, folder or separator (reference to moz_bookmarks) and an annotation name (reference to moz_anno_attributes) to the value of the annotation. favicon table moz_favicons: this contains a
list of unique favicon uris and data. one or more pages in moz_places refer to each entry. when no pages reference a favicon, the icon entry will be deleted. if the mime type of the image is image/png, the data blob must be reencoded from base16 (the format in which it is stored) to base64 in order to display correctly. expiration expiration is handled in toolkit/components/places/nspla...
Retrieving part of the bookmarks tree
parameters such as keywords or date ranges (as in this example), the root of the result will be an nsinavhistorycontainerresultnode corresponding to your folder. if you have a complex query the root will be a nsinavhistoryqueryresultnode. before accessing the children of any result container, you must first open it, and then you can iterate the children. as long as the container is open, it will
listen for notifications from the bookmarks system to keep itself up-to-date. when you're done, be sure to close the container to free up the resources. otherwise, it will continue to get observer notifications and update itself, slowing down the whole browser. var rootnode = result.root; rootnode.containeropen = true; // iterate over the immediate children of this folder and dump to console for (var...
...ild(i); dump("child: " + node.title + "\n"); } // close a container after using it! rootnode.containeropen = false; if you encounter a node with a type of result_type_folder or another type of container, you can open these folders and descend into the hierarchy. you will want to read the section "using the results" in places:query system to understand the different result types. ...
Using the Places annotation service
c++ callers will want to use getp...
...c++ callers will want to use getpageannotationnamestarray which returns a com array, making memory management much easier and reducing the chance of leaks. ...
extIApplication
the id of the application. name readonly attribute astring the name of the application. version readonly attribute astring the version number of the application. console readonly attribute exticonsole the console object for the application. extensions readonly attribute extiextensions the extensions object for the application. contains a
list of all installed extensions. not available anymore on gecko 2.0 (see [1]), use getextensions() instead obsolete since gecko 2.0 prefs readonly attribute extipreferencebranch the preferences object for the application. defaults to an empty root branch. storage readonly attribute extisessionstorage the storage object for the application. events readonly att...
... application. it is possible for the shutdown to be canceled. boolean quit() return value boolean value indicating whether the shutdown was successful. restart() attempts to restart the application. it is possible for the restart to be canceled. boolean restart() return value boolean value indicating whether the restart was successful. getextensions(acallback) calls acallback with the
list of installed extensions. void getextensions(extiextensionscallback acallback) return value none. xpcom although the application object is preloaded into xul scripts, it is not preloaded into javascript xpcom code. the object needs to be accessed like any other xpcom service: var application = components.classes["@mozilla.org/fuel/application;1"].getservice(components.interfaces.fueliapplica...
XML Extras
fixptr and xpointer available since 1.4alpha in the core mozilla. moved to xml extras during 1.4beta. see also: xml in mozilla document.load() a few examples dealing with xml from mozillazine knowledge base. qa and testing there are some online tests for mainly exercising the http get method via xmlhttprequest. other test cases for each of the implemented components
listed above exist in extensions/xmlextras/tests/. more exhaustive test suites need to be created, however. if you'd like to help out with qa, you can do one of the following: sign up as the qa owner for any of the implemented components. the qa owner will manage the tests associated with their component, act as qa contact for related bugs and help with regression testing. contribute a test suite ...
...shouldn't pose a problem (there you do not need that line either). additionally, "foo.com:80" and "foo.com:313" are considered different hosts for security purposes. you cannot open a connection to a different host. domparser creation not available new domparser() xmlserializer creation not available new xmlserializer() minimal documentation for the components
listed above can be found using mozilla documentation generated by doxygen. file new bugs for additional documentation contributions, either specifically aimed at javascript developers or to complete & clarify the javadoc-style comments in the idl files. nsidomserializer (currently, the javascript constructor is xmlserializer()) nsidomparser (currently, the javascript constructor is domparser()) ...
Avoiding leaks in JavaScript XPCOM components
the memory they used to the heap. garbage collection (at least when the term is not used to refer to lesser algorithms like reference counting) is pretty good at freeing memory that should be freed. however, in a fully garbage-collected system the programmer can still create leaks by leaving objects reachable that are no longer needed. for example, if an object's constructor adds the object to a
list that is reachable from a global variable and nothing ever removes it from the
list, the object will never be destroyed since it is always reachable from the
list. memory management in xpcom and javascript javascript code that uses xpcom through xpconnect uses two different memory management models. javascript uses garbage collection. xpcom uses reference counting. authors of javascript code tha...
...bserver you just created until you unregister the observer. if you don't unregister the observer, the observer, the javascript global object for the context in which it was created, and a bunch of associated objects will all leak for the lifetime of the application. it's also worth noting that failing to unregister an observer that's attached to something temporary (such as a controller or event
listener) can cause the garbage collector to take an extra cycle to clean up everything that was associated with a document if the temporary object itself is destroyed as a result of garbage collection. see one of the patches in bug 231384 for some examples. don't create cycles through xpcom in a garbage-collected system, reference cycles aren't a problem. if a has a pointer to b and b has a pointer...
Creating XPCOM components
es subclassing nsisupports the web locking interface implementing weblock declaration macros representing return values in xpcom xpidl code generation getting the weblock service from a client implementing the iweblock interface the directory service modifying paths with nsifile manipulating files with nsifile using nsilocalfile for reading data processing the white
list data iweblock method by method lock and unlock addsite removesite setsites getnext getsites hasmoreelements finishing the component using frozen interfaces copying interfaces into your build environment implementing the nsicontentpolicy interface receiving notifications implementing the nsicontentpolicy uniform resource locators checking the white...
...data iweblock method by method lock and unlock addsite removesite setsites getnext getsites hasmoreelements finishing the component using frozen interfaces copying interfaces into your build environment implementing the nsicontentpolicy interface receiving notifications implementing the nsicontentpolicy uniform resource locators checking the white
list creating nsiuri objects building the weblock ui user interface package
list client code overview xul the xul document the locking ui site adding ui weblock.xul overlaying new user interface into mozilla weblockoverlay.xul other resources weblock.css image resources packaging weblock component installation overview archiving resources the weblo...
XPCOM hashtable guide
i use a hashtable? hashtables are useful for sets of data that need swift random access; with non-integral keys or non-contiguous integral keys; or where items will be frequently added or removed. hashtables should not be used for sets that need to be sorted; very small datasets (less than 12-16 items); data that does not need random access. in these situations, an array, a linked-
list, or various tree data structures are more efficient. which hashtable should i use? the appropriate hashtable class to use depends solely on the data type. the template specialization to use depends on the data type and the key type. data type hashtable class none (for a hash set) nsthashtable simple types (numbers, booleans, etc) nsdatahashtab...
...t reference-counted) nsclasshashtable reference-counted concrete classes nsrefptrhashtable interface pointers nsinterfacehashtable each of these classes is a template with two parameters. the first is the hash key and the second is the data to be stored. there are a number of builtin hash keys available in nshashkeys.h, the more useful of which are
listed below. key type hashkey class strings nsstringhashkey/nscstringhashkey integers nsuint32hashkey/nsuint64hashkey pointers nsptrhashkey<t> owned interface pointers nsisupportshashkey reference-counted concrete classes nsrefptrhashkey there are a number of more esoteric hashkey classes in nshashkeys.h, and you can alwa...
Interfacing with the XPCOM cycle collector
o set the object pointer to null: ns_impl_cycle_collection_unlink_begin(nsfoo) ... ns_impl_cycle_collection_unlink(msomemember) ... //if your class is a wrapper cache: //ns_impl_cycle_collection_unlink_preserved_wrapper tmp->msomeobj = nullptr; ns_impl_cycle_collection_unlink_end in the destructor, you should call mozilla::dropjsobjects(this); in your traverse method you need to
list members involved in the cycle collector, i-e no js objects: ns_impl_cycle_collection_traverse_begin(nsfoo) ... ns_impl_cycle_collection_traverse(msomemember) ... ns_impl_cycle_collection_traverse_end finally, you need to manually add the js object to the trace method: ns_impl_cycle_collection_trace_begin(nsfoo) //if your class is a wrapper cache: //ns_impl_cycle_collection_trace_pre...
...cache: //ns_impl_cycle_collection_trace_preserved_wrapper ns_impl_cycle_collection_trace_js_member_callback(msomeobj) ns_impl_cycle_collection_trace_end note that if your class is a wrapper cache then you likely have generate code that uses ns_impl_cycle_collection_wrappercache_# macro instead of ns_impl_cycle_collection_#. unfortunately this macro defines the trace method and so you can't
list your js object; hence, you need to also manually implmenet trace and unlink as above. handling js::value fields recall (or see here) that a js::value may reference a string or object and is subject to gc. hence, we need to tell the cycle collector about any such member variables. this is the same as for the jsobject case, but using the ns_impl_cycle_collection_trace_jsval_member_callback macro:...
Components.utils.createObjectIn
which determines the name of the object in the target compartment. return value a new object in the specified scope. ...
... to create an object with a specified name, use defineas: var foo = components.utils.createobjectin(mywindow, {defineas: "foo"}); now the target ...
Components.utils
createarrayin() removed in gecko 31 returns an array created in specified compartment. ...
...ted (through its prototype chain at birth, for example). getjstestingfunctions() getobjectprincipal() gets the nsiprincipal for the given javascript object. getweakreference() gets a weak reference for the object passed in. import() loads a js module into the current script, without sharing a scope. importglobalproperties() specify a
list of constructors to import into the scope. isxraywrapper() test whether a given object is an xray or not. unload() unloads a js module loaded with import(). isdeadwrapper() determines whether this object is backed by a deadobjectproxy. lookupmethod() looks up a native (i.e. declared in the interface) method or property of an xpcom object. serves t...
IAccessibleEditableText
length. endoffset start index of the text to be replaced. the valid range is 0..length. text the text that replaces the text between the given indices. return value e_invalidarg if bad [in] passed. s_ok. setattributes() replaces the attributes of a text range by the given set of attributes. sets the attributes for the text between the two given indices. ...
... return value e_invalidarg if bad [in] passed. s_ok. ...
imgIContainerObserver
method overview void framechanged(in imgirequest arequest, in imgicontainer acontainer, [const] in nsintrect adirtyrect); native code only! methods native code only!framechanged called when the frame for an image container has changed. ...
...method overview void framechanged(in imgirequest arequest, in imgicontainer acontainer, [const] in nsintrect adirtyrect); native code only! methods native code only!framechanged called when the frame for an image container has changed. ...
nsIAccessible
top or below placed accessible methods getkeybindings provides array of localized string of global keyboard accelerator for the given action index supported by accessible. getstate provides a bit fields of accessible states which describe boolean properties of accessible. groupposition this method returns grouping information. used for tree items,
list items, tab panel labels, radio buttons, etc. also used for collectons of non-text objects. getchildatpoint this method returns an accessible child which contains the coordinate at (x, y) in screen pixels. getchildat this method returns nth accessible child using zero-based index or last child if index than less than zero. getaccessibletoright this m...
...ible tree. previoussibling previous sibling in accessible tree. firstchild first child in accessible tree. lastchild last child in accessible tree. children array of all this element's children. childcount number of accessible children. indexinparent the 0-based index of this accessible in its parent's
list of children, or -1 if this accessible does not have a parent. name accessible name -- the main text equivalent for this node. value accessible value -- a number or a secondary text equivalent for this node. widgets that use role attribute can force a value using the valuenow attribute. description accessible description -- long text associated with ...
nsIAccessibleEditableText
ard. void pastetext( in long position ); parameters position the offset at which to insert the text from the system clipboard into the text represented by this object. exceptions thrown ns_error_failure indicates the text cannot be pasted from the clipboard. setattributes() sets the attributes for the text between the two given indices. ...
... exceptions thrown ns_error_not_implemented always. the method is not implemented. settextcontents() replaces the text represented by this object with the given text. void settextcontents( in astring text ); parameters text the text that will replace the old text. ...
nsIAccessibleRetrieval
create a new accessible of the appropriate type if necessary, or use one from the accessibility cache if it already exists. nsiaccessible getaccessiblefor( in nsidomnode anode ); parameters anode the dom node to get an acce...
... arelationtype ); parameters arelationtype the accessible relation type constant. return value accessible relation type presented as human readable string. getstringrole() returns accessible role as a string. astring getstringrole( in unsigned long arole ); parameters arole the accessible role constants. return value accessible role as a string. getstringstates() returns a
list which contains accessible states as strings. nsidomdomstring
list getstringstates( in unsigned long astates, in unsigned long aextrastates ); parameters astates accessible states. aextrastates accessible extra states. return value a
list which contains accessible states as strings. see also mozilla access nsiaccessible nsiaccessnode ...
nsIAnnotationService
method, if you need this along with the mime-type etc. it throwns an exception if the annotation is not set. pruint16 getpageannotationtype( in long long aitemid, in autf8string aname ); parameters auri the item on which the annotation is set. aname the annotation name. return value returns one of the type_* constants defined above. ...
...s one of the type_* constants defined above. getpageswithannotation() this method returns a
list of all uris having a given annotation. void getpageswithannotation( in autf8string name, [optional] out unsigned long resultcount, [retval, array, size_is(resultcount)] out nsiuri results ); parameters name the annotation name. resultcount optional count of uris. results returns the
list of all uris. getitemswithannotation() this method returns a
list of all items having a given annotation. void getitemswithannotation( in autf8string name, [optional] out unsigned long resultcount, [retval, array, size_is(resultcount)] out long long results ); parameters name the annotation name. resultcount optional count of items. results returns the
list of all items. getp...
nsIAppShell
hod overview void create(inout int argc, inout string argv); obsolete since gecko 1.9 void dispatchnativeevent(in prbool arealevent, in voidptr aevent); obsolete since gecko 1.9 void exit(); void favorperformancehint(in boolean favorperfoverstarvation, in unsigned long starvationdelay); void getnativeevent(in prboolref arealevent, in voidptrref aevent); obsolete since gecko 1.9 void
listentoeventqueue(in nsieventqueue aqueue, in prbool a
listen); obsolete since gecko 1.9 void resumenative(); void run(); void runinstablestate(in nsirunnable arunnable); void spindown(); obsolete since gecko 1.9 void spinup(); obsolete since gecko 1.9 void suspendnative(); attributes attribute type description eventloopnestinglevel unsigned long the current event loop nesting l...
...in milliseconds to wait before the pr_false actually takes effect. getnativeevent() obsolete since gecko 1.9 (firefox 3) after event dispatch execute app specific code. void getnativeevent( in prboolref arealevent, in voidptrref aevent ); parameters arealevent event is real or a null placeholder (macintosh). aevent void pointer to native event structure.
listentoeventqueue() obsolete since gecko 1.9 (firefox 3) an event queue has been created or destroyed. hook or unhook it from your system, as necessary. void
listentoeventqueue( in nsieventqueue aqueue, in prbool a
listen ); parameters aqueue the queue in question. a
listen pr_true for a new queue wanting hooking up. pr_false for a queue wanting to be unhooked. resumenative() re...
nsIApplicationCacheService
value the currently active cache object for the cache group. getapplicationcache() returns the nsiapplicationcache object for the specified client id. nsiapplicationcache getapplicationcache( in acstring clientid ); parameters clientid the client id for which to return the application cache object. return value the application cache object for the specified client id. getgroups() returns the
list of application cache groups. void getgroups( out unsigned long count, optional [array, size_is(count), retval] out string groupids ); parameters count optional the count of the application cache groups. groupids the
list of application cache groups. see also offline resources in firefox nsiapplicationcache nsiapplicationcachecontainer nsiapplicationcachechannel nsiapplicationcachenamespac...
...roups. void getgroups( out unsigned long count, optional [array, size_is(count), retval] out string groupids ); parameters count optional the count of the application cache groups. groupids the
list of application cache groups. ...
nsIAutoCompleteSearch
toolkit/components/autocomplete/nsiautocompletesearch.idlscriptable this interface is implemented by search providers to start and stop autocomplete. inherits from: nsisupports last changed in gecko 1.7 users call startsearch() and pass in an nsiautocompleteobserver when the search starts. results can be sent to the
listener either synchronously or asynchronously, depending on the implementation. method overview void startsearch(in astring searchstring, in astring searchparam, in nsiautocompleteresult previousresult, in nsiautocompleteobserver
listener); void stopsearch(); methods startsearch() search for a given string and notify a
listener (either synchronously or asynchronously) of the result. void startsearch( in astring searchstring, in astring searchparam, i...
...ng, in astring searchparam, in nsiautocompleteresult previousresult, in nsiautocompleteobserver
listener); void stopsearch(); methods startsearch() search for a given string and notify a
listener (either synchronously or asynchronously) of the result. void startsearch( in astring searchstring, in astring searchparam, in nsiautocompleteresult previousresult, in nsiautocompleteobserver
listener ); parameters searchstring the string to search for. searchparam an extra parameter. can be empty if not needed. previousresult the previous nsiautocompleteresult to use for faster searching. can be null.
listener an nsiautocompleteobserver
listener to notify when the search is complete. stopsearch() stop all searches that are in progress. void stopsearch(); parameters none. ...
nsIClassInfo
g nsiservicemanager.getservicebycontractid(). read only. flags pruint32 specifies various binary properties of this class. possible values for this attribute include a bit-wise combination of the constants read only. implementationlanguage obsolete since gecko 40 pruint32 the language type in which this class is implemented. see nsiprogramminglanguage.constants for a
list of possible values. read only. constants bitflags for 'flags' attribute. constant value description singleton 1 << 0 the class is a singleton that must be accessed via nsiservicemanager. threadsafe 1 << 1 the class may be accessed by any thread. main_thread_only 1 << 2 the class may only be accessed by the main application threa...
...nce object. nsisupports gethelperforlanguage( in pruint32 language ); parameters language this parameter selects the language mapping specific helper object to be returned. nsiprogramminglanguage defines language identifiers that may be passed for this parameter. return value should return null if no helper available for given language. getinterfaces() this method returns an ordered
list of interfaces iids that instances of the class promise to implement. note that nsisupports is an implicit member of the implemented set of interfaces and need not be included. if this method is not supported by an implementation, then it should return 0 for count and null for array. void getinterfaces( out pruint32 count, [array, size_is(count), retval] out nsiidptr array ); parameters ...
nsIClipboard
t changed in gecko 30.0 (firefox 30.0 / thunderbird 30.0 / seamonkey 2.27) method overview void emptyclipboard(in long awhichclipboard); void forcedatatoclipboard(in long awhichclipboard); obsolete since gecko 1.8 void getdata(in nsitransferable atransferable, in long awhichclipboard); boolean hasdatamatchingflavors([array, size_is(alength)] in string aflavor
list, in unsigned long alength, in long awhichclipboard); void setdata(in nsitransferable atransferable, in nsiclipboardowner anowner, in long awhichclipboard); boolean supportsselectionclipboard(); boolean supportsfindclipboard(); constants most clipboard operations in firefox use kglobalclipboard, which is the one also used by the typical control-c/control-v keyboa...
... clipboard. awhichclipboard specifies the clipboard to which this operation applies. hasdatamatchingflavors() this method provides a way to give correct ui feedback about, for instance, whether a paste should be allowed. it does not actually retrieve the data and should be a very inexpensive call. all it does is check if there is data on the clipboard matching any of the flavors in the given
list. boolean hasdatamatchingflavors( [array, size_is(alength)] in string aflavor
list, in unsigned long alength, in long awhichclipboard ); parameters aflavor
list an array of ascii strings. alength the length of the aflavor
list. awhichclipboard specifies the clipboard to which this operation applies. return value returns true, if data is present and it matches the specified flavor.
nsIClipboardDragDropHooks
s or data presented to the os. used for drag and copy actions. because this can be called many times, it is highly recommended that the implementation be very efficient so user feedback is not negatively impacted. boolean oncopyordrag( in nsidomevent aevent, in nsitransferable trans ); parameters aevent the dom event (drag drop). null if triggered by copy. trans the transferable holding the
list of flavors and the data for each flavor. return value true to indicate that copy/drag can proceed. otherwise, false to indicate that the copy/drag is canceled, does not go to operating system. onpasteordrop() provide an alternative action to the built-in behavior when something is dropped on the browser or in an editor. boolean onpasteordrop( in nsidomevent event, in nsitransferable trans );...
..., false to indicate that the copy/drag is canceled, does not go to operating system. onpasteordrop() provide an alternative action to the built-in behavior when something is dropped on the browser or in an editor. boolean onpasteordrop( in nsidomevent event, in nsitransferable trans ); parameters event the dom event (drag drop); null if triggered by paste. trans the transferable holding the
list of flavors and the data for each flavor. return value true to indicate the action was handled, do not perform built-in behavior. otherwise, false to indicate the action was not overridden, do built-in behavior. see also nsiclipboard ...
nsICookieService
n gecko 1.9 (firefox 3) see nsicookiemanager and nsicookiemanager2 for methods to manipulate the cookie database directly. this separation of interface is mainly historical. var cookiesvc = components.classes["@mozilla.org/cookieservice;1"] .getservice(components.interfaces.nsicookieservice); notifications this service broadcasts the following notifications when the cookie
list is changed, or a cookie is rejected: topic subject data cookie-changed broadcast whenever the cookie
list changes in some way. there are four possible data strings for this notification; one notification will be broadcast for each change. depending on the data value, either an nsicookie2 interface pointer representing the cookie object that changed, or an...
...ected cookie. deleted a cookie was deleted. the subject is the deleted cookie. added a cookie was added. the subject is the added cookie. changed a cookie was changed. the subject is the changed cookie. batch-deleted a set of cookies were deleted as part of a purge operation. this typically happens because they have either expired or because the cookie
list has grown too large. the subject is an nsiarray of deleted cookies. cleared the entire cookie
list was cleared. the subject is null. reload the entire cookie
list was changed, and the observer should reload the
list of cookies. the subject is null. private-cookie-changed since firefox 20 (see bugzilla #837091) same as cookie-changed, except used in lie...
nsIDOMEvent
is a bubbling event. if the event can bubble the value is true, else the value is false. read only. cancelable boolean used to indicate whether or not an event can have its default action prevented. if the default action can be prevented the value is true, else the value is false. read only. currenttarget nsidomeventtarget used to indicate the eventtarget whose event
listeners are currently being processed. this is particularly useful during capturing and bubbling. read only. defaultprevented boolean used to indicate whether preventdefault() has been called for this event. read only. eventphase unsigned short used to indicate which phase of event flow is currently being evaluated. read only. explicitoriginaltarget nsidome...
... void serialize( in ipcmessageptr amsg, in boolean aserializeinterfacetype ); parameters amsg aserializeinterfacetype native code only!settarget void settarget( in nsidomeventtarget atarget ); parameters atarget native code only!settrusted void settrusted( in boolean atrusted ); parameters atrusted stopimmediatepropagation() prevents other event
listeners from being triggered and, unlike stoppropagation() its effect is immediate. void stopimmediatepropagation(); parameters none. stoppropagation() the stoppropagation method is used prevent further propagation of an event during event flow. if this method is called by any event
listener the event will cease propagating through the tree. the event will complete dispatch to all
listeners on ...
nsIDOMFileException
f this interface presently differs from the working draft of the file api specification. content/base/public/nsidomfileexception.idlscriptable please add a summary to this article. ...
...tribute type description code unsigned short the error code describing the error condition that took place; see the constants
list for details. constants constant value description not_found_err 0 the specified file wasn't found. ...
nsIDOMWindow
); nsiselection getselection(); void scrollby(in long xscrolldif, in long yscrolldif); void scrollbylines(in long numlines); void scrollbypages(in long numpages); void scrollto(in long xscroll, in long yscroll); void sizetocontent(); attributes attribute type description applicationcache nsidomofflineresource
list get the application cache object for this window. read only. note: prior to gecko 7.0 this attribute was part of nsidomwindow2. document nsidomdocument the document contained in the window. read only. frames nsidomwindowcollection the child windows for this window. read only. native code only! globalstorage nsidomstorage
list global storage, accessib...
...he root window for the hierarchy of windows that contain this nsidomwindow. this is the window itself if there is no parent, or if the parent is of a different type. the window hierarchy does not cross chrome-content boundaries. this attribute is "replaceable" in javascript. read only. windowroot nsidomeventtarget the window root for this window. this is useful for connecting event
listeners to this window as well as every other window nested in that window root. read only. native code only! note: prior to gecko 7.0 this attribute was part of nsidomwindow2. methods getcomputedstyle() see dom-window-getcomputedstyle for details. nsidomcssstyledeclaration getcomputedstyle( in nsidomelement elt, in domstring pseudoelt optional ); parameters elt pseudoelt opti...
nsIEditor
i.outputtostring('text/html', 8); // xml: all in xml with _moz_dirty="" in new tags, html tags are in upper case // application/xhtml+xml format do the same editorapi.outputtostring('text/xml', 2); // the body is not recognized, everything is printed void outputtostream(in nsioutputstream astream, in astring formattype, in acstring charsetoverride, in unsigned long flags);
listener methods void addeditorobserver(in nsieditorobserver observer);obsolete since gecko 18 void seteditorobserver(in editaction
listener observer); void removeeditorobserver(in nsieditorobserver observer obsolete since gecko 18); void addeditaction
listener(in nsieditaction
listener
listener); void removeeditaction
listener(in nsieditaction
listener
listener...
...torobserver(in nsieditorobserver observer);obsolete since gecko 18 void seteditorobserver(in editaction
listener observer); void removeeditorobserver(in nsieditorobserver observer obsolete since gecko 18); void addeditaction
listener(in nsieditaction
listener
listener); void removeeditaction
listener(in nsieditaction
listener
listener); void adddocumentstate
listener(in nsidocumentstate
listener
listener); void removedocumentstate
listener(in nsidocumentstate
listener
listener); debug methods void dumpcontenttree(); void debugdumpcontent() ; void debugunittests(out long outnumtests, out long outnumtestsfailed); [notxpcom] boolean ismodifiablenode(in nsidomnode anode); constants load flags ...
nsIEditorIMESupport
read only. methods native code only!begincomposition obsolete since gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1)this feature is obsolete. although it may still work in some browser...
...olete since gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1)this feature is obsolete. ...
nsIErrorService
ed. return value the key to use to retrieve the error string from the nsresult's module's string bundle. registererrorstringbundle() registers a string bundle url for an error module. void registererrorstringbundle( in short errormodule, in string stringbundleurl ); parameters errormodule the module for which the string bundle is to be registered. should be one of the modules
listed in xpcom/base/nserror.h, such as ns_error_module_storage. stringbundleurl the url of the string bundle to register for the module. registererrorstringbundlekey() registers a key in a string bundle for an nsresult error code. void registererrorstringbundlekey( in nsresult error, in string stringbundlekey ); parameters error the nsresult for which the string bun...
... stringbundlekey the key that should be used to retrieve the error string from string bundle for the given nsresult. unregistererrorstringbundle() unregisters a string bundle url for an error module. void unregistererrorstringbundle( in short errormodule ); parameters errormodule the module for which the string bundle is to be unregistered. should be one of the modules
listed in xpcom/base/nserror.h, such as ns_error_module_storage. unregistererrorstringbundlekey() unregisters a key in a string bundle for an nsresult error code. void unregistererrorstringbundlekey( in nsresult error ); parameters error the nsresult for which the string bundle key is to be unregistered. ...
nsIFileView
inherits from: nsisupports last changed in gecko 1.7 note: nsifileview is linux-only interface. it's not included in windows or mac builds. note: a quirk of the nsifileview is that it requires an appropriate treecols section in the tree tag, by default fileview will return the file size in the column. if the treecol id is "filenamecolumn" fileview will return the file name, if the id is "lastmodifiedcolumn" it will return the date of last modification. currently no other file stats are implemented. ...
...type in effect. read only. constants constant value description sortname 0 sort by file name. sortsize 1 sort by file size. sortdate 2 sort by the date of the last modification. methods setdirectory() set the directory to be browsed. void setdirectory( in nsifile directory ); parameters directory the directory to be browsed. setfilter() set the filter to be applied to the file
list, for example "*.jpg" would only return jpg files. void setfilter( in astring filterstring ); parameters filterstring the filter to be applied to the file
list. sort() set the method used for sorting. void sort( in short sorttype, in boolean reversesort ); parameters sorttype one of the sort* constants. reversesort true, results will be sorted in ascending order. example <?xml version=...
nsIHttpServer
http;1"] .createinstance(components.interfaces.nsihttpserver); return { get objectname () { return "webserver"; }, /** * @param integer|string port port or "host:port" * @param object opt optional options. ...
... }); }, close: function(){ server.stop(function(){}); }, get port() { return server.identity.primaryport } } } reference : mozilla-release/netwerk/test/httpserver/nsihttpserver.idl [scriptable, uuid(cea8812e-faa6-4013-9396-f9936cbb74ec)] interface nsihttpserver : nsisupports { /** * starts up this server,
listening upon the given port. * * @param port * the port upon which
listening should happen, or -1 if no specific port is * desired * @throws ns_error_already_initialized * if this server is already started * @throws ns_error_not_available * if the server is not started and cannot be started on the desired port * (perhaps because the port is already in use or beca...
nsIINIParser
f8stringenumerator providing the keys available within the specified section of the ini file. nsiutf8stringenumerator getkeys( in autf8string asection ); parameters asection the name of the section whose keys you wish to enumerate. return value an nsiutf8stringenumerator object that can be used to access the section's keys. getsections() returns an nsiutf8stringenumerator providing a
list of the sections available within the ini file. nsiutf8stringenumerator getsections(); parameters none. return value an nsiutf8stringenumerator object that can be used to access the sections in the ini file. getstring() returns the string value for the specified key within a particular section of the ini file. autf8string getstring( in autf8string asection, in autf8string akey ); parameters ...
...// get all sections in the ini file var sectenum = iniparser.getsections(); // save the sections in an array var sections = []; while (sectenum && sectenum.hasmore()) { var section = sectenum.getnext(); // add an array entry for each section sections.push(section); } enumerating keys this example shows how to fetch the values for all the keys in the sec...
nsILivemarkService
reatelivemark( in long long folder, in astring name, in nsiuri siteuri, in nsiuri feeduri, in long index ); parameters folder the id of the parent folder. name the name to show when displaying the livemark. siteuri the uri of the site from which the livemark was created. feeduri the uri of the actual rss feed. index the index to insert at, or -1 to append to the end of the
list. return value the id of the folder for the livemark. createlivemarkfolderonly() this method also creates a new livemark but use this method during startup to avoid http traffic. long long createlivemarkfolderonly( in long long folder, in astring name, in nsiuri siteuri, in nsiuri feeduri, in long index ); parameters folder the id of the parent folder. name the name to show...
...arkfolderonly( in long long folder, in astring name, in nsiuri siteuri, in nsiuri feeduri, in long index ); parameters folder the id of the parent folder. name the name to show when displaying the livemark. siteuri the uri of the site from which the livemark was created. feeduri the uri of the actual rss feed. index the index to insert at, or -1 to append to the end of the
list. return value returns the id of the folder for the livemark. getfeeduri() this method retrieves the uri of the syndication feed associated with a livemark container. nsiuri getfeeduri( in long long container ); parameters container the folder id of a livemark container. return value a nsiuri representing the uri of the feed; if the livemark container doesn't have a valid feed uri...
nsILoginManagerStorage
submitted. to match any form login, specify an empty string. to not match to any form login, specify null. ahttprealm the http realm for which the login applies. to match logins for any realm, specify an empty string. to not match any realm, specify null. logins return in this parameter an array of nsilogininfo matching the search criteria. getalldisabledhosts() implement this method to return a
list of all hosts for which password saving is disabled. void getalldisabledhosts( out unsigned long count, optional [retval, array, size_is(count)] out wstring hostnames ); parameters count optional return in this parameter the number of disabled hostnames returned in the hostnames parameter. hostnames return in this parameter an array of all hostnames for which password saving is disabled. ge...
...s always returned; if there are no logins the array is empty. this does not decrypt logins before returning the array. void getallencryptedlogins( out unsigned long count, optional [retval, array, size_is(count)] out nsilogininfo logins ); parameters count optional the number of elements in the array. logins an array of nsilogininfo objects. getalllogins() implement this method to return a
list of all logins in the login store. void getalllogins( out unsigned long count, optional [retval, array, size_is(count)] out nsilogininfo logins ); parameters count optional return in this parameter the number of logins returned in the logins array. logins return in this parameter an array of all nsilogininfo objects in the login store. this parameter must always be an array; if there are no ...
nsIMessageSender
for example, a child-process message manager will send messages that are only delivered to its one parent-process message manager. to send messages to multiple "other sides", you would use nsimessagebroadcaster. see message manager interfaces for more details on the distinction between message senders and message broadcasters. ...
...ween message senders and message broadcasters. methods void sendasyncmessage([optional] in astring messagename, [optional] in jsval obj, [optional] in jsval objects, [optional] in nsiprincipal principal); sendasyncmessage() send messagename and obj to the "other side" of this message manager. this invokes
listeners who registered for messagename using a nsimessage
listenermanager. see nsimessage
listener::receivemessage() for the format of the data delivered to
listeners. throws ns_error_not_initialized if the sender is not initialized. for example, we will throw ns_error_not_initialized if we try to send a message to a cross-process frame but the other process has not yet been set up. throws ns_e...
nsIMsgDBView
() opens the view with a set of specified headers. note: this is not implemented in the base implementation. void openwithhdrs(in nsisimpleenumerator aheaders, in nsmsgviewsorttypevalue asorttype, in nsmsgviewsortordervalue asortorder, in nsmsgviewflagstypevalue aviewflags, out long acount); parameters aheaders a
list of headers to open, arranged in an nsisimpleenumerator. asorttype a nsmsgviewsorttypevalue designating the sort type used for the folder. defined in the interface: nsmsgviewsorttype. sortorder an nsmsgviewsortordervalue designating the sort order used for the folder. defined in the interface: nsmsgviewsortorder. viewflags other flags to be used. defined in the interface: nsmsgviewflagstype.
... folder. defined in the interface: nsmsgviewsorttype. sortorder an nsmsgviewsortordervalue designating the sort order used for the folder. defined in the interface: nsmsgviewsortorder. viewflags other flags to be used. defined in the interface: nsmsgviewflagstype. return values acount upon return, the count variable may contain the number of messages loaded. close() close the current
list of messages. void close(); init() initializes the database view for use. void init(in nsimessenger amessengerinstance, in nsimsgwindow amsgwindow, in nsimsgdbviewcommandupdater acommandupdater); parameters amessengerinstance amsgwindow acommandupdater sort() sorts the currently loaded messages. void sort(in nsmsgviewsorttypevalue sorttype, in ns...
nsIMsgSearchCustomTerm
id /** * globally unique string to identify this search term. * recommended form: extensionname@example.com#termname * commas and quotes are not allowed, the id must not * parse to an integer, and names of standard search * attributes in searchattribentrytable in nsmsgsearchterm.cpp * are not allowed. */ readonly attribute acstring id; name /// name to display in term
list. this should be localized. */ readonly attribute astring name; needsbody /// does this term need the message body? readonly attribute boolean needsbody; methods getenabled /** * is this custom term enabled? * * @param scope search scope (nsmsgsearchscope) * @param op search operator (nsmsgsearchop). if null, determine * if term is ...
... * @param scope search scope (nsmsgsearchscope) * @param op search operator (nsmsgsearchop). if null, determine * if term is available for any operator. * * @return true if available */ boolean getavailable(in nsmsgsearchscopevalue scope, in nsmsgsearchopvalue op); getavailableoperators /** *
list the valid operators for this term. * * @param scope search scope (nsmsgsearchscope) * @param length object to hold array length * * @return array of operators */ void getavailableoperators(in nsmsgsearchscopevalue scope, out unsigned long length, [retval, array, size_is(length)] ...
nsIPermissionManager
m an action. pruint32 testpermissionfromprincipal( in nsiprincipal principal, in string type ); parameters principal the principal to be tested. type a case-sensitive ascii string, identifying the consumer. return value a pruint32 representing the permission, or unknown_action if no permission exists. remarks this service broadcasts the following notification when the permission
list is changed: topic : "perm-changed" (perm_change_notification) broadcast whenever the permission
list changes in some way. there are four possible data strings for this notification; one notification will be broadcast for each change, and will involve a single permission. data : "deleted" a permission was deleted. the subject is the deleted nsipermission. data : "added" a permission was added.
...the subject is null. see also nsisimpleenumerator ...
nsIProcessScriptLoader
ady running at the time of the call. if this flag is true, the process script will be loaded into any new child processes created after the loadprocessscript() call, until removedelayedprocessscript() is called for that script. if you are calling loadprocessscript() on a chromemessagesender, you should always pass true here. removedelayedprocessscript() removes aurl from the
list of scripts which support delayed load. this cancels the effect of the aallowdelayedload flag, meaning that the loader will no longer load the script into new child processes. if you used aallowdelayedload, you should call this as part of your cleanup (for example, when your add-on is disabled or uninstalled). parameters name type description aurl string url for th...
... processes. if you used aallowdelayedload, you should call this as part of your cleanup (for example, when your add-on is disabled or uninstalled). parameters name type description aurl string url for the script to remove. getdelayedprocessscripts() returns all delayed scripts that will be loaded once a child process becomes available. the return value is a
list of pairs [<url>, false]. returns
list of the delayed scripts. each script is returned as a pair: [<url>, false]. ...
nsIProfile
, which were based off gecko 1.8.1. however, it hasn't been used in firefox since before firefox 1.0. ...
...if true, an existing directory may be used; otherwise, the profile directory will be unique. deleteprofile() deletes the specified profile. void deleteprofile( in wstring name, in boolean candeletefiles ); parameters name the name of the profile to delete. candeletefiles if true, the profile manager will try to delete all of the profile's files and its directory. getprofile
list() returns an array of strings indicating the names of all the available profiles. void getprofile
list( out unsigned long length, [retval, array, size_is(length)] out wstring profilenames ); parameters length on return, contains the number of profiles in the profilenames array. profilenames on return, contains an array of all of the available profiles' names. profileexists()...
nsIProtocolHandler
ed only by callers with a principal that subsumes this uri. for example, privileged code and websites that are same origin as this uri. uri_non_persistable 1<<10 loading channels from this protocol has side-effects that make it unsuitable for saving to a local file. uri_does_not_return_data 1<<11 channels using this protocol never call ondataavailable() on the
listener passed to asyncopen(), and therefore do not return any usable data. uri_is_local_resource 1<<12 uris for this protocol are considered to be local resources. this could be a local file (uri_is_local_file), a ui resource (uri_is_ui_resource), or something else that would not hit the network. uri_opening_executes_script 1<<13 uris for this protocol execute scr...
...ler, but should instead set the allows_proxy_http flag. allows_proxy_http 1<<3 the protocol handler can be proxied using an http proxy (for example, http and ftp). nsiioservice.newchannelfromuri() will feed uris from this protocol handler to the http protocol handler instead. this flag is ignored if allows_proxy is not set. methods allowport() lets a protocol override black
listed ports. this method is called when there's an attempt to connect to a port that is black
listed. for example, for most protocols, port 25 (simple mail transfer protocol) is banned. when a uri containing this port number is encountered, this method is called to ask if the protocol handler wants to override the ban. boolean allowport( in long port, in string scheme ); parameters port the...
nsIProtocolProxyService
r null for a direct connection. exceptions thrown ns_error_not_available if there is no alternate proxy available. registerfilter() this method may be used to register a proxy filter instance. each proxy filter is registered with an associated position that determines the order in which the filters are applied (starting from position 0). when resolve/asyncresolve is called, it generates a
list of proxies for the given uri, and then it applies the proxy filters. the filters have the opportunity to modify the
list of proxies. if two filters register for the same position, then the filters will be visited in the order in which they were registered. if the filter is already registered, then its position will be updated. after filters have been run, any disabled or disallowed proxies will...
...a proxy is disabled if it had previously failed-over to another proxy (see getfailoverforproxy()). a proxy is disallowed, for example, if it is a http proxy and the nsiprotocolhandler for the queried uri does not permit proxying via http. ...
nsIPushService
) { cu.reporterror("error unsubscribing: " + code); return; } // `ok === true` if the subscription was removed, or `false` if the // `(scope, principal)` pair didn't have a subscription. } ); receiving push messages subscriptions created from privileged code use xpcom observer notifications instead of service worker events. you can use the global nsiobserverservice to
listen for these notifications. messages sent to system subscriptions are broadcasted to all push-message observers. your nsiobserver should ensure the data parameter matches your subscription scope. otherwise, your code may try to handle messages meant for other subscriptions. topic subject data description push api counterpart push-message nsipushmessage if the m...
...ipushmessage if the message has a payload; null for blank messages. scope fired when a push message is sent to a system subscription. serviceworkerglobalscope.onpush push-subscription-change null scope fired when the push server drops a subscription, or the subscription identifier changes. serviceworkerglobalscope.onpushsubscriptionchange please make sure you
listen for push-subscription-change. if the subscription is lost, and your code isn't
listening for this notification, you won't be able to receive messages until you create a new subscription. example const obsservice = cc["@mozilla.org/observer-service;1"] .getservice(ci.nsiobserverservice); let pushobserver = { scope: "chrome://my-module/push", observe(subject, topic, ...
nsIRadioInterfaceLayer
.getservice(components.interfaces.nsiinterfacerequestor) .createinstance(components.interfaces.nsiradiointerfacelayer); method overview void answercall(in unsigned long callindex); void deactivatedatacall(in domstring cid, in domstring reason); void dial(in domstring number); void enumeratecalls(in nsiriltelephonycallback callback); void getdatacall
list(); unsigned short getnumberofmessagesfortext(in domstring text); void hangup(in unsigned long callindex); void registercallback(in nsiriltelephonycallback callback); void registerdatacallcallback(in nsirildatacallback callback); void rejectcall(in unsigned long callindex); void sendsms(in domstring number, in domstring message, in long requestid, in unsigned long long processid); vo...
... in domstring number ); parameters number missing description exceptions thrown missing exception missing description enumeratecalls() will continue calling callback.enumeratecallstate until the callback returns false. void enumeratecalls( in nsiriltelephonycallback callback ); parameters callback missing description exceptions thrown missing exception missing description getdatacall
list() void getdatacall
list(); parameters none. exceptions thrown missing exception missing description getnumberofmessagesfortext() returns the number of multi-part sms needed for a given text (160 characters for one sms). unsigned short getnumberofmessagesfortext( in domstring text ); parameters text the body text of an sms. return value unsigned short. number of sms needed. hangup() void ha...
nsIResumableChannel
netwerk/base/public/nsiresumablechannel.idlscriptable this interface is meant to be implemented by the channels that support resuming broken downloads (for example necko's html and ftp channels). inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void asyncopenat(in nsistream
listener
listener, in nsisupports ctxt, in unsigned long startpos, in nsiresumableentityid entityid); obsolete since gecko 1.8 void resumeat(in unsigned long long startpos, in acstring entityid); attributes attribute type description entityid acstring the entity id for this uri. available after onstartrequest. read only. exceptions thrown ns_error_not_resumable if this load is not resumable. methods asyncopenat() ...
...e description entityid acstring the entity id for this uri. available after onstartrequest. read only. exceptions thrown ns_error_not_resumable if this load is not resumable. methods asyncopenat() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) open this channel, and read starting at the specified offset. the request given to the nsistream
listener will be qiable to nsiresumableinfo. void asyncopenat( in nsistream
listener
listener, in nsisupports ctxt, in unsigned long startpos, in nsiresumableentityid entityid ); parameters
listener as for asyncopen. ctxt as for asyncopen. startpos the starting offset, in bytes, to use to download. entityid information about the file, to match before obtaining the file. pass an empty string t...
nsISound
vent_alert_dialog_open 1 an alert dialog is opened. event_confirm_dialog_open 2 a confirm dialog is opened. event_prompt_dialog_open 3 a prompt dialog (one that allows the user to enter data, such as an authentication dialog) is opened. event_select_dialog_open 4 a select dialog (one that contains a
list box) is opened. event_menu_execute 5 a menu item is executed. event_menu_popup 6 a popup menu is shown. event_editor_max_len 7 more characters than the maximum allowed are typed into a text field. methods beep() plays a beep sound. void beep(); parameters none. init() not strictly necessary, but avoi...
... dialog is opened. _moz_confirmdialog the system sound when a confirm dialog is opened. _moz_promptdialog the system sound when a prompt dialog (one that allows the user to enter data, such as an authentication dialog) is opened. _moz_selectdialog the system sound when a select dialog (one that contains a
list box) is opened. _moz_menucommand the system sound when a menu item is executed. _moz_menupopup the system sound when a popup menu is shown. ...
nsIStringBundle
nd in the properties file (that is you can't omit %1 and use only %2). do not try to use any other types. this uses nstextformatter::smprintf. wstring formatstringfromid( in long aid, [array, size_is(length)] in wstring params, in unsigned long length ); parameters aid the id of the string to retrieve. params parameters to pass in to the string. length the length of the parameter
list. return value returns the formatted string. formatstringfromname() returns a formatted string with the given key name from the string bundle, where each occurrence of %s (uppercase) is replaced by each successive element in the supplied array. you may also use other formatting codes, but can only pass unicode strings in. the name should refer to a string in the bundle that uses %s, and the n...
...is you can't omit %1 and use only %2). do not try to use any other types. this uses nstextformatter::smprintf to do the dirty work. wstring formatstringfromname( in wstring aname, [array, size_is(length)] in wstring params, in unsigned long length ); parameters aname the name of the string to retrieve. params parameters to pass in to the string. length the length of the parameter
list. return value returns the formatted string. getsimpleenumeration() nsisimpleenumerator getsimpleenumeration(); parameters none. return value returns a nsisimpleenumerator of all nsipropertyelement entries in the string bundle. getstringfromid() retrieves a string from the bundle by its id. wstring getstringfromid( in long aid ); parameters aid the id of the string to retrieve...
nsITransaction
ansaction again. can only be called on a transaction that was previously undone. ...
...n only be called on a transaction that was previously undone. ...
nsITransferable
estination directory for a file drag is known. methods adddataflavor() adds a new data flavor, indicating that this transferable can receive the type of data represented by the specified flavor string. void adddataflavor( in string adataflavor ); parameters adataflavor a string defining a new data flavor that the transferable supports. ...
... nsisupportsarray flavorstransferablecanimport(); parameters none. ...
nsIUpdatePrompt
pdate.silent preference is true the call will be a no-op. void showupdateerror( in nsiupdate update ); parameters update an nsiupdate describing the update that failed to install. the nsiupdate object will not be the actual update when the error occurred during an update check and will instead be an nsiupdate object with the error information for the update check. showupdatehistory() shows a
list of all updates that have been installed to date. void showupdatehistory( in nsidomwindow parent ); parameters parent an nsidomwindow indicating the parent window to which to anchor the update
list window. this can be null. showupdateinstalled() shows a message detailing the update that was just installed successfully. if the app.update.silent preference is true, the app.update.showinstalledu...
...lled successfully. ...
nsIWebContentHandlerRegistrar
xpfe/appshell/public/nsiwebcontenthandlerregistrar.idlscriptable applications wishing to use web content handlers need to implement this interface. typically they will prompt the user to confirm adding an entry to the local
list. inherits from: nsisupports last changed in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) implemented by @mozilla.org/embeddor.implemented/web-content-handler-registrar;1 as a service: var nsiwchr = cc["@mozilla.org/embeddor.implemented/web-content-handler-registrar;1"] .getservice(ci.nsiwebcontenthandlerregistrar); method overview void registercontenthandler(in domstring mimetype, in domstring uri, in domstring title, in nsidomwindow contentwindow) void registerprotocolhandler(in domstring protoco...
... the dom content window from which the method has been called. note: script must execute from same domain as uri or else it will throw permission error. can bypass this by opening about:config and setting preference of gecko.handlerservice.allowregisterfromdifferenthost to true. examples register a webmail service as mailto handler the following code aims to add "outlook.com live mail" to
list of webservice handlers. in the image below "gmail" and "yahoo! mail" already exist as webservice handlers. cu.import('resource://gre/modules/services.jsm'); var nsiwchr = cc["@mozilla.org/embeddor.implemented/web-content-handler-registrar;1"] .getservice(ci.nsiwebcontenthandlerregistrar); var htmlcontentwindow = undefined; var registeruri = 'http://mail.live.com/secure/start?
nsIAbCard/Thunderbird3
firstname astring shorthand for getproperty and setproperty. lastname astring shorthand for getproperty and setproperty. displayname astring shorthand for getproperty and setproperty. primaryemail astring shorthand for getproperty and se...
...t this card has as an enumerator, whose members are all nsiproperty objects. firstname astring shorthand for getproperty and setproperty. lastname astring shorthand for getproperty and setproperty. displayname astring shorthand for getproperty and setproperty. primaryemail astring shorthand for getproperty and setproperty. ismail
list boolean if ismail
list is true then mail
listuri will contain the uri of the associated mail
list. this will be removed from the interface at a later date. mail
listuri string if ismail
list is true then mail
listuri will contain the uri of the associated mail
list. this will be removed from the interface at a later date. methods getproperty() returns a pr...
XPCOM reference
grouping and category names were made by somewhat arbitrary decision by the author. (i'm fully aware that this will be a great point of discussion and probably will end in tears, but since i...
...componentsthere are a number of components provided in the standard implementation of xpcom; these are as follows.xpcom glue classesthese "glue" classes are provided to make it easier to use xpcom from c++ code.xpcom interface referencethis is a reference to the xpcom interfaces provided by the mozilla platform.xpcom interface reference by groupingthis page
lists the current (as of dec. 01, 2010)
list of mozilla interfaces as
listed on the xpcom interface reference page where that page
lists items by alphabetical sorting, this page attempts to group them by function. grouping and category names were made by somewhat arbitrary decision by the author. (i'm fully aware that this will be a great point of discussion and probably will end in tears, but since i'm the first person to apparently take a...
Storage
se that the binding mechanism does that for you. you can still use this helper object by manually creating the statement wrapper, mozistoragestatementwrapper, which is provided in gecko 1.9.1 and later. using named parameters in c++ is a lot more difficult, so it's generally accepted to use numerical placeholders instead. the example below uses mozistoragestatement.bindint32parameter(). the full
list of binding functions can be found with the mozistoragestatement documentation. c++ example: nscomptr<mozistoragestatement> statement; rv = mdbconn->createstatement(ns_literal_cstring("select * from table_name where id = ?1"), getter_addrefs(statement)); ns_ensure_success(rv, rv); rv = statement->bindint32parameter(0, 1234); ns_ensure_success(rv, rv); note: numer...
...once all the parameters are set up, a single call to mozistoragestatement.bindparameters() will ensure that the parameters are bound before execution. you can then execute the statement asynchronously, and the statement will get each set of bindings bound to it before execution asynchronously. executing a statement...
Troubleshooting XPCOM components registration
also check that the function nsgetmodule is exported. you can also use the profiling feature of dependency walker to view failed module loads while running your application. open the profile menu and select start profiling.... in the dialog that appears, you can provide command line parameters and click ok to start the application. you will see any modules that failed to load in the module
list. note: you should delete compreg.dat from your profile before doing this. note that even your version of msvc may matter; your test machine may not have the c runtime libraries (msvcr70.dll / msvcp70.dll for msvc 7.0, and similarly named files for 7.1 and 8.0) available. this even means that if you are using a component stub, the stub needs to be compiled using a ver...
...may be able build your component using use_static_libs=1 in order to remove c runtime library dependencies. linux-specific hints check if you have missing dependent libraries: from your firefox (/xulrunner) install directory, run "./run-mozilla.sh `which ldd` -r path/to/your/component.so". there should be no "not found" entries and no undefined symbols. (the -r switch from gnu ldd
lists function relocations; adjust as suitable for your version) trace shared library loading by setting the environment variable ld_debug=all while launching firefox (see `man ld.so` for details). use strace to see if firefox is trying to load your components. pass the -wl,-z,defs flag to gcc when linking your component. this will ensure that undefined symbols show an error at link time inste...
Weak reference
prevent a dangling pointer, however. so, instead of holding an owning reference to an nsiobserver, it holds a weak reference. the weak reference doesn't artificially extend the life of the observer, and yet, it can never dangle. the following assumes that any nsiobserver that is passed in also implements nsisupportsweakreference. you can extrapolate from managing a single observer to managing a
list of observers. class nsobservable { public: // ... nsresult addobserver( nsiobserver* ); nsresult notifyobservers( nsimessage* ); // ... private: nsweakptr mobserver; // ...or imagine a
list of observers here }; // ... nsresult nsobservable::addobserver( nsiobserver* aobserver ) { mobserver = getter_addrefs( ns_getweakreference(aobserver) );...
... { public: // ... nsresult addobserver( nsiobserver* ); nsresult notifyobservers( nsimessage* ); // ... private: nsweakptr mobserver; // ...or imagine a
list of observers here }; // ... nsresult nsobservable::addobserver( nsiobserver* aobserver ) { mobserver = getter_addrefs( ns_getweakreference(aobserver) ); // ...or append this to the
list of observers return ns_ok; } nsresult nsobservable::notifyobservers( nsimessage* amessage ) { nscomptr<nsiobserver> observer = do_queryreferent(mobserver); if ( observer ) observer->noticemessage(amessage); else mobserver = 0; // or remove this observer from the
list, he's gone away return ns_ok; } // ... it's key to note that an nsweakptr has exac...
Autoconfiguration in Thunderbird
server you set up a web server bound to a physical ip address. this may be on the same machine as other web servers, but the web server must be configured to the content to any requested domain. you must use a virtual host that match all autoconfig.* domains of your customers. in apache terms, you can use a "ip-based virtual host". ...
...r=301,ne] #... </virtualhost> <virtualhost *:80> documentroot /var/www/autoconfig/ servername autoconfig.hoster.com <directory /var/www/autoconfig> order allow,deny allow from all </directory> </virtualhost> if you use nginx, you can easily add a subdomain to all your domains, which does the same as above. either, you can redirect them to a common hostname: server {
listen 10.2.3.4:80; #use your server's public ip here! server_name autoconfig.*; return 301 http://autoconfig.hoster.com$request_uri; } or serve them directly from a common directory: server {
listen 10.2.3.4:80; #again, use your server's public ip here! server_name autoconfig.*; location / { root /var/www/autoconfig; } } ssl https was added in june 2019 to the spec. please use https whe...
MailNews fakeserver
to enable/disable debugging, call setdebuglevel on your nsmailserver instance with one of the following options: const fsdebugnone = 0; // dump nothing cons...
...orders. the only generated header is lines. ...
Mailnews and Mail code review requirements
obtained a ui-review on an attachment, set ui-review to '?' and enter :bwinton (for blake winton) as the requestee. mike conley (:mconley) can also provide useful feedback, but blake is the current ultimate decider for ui choices in thunderbird. rules for all patches affecting mailnews/ and mail/ wherever possible, significant patches in a certain area should be reviewed by one of the
listed sub-module owner/reviewers. peers may grant review in any area covered by mailnews/, provided they feel confident in their knowledge of the code being changed. sub-module peers may only grant review in the
listed sub-module. if a reviewer feels that the patch would benefit from additional reviews, they should request a second review from an appropriate person. super-review is required in ce...
... don't affect the actual product cannot be usefully tested. these bugs should have the in-testsuite- flag set. rubber-stamp approvals for intermittently failing ("orange") test fixes/debugging in order to make it easier to debug and fix tests that fail intermittently ("intermittent orange" tests), we have created the following two rubber-stamps based on this proposal on the tb-planning mailing
list. the procedure to use these is to be sure to: include "rs=simple-orange-fix" or "rs=orange-debugging" in the first line of the commit message paste a link to the pushed commit with the rubber stamp in the bug make sure you pasted a link to any try-server pushes of the patch in the bug rs=simple-orange-fix requirements: the patch is fixing an intermittent orange test failure. the patc...
Main Windows
warning: this content is for older versions of thunderbird. much of it may no longer be relevant. see developer.thunderbird.net for newer information. the base chrome directory of thunderbird can sometimes appear confusing when you're just beginning to look at it. as such, i've always thought it would be nice to have a
list of what xul, js, or other files are that are here, what they do, and where they overlay at different points within the client. things appear confusing for several reasons: much of the code is written to be portable, so instead of duplicating it, its been put in overlays that are loaded over many different types of windows. some of the code was written based off of early firefox code, but is not exactly the same. you’ll sometimes see reimplementations of...
...e, edit, view, etc). osx only: macmenuoverlay.xul a special overlay for osx that adds a few items to the window menu. messagewindow.xul messagewindow.xul is shown when a message is opened. its almost exactly the same as messenger.xul in terms of overlays, but just lacks the folder and threadpanes normally shown. menus, toolbar buttons, and headers are all taken from exactly the same overlays
listed above though. mailwindowoverlay.xul this is the red sections shown in the interface above, including the toolbars, notification bars and the status bar.it also includes most of the commands, keysets, and context menus of thunderbird, along with a whole lot of javascript. msghdrviewoverlay.xul shown in blue above, this overlay consists of three boxes. two are stacked showing either a brie...
Building a Thunderbird extension 1: introduction
eloper.thunderbird.net for newer information. this tutorial will introduce you to the components of a thunderbird extension and will show you how to build your own. ...
...ctors. these are described on the page "setting up an extension development environment". documentation thunderbird extensions (documentation overview) firefox addons developer guide (many topics are applicable to thunderbird) mozilla cross-reference source code browser ("comm-central" contains the thunderbird code repository) community the thunderbird development community has a mailing
list with an extensive searchable archive with an extensive searchable archive. you can also talk with the community on the #maildev irc channel. next » ...
Creating a Custom Column
nt the nsimsgcustomcolumnhandler interface which defines the basic set of functionality that must be implemented to handle a column. note that an object that implements this interface can also take control of an existing, built-in column, but more about that later. 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. from nsitreeview: getcellproperties(row, col, props): optionally modify the props array getrowproperties(row, props): optionally modify the props array getimagesrc(row, col): return a string (or null)...
...ew function, addcolumnhandler that takes a column id and a handler object. our implementation will need to call something similar to: gdbview.addcolumnhandler("colreplyto", columnhandler); setting the custom column handler we've added a special event that gets fired whenever a view is created. when that event fires, you should set up the custom column handler on the new view. ...
Activity Manager examples
ndo : public nsiactivityundohandler { public: ns_decl_isupports ns_decl_nsiactivityundohandler mycopyeventundo() {} private: ~mycopyeventundo() {} }; ns_impl_isupports1(mycopyeventundo, nsiactivityundohandler) ns_imethodimp mycopyeventundo::undo(nsiactivityevent *event, nsresult *result) { nsresult rv; // get the subjects of this copy event pruint32 length; nsivariant **subject
list; rv = event->getsubjects(&length, &subject
list); if(ns_failed(rv)) return rv; // first subject in the
list is the source folder in this particular case nscomptr<nsimsgfolder> folder = do_queryinterface(subject
list[0]); // get the initiator nsivariant *initiator; event->getinitiator(&initiator); if (initiator) { nsisupports* ptr; rv = object->getasisupports(&ptr); ...
...o(); nscomptr<nsiactivityevent> copyevent(do_createinstance("@mozilla.org/activity-event;1")); // the initiator of this particular event is copyservice. we want to // associate it with the event since we are going to use it in the // undo handler. // same for the source folder, it is required for undo operation, but // since it is the subject of this activity (event), it goes into the // subject
list. // wrap copyservice in a nsvariant component nscomptr<nsiwritablevariant> initiator = do_createinstance(ns_variant_contractid); initiator->setasisupports(reinterpret_cast<nsisupports*>(copyservice)); // subject of the delete operation is the imap folder // wrap it in a nsvariant component nscomptr<nsiwritablevariant> srcfolder = do_createinstance(ns_variant_contractid); srcfolder->setasisuppor...
Tips and Tricks from the newsgroups
you can also help by creating how-tos from any of these topics. ...
... are unknown) determine whether a message has been flagged as junk imap: getting message key of copied message by nsimsgcopyservice::copyfilemessage access the plain text content of the email body get information about attachment without selecting message repeat image display using css sprites scan for new messages at startup and manually scan a folder initiated by user force
listeners to run consecutively to prevent pop messages from getting garbled during message retrieval ...
Thunderbird extensions
how to create your first message query and read the gloda examples gloda internals: gloda debugging, gloda indexing more thunderbird-specific links some links may be out of date, but they still provide valuable information on the codebase. ...
...rbird api docs (mostly a collection of out-of-date pages, relevance is rather dubious) general links finding the code for a feature mozillazine articles on thunderbird community / communications thunderbird specific : add-ons section on developer.thunderbird.net thunderbird communication channels add-on developers forum/mailing
list #maildev irc channel more general : mozillazine extension development forum general developer channels related topics xul, javascript, xpcom, themes, developing mozilla categori ...
Using the Mozilla symbol server
bol path (note: you can replace c:\symcache\ with any writable directory on your computer, if you'd prefer a different location for downloaded symbols): srv*c:\symcache\*https://symbols.mozilla.org/ set this string as _nt_symbol_path in the environment, using the windbg menus, or by typing the .sympath command. ...
...rm is either 'darwin' (for mac) or 'linux'. the rest of values are based on the contents of the application.ini file under the [app] heading: for example, the thunderbird 3.1b2 release with name=thunderbird, version=3.1b2, buildid=20100430125415 would have a filename of "thunderbird-3.1b2-linux-20100430125415-symbols.txt" under the thunderbird directory at symbols.mozilla.org. its contents are a
list of paths to files, all relative to the directory the blah-symbols.txt file is found in. the source server in addition to symbols, mozilla also has a source server, letting you do source-level debugging and inspection on demand. troubleshooting: symbols will not download if symbols will not download no matter what you do, the problem may be that internet explorer has been set to the work offli...
Drawing and Event Handling - Plugins
w the drag highlight and handle drops when they occur within the instance rectangle. the browser is also responsible for sending the plug-in all events targeted to an instance, such as mouse clicks when the cursor is within the instance rectangle or suspend and resume events when the application is switched in and out. events are sent to the plug-in with a call to npp_handleevent; for a complete
list of event types, see the reference entry for npevent. windows on windows, the browser registers a window class and creates an instance of that class for the plug-in instance. the plug-in can then subclass the window to receive any events it needs. if the plug-in needs to receive periodic time messages (for example, for animation), it should use a timer or a separate thread. unix on unix, the b...
.... the plug-in must return true from npp_handleevent if it has handled the event and false if it has not. mac os uses this mechanism for both windowed and windowless plug-ins; on this platform, npp_handleevent is the only way the plug-in can receive events from its host application. int16 npp_handleevent(npp instance, npevent *event); the instance parameter represents the current plug-in. for a
list of event types the application is responsible for delivering to the plug-in, see the npevent structure. this code shows the specific data passed through this method for each platform: #ifdef xp_mac typedef eventrecord npevent; #elif defined(xp_win) typedef struct _npevent { int16 event; int16 wparam; int32 lparam; } npevent; #elif defined(xp_unix) typedef xevent npevent; #else t...
Initialization and Destruction - Plugins
ing plug-ins. plug-ins are native code libraries: .dll files on windows, .so or .dso files on unix, and powerpc shared library files or 68k code resources on mac os. to reduce memory overhead, plug-ins are usually loaded only when needed and released as soon as possible. in the initialization process, the browser passes the plug-in two tables of function pointers for all api calls: one table
lists all api calls from the plug-in to the browser. this table is filled out by the browser before the initialization call. the other table
lists all api calls from the browser to the plug-in. this table is filled out by the plug-in during the initialization call. the function tables also contain version information that the plug-in checks to verify that it is compatible with the api capabilities ...
...embed element in the example, the browser passes the values in argv to the plug-in instance: argc = 4 argn = { "src", "height", "width", "loop" } argv = { "movie.avi", "100", "100", "true" } the saved parameter allows an instance of a plug-in to save its data and, when the instance is destroyed, pass the data to the next instance of the plug-in at the same url. the data is saved in the history
list. as long as the plug-in still appears in this
list, that saved data is associated with the page; any new instances receive this data. instance destruction plug-in instances are created with npp_new and destroyed with npp_destroy. the browser calls npp_destroy when a plug-in instance is deleted, usually because the user has left the page containing the instance, closed the window, or quit the ap...
The Web Developer Menu - Firefox Developer Tools
the web developer menu is the main way to access the developer tools that are built into firefox. ...
... the web developer menu is the main way to access the developer tools that are built into firefox. ...
Debugging service workers - Firefox Developer Tools
worker to store your site assets in cache storage (using the cache api), which is essential for creating offline apps, it can be annoying to test the cache. when you fill up the cache with assets, but then want to alter the behavior slightly, you previously had to manually write code to empty the cache, and then fill it again. the firefox devtools’ storage tab has a cache storage section that
lists all the different caches you have stored under each different origin. right/ctrl clicking on one of the caches gives you two options: delete all — delete all caches under this origin. delete "name of cache" — delete only the highlighted cache. you can also click on one of the individual items stored in the cache, then right/ctrl click on it to get options for deleting just that item...
...erred column. note: there is currently a bug whereby the network monitor cannot show network requests from a service worker running in a different process to the application (bug 1432311). finding registered service workers on other domains as mentioned above, the service worker view of the application panel shows all the service workers registered on the current domain. if you want to see a
list of information concerning all the service workers registered on your browser, you can visit about:debugging#/runtime/this-firefox. below the
list of installed extensions you'll find a
list of all the service workers you have registered. ...
Browser Console - Firefox Developer Tools
here's an example add-on that just logs an error when the user clicks a widget: widget = require("sdk/widget").widget({ id: "an-error-happened", label: "error!", width: 40, content: "error!", onclick: logerror }); funct...
... the command line interpreter gets access to the tabbrowser object, through the gbrowser global, and that enables you to control the browser through the command line. try running this code in the browser console's command line (remember that to send multiple lines to the browser console, use shift+enter): var newtabbrowser = gbrowser.getbrowserfortab(gbrowser.selectedtab); newtabbrowser.addevent
listener("load", function() { newtabbrowser.contentdocument.body.innerhtml = "<h1>this page has been eaten</h1>"; }, true); newtabbrowser.contentdocument.location.href = "https://mozilla.org/"; it adds a
listener to the currently selected tab's load event that will eat the new page, then loads a new page. note: you can restart the browser with the command ctrl + alt + r (windows, linux) or cmd + ...
Browser Toolbox - Firefox Developer Tools
) console style editor performance network monitor page inspector accessibility inspector you can debug chrome: and about: pages using the normal debugger, just as if they were ordinary content pages. targeting a document in the normal toolbox, there's a button in the toolbar enabling you to target specific iframes in the document. ...
...there is a way to disable this behavior. ...
Break on DOM mutation - Firefox Developer Tools
ttribute modification execution pauses when any of the elementsʼ attributes are modified. that means, the script execution is stopped whenever an attribute is added to or removed from the element the option is set on or the value of one of its attributes is changed. examples for when this breakpoint is triggered are calling element.setattribute(), element.removeattribute(), and element.class
list.add(), or setting element.id. node removal execution pauses if the element the option is set on is removed. examples for when this breakpoint is triggered are calling element.remove() or node.removechild() on its parent node. once you set the breakpoint, go to the debugger. you can see the breakpoint
listed in the right-most panel under dom mutation breakpoints. click on the icon follow...
... the panel on the right shows that execution is "paused on dom mutation" and you, as with any other breakpoint, you can see the call stack and view any watch expressions you may have set up. ...
Access debugging in add-ons - Firefox Developer Tools
we are planning to deprecate the use by firefox add-ons of the techniques described in this document. don't write new add-ons that use these techniques. the following items are accessible in the context of chrome://browser/content/debugger.xul (or, in version 23 beta, chrome://browser/content/devtools/debugger.xul): window.addevent
listener("debugger:editorloaded") - called when the read-only script panel loaded. ...
...by firefox add-ons of the techniques described in this document. don't write new add-ons that use these techniques. the following items are accessible in the context of chrome://browser/content/debugger.xul (or, in version 23 beta, chrome://browser/content/devtools/debugger.xul): window.addevent
listener("debugger:editorloaded") - called when the read-only script panel loaded. ...
Deprecated tools - Firefox Developer Tools
this page documents the deprecated panels and the bugs that track their removal. although these panels have been removed, you still have access to the old code, and there are alternative webextensions that you can try to get similar functionality. ...
...s also intended to support application development for firefox os. alternatives remote debugging is available in about:debugging as of firefox 68. features not ported to about:debugging are: wifi debugging for firefox for android, application development. features that are planned but not ported yet: remote browser screenshots and edit remote browser configuration. more details on the mailing-
list thread. canvas debugger bugzilla issue: bug 1403938 removed as of firefox 67 description canvas debugger allowed users to inspect the canvas element and see how frequently a given function is called. it was deprecated due to lack of use. we do not have dedicated documentation for the canvas debugger. alternatives spector.js is a webextension that can provide these features with 3d conte...
All keyboard shortcuts - Firefox Developer Tools
because access keys are locale-dependent, they're not documented in this page. opening and closing tools these shortcuts work in the main browser window to open the specified tool. the same shortcuts will work to close tools hosted in the toolbox, if the tool is active. for tools like the browser console that open in a new window, you have to close the window to close the tool. ...
... the currently selected tool) esc esc esc these shortcuts work in all tools that are hosted in the toolbox. command windows macos linux increase font size ctrl + + cmd + + ctrl + + decrease font size ctrl + - cmd + - ctrl + - reset font size ctrl + 0 cmd + 0 ctrl + 0 source editor this table
lists the default shortcuts for the source editor. in the editor preferences section of the developer tools settings, you can choose to use vim, emacs, or sublime text key bindings instead. to select these, visit about:config, select the setting devtools.editor.keymap, and assign "vim" or "emacs", or "sublime" to that setting. if you do this, the selected bindings will be used for all the developer ...
Aggregate view - Firefox Developer Tools
you can use this to filter the contents of the snapshot that are displayed, so you can quickly see, for example, how many objects of a specific class were allocated. type this is the default view, which looks something like this: it groups the things on the heap into types, including: javascript objects: such as function or array dom elements: such as htmlspanelement or window strings:
listed as "strings" javascript sources:
listed as "jsscript" internal objects: such as "js::shape". these are prefixed with "js::". each type gets a row in the table, and rows are ordered by the amount of memory occupied by objects of that type. for example, in the screenshot above you can see that javascript objects account for most memory, followed by strings. the "total count" column shows y...
...ect an item to view its retaining paths". if you select an item, you'll see the retaining paths panel for that item: call stack the call stack shows you exactly where in your code you are making heap allocations. because tracing allocations has a runtime cost, it must be explicitly enabled by checking "record call stacks" before you allocate the memory in the snapshot. 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 ...
Throttling - Firefox Developer Tools
e how your app will behave under different connection types. throttling the toolbar includes a throttling dropdown, which allows you to throttle your network speed to emulate various different network speed conditions. simply choose an option from the menu, and it will persist across reloads. the characteristics emulated are: download speed upload speed minimum latency the table below
lists the numbers associated with each network type, but please do not rely on this feature for exact performance measurements; it's intended to give an approximate idea of the user experience in different conditions. the speeds are expressed in multiples of bits per second. selection download speed upload speed minimum latency (ms) gprs 50 kbps 20 kbps 500 ...
...2g 450 kbps 150 kbps 150 regular 3g 750 kbps 250 kbps 100 good 3g 1.5 mbps 750 kbps 40 regular 4g/lte 4 mbps 3 mbps 20 dsl 2 mbps 1 mbps 5 wi-fi 30 mbps 15 mbps 2 network monitor features the following articles cover different aspects of using the network monitor: toolbar network request
list network request details network traffic recording performance analysis ...
Network monitor toolbar - Firefox Developer Tools
the network monitor provides two toolbar areas, one above the main section, and another below. toolbar the toolbar is at the top of the main network monitor window. (prior to firefox 77, this toolbar was arranged somewhat differently.) it provides: an icon to clear the network request
list. a box enabling you to filter requests by url and by properties. a set of tool icons: pause (or resume) recording network log search the log request blocking an array of buttons to filter the network request
list by type: by the content type of the response xhr requests websocket upgrades and messages (labeled ws) other requests a checkbox that allows you to disable caching. throttling menu, to simulate various connection types a menu of other actions: ...
...current contents of the network log to the clipboard in har format. ...
Network Monitor - Firefox Developer Tools
onitor records network requests any time the toolbox is open, even if the network monitor itself is not selected. this means you can start debugging a page in, for example, the web console, then switch to the network monitor to see network activity without having to reload the page. ...
...ity without having to reload the page. ...
CSS Flexbox Inspector: Examine Flexbox layouts - Firefox Developer Tools
ontainer section: you can control the color of the overlay by clicking on the small circle next to the selector. this will toggle a color picker so you can select a different color for the overlay. the switch on the right-hand side of the flex container section will also toggle the overlay on and off. flex item properties the flex items within the flex container are displayed as a numbered
list in the flex items section. each entry displays the item's selector. hover over an element to highlight it on the page. if you click on the item, the display shifts to show details about that element: this view shows information about the calculations for the size of the selected flex item: a diagram visualizing the sizing of the flex item content size - the size of the component without...
... ...
Examine and edit HTML - Firefox Developer Tools
the element doesn't have any dimensions. there is an ellipsis shown between the opening and closing tag of an element when the node is collapsed if it has larger contents. now children are indicated in the tree with this icon: at the right side of some nodes there are markers shown indicating different pieces of information related to it: event the element has one or several event
listeners attached to it. clicking the marker opens a tooltip
listing the event
listeners and allows you for each
listener to switch to the line of javascript code in the debugger where the
listener is defined. scroll the element is a scroll container, i.e. it has overflow: scroll or overflow: auto applied to it, and it has scrollable overflow. grid the element is a grid contai...
...ine-flex or display: inline flex applied to it. clicking the marker enables the flexbox highlighter. custom… the element is a custom element. clicking the marker switches to the line of javascript code in the debugger where the custom element got defined. note: there are some useful keyboard shortcuts that can be used in the html tree — see the html pane keyboard shortcuts
list. ::before and ::after you can inspect pseudo-elements added using ::before and ::after: custom element definition when you open the inspector on a page that includes custom elements, you can view the class definition for the custom element in the debugger: inspect the element click on the word custom the source for the element's class will be displayed in the debugger. whitespac...
Shader Editor - Firefox Developer Tools
eveloper tools" item. you'll now see "shader editor" appear in the toolbar. click it and the shader editor opens. at first you'll just see a blank window with a button asking you to reload the page: to get started, load a page which creates a webgl context and loads a program into it. the screenshots below are from the unreal engine demo. ...
... a page which creates a webgl context and loads a program into it. the screenshots below are from the unreal engine demo. you'll now see a window divided into three panes: a
list of all the glsl programs on the left, the vertex shader for the currently selected program in the middle, and the fragment shader for the currently selected program on the right: managing programs the left hand pane
lists all programs currently in use by a webgl context. if you hover over an entry in the
list, the geometry drawn by that program is highlighted in red: if you click the eyeball icon just left of the program's entry, that program is disabled. this is useful for focusing on certain shaders or hiding overlapping geometry: if you click the entry, its vertex and fragment shaders are shown in the other ...
IndexedDB - Firefox Developer Tools
when you select an origin inside the indexed db storage type in the storage tree of the storage inspector, a table
lists the details of all the databases present for that origin. note: the data shown in an indexeddb database is a snapshot of the data as it was when you opened the storage inspector tool. databases have the following details: database name — the name of the database. storage — the storage type specified for the database. origin — the origin of the database. version — the database version. object stores — the number of object stores in the database. when an indexeddb database is selected in the storage tree, details about all the object stores are
listed in the table. any object store has the following details: object store name — the name of the obje...
...he table. any object store has the following details: object store name — the name of the object store. key — the keypath property of the object store. auto increment — is automatic incrementation of the keys enabled? indexes — array of indexes present in the object store as shown below. when an object store is selected in the storage tree, all the items in that object store are
listed in the table. all items have a key and a value associated with them. you can delete an indexeddb database using the context menu in the storage tree: if the database cannot be deleted (most commonly because there are still active connections to the database), a warning message will be displayed in the storage inspector: you can use the context menu in the table widget to delete all items i...
AbortSignal: abort event - Web APIs
ncelable no interface event event handler onabort examples in the following snippets, we create a new abortcontroller object, and get its abortsignal (available in the signal property). later on we check whether or not it the signal has been aborted using the onabort property, and send an appropriate log to the console. ...
...wing snippets, we create a new abortcontroller object, and get its abortsignal (available in the signal property). later on we check whether or not it the signal has been aborted using the onabort property, and send an appropriate log to the console. you can use the abort event in an addevent
listener method: var controller = new abortcontroller(); var signal = controller.signal; signal.addevent
listener('abort', function() { console.log('request aborted'); }; or use the onabort event handler property: var controller = new abortcontroller(); var signal = controller.signal; signal.onabort = function() { console.log('request aborted'); }; specifications specification status domthe definition of 'abort' in that specification. living standard ...
AbortSignal - Web APIs
object that allows you to communicate with a dom request (such as a fetch) and abort it if required via an abortcontroller object. properties the abortsignal interface also inherits properties from its parent interface, eventtarget. abortsignal.aborted read only a boolean that indicates whether the request(s) the signal is communicating with is/are aborted (true) or not (false). events
listen to this event using addevent
listener() or by assigning an event
listener to the oneventname property of this interface. abort invoked when the dom request(s) the signal is communicating with is/are aborted. also available via the onabort property. methods the abortsignal interface inherits methods from its parent interface, eventtarget. examples in the following snippet, we aim to dow...
...then grab a reference to its associated abortsignal object using the abortcontroller.signal property. when the fetch request is initiated, we pass in the abortsignal as an option inside the request's options object (see {signal}, below). this associates the signal and controller with the fetch request and allows us to abort it by calling abortcontroller.abort(), as seen below in the second event
listener. var controller = new abortcontroller(); var signal = controller.signal; var downloadbtn = document.queryselector('.download'); var abortbtn = document.queryselector('.abort'); downloadbtn.addevent
listener('click', fetchvideo); abortbtn.addevent
listener('click', function() { controller.abort(); console.log('download aborted'); }); function fetchvideo() { ... fetch(url, {signal}).
AbsoluteOrientationSensor - Web APIs
sic example the following example, which is loosely based on intel's orientation phone demo, instantiates an absoluteorientationsensor with a frequency of 60 times a second. on each reading it uses orientationsensor.quaternion to rotate a visual model of a phone. ...
...mes a second. on each reading it uses orientationsensor.quaternion to rotate a visual model of a phone. const options = { frequency: 60, referenceframe: 'device' }; const sensor = new absoluteorientationsensor(options); sensor.addevent
listener('reading', () => { // model is a three.js object instantiated elsewhere. model.quaternion.fromarray(sensor.quaternion).inverse(); }); sensor.addevent
listener('error', error => { if (event.error.name == 'notreadableerror') { console.log("sensor is not available."); } }); sensor.start(); permissions example using orientation sensors requires requesting permissions for multiple device sensors. because the permissions uses promises, a good way to request permissions is to use promise.all. const sensor = new absoluteorientationsensor(); prom...
Animation.play() - Web APIs
ished, calling play() restarts the animation, playing it from the beginning. syntax animation.play(); parameters none. return value undefined example in the growing/shrinking alice game example, clicking or tapping the cake causes alice's growing animation (alicechange) to play forward, causing her to get bigger, as well as triggering the cake's animation. two animation.play()s, one event
listener: // the cake has its own animation: var nommingcake = document.getelementbyid('eat-me_sprite').animate( [ { transform: 'translatey(0)' }, { transform: 'translatey(-80%)' } ], { fill: 'forwards', easing: 'steps(4, end)', duration: alicechange.effect.timing.duration / 2 }); // pause the cake's animation so it doesn't play immediately. nommingcake.pause(); // this function will p...
.../ 2 }); // pause the cake's animation so it doesn't play immediately. nommingcake.pause(); // this function will play when ever a user clicks or taps var growalice = function() { // play alice's animation. alicechange.play(); // play the cake's animation. nommingcake.play(); } // when a user holds their mouse down or taps, call growalice to make all the animations play. cake.addevent
listener("mousedown", growalice, false); cake.addevent
listener("touchstart", growalice, false); specifications specification status comment web animationsthe definition of 'play()' in that specification. working draft ...
Animation - Web APIs
. if the animation is finished or unplayed, it will play from end to beginning. animation.updateplaybackrate() sets the speed of an animation after first synchronizing its playback position. automatically removing filling animations it is possible to trigger a large number of animations on the same element. if they are indefinite (i.e., forwards-filling), this can result in a huge animations
list, which could create a memory leak. for this reason, modern browsers have implemented the part of the web animations spec that automatically removes overriding forward filling animations, unless the developer explicitly specifies to keep them. you can see this in action in our simple replace indefinite animations demo. the related javascript features are: animation.commitstyles() for commiting...
...in kinds of motion can be a trigger for vestibular disorders, epilepsy, and migraine, and scotopic sensitivity. consider providing a mechanism for pausing or disabling animation, as well as using the reduced motion media query to create a complimentary experience for users who have expressed a preference for no animated experiences. designing safer web animation for motion sensitivity · an a
list apart article an introduction to the reduced motion media query | css-tricks responsive design for motion | webkit mdn understanding wcag, guideline 2.2 explanations understanding success criterion 2.2.2 | w3c understanding wcag 2.0 specifications specification status comment web animationsthe definition of 'animation' in that specification. working draft in...
Attr - Web APIs
text-anchor="middle" alignment-baseline="middle">attr</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} warning: starting in gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4), a number of deprecated properties and methods output warning messages to the console. you should revise your code accordingly. see deprecated properties and methods for a complete
list. properties name read only the attribute's name. namespaceuri read only a domstring representing the namespace uri of the attribute, or null if there is no namespace. localname read only a domstring representing the local part of the qualified name of the attribute. prefix read only a domstring representing the namespace prefix of the attribute, or null if no prefix is specified. ...
.... in dom4 they were moved to attr. this change is implemented in chrome since version 46.0 and firefox since version 48.0. deprecated properties and methods the following properties have been deprecated. where available, the appropriate replacement is noted. attributes this property now always returns null. childnodes obsolete since gecko 14 this property now always returns an empty node
list. firstchild obsolete since gecko 14 this property now always returns null. isid read only indicates whether the attribute is an "id attribute". an "id attribute" being an attribute which value is expected to be unique across a dom document. in html dom, "id" is the only id attribute, but xml documents could define others. whether or not an attribute is unique is often determined by a dtd or ...
AudioContext.getOutputTimestamp() - Web APIs
formance interface; the time after the document containing the audio context was first rendered examples in the following code we start to play an audio file after a play button is clicked, and start off a requestanimationframe loop running, which constantly outputs the contexttime and performancetime. you can see full code of this example at output-timestamp (see it live also). ...
...running, which constantly outputs the contexttime and performancetime. you can see full code of this example at output-timestamp (see it live also). ...
AudioScheduledSourceNode: ended event - Web APIs
cancelable no interface event event handler property audioscheduledsourcenode.onended usage notes this event occurs when a audioscheduledsourcenode has stopped playing, either because it's reached a predetermined stop time, the full duration of the audio has been performed, or because the entire buffer has been played. ...
... this event occurs when a audioscheduledsourcenode has stopped playing, either because it's reached a predetermined stop time, the full duration of the audio has been performed, or because the entire buffer has been played. examples in this simple example, an event
listener for the ended event is set up to enable a "start" button in the user interface when the node stops playing: node.addevent
listener('ended', () => { document.getelementbyid("startbutton").disabled = false; }) you can also set up the event handler using the audioscheduledsourcenode.onended property: node.onended = function() { document.getelementbyid("startbutton").disabled = false; } for an example of the ended event in use, see our audio-buffer example on github. specifications specification status ...
BiquadFilterNode.getFrequencyResponse() - Web APIs
b a reference to it in our javascript: <p>biquad filter frequency response for: </p> <ul class="freq-response-output"> </ul> var freqresponseoutput = document.queryselector('.freq-response-output'); finally, after creating our biquad filter, we use getfrequencyresponse() to generate the response data and put it in our arrays, then loop through each data set and output them in a human-readable
list at the bottom of the page: var biquadfilter = audioctx.createbiquadfilter(); biquadfilter.type = "lowshelf"; biquadfilter.frequency.value = 1000; biquadfilter.gain.value = range.value; ... function calcfrequencyresponse() { biquadfilter.getfrequencyresponse(myfrequencyarray,magresponseoutput,phaseresponseoutput); for(i = 0; i <= myfrequencyarray.length-1;i++){ var
listitem = documen...
... var biquadfilter = audioctx.createbiquadfilter(); biquadfilter.type = "lowshelf"; biquadfilter.frequency.value = 1000; biquadfilter.gain.value = range.value; ... function calcfrequencyresponse() { biquadfilter.getfrequencyresponse(myfrequencyarray,magresponseoutput,phaseresponseoutput); for(i = 0; i <= myfrequencyarray.length-1;i++){ var
listitem = document.createelement('li');
listitem.innerhtml = '<strong>' + myfrequencyarray[i] + 'hz</strong>: magnitude ' + magresponseoutput[i] + ', phase ' + phaseresponseoutput[i] + ' radians.'; freqresponseoutput.appendchild(
listitem); } } calcfrequencyresponse(); specifications specification status comment web audio apithe definition of 'getfrequencyresponse()' in that specification. working draft ...
Blob - Web APIs
ting blob functionality and expanding it to support files on the user's system. using blobs to construct a blob from other non-blob objects and data, use the blob() constructor. to create a blob that contains a subset of another blob's data, use the slice() method. to obtain a blob object for a file on the user's file system, see the file documentation. the apis accepting blob objects are also
listed in the file documentation. constructor blob() returns a newly created blob object which contains a concatenation of all of the data in the array passed into the constructor. instance properties blob.prototype.size read only the size, in bytes, of the data contained in the blob object. blob.prototype.type read only a string indicating the mime type of the data contained in the blo...
...nt.createelement('a'); link.href = url; link.innertext = 'open the array url'; document.body.appendchild(link); result click the link in the example to see the browser decode the object url. extracting data from a blob one way to read content from a blob is to use a filereader. the following code reads the content of a blob as a typed array: const reader = new filereader(); reader.addevent
listener('loadend', () => { // reader.result contains the contents of blob as a typed array }); reader.readasarraybuffer(blob); another way to read content from a blob is to use a response. the following code reads the content of a blob as text: const text = await (new response(blob)).text(); or by using blob.prototype.text(): const text = await blob.text(); by using other methods of fileread...
BroadcastChannel - Web APIs
note: this feature is available in web workers. ...
...message event is fired on this object. broadcastchannel.onmessageerror an eventhandler called when a messageevent of type messageerror is fired—that is, when it receives a message that cannot be deserialized. methods this interface also inherits methods from its parent, eventtarget. broadcastchannel.postmessage() sends the message, of any type of object, to each broadcastchannel object
listening to the same channel. broadcastchannel.close() closes the channel object, indicating it won't get any new messages, and allowing it to be, eventually, garbage collected. events message fired when when a message arrives on the channel. also available via the onmessage property. messageerror fired when a message arrives that can't be deserialized. also available via the onmessageerr...
CSSStyleSheet.cssRules - Web APIs
the read-only cssstylesheet property cssrules returns a live cssrule
list which provides a real-time, up-to-date
list of every css rule which comprises the stylesheet. each item in the
list is a cssrule defining a single rule. syntax var rules = cssstylesheet.cssrules; value a live-updating cssrule
list containing each of the css rules making up the stylesheet. each entry in the rule
list is a cssrule object describing one rule making up the stylesheet. ...
... the stylesheet. each item in the
list is a cssrule defining a single rule. syntax var rules = cssstylesheet.cssrules; value a live-updating cssrule
list containing each of the css rules making up the stylesheet. each entry in the rule
list is a cssrule object describing one rule making up the stylesheet. examples individual rules within the stylesheet can then be accessed by index: let rule
list = document.stylesheets[0].cssrules; for (let i=0; i < rule
list.length; i++) { processrule(rule
list[i]); } rules can also be accessed using for...of: let rule
list = document.stylesheets[0].cssrules; for (let rule of rule
list) { processrule(rule); } however, because cssrule is not a proper array, you can't use foreach(). specifications specification status comment ...
Cache.addAll() - Web APIs
t return successfully, but also if the request is a cross-origin no-cors request (in which case the reported status is always 0.) examples this code block waits for an installevent to fire, then runs waituntil() to handle the install process for the app. this consists of calling cachestorage.open to create a new cache, then using addall() to add a series of assets to it. ...
...pp. this consists of calling cachestorage.open to create a new cache, then using addall() to add a series of assets to it. this.addevent
listener('install', function(event) { event.waituntil( caches.open('v1').then(function(cache) { return cache.addall([ '/sw-test/', '/sw-test/index.html', '/sw-test/style.css', '/sw-test/app.js', '/sw-test/image-
list.js', '/sw-test/star-wars-logo.jpg', '/sw-test/gallery/', '/sw-test/gallery/bountyhunters.jpg', '/sw-test/gallery/mylittlevader.jpg', '/sw-test/gallery/snowtroopers.jpg' ]); }) ); }); specifications specification status comment service workersthe definition of 'cache: addall' in that specification. working draft i...
Cache - Web APIs
nterface. this is an implementation of the windoworworkerglobalscope mixin. note: in chrome, visit chrome://inspect/#service-workers and click on the "inspect" link below the registered service worker to view logging statements for the various actions the service-worker.js script is performing. var cache_version = 1; var current_caches = { font: 'font-cache-v' + cache_version }; self.addevent
listener('activate', function(event) { // delete all caches that aren't named in current_caches. // while there is only one cache in this example, the same logic will handle the case where // there are multiple versioned caches. var expectedcachenamesset = new set(object.values(current_caches)); event.waituntil( caches.keys().then(function(cachenames) { return promise.all( ...
... return promise.all( cachenames.map(function(cachename) { if (!expectedcachenamesset.has(cachename)) { // if this cache name isn't present in the set of "expected" cache names, then delete it. ...
CacheStorage.delete() - Web APIs
we wait for an activate event, and then run a waituntil() block that clears up any old, unused caches before a new service worker is activated. here we have an array of cache names we want to keep (cachestokeep). we return the keys of the caches in the cachestorage object using cachestorage.keys, then check each key to see if it is in the array. if not, we delete it using delete(). ...
... worker is activated. here we have an array of cache names we want to keep (cachestokeep). we return the keys of the caches in the cachestorage object using cachestorage.keys, then check each key to see if it is in the array. if not, we delete it using delete(). this.addevent
listener('activate', function(event) { var cachestokeep = ['v2']; event.waituntil( caches.keys().then(function(key
list) { return promise.all(key
list.map(function(key) { if (cachestokeep.indexof(key) === -1) { return caches.delete(key); } })); }) ); }); specifications specification status comment service workersthe definition of 'cachestorage: delete' in that specification. working draft initial definition. ...
CacheStorage.open() - Web APIs
eturn value a promise that resolves to the requested cache object. examples this example is from the mdn sw-test example (see sw-test running live). here we wait for an installevent to fire, then runs waituntil() to handle the install process for the app. this consists of calling cachestorage.open() to create a new cache, then using cache.addall() to add a series of assets to it. ...
... consists of calling cachestorage.open() to create a new cache, then using cache.addall() to add a series of assets to it. self.addevent
listener('install', function(event) { event.waituntil( caches.open('v1').then(function(cache) { return cache.addall([ '/sw-test/', '/sw-test/index.html', '/sw-test/style.css', '/sw-test/app.js', '/sw-test/image-
list.js', '/sw-test/star-wars-logo.jpg', '/sw-test/gallery/bountyhunters.jpg', '/sw-test/gallery/mylittlevader.jpg', '/sw-test/gallery/snowtroopers.jpg' ]); }) ); specifications specification status comment service workersthe definition of 'cachestorage: open' in that specification. working draft initial definition. ...
CanvasRenderingContext2D.addHitRegion() - Web APIs
l. defaults to null. role an aria role for accessibility tools to determine how to represent this region, if there is no control. defaults to null. examples using the addhitregion method this example demonstrates the addhitregion() method. ...
...alse); ctx.stroke();</textarea> var canvas = document.getelementbyid("canvas"); var ctx = canvas.getcontext("2d"); var textarea = document.getelementbyid("code"); var reset = document.getelementbyid("reset"); var edit = document.getelementbyid("edit"); var code = textarea.value; function drawcanvas() { ctx.clearrect(0, 0, canvas.width, canvas.height); eval(textarea.value); } reset.addevent
listener("click", function() { textarea.value = code; drawcanvas(); }); edit.addevent
listener("click", function() { textarea.focus(); }); canvas.addevent
listener("mousemove", function(event){ if(event.region) { alert("ouch, my eye :("); } }); textarea.addevent
listener("input", drawcanvas); window.addevent
listener("load", drawcanvas); specifications canvas hit regions have been r...
CanvasRenderingContext2D.isPointInPath() - Web APIs
use, this example checks whether the cursor is in a circular path2d path. if yes, the circle becomes green, otherwise it is red. ...
...ursor is in a circular path2d path. if yes, the circle becomes green, otherwise it is red. ...
CanvasRenderingContext2D - Web APIs
or of the shadow. default: fully-transparent black. canvasrenderingcontext2d.shadowoffsetx horizontal distance the shadow will be offset. default: 0. canvasrenderingcontext2d.shadowoffsety vertical distance the shadow will be offset. default: 0. paths the following methods can be used to manipulate paths of objects. canvasrenderingcontext2d.beginpath() starts a new path by emptying the
list of sub-paths. call this method when you want to create a new path. canvasrenderingcontext2d.closepath() causes the point of the pen to move back to the start of the current sub-path. it tries to draw a straight line from the current point to the start. if the shape has already been closed or has only one point, this function does nothing. canvasrenderingcontext2d.moveto() moves the starting p...
...text2d.ispointinstroke() reports whether or not the specified point is inside the area contained by the stroking of a path. transformations objects in the canvasrenderingcontext2d rendering context have a current transformation matrix and methods to manipulate it. the transformation matrix is applied when creating the current default path, painting text, shapes and path2d objects. the methods
listed below remain for historical and compatibility reasons as svgmatrix objects are used in most parts of the api nowadays and will be used in the future instead. canvasrenderingcontext2d.currenttransform current transformation matrix (svgmatrix object). canvasrenderingcontext2d.gettransform retrieves the current transformation matrix being applied to the context. canvasrenderingcontext2d.r...
Basic animations - Web APIs
er that you wish to perform an animation and requests that the browser call a specified function to update an animation before the next repaint. if you don't want any user interaction you can use the setinterval() function which repeatedly executes the supplied code. if we wanted to make a game, we could use keyboard or mouse events to control the animation and use settimeout(). by setting event
listeners, we catch any user interaction and execute our animation functions. in the examples below, we'll use the window.requestanimationframe() method to control the animation. the requestanimationframe method provides a smoother and more efficient way for animating by calling the animation frame when the system is ready to paint the frame. the number of callbacks is usually 60 times per second an...
... h / 2, 400, 4, 4), anima() } function anima() { c.fillstyle = "rgba(0,0,0,0.11)", c.fillrect(0, 0, cc.width, cc.height), fa.foreach(t => t.put()), s.draw(), document.getelementbyid("time").innertext = tmz(), settimeout(() => { requestanimationframe(anima) }, fw) } function emit(t) { key.keydown(t) } function touch(t) { t.class
list.toggle("off"), document.getelementsbyclassname("keypress")[0].class
list.toggle("hide") } var t = new date + "", d = void 0, cc = document.getelementsbytagname("canvas")[0], c = cc.getcontext("2d"); key = {}, key.keydown = function (t) { var e = document.createevent("keyboardevent"); object.defineproperty(e, "keycode", { get: function...
Basic usage of canvas - Web APIs
as>. scripts can also check for support programmatically by simply testing for the presence of the getcontext() method. our code snippet from above becomes something like this: var canvas = document.getelementbyid('tutorial'); if (canvas.getcontext) { var ctx = canvas.getcontext('2d'); // drawing code here } else { // canvas-unsupported code here } a skeleton template here is a minima
listic template, which we'll be using as a starting point for later examples. note: it is not good practice to embed a script inside html. we do it here to keep the example concise. <!doctype html> <html> <head> <meta charset="utf-8"/> <title>canvas tutorial</title> <script type="text/javascript"> function draw() { var canvas = document.getelementbyid('tutorial'); ...
...this function, or one like it, could also be called using window.settimeout(), window.setinterval(), or any other event handler, as long as the page has been loaded first. here is how a template would look in action. as shown here, it is initially blank. a simple example to begin, let's take a look at a simple example that draws two intersecting recta...
Channel Messaging API - Web APIs
ntext using window.postmessage along with two arguments (the message to send, and the object to transfer ownership of, in this case the port itself.) when these transferable objects are transferred, they are 'neutered' on the previous context — the one they previously belonged to. for instance a port, when is sent, cannot be used anymore by the original context. the other browsing context can
listen for the message using messageport.onmessage, and grab the contents of the message using the event's data attribute. you could then respond by sending a message back to the original document using messageport.postmessage. when you want to stop sending messages down the channel, you can invoke messageport.close to close the ports. find out more about how to use this api in using channel messagi...
...ostmessage. when you want to stop sending messages down the channel, you can invoke messageport.close to close the ports. find out more about how to use this api in using channel messaging. channel messaging interfaces messagechannel creates a new message channel to send messages across. messageport controls the ports on the message channel, allowing sending of messages from one port and
listening out for them arriving at the other. portcollection an array of messageports; an experimental solution to allow broadcasting of a message to multiple ports simultaneously. examples we have published a channel messaging basic demo on github (run it live too), which shows a really simple single message transfer between a page and an embedded <iframe>. you can also see a multimessaging d...
CharacterData - Web APIs
nondocumenttypechildnode interface. characterdata.data is a domstring representing the textual data contained in this object. characterdata.length read only returns an unsigned long representing the size of the string contained in characterdata.data. nondocumenttypechildnode.nextelementsibling read only returns the element immediately following the specified one in its parent's children
list, or null if the specified element is the last one in the
list. nondocumenttypechildnode.previouselementsibling read only returns the element immediately prior to the specified one in its parent's children
list, or null if the specified element is the first one in the
list. methods inherits methods from its parent, node, and implements the childnode and nondocumenttypechildnode interface. ...
...characters, starting at the specified offset, from the characterdata.data string; when this method returns, data contains the shortened domstring. characterdata.insertdata() inserts the specified characters, at the specified offset, in the characterdata.data string; when this method returns, data contains the modified domstring. childnode.remove() removes the object from its parent children
list. characterdata.replacedata() replaces the specified amount of characters, starting at the specified offset, with the specified domstring; when this method returns, data contains the modified domstring. characterdata.substringdata() returns a domstring containing the part of characterdata.data of the specified length and starting at the specified offset. specifications specificatio...
ChildNode - Web APIs
the childnode mixin contains methods and properties that are common to all types of node objects that can have a parent. it's implemented by element, documenttype, and characterdata objects. properties there are neither inherited, nor specific properties. methods there are no inherited methods. childnode.remove() removes this childnode from the children
list of its parent. childnode.before() inserts a set of node or domstring objects in the children
list of this childnode's parent, just before this childnode. domstring objects are inserted as equivalent text nodes. childnode.after() inserts a set of node or domstring objects in the children
list of this childnode's parent, just after this childnode. domstring objects are inserted as equivalent text nodes. childnode.replacew...
...domstring objects are inserted as equivalent text nodes. specifications specification status comment domthe definition of 'childnode' in that specification. living standard split the elementtraversal interface in parentnode and childnode. ...
Client.postMessage() - Web APIs
; parameters message the message to send to the client. this can be any structured-clonable type. transfer optional a sequence of objects that are transferred with the message. the ownership of these objects is given to the destination side and they are no longer usable on the sending side. return value undefined. examples sending a message from a service worker to a client: addevent
listener('fetch', event => { event.waituntil(async function() { // exit early if we don't have access to the client. // eg, if it's cross-origin. if (!event.clientid) return; // get the client. const client = await clients.get(event.clientid); // exit early if we don't get the client. // eg, if it closed. if (!client) return; // send a message to the client. ...
...urn; // get the client. const client = await clients.get(event.clientid); // exit early if we don't get the client. // eg, if it closed. if (!client) return; // send a message to the client. client.postmessage({ msg: "hey i just got a fetch from you!", url: event.request.url }); }()); }); receiving that message: navigator.serviceworker.addevent
listener('message', event => { console.log(event.data.msg, event.data.url); }); specifications specification status comment service workersthe definition of 'postmessage()' in that specification. working draft initial definition. ...
Client.url - Web APIs
the url read-only property of the client interface returns the url of the current service worker client. syntax var clienturl = client.url; value a usvstring. ...
...rker client. syntax var clienturl = client.url; value a usvstring. example self.addevent
listener('notificationclick', function(event) { console.log('on notification click: ', event.notification.tag); event.notification.close(); // this looks to see if the current is already open and // focuses if it is event.waituntil(clients.matchall({ type: 'window' }).then(function(client
list) { for (var i = 0; i < client
list.length; i++) { var client = client
list[i]; if (client.url == '/' && 'focus' in client) return client.focus(); } if (clients.openwindow) return clients.openwindow('/'); })); }); specifications specification status comment service workersthe definition of 'url' in that specification. working draft...
Clients.matchAll() - Web APIs
the matchall() method of the clients interface returns a promise for a
list of service worker client objects. include the options parameter to return all service worker clients whose origin is the same as the associated service worker's origin. if options are not included, the method returns only the service worker clients controlled by the service worker. syntax self.clients.matchall(options).then(function(clients) { // do something with your clients
list }); parameters options optional an options object allowing you to set options for the matching operation. available options are: includeuncontrolled: a boolean — if set to true, the matching operation will return all service worker clients who share the same origin as the current service worker. otherwise, it returns only the...
... false. type: sets the type of clients you want matched. available values are "window", "worker", "sharedworker", and "all". the default is "all". return value a promise that resolves to an array of client objects. in chrome 46/firefox 54 and later, this method returns clients in most recently focused order, correct as per spec. examples clients.matchall(options).then(function(client
list) { for (var i = 0 ; i < client
list.length ; i++) { if (client
list[i].url === 'index.html') { clients.openwindow(client
list[i]); // or do something else involving the matching client } } }); specifications specification status comment service workersthe definition of 'clients: matchall' in that specification. working draft initial definition ...
Constraint validation API - Web APIs
es that a form control element can have, with respect to its defined constraints. together, they help explain whether and why an element's value fails to validate. invalid event this event type is fired at a form control element if the element does not satisfy its constraints. ...
...form validation features will cause this to produce a default error message if you try to submit the form with either no valid filled in, or a value that does not match the pattern. if you wanted to instead display custom error messages, you could use javascript like the following: const nameinput = document.queryselector('input'); const form = document.queryselector('form'); nameinput.addevent
listener('input', () => { nameinput.setcustomvalidity(''); nameinput.checkvalidity(); }); nameinput.addevent
listener('invalid', () => { if(nameinput.value === '') { nameinput.setcustomvalidity('enter your username!'); } else { nameinput.setcustomvalidity('usernames can only contain upper and lowercase letters. try again!'); } }); the example renders like so: in brief: we chec...
ContentIndexEvent - Web APIs
t to be removed. the contentdelete event is only fired when the deletion happens due to interaction with the browser's built-in user interface. it is not fired when the contentindex.delete method is called. constructor contentindexevent() creates and returns a new contentindexevent object whose type and other options are configured as specified. ...
...in addition to the properties
listed below, this interface inherits the properties of its parent interface, extendableevent. id read only a string which identifies the deleted content index via it's id. methods while contentindexevent offers no methods of its own, it inherits any specified by its parent interface, extendableevent. examples this example shows the sevice worker script
listening for the contentdelete event and logs the removed content index id. self.addevent
listener('contentdelete', (event) => { console.log(event.id); // logs content index id, which can then be used to determine what content to delete from your cache }); specifications specification status comment unknownthe definition of 'contentindexevent' in that specification. ...
CustomEvent - Web APIs
m.) methods customevent.initcustomevent() initializes a customevent object. if the event has already being dispatched, this method does nothing. this interface inherits methods from its parent, event: event.createevent() creates a new event, which must then be initialized by calling its initevent() method. event.composedpath() returns the event’s path (objects on which
listeners will be invoked). this does not include nodes in shadow trees if the shadow root was created with its shadowroot.mode closed. event.initevent() initializes the value of an event created. if the event has already been dispatched, this method does nothing. event.preventdefault() cancels the event (if it is cancelable). event.stopimmediatepropagation() for this particular event, prev...
...invoked). this does not include nodes in shadow trees if the shadow root was created with its shadowroot.mode closed. event.initevent() initializes the value of an event created. if the event has already been dispatched, this method does nothing. event.preventdefault() cancels the event (if it is cancelable). event.stopimmediatepropagation() for this particular event, prevent all other
listeners from being called. this includes
listeners attached to the same element as well as those attached to elements that will be traversed later (during the capture phase, for instance). event.stoppropagation() stops the propagation of events further along in the dom. obsolete methods event.getpreventdefault() non-standard; use event.defaultprevented instead. (returns the value of event.
DedicatedWorkerGlobalScope: message event - Web APIs
eives a message from its parent (i.e. when the parent sends a message using worker.postmessage()). ...
... no cancelable no interface messageevent event handler property onmessage examples this code creates a new worker and sends it a message using worker.postmessage(): const worker = new worker("static/scripts/worker.js"); worker.addevent
listener('message', (event) => { console.log(`received message from worker: ${event.data}`) }); the worker can
listen for this message using addevent
listener(): // inside static/scripts/worker.js self.addevent
listener('message', (event) => { console.log(`received message from parent: ${event.data}`); }); alternatively, it could
listen using the onmessage event handler property: // static/scripts/worker.js self.onmessage = (event) => { console.log(`received message from parent: ${event.data}`); ...
Document: animationcancel event - Web APIs
such that the animation is removed, or when the animating node is hidden using css. therefore, either directly or because any of its containing nodes are hidden. bubbles yes cancelable no interface animationevent event handler property onanimationcancel the original target for this event is the element that had the animation applied. ...
... no interface animationevent event handler property onanimationcancel the original target for this event is the element that had the animation applied. you can
listen for this event on the document interface to handle it in the capture or bubbling phases. for full details on this event please see the page on htmlelement: animationcancel. examples this code adds a
listener to the animationcancel event. document.addevent
listener('animationcancel', () => { console.log('animation canceled'); }); the same, but using the onanimationcancel property instead of addevent
listener(): document.onanimationcancel = () => { console.log('animation canceled'); }; see a live example of this event. specifications specification status comment ...
Document: animationend event - Web APIs
aborts before reaching completion, such as if the element is removed from the dom or the animation is removed from the element, the animationend event is not fired. bubbles yes cancelable no interface animationevent event handler property onanimationend the original target for this event is the element that had the animation applied. ...
...ncelable no interface animationevent event handler property onanimationend the original target for this event is the element that had the animation applied. you can
listen for this event on the document interface to handle it in the capture or bubbling phases. for full details on this event please see the page on htmlelement: animationend. examples this example
listens for the animationend event: document.addevent
listener('animationend', () => { console.log('animation ended'); }); the same, but using the onanimationend event handler property: document.onanimationend = () => { console.log('animation ended'); }; see a live example of this event. specifications specification status comment css animations working draft ...
Document: animationiteration event - Web APIs
s. this event does not occur at the same time as the animationend event, and therefore does not occur for animations with an animation-iteration-count of one. bubbles yes cancelable no interface animationevent event handler property onanimationiteration the original target for this event is the element that had the animation applied. ...
...ent is the element that had the animation applied. you can
listen for this event on the document interface to handle it in the capture or bubbling phases. for full details on this event please see the page on htmlelement: animationiteration. examples this code uses animationiteration to keep track of the number of iterations an animation has completed: let iterationcount = 0; document.addevent
listener('animationiteration', () => { iterationcount++; console.log(`animation iteration count: ${iterationcount}`); }); the same, but using the onanimationiteration event handler property: let iterationcount = 0; document.onanimationiteration = () => { iterationcount++; console.log(`animation iteration count: ${iterationcount}`); }; see a live example of this event. specifications ...
Document: animationstart event - Web APIs
o fire with an elapsedtime equal to the absolute value of the delay (and, correspondingly, the animation will begin playing at that time index into the sequence). bubbles yes cancelable no interface animationevent event handler property onanimationstart the original target for this event is the element that had the animation applied. ...
... cancelable no interface animationevent event handler property onanimationstart the original target for this event is the element that had the animation applied. you can
listen for this event on the document interface to handle it in the capture or bubbling phases. for full details on this event please see the page on htmlelement: animationstart. examples this
listens for the animationstart event and logs a message when it is fired: document.addevent
listener('animationstart', () => { console.log('animation started'); }); the same, but using onanimationstart: document.onanimationstart = () => { console.log('animation started'); }; see a live example of this event. specifications specification status comment css animati...
Document.applets - Web APIs
example // when you know the second applet is the one you want my_java_app = document.applets[1]; specifications specification status comment html living standardthe definition of 'document.applets' in that specification. living standard obsoleted. ...
... example // when you know the second applet is the one you want my_java_app = document.applets[1]; specifications specification status comment html living standardthe definition of 'document.applets' in that specification. living standard obsoleted. ...
EventTarget.dispatchEvent() - Web APIs
return value the return value is false if event is cancelable and at least one of the event handlers which received event called event.preventdefault(). otherwise it returns true. ...
... return value the return value is false if event is cancelable and at least one of the event handlers which received event called event.preventdefault(). otherwise it returns true. ...
ExtendableEvent - Web APIs
as part of the service worker lifecycle. this ensures that any functional events (like fetchevent) are not dispatched until it upgrades database schemas and deletes the outdated cache entries. if waituntil() is called outside of the extendableevent handler, the browser should throw an invalidstateerror; note also that multiple calls will stack up, and the resulting promises will be added to the
list of extend lifetime promises. note: the behaviour described in the above paragraph was fixed in firefox 43 (see bug 1180274.) this interface inherits from the event interface. <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 8.571428571428571%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: a...
...the same approach can be used for multiple caches. it maps a shorthand identifier for a cache to a specific, versioned cache name. note: in chrome, logging statements are visible via the "inspect" interface for the relevant service worker accessed via chrome://serviceworker-internals. var cache_version = 1; var current_caches = { prefetch: 'prefetch-cache-v' + cache_version }; self.addevent
listener('install', function(event) { var urlstoprefetch = [ './static/pre_fetched.txt', './static/pre_fetched.html', 'https://www.chromium.org/_/rsrc/1302286216006/config/customlogo.gif' ]; console.log('handling install event. resources to pre-fetch:', urlstoprefetch); event.waituntil( caches.open(current_caches['prefetch']).then(function(cache) { return cache.addall(u...
FeaturePolicy.features() - Web APIs
the features() method of the featurepolicy interface returns a
list of names of all features supported by the user agent. feature whose name appears on the
list might not be allowed by the feature policy of the current execution context and/or might not be accessible because of user's permissions. syntax const supportedfeatures = featurepolicy.features() parameters none. return value a
list of strings that represent names of all feature policy directives supported by the user agent. example the followin example logs all the supported directives in the console. ...
...use of user's permissions. syntax const supportedfeatures = featurepolicy.features() parameters none. return value a
list of strings that represent names of all feature policy directives supported by the user agent. example the followin example logs all the supported directives in the console. // get the feature policy object const featurepolicy = document.featurepolicy // retreive the
list of all supported feature policy directives const supporteddirectives = featurepolicy.features() // print out each directive into the console for (const directive of supporteddirectives){ console.log(directive) } specification specification status comment feature policythe definition of 'features' in that specification. editor's draft initial definition. ...
FeaturePolicy - Web APIs
the featurepolicy interface of the feature policy api represents the set of policies applied to the current execution context. featurepolicy methods featurepolicy.allowsfeature returns a boolean that indicates whether or not a particular feature is enabled in the specified context. featurepolicy.features returns a
list of names of all features supported by the user agent. feature whose name appears on the
list might not be allowed by the feature policy of the current execution context and/or might not be accessible because of user's permissions. featurepolicy.allowedfeatures returns a
list of names of all features supported by the user agent and allowed by the feature policy. note that features appearing on this
list might still be behind a user permission. featurepolicy.getallow...
...pears on the
list might not be allowed by the feature policy of the current execution context and/or might not be accessible because of user's permissions. featurepolicy.allowedfeatures returns a
list of names of all features supported by the user agent and allowed by the feature policy. note that features appearing on this
list might still be behind a user permission. featurepolicy.getallow
listforfeature returns the allow
list for the specified feature. specification specification status comment feature policy editor's draft initial definition. ...
FetchEvent.preloadResponse - Web APIs
he fetchevent interface returns a promise that resolves to the navigation preload response if navigation preload was triggered or undefined otherwise. syntax var expectedresponse = fetchevent.preloadresponse; value a promise that resolves to a response or otherwise to undefined. example this code snippet is from the navigation preload page. ...
...s from the navigation preload page. the serviceworkerglobalscope.onfetch event handler
listens for the fetch event. when fired, pass a promise that back to the controlled page to fetchevent.respondwith(). this promise resolves to the first matching url request in the cache object. if no match is found, the code checks for a preloaded response. else it fetches a response from the network. addevent
listener('fetch', event => { event.respondwith(async function() { // respond from the cache if we can const cachedresponse = await caches.match(event.request); if (cachedresponse) return cachedresponse; // else, use the preloaded response, if it's there const response = await event.preloadresponse; if (response) return response; // else try the network. return fetch...
FetchEvent.request - Web APIs
(since version 46, in the case of firefox.) if a request is not provided by some other means, the constructor init object must contain a request (see fetchevent.fetchevent().) syntax var recentrequest = fetchevent.request; value a request object. example this code snippet is from the service worker fetch sample (run the fetch sample live). the serviceworkerglobalscope.onfetch event handler
listens for the fetch event. when fired, pass a promise that back to the controlled page to fetchevent.respondwith(). this promise resolves to the first matching url request in the cache object. if no match is found, the code fetches a response from the network. the code also handles exceptions thrown from the serviceworkerglobalscope.fetch operation. note that an http error response (e.g., 404) will...
...mise resolves to the first matching url request in the cache object. if no match is found, the code fetches a response from the network. the code also handles exceptions thrown from the serviceworkerglobalscope.fetch operation. note that an http error response (e.g., 404) will not trigger an exception. it will return a normal response object that has the appropriate error code set. self.addevent
listener('fetch', function(event) { console.log('handling fetch event for', event.request.url); event.respondwith( caches.match(event.request).then(function(response) { if (response) { console.log('found response in cache:', response); return response; } console.log('no response found in cache. about to fetch from network...'); return fetch(event.requ...
File.getAsBinary() - Web APIs
e file's data in raw binary format. note: this method is obsolete; you should use the filereader method readasbinarystring() or readasarraybuffer() instead. syntax var binary = instanceoffile.getasbinary(); returns a string. ...
...format. note: this method is obsolete; you should use the filereader method readasbinarystring() or readasarraybuffer() instead. syntax var binary = instanceoffile.getasbinary(); returns a string. ...
File.getAsDataURL() - Web APIs
he entire contents of the referenced file. note: this method is obsolete; you should use the filereader method readasdataurl() instead. ...
...ferenced file. note: this method is obsolete; you should use the filereader method readasdataurl() instead. ...
File.getAsText() - Web APIs
oding); parameters encoding a string indicating the encoding to use for the returned data. if this string is empty, utf-8 is assumed. returns a string containing the file's data interpreted as text in the specified encoding. ...
...ing a string indicating the encoding to use for the returned data. if this string is empty, utf-8 is assumed. returns a string containing the file's data interpreted as text in the specified encoding. ...
File.lastModified - Web APIs
he unix epoch (january 1, 1970 at midnight). files without a known last modified date return the current date. syntax const time = instanceoffile.lastmodified; value a number that represents the number of milliseconds since the unix epoch. ...
...ithout a known last modified date return the current date. syntax const time = instanceoffile.lastmodified; value a number that represents the number of milliseconds since the unix epoch. example reading from file input <input type="file" multiple id="fileinput"> const fileinput = document.queryselector('#fileinput'); fileinput.addevent
listener('change', (event) => { // files is a file
list object (similar to node
list) const files = event.target.files; for (let file of files) { const date = new date(file.lastmodified); console.log(`${file.name} has a last modified date of ${date}`); } }); try the results out below: dynamically created files if a file is created dynamically, the last modified time can be supplied in the new file() constructor function. if it is m...
FileReader: abort event - Web APIs
nput[type="file"]'); const preview = document.queryselector('img.preview'); const eventlog = document.queryselector('.event-log-contents'); const reader = new filereader(); function handleevent(event) { eventlog.textcontent = eventlog.textcontent + `${event.type}: ${event.loaded} bytes transferred\n`; if (event.type === "load") { preview.src = reader.result; } } function add
listeners(reader) { reader.addevent
listener('loadstart', handleevent); reader.addevent
listener('load', handleevent); reader.addevent
listener('loadend', handleevent); reader.addevent
listener('progress', handleevent); reader.addevent
listener('error', handleevent); reader.addevent
listener('abort', handleevent); } function handleselected(e) { eventlog.textcontent = ''; con...
... reader.addevent
listener('load', handleevent); reader.addevent
listener('loadend', handleevent); reader.addevent
listener('progress', handleevent); reader.addevent
listener('error', handleevent); reader.addevent
listener('abort', handleevent); } function handleselected(e) { eventlog.textcontent = ''; const selectedfile = fileinput.files[0]; if (selectedfile) { add
listeners(reader); reader.readasdataurl(selectedfile); } reader.abort(); } fileinput.addevent
listener('change', handleselected); result specifications specification status file api working draft ...
FileReader: error event - Web APIs
ound or not readable). ...
... filereader.onerror examples const fileinput = document.queryselector('input[type="file"]'); const reader = new filereader(); function handleselected(e) { const selectedfile = fileinput.files[0]; if (selectedfile) { reader.addevent
listener('error', () => { console.error(`error occurred reading file: ${selectedfile.name}`); }); reader.addevent
listener('load', () => { console.error(`file: ${selectedfile.name} read successfully`); }); reader.readasdataurl(selectedfile); } } fileinput.addevent
listener('change', handleselected); specifications specification status file api working draft ...
FileReader: load event - Web APIs
nput[type="file"]'); const preview = document.queryselector('img.preview'); const eventlog = document.queryselector('.event-log-contents'); const reader = new filereader(); function handleevent(event) { eventlog.textcontent = eventlog.textcontent + `${event.type}: ${event.loaded} bytes transferred\n`; if (event.type === "load") { preview.src = reader.result; } } function add
listeners(reader) { reader.addevent
listener('loadstart', handleevent); reader.addevent
listener('load', handleevent); reader.addevent
listener('loadend', handleevent); reader.addevent
listener('progress', handleevent); reader.addevent
listener('error', handleevent); reader.addevent
listener('abort', handleevent); } function handleselected(e) { eventlog.textcontent = ''; con...
... reader.addevent
listener('load', handleevent); reader.addevent
listener('loadend', handleevent); reader.addevent
listener('progress', handleevent); reader.addevent
listener('error', handleevent); reader.addevent
listener('abort', handleevent); } function handleselected(e) { eventlog.textcontent = ''; const selectedfile = fileinput.files[0]; if (selectedfile) { add
listeners(reader); reader.readasdataurl(selectedfile); } } fileinput.addevent
listener('change', handleselected); result specifications specification status file api working draft ...
FileReader: loadend event - Web APIs
nput[type="file"]'); const preview = document.queryselector('img.preview'); const eventlog = document.queryselector('.event-log-contents'); const reader = new filereader(); function handleevent(event) { eventlog.textcontent = eventlog.textcontent + `${event.type}: ${event.loaded} bytes transferred\n`; if (event.type === "load") { preview.src = reader.result; } } function add
listeners(reader) { reader.addevent
listener('loadstart', handleevent); reader.addevent
listener('load', handleevent); reader.addevent
listener('loadend', handleevent); reader.addevent
listener('progress', handleevent); reader.addevent
listener('error', handleevent); reader.addevent
listener('abort', handleevent); } function handleselected(e) { eventlog.textcontent = ''; con...
... reader.addevent
listener('load', handleevent); reader.addevent
listener('loadend', handleevent); reader.addevent
listener('progress', handleevent); reader.addevent
listener('error', handleevent); reader.addevent
listener('abort', handleevent); } function handleselected(e) { eventlog.textcontent = ''; const selectedfile = fileinput.files[0]; if (selectedfile) { add
listeners(reader); reader.readasdataurl(selectedfile); } } fileinput.addevent
listener('change', handleselected); result specifications specification status file api working draft ...
FileReader: loadstart event - Web APIs
nput[type="file"]'); const preview = document.queryselector('img.preview'); const eventlog = document.queryselector('.event-log-contents'); const reader = new filereader(); function handleevent(event) { eventlog.textcontent = eventlog.textcontent + `${event.type}: ${event.loaded} bytes transferred\n`; if (event.type === "load") { preview.src = reader.result; } } function add
listeners(reader) { reader.addevent
listener('loadstart', handleevent); reader.addevent
listener('load', handleevent); reader.addevent
listener('loadend', handleevent); reader.addevent
listener('progress', handleevent); reader.addevent
listener('error', handleevent); reader.addevent
listener('abort', handleevent); } function handleselected(e) { eventlog.textcontent = ''; con...
... reader.addevent
listener('load', handleevent); reader.addevent
listener('loadend', handleevent); reader.addevent
listener('progress', handleevent); reader.addevent
listener('error', handleevent); reader.addevent
listener('abort', handleevent); } function handleselected(e) { eventlog.textcontent = ''; const selectedfile = fileinput.files[0]; if (selectedfile) { add
listeners(reader); reader.readasdataurl(selectedfile); } } fileinput.addevent
listener('change', handleselected); result specifications specification status file api working draft ...
FileReader: progress event - Web APIs
nput[type="file"]'); const preview = document.queryselector('img.preview'); const eventlog = document.queryselector('.event-log-contents'); const reader = new filereader(); function handleevent(event) { eventlog.textcontent = eventlog.textcontent + `${event.type}: ${event.loaded} bytes transferred\n`; if (event.type === "load") { preview.src = reader.result; } } function add
listeners(reader) { reader.addevent
listener('loadstart', handleevent); reader.addevent
listener('load', handleevent); reader.addevent
listener('loadend', handleevent); reader.addevent
listener('progress', handleevent); reader.addevent
listener('error', handleevent); reader.addevent
listener('abort', handleevent); } function handleselected(e) { eventlog.textcontent = ''; con...
... reader.addevent
listener('load', handleevent); reader.addevent
listener('loadend', handleevent); reader.addevent
listener('progress', handleevent); reader.addevent
listener('error', handleevent); reader.addevent
listener('abort', handleevent); } function handleselected(e) { eventlog.textcontent = ''; const selectedfile = fileinput.files[0]; if (selectedfile) { add
listeners(reader); reader.readasdataurl(selectedfile); } } fileinput.addevent
listener('change', handleselected); result specifications specification status file api working draft ...
FileReader.readAsDataURL() - Web APIs
adasdataurl(blob); parameters blob the blob or file from which to read. ...
...multiple> <div id="preview"></div> javascript function previewfiles() { var preview = document.queryselector('#preview'); var files = document.queryselector('input[type=file]').files; function readandpreview(file) { // make sure `file.name` matches our extensions criteria if ( /\.(jpe?g|png|gif)$/i.test(file.name) ) { var reader = new filereader(); reader.addevent
listener("load", function () { var image = new image(); image.height = 100; image.title = file.name; image.src = this.result; preview.appendchild( image ); }, false); reader.readasdataurl(file); } } if (files) { [].foreach.call(files, readandpreview); } } note: the filereader() constructor was not supported by internet explorer fo...
FontFaceSet.check() - Web APIs
"italic bold 16px roboto" text: limit the font faces to those whose unicode range contains at least one of the characters in text. this does not check for individual glyph coverage. ...
..."italic bold 16px roboto" text: limit the font faces to those whose unicode range contains at least one of the characters in text. this does not check for individual glyph coverage. ...
FormDataEvent.formData - Web APIs
the formdata read only property of the formdataevent interface contains the formdata object representing the data contained in the form when the event was fired. syntax formdata = formdataevent.formdata returns a formdata object. ...
...ata returns a formdata object. ...
GamepadEvent - Web APIs
nts window.gamepadconnected and window.gamepaddisconnected are fired in response to. constructor gamepadevent() returns a new gamepadevent object. properties gamepadevent.gamepad read only returns a gamepad object, providing access to the associated gamepad data for the event fired. examples the gamepad property being called on a fired window.gamepadconnected event. ...
...epad data for the event fired. examples the gamepad property being called on a fired window.gamepadconnected event. window.addevent
listener("gamepadconnected", function(e) { console.log("gamepad connected at index %d: %s. %d buttons, %d axes.", e.gamepad.index, e.gamepad.id, e.gamepad.buttons.length, e.gamepad.axes.length); }); and on a window.gamepaddisconnected event. window.addevent
listener("gamepaddisconnected", function(e) { console.log("gamepad disconnected from index %d: %s", e.gamepad.index, e.gamepad.id); }); specifications specification status comment gamepadthe definition of 'gamepadevent' in that specification. working draft initial definition browser compatibility desktopmobilechromeedgefirefoxinternet exploreroperasafariandr...
GlobalEventHandlers.oncontextmenu - Web APIs
on is clicked on the window. unless the default behavior is prevented, the browser context menu will activate. syntax target.oncontextmenu = functionref; value functionref is a function name or a function expression. the function receives an event object as its sole argument. only one oncontextmenu handler can be assigned to an object at a time. you may prefer to use the eventtarget.addevent
listener() method instead, since it's more flexible. examples disabling context menus this snippet prevents context menus from opening in the window. the context menu typically appears upon a right click. html <p>try opening the context menu. is it disabled?<p> javascript window.oncontextmenu = (e) => { e.preventdefault(); } result pausing an animation this example pauses a spinning sha...
...e(0); } to { transform: rotate(1turn); } } .shape { width: 8em; height: 8em; display: flex; align-items: center; justify-content: center; animation: spin 18s linear infinite; background: lightsalmon; border-radius: 42%; margin: 1em; } .paused { background-color: #ddd; } .paused .shape { animation-play-state: paused; } javascript function pause(e) { body.class
list.add('paused'); note.removeattribute('hidden'); } function play(e) { body.class
list.remove('paused'); note.setattribute('hidden', ''); } const body = document.queryselector('body'); const note = document.queryselector('.note'); window.oncontextmenu = pause; window.onpointerdown = play; result specifications specification status comment html living standardthe ...
GlobalEventHandlers.onformdata - Web APIs
the onformdata property of the globaleventhandlers mixin is the eventhandler for processing formdata events, fired after the entry
list representing the form's data is constructed. this happens when the form is submitted, but can also be triggered by the invocation of a formdata() constructor. onformdata is available on htmlformelement. syntax target.onformdata = functionref; value functionref is a function name or a function expression. the function receives a formdataevent object as its sole argument. ...
...triggered by the invocation of a formdata() constructor. onformdata is available on htmlformelement. syntax target.onformdata = functionref; value functionref is a function name or a function expression. the function receives a formdataevent object as its sole argument. ...
GlobalEventHandlers.onpointerdown - Web APIs
ed. this event can be sent to window, document, and element objects. this is functionally equivalent to the mousedown event when generated due to user activity with a mouse or mouse-compatible device. if the pointerdown event isn't canceled through a call to preventdefault(), most user agents will fire a mousedown event, so that sites not using pointer events will work. you can also use addevent
listener() to add a
listener for pointerdown events. syntax target.onpointerdown = downhandler; var downhandler = target.onpointerdown; value a function to handle the pointerdown event for the target element, document, or window. it receives as input the pointerevent describing the pointerdown event. example this example demonstrates how to watch for and act upon pointerdown events using onpoi...
...own events. syntax target.onpointerdown = downhandler; var downhandler = target.onpointerdown; value a function to handle the pointerdown event for the target element, document, or window. it receives as input the pointerevent describing the pointerdown event. example this example demonstrates how to watch for and act upon pointerdown events using onpointerdown. you could also use addevent
listener(), of course. javascript first, let's look at the javascript code that handles the pointerdown event. var targetbox = document.getelementbyid("target"); targetbox.onpointerdown = handledown; function handledown(evt) { var action; switch(evt.pointertype) { case "mouse": action = "clicking"; break; case "pen": action = "tapping"; break; case "touch"...
GlobalEventHandlers - Web APIs
the globaleventhandlers mixin describes the event handlers common to several interfaces like htmlelement, document, or window. each of these interfaces can, of course, add more event handlers in addition to the ones
listed below. note: globaleventhandlers is a mixin and not an interface; you can't actually create an object of type globaleventhandlers. properties this interface doesn't include any properties except for the event handlers
listed below. event handlers these event handlers are defined on the globaleventhandlers mixin, and implemented by htmlelement, document, window, as well as by workerglobalscope for web workers. globaleventhandlers.onabort is an eventhandler representing the code to be called when the abort event is raised. globaleventhandlers.onanimationcancel ...
...ode to be called when the durationchange event is raised. globaleventhandlers.onemptied is an eventhandler representing the code to be called when the emptied event is raised. globaleventhandlers.onended is an eventhandler representing the code to be called when the ended event is raised. globaleventhandlers.onformdata is an eventhandler for processing formdata events, fired after the entry
list representing the form's data is constructed. globaleventhandlers.ongotpointercapture is an eventhandler representing the code to be called when the gotpointercapture event type is raised. globaleventhandlers.oninput is an eventhandler representing the code to be called when the input event is raised. globaleventhandlers.oninvalid is an eventhandler representing the code to be called when th...
HTMLAreaElement - Web APIs
component (including trailing colon ':'), of the referenced url. htmlareaelement.referrerpolicy is a domstring that reflects the referrerpolicy html attribute indicating which referrer to use when fetching the linked resource. htmlareaelement.rel is a domstring that reflects the rel html attribute, indicating relationships of the current document to the linked resource. htmlareaelement.rel
list read only returns a domtoken
list that reflects the rel html attribute, indicating relationships of the current document to the linked resource, as a
list of tokens. htmlhyperlinkelementutils.search is a usvstring containing the search element (including leading question mark '?'), if any, of the referenced url. htmlareaelement.shape is a domstring that reflects the shape html attribute, ind...
...earch, and hash, have been moving to the htmlhyperlinkelementutils mixin, and htmlareaelement implements this mixin. html5the definition of 'htmlareaelement' in that specification. recommendation technically, the properties tabindex and accesskey are now defined on htmlelement. the following property is now obsolete: nohref. the following properties have been added: rel, rel
list, media, hreflang, type, host, hostname, pathname, port, protocol, search, and hash. document object model (dom) level 2 html specificationthe definition of 'htmlareaelement' in that specification. obsolete no change from document object model (dom) level 1 specification. document object model (dom) level 1 specificationthe definition of 'htmlareaelement' in that specificat...
HTMLButtonElement.labels - Web APIs
the htmlbuttonelement.labels read-only property returns a node
list of the <label> elements associated with the <button> element. syntax var labelelements = button.labels; return value a node
list containing the <label> elements associated with the <button> element. ...
...operty returns a node
list of the <label> elements associated with the <button> element. syntax var labelelements = button.labels; return value a node
list containing the <label> elements associated with the <button> element. example html <label id="label1" for="test">label 1</label> <button id="test">button</button> <label id="label2" for="test">label 2</label> javascript window.addevent
listener("domcontentloaded", function() { const button = document.getelementbyid("test"); for(var i = 0; i < button.labels.length; i++) { console.log(button.labels[i].textcontent); // "label 1" and "label 2" } }); specifications specification status comment html living standardthe definition of 'labels' in that specification. living standard initial defi...
HTMLButtonElement - Web APIs
ibute overrides the novalidate attribute of the <form> element that owns this element. htmlbuttonelement.formtarget is a domstring reflecting a name or keyword indicating where to display the response that is received after submitting the form. if specified, this attribute overrides the target attribute of the <form> element that owns this element. htmlbuttonelement.labels read only is a node
list that represents a
list of <label> elements that are labels for this button. htmlbuttonelement.menu is a htmlmenuelement representing the menu element to be displayed if the button is clicked and is of type="menu". htmlbuttonelement.name is a domstring representing the name of the object when submitted with a form. html5 if specified, it must not be the empty string. htmlbuttonelement.tabin...
...o an empty or invalid value. reset: the button resets the form. button: the button does nothing. menu: the button displays a menu. htmlbuttonelement.willvalidate read only is a boolean indicating whether the button is a candidate for constraint validation. it is false if any conditions bar it from constraint validation, including: its type property is reset or button; it has a <data
list> ancestor; or the disabled property is set to true. htmlbuttonelement.validationmessage read only is a domstring representing the localized message that describes the validation constraints that the control does not satisfy (if any). this attribute is the empty string if the control is not a candidate for constraint validation (willvalidate is false), or it satisfies its constraints. htmlbutt...
HTMLFormControlsCollection - Web APIs
this interface replaces one method from htmlcollection, on which it is based. ...
... fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlformcontrolscollection</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface inherits the properties of its parent, htmlcollection. methods this interface inherits the methods of its parent, htmlcollection. htmlformcontrolscollection.nameditem() returns the radionode
list or the element in the collection whose name or id matches the specified name, or null if no nodes match. note that this version of nameditem() hide the one inherited from htmlcollection. like that one, in javascript, using the array bracket syntax with a string, like collection["value"] is equivalent to collection.nameditem("value"). specifications specification status comment ...
HTMLFormElement: reset event - Web APIs
the reset event fires when a <form> is reset. bubbles yes (although specified as a simple event that doesn't bubble) cancelable yes interface event event handler property globaleventhandlers.onreset examples this example uses eventtarget.addevent
listener() to
listen for form resets, and logs the current event.timestamp whenever that occurs. ...
...ent.timestamp whenever that occurs. html <form id="form"> <label>test field: <input type="text"></label> <br><br> <button type="reset">reset form</button> </form> <p id="log"></p> javascript function logreset(event) { log.textcontent = `form reset! time stamp: ${event.timestamp}`; } const form = document.getelementbyid('form'); const log = document.getelementbyid('log'); form.addevent
listener('reset', logreset); result specifications specification status comment html living standardthe definition of 'reset' in that specification. working draft no change html 5.2the definition of 'reset' in that specification. recommendation no change html 5.1the definition of 'reset' in that specification. recommendation added in...
HTMLFormElement: submit event - Web APIs
="submit">) or presses enter while editing a field (e.g. <input type="text">) in a form. the event is not sent to the form when calling the form.submit() method directly. note: trying to submit a form that does not pass validation triggers an invalid event. in this case, the validation prevents form submission, and thus there is no submit event. examples this example uses eventtarget.addevent
listener() to
listen for form submit, and logs the current event.timestamp whenever that occurs, then prevents the default action of submitting the form. html <form id="form"> <label>test field: <input type="text"></label> <br><br> <button type="submit">submit form</button> </form> <p id="log"></p> javascript function logsubmit(event) { log.textcontent = `form submitted! time stamp: ${even...
...m. html <form id="form"> <label>test field: <input type="text"></label> <br><br> <button type="submit">submit form</button> </form> <p id="log"></p> javascript function logsubmit(event) { log.textcontent = `form submitted! time stamp: ${event.timestamp}`; event.preventdefault(); } const form = document.getelementbyid('form'); const log = document.getelementbyid('log'); form.addevent
listener('submit', logsubmit); result specifications specification status comment html living standardthe definition of 'submit' in that specification. working draft no change html 5.2the definition of 'submit' in that specification. recommendation no change html 5.1the definition of 'submit' in that specification. recommendation no ...
HTMLIFrameElement - Web APIs
onospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmliframeelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmliframeelement.align is a domstring that specifies the alignment of the frame with respect to the surrounding context. htmliframeelement.allow is a
list of origins the the frame is allowed to display content from. this attribute also accepts the values self and src which represent the origin in the iframe's src attribute. the default value is src. htmliframeelement.allowfullscreen is a boolean indicating whether the inline frame is willing to be placed into full screen mode. see using full-screen mode for details. htmliframeelement.allowpaym...
.... htmliframeelement.featurepolicy read only returns the featurepolicy interface which provides a simple api for introspecting the feature policies applied to a specific document. htmliframeelement.referrerpolicy is a domstring that reflects the referrerpolicy html attribute indicating which referrer to use when fetching the linked resource. htmliframeelement.sandbox is a domsettabletoken
list that reflects the sandbox html attribute, indicating extra restrictions on the behavior of the nested content. htmliframeelement.scrolling is a domstring that indicates whether the browser should provide scrollbars for the frame. htmliframeelement.src is a domstring that reflects the src html attribute, containing the address of the content to be embedded. note that programatically removing...
HTMLImageElement.sizes - Web APIs
the htmlimageelement property sizes allows you to specify the layout width of the image for each of a
list of media conditions. this provides the ability to automatically select among different images—even images of different orientations or aspect ratios—as the document state changes to match different media conditions. each condition is specified using the same conditional format used by media queries. syntax let sizes = htmlimageelement.sizes; htmlimageelement.sizes = sizes; value a usvstring containing a comma-separated
list of source size descriptors followed by an optional fallback size. each source size descriptor is comprised of a media condition, then at least one whitespace character, then the source size value to use for the image when the media condition evaluates to true...
...s the two buttons that let you toggle the third width option between 40em and 50em; this is done by handling the click event, using the javascript string object method replace() to replace the relevant portion of the sizes string. let image = document.queryselector("article img"); let break40 = document.getelementbyid("break40"); let break50 = document.getelementbyid("break50"); break40.addevent
listener("click", event => image.sizes = image.sizes.replace(/50em,/, "40em,")); break50.addevent
listener("click", event => image.sizes = image.sizes.replace(/40em,/, "50em,")); result this result may be viewed in its own window here. specifications specification status comment html living standardthe definition of 'htmlimageelement.sizes' in that specificati...
HTMLImageElement - Web APIs
if it were rendered at its natural full size. htmlimageelement.referrerpolicy a domstring that reflects the referrerpolicy html attribute, which tells the user agent how to decide which referrer to use in order to fetch the image. read this article for details on the possible values of this string. htmlimageelement.sizes a domstring reflecting the sizes html attribute. this string specifies a
list of comma-separated conditional sizes for the image; that is, for a given viewport size, a particular image size is to be used. read the documentation on the sizes page for details on the format of this string. htmlimageelement.src a usvstring that reflects the src html attribute, which contains the full url of the image including base uri. you can load a different image into the element by chan...
...read the documentation on the sizes page for details on the format of this string. htmlimageelement.src a usvstring that reflects the src html attribute, which contains the full url of the image including base uri. you can load a different image into the element by changing the url in the src attribute. htmlimageelement.srcset a usvstring reflecting the srcset html attribute. this specifies a
list of candidate images, separated by commas (',', u+002c comma). each candidate image is a url followed by a space, followed by a specially-formatted string indicating the size of the image. the size may be specified either the width or a size multiple. read the srcset page for specifics on the format of the size substring. htmlimageelement.usemap a domstring reflecting the usemap html attribute, ...
HTMLInputElement: search event - Web APIs
sent, after a ua-defined timeout elapses since the most recent keystroke (with new keystrokes resetting the timeout so the firing of the event is debounced). current ua implementations of <input type="search"> have an additional control to clear the field. using this control also fires the search event. in that case the value of the <input> element will be the empty string. ...
...resetting the timeout so the firing of the event is debounced). current ua implementations of <input type="search"> have an additional control to clear the field. using this control also fires the search event. in that case the value of the <input> element will be the empty string. examples // addevent
listener version const input = document.queryselector('input[type="search"]'); input.addevent
listener('search', () => { console.log("the term searched for was " + input.value); }) // onsearch version const input = document.queryselector('input[type="search"]'); input.onsearch = () => { console.log("the term searched for was " + input.value); }) specifications this event is not part of any specification. ...
HTMLInputElement.stepDown() - Web APIs
will not increment beyond the max value. if the value before invoking the stepdown() method is invalid, for example, if it doesn't match the constraints set by the step attribute, invoking the stepdown() method will return a value that does match the form controls constraints. if the form control is non time, date, or numeric in nature, and therefore does not support the step attribute (see the
list of supported input types in the the table above), or if the step value is set to any, an invalidstateerror exception is thrown. htmlinputelement.stepdown() decrements the value by (step * n), where n defaults to 1 if not specified. throws an invalid_state_err exception: if the method is not applicable to for the current type value, if the element has no step value, if the value cannot...
...try it with 0, 5, -2, etc. */ input.stepdown(); } } css input:invalid { border: red solid 3px;...
HTMLInputElement.stepUp() - Web APIs
the constraints set by the step attribute. if the value before invoking the stepup() method is invalid—for example, if it doesn't match the constraints set by the step attribute—invoking the stepup() method will return a value that does match the form controls constraints. if the form control is non time, date, or numeric in nature, and therefore does not support the step attribute (see the
list of supported input types in the the table above), or if the step value is set to any, an invalidstateerror exception is thrown. syntax element.stepup( [ stepincrement ] ); parameters stepincrement the optional stepincrement paremeter is a numeric value. if no parameter is passed, stepincrement defaults to 1. example click the button in this example to increment the number ...
...try it with 0 */ input.stepup() } } css input:invalid { border: red solid 3px; } result note if you d...
HTMLLIElement - Web APIs
the htmllielement interface exposes specific properties and methods (beyond those defined by regular htmlelement interface it also has available to it by inheritance) for manipulating
list elements. <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle"...
...,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmllielement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmllielement.type is a domstring representing the type of the bullets, "disc", "square" or "circle". as the standard way of defining the
list type is via the css
list-style-type property, use the cssom methods to set it via a script. htmllielement.value is a long indicating the ordinal position of the
list element inside a given <ol>. it reflects the value attribute of the html <li> element, and can be smaller than 0. if the <li> element is not a child of an <ol> element, the property has no meaning. methods no specific method; in...
HTMLMediaElement.readyState - Web APIs
_future_data 3 data for the current playback position as well as for at least a little bit of time into the future is available (in other words, at least two frames of video, for example). have_enough_data 4 enough data is available—and the download rate is high enough—that the media can be played through to the end without interruption. ...
...hrough to the end without interruption. examples this example will
listen for audio data to be loaded for the element `example`. it will then check if at least the current playback position has been loaded. if it has, the audio will play. <audio id="example" preload="auto"> <source src="sound.ogg" type="audio/ogg" /> </audio> var obj = document.getelementbyid('example'); obj.addevent
listener('loadeddata', function() { if(obj.readystate >= 2) { obj.play(); } }); specifications specification status comment html living standardthe definition of 'htmlmediaelement.readystate' in that specification. living standard html5the definition of 'htmlmediaelement.readystate' in that specification. recommendation ...
HTMLMeterElement.labels - Web APIs
the htmlmeterelement.labels read-only property returns a node
list of the <label> elements associated with the <meter> element. syntax var labelelements = meter.labels; return value a node
list containing the <label> elements associated with the <meter> element. ...
...e
list of the <label> elements associated with the <meter> element. syntax var labelelements = meter.labels; return value a node
list containing the <label> elements associated with the <meter> element. example html <label id="label1" for="test">label 1</label> <meter id="test" min="0" max="100" value="70">70</meter> <label id="label2" for="test">label 2</label> javascript window.addevent
listener("domcontentloaded", function() { const meter = document.getelementbyid("test"); for(var i = 0; i < meter.labels.length; i++) { console.log(meter.labels[i].textcontent); // "label 1" and "label 2" } }); specifications specification status comment html living standardthe definition of 'labels' in that specification. living standard no change ...
HTMLOutputElement.labels - Web APIs
the htmloutputelement.labels read-only property returns a node
list of the <label> elements associated with the <output> element. syntax var labelelements = output.labels; return value a node
list containing the <label> elements associated with the <output> element. ...
...operty returns a node
list of the <label> elements associated with the <output> element. syntax var labelelements = output.labels; return value a node
list containing the <label> elements associated with the <output> element. example html <label id="label1" for="test">label 1</label> <output id="test">output</output> <label id="label2" for="test">label 2</label> javascript window.addevent
listener("domcontentloaded", function() { const output = document.getelementbyid("test"); for(var i = 0; i < output.labels.length; i++) { console.log(output.labels[i].textcontent); // "label 1" and "label 2" } }); specifications specification status comment html living standardthe definition of 'labels' in that specification. living standard no change ...
HTMLProgressElement.labels - Web APIs
the htmlprogresselement.labels read-only property returns a node
list of the <label> elements associated with the <progress> element. syntax var labelelements = progress.labels; return value a node
list containing the <label> elements associated with the <progress> element. ...
... the <label> elements associated with the <progress> element. syntax var labelelements = progress.labels; return value a node
list containing the <label> elements associated with the <progress> element. example html <label id="label1" for="test">label 1</label> <progress id="test" value="70" max="100">70%</progress> <label id="label2" for="test">label 2</label> javascript window.addevent
listener("domcontentloaded", function() { const progress = document.getelementbyid("test"); for(var i = 0; i < progress.labels.length; i++) { console.log(progress.labels[i].textcontent); // "label 1" and "label 2" } }); specifications specification status comment html living standardthe definition of 'labels' in that specification. living standard no cha...
HTMLSelectElement.labels - Web APIs
the htmlselectelement.labels read-only property returns a node
list of the <label> elements associated with the <select> element. syntax var labelelements = select.labels; return value a node
list containing the <label> elements associated with the <select> element. ...
...select> element. syntax var labelelements = select.labels; return value a node
list containing the <label> elements associated with the <select> element. example html <label id="label1" for="test">label 1</label> <select id="test"> <option value="1">option 1</option> <option value="2">option 2</option> </select> <label id="label2" for="test">label 2</label> javascript window.addevent
listener("domcontentloaded", function() { const select = document.getelementbyid("test"); for(var i = 0; i < select.labels.length; i++) { console.log(select.labels[i].textcontent); // "label 1" and "label 2" } }); specifications specification status comment html living standardthe definition of 'labels' in that specification. living standard no change ...
IDBObjectStoreSync - Web APIs
keypath readonly domstring the key path of this object store. if this attribute is set to null, then the application must provide a key for each modification operation. mode readonly unsigned short the mode for isolating access to the data in this object store. for possible values, see constants. na...
... keypath readonly domstring the key path of this object store. if this attribute is set to null, then the application must provide a key for each modification operation. mode readonly unsigned short the mode for isolating access to the data in this object store. for possible values, see constants. name read...
IDBRequest - Web APIs
request completes successfully or when an error occurs. idbrequest.transaction read only the transaction for the request. this property can be null for certain requests, for example those returned from idbfactory.open unless an upgrade is needed. (you're just connecting to a database, so there is no transaction to return). methods no methods, but inherits methods from eventtarget. events
listen to these events using addevent
listener() or by assigning an event
listener to the oneventname property of this interface. error fired when an error caused a request to fail. also available via the onerror property. success fired when an idbrequest succeeds. also available via the onsuccess property. example in the following code snippet, we open a database asynchronously and make a r...
...succeeds. also available via the onsuccess property. 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. for a full working example, see our to-do notifications app (view example live.) var db; // let us open our database var dbopenrequest = window.indexeddb.open("todo
list", 4); // these two event handlers act on the database being // opened successfully, or not dbopenrequest.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database. db = dbopenrequest.result; }; specifications s...
ImageCapture - Web APIs
eates a new imagecapture object which can be used to capture still frames (photos) from a given mediastreamtrack which represents a video stream. properties imagecapture.track read only returns a reference to the mediastreamtrack passed to the constructor. methods the imagecapture interface is based on eventtarget, so it includes the methods defined by that interface as well as the ones
listed below. imagecapture.takephoto() takes a single exposure using the video capture device sourcing a mediastreamtrack and returns a promise that resolves with a blob containing the data. imagecapture.getphotocapabilities() returns a promise that resolves with a photocapabilities object containing the ranges of available configuration options. imagecapture.getphotosettings() returns a promi...
... working draft initial definition. ...
Basic concepts - Web APIs
rowser. because it lets you create web applications with rich query abilities regardless of network availability, these applications can work both online and offline. indexeddb is useful for applications that store a large amount of data (for example, a catalog of dvds in a lending library) and applications that don't need persistent internet connectivity to work (for example, mail clients, to-do
lists, and notepads). about this document this introduction discusses essential concepts and terminology in indexeddb. it gives you the big picture and explains key concepts. you'll find the following useful: for an overview of the design and structure of indexeddb, see big concepts. to learn more about indexeddb terms, see the definitions section. for a detailed tutorial on how to use the ap...
... know if the operation succeeded or failed. this sounds a little complicated at first, but there are sanity measures baked in. it's not that different from the way that xmlhttprequest works. indexeddb uses a lot of requests. requests are objects that receive the success or failure dom events that were mentioned previously. they have onsuccess and onerror properties, and you can call addevent
listener() and removeevent
listener() on them. they also have readystate, result, and errorcode properties that tell you the status of the request. the result property is particularly magical, as it can be many different things, depending on how the request was generated (for example, an idbcursor instance, or the key for a value that you just inserted into the database). indexeddb uses dom event...
InputEvent.data - Web APIs
the data read-only property of the inputevent interface returns a domstring with the inserted characters. this may be an empty string if the change doesn't insert text (such as when deleting characters, for example). syntax var astring = inputevent.data; value a domstring. ...
...y change is made to the contents of the <input> element (either by typing or pasting), the text that was added is retrieved via the inputevent.data property and reported in the paragraph below the input. <p>some text to copy and paste.</p> <input type="text"> <p class="result"></p> var editable = document.queryselector('input') var result = document.queryselector('.result'); editable.addevent
listener('input', (e) => { result.textcontent = "inputted text: " + e.data; }); specifications specification status comment input events level 2the definition of 'data' in that specification. working draft initial definition. ...
InputEvent.dataTransfer - Web APIs
the datatransfer read-only property of the inputevent interface returns a datatransfer object containing information about richtext or plaintext data being added to or removed from editible content. syntax var datatransfer = inputevent.datatransfer value a datatransfer object. examples in the following simple example we've set up an event
listener on the input event so that when any content is pasted into the contenteditable <p> element, its html source is retrieved via the inputevent.datatransfer.getdata() method and reported in the paragraph below the input. try copying and pasting some of the content provided to see the effects. <p><span style="font-weight: bold; color: blue">whoa, bold blue text!</span></p> <p><span style="font-style: italic; color: red">exciting: italic red tex...
... working draft initial definition. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contr...
InputEvent.inputType - Web APIs
roperty of the inputevent interface returns the type of change made to editible content. possible changes include for example inserting, deleting, and formatting text. syntax var astring = inputevent.inputtype; value a domstring containing the type of input that was made. there are many possible values, such as inserttext, deletecontentbackward, insertfrompaste, and formatbold. for a complete
list of the available input types, see the attributes section of the input events level 1 spec. examples this example logs the inputtype for input events on an editable <div>. html <p id="log">input type: </p> <div contenteditable="true" style="margin: 20px;padding: 20px;border:2px dashed red;"> <p>some sample text. try inserting line breaks, or deleting text in different ways, or pasting differ...
...spec. examples this example logs the inputtype for input events on an editable <div>. html <p id="log">input type: </p> <div contenteditable="true" style="margin: 20px;padding: 20px;border:2px dashed red;"> <p>some sample text. try inserting line breaks, or deleting text in different ways, or pasting different content in.</p> <hr> <ul> <li>a sample</li> <li>bulleted</li> <li>
list.</li> </ul> <p>another paragraph.</p> </div> javascript const log = document.getelementbyid('log'); const editable = document.queryselector('div[contenteditable]'); editable.addevent
listener('input', loginputtype); function loginputtype(event) { log.textcontent = `input type: ${event.inputtype}`; } result try editing the text inside the <div> and see what happens. note: see also m...
KeyboardEvent.charCode - Web APIs
roperty instead. syntax var code = event.charcode; return value a number that represents the unicode value of the character key that was pressed. example html <p>type anything into the input box below to log a <code>charcode</code>.</p> <input type="text" /> <p id="log"></p> javascript let input = document.queryselector('input'); let log = document.queryselector('#log'); input.addevent
listener('keypress', function(e) { log.innertext = `key pressed: ${string.fromcharcode(e.charcode)}\ncharcode: ${e.charcode}`; }); result notes in a keypress event, the unicode value of the key pressed is stored in either the keycode or charcode property, but never both. if the key pressed generates a character (e.g., 'a'), charcode is set to the code of that character; charcode respects the ...
...stored in keycode or charcode, query the which property. characters entered through an ime do not register through keycode or charcode. actually with the chinese ime i'm using, entering the ime results in a keypress event with keycode = 229 and no other key events fire until the ime exits (which may happen after multiple characters are inputted). i'm not sure if other ime's work this way. for a
list of the charcode values associated with particular keys, run example 7: displaying event object properties and view the resulting html table. specifications specification status comment document object model (dom) level 3 events specificationthe definition of 'keyboardevent.charcode' in that specification. obsolete initial definition; specified as deprecated ...
KeyboardEvent.initKeyEvent() - Web APIs
. shiftkeyarg a boolean that is true if the virtual key to be generated is a combination of keys containing the shift key. metakeyarg is a boolean that is true if the virtual key to be generated is a combination of keys containing the meta key. keycodearg is a unsigned long representing the virtual key code value of the key which was depressed, otherwise 0. see keyboardevent.keycode for the
list of key codes. charcodearg is a unsigned long representingthe unicode character associated with the depressed key otherwise 0. example var event = document.createevent('keyboardevent'); // create a key event // define the event event.initkeyevent("keypress", // typearg, true, // canbubblearg, true, // cancelablearg, ...
...vent is the current gecko equivalent of the dom level 3 events (initially drafted and also deprecated in favor of keyboardevent() keyboard.initkeyboardevent() method with the following arguments : typearg of type domstring canbubblearg of type boolean cancelablearg of type boolean viewarg of type views::abstractview keyidentifierarg of type domstring keylocationarg of type unsigned long modifiers
list of type domstring); ...
KeyboardEvent.initKeyboardEvent() - Web APIs
deprecated in newer draft. gecko won't support this feature since implementing this method as experimental broke existing web apps (see bug 999645). web applications should use constructor instead of this if it's available. syntax kbdevent.initkeyboardevent(typearg, canbubblearg, cancelablearg, viewarg, chararg, keyarg, locationarg, modifiers
listarg, repeat) parameters typearg the type of keyboard event; this will be one of keydown, keypress, or keyup. canbubblearg whether or not the event can bubble. cancelablearg whether or not the event can be canceled. viewarg the windowproxy it is associated to. chararg the value of the char attribute. keyarg the value of the key attribute. locationarg the value of the location attr...
...rameters typearg the type of keyboard event; this will be one of keydown, keypress, or keyup. canbubblearg whether or not the event can bubble. cancelablearg whether or not the event can be canceled. viewarg the windowproxy it is associated to. chararg the value of the char attribute. keyarg the value of the key attribute. locationarg the value of the location attribute. modifiers
listarg a whitespace-delineated
list of modifier keys that should be considered to be active on the event's key. for example, specifying "control shift" indicates that the user was holding down the control and shift keys when pressing the key described by the event. repeatarg the value of the repeat attribute. ...
Keyboard API - Web APIs
keyboard map api provides a way to retrieve the string generated by a particular key press, through the keyboard interface and the keyboardlayoutmap interface. the keyboard interface is accessed through navigator.keyboard. keyboard provides the keyboard.getlayoutmap method, which returns a promise that resolves with a keyboardlayoutmap object that contains members for converting codes to keys. a
list of valid code values is found in the writing system keys section of the ui events keyboardevent code values spec. the following example demonstrates how to get the location-specific or layout-specific string associated with the key labeled w on an english qwerty keyboard. if (navigator.keyboard) { var keyboard = navigator.keyboard; keyboard.getlayoutmap() .then(keyboardlayoutmap => { ...
...e-streaming experiences often require access to special keys and keyboard shortcuts while in full-screen mode. examples of such key/key combinations include escape, alt+tab, and ctrl+n. those keys and key combinations are typically captured by the user agent or the underlying operating system, as illustrated in the following example. to capture the "w", "a", "s", and "d" keys, call lock() with a
list that contains the key code attribute value for each of these keys: navigator.keyboard.lock(["keyw", "keya", "keys", "keyd"]); this captures these keys regardless of which modifiers are used with the key press. assuming a standard united states qwerty layout, registering keyw ensures that "w", shift+"w", control+"w", control+shift+"w", and all other key modifier combinations with "w" are sent to...
LayoutShift - Web APIs
xamples the following example shows how to capture layout shifts and log them to the console. note that in this example data is only sent to the server when the user leaves the tab. // catch errors since some browsers throw when using the new `type` option. ...
...ows how to capture layout shifts and log them to the console. note that in this example data is only sent to the server when the user leaves the tab. // catch errors since some browsers throw when using the new `type` option. // https://bugs.webkit.org/show_bug.cgi?id=209216 try { let cumulativelayoutshiftscore = 0; const observer = new performanceobserver((
list) => { for (const entry of
list.getentries()) { // only count layout shifts without recent user input. if (!entry.hadrecentinput) { cumulativelayoutshiftscore += entry.value; } } }); observer.observe({type: 'layout-shift', buffered: true}); document.addevent
listener('visibilitychange', () => { if (document.visibilitystate === 'hidden') { // force any pending records to be dispatched. observ...
Location - Web APIs
ine-height:1.5; background:black;} [title]:hover:before, :target:before {background:black; color:yellow;} [title] [title]:before {margin-top:1.5em;} [title] [title] [title]:before {margin-top:3em;} [title]:hover, :target {position:relative; z-index:1; outline:50em solid rgba(255,255,255,.8);} javascript [].foreach.call(document.queryselectorall('[title][id]'), function (node) { node.addevent
listener("click", function(e) { e.preventdefault(); e.stoppropagation(); window.location.hash = '#' + $(this).attr('id'); }); }); [].foreach.call(document.queryselectorall('[title]'), function (node) { node.addevent
listener("click", function(e) { e.preventdefault(); e.stoppropagation(); window.location.hash = ''; }); }); result properties location.ancestororigins ...
...n(e) { e.preventdefault(); e.stoppropagation(); window.location.hash = '#' + $(this).attr('id'); }); }); [].foreach.call(document.queryselectorall('[title]'), function (node) { node.addevent
listener("click", function(e) { e.preventdefault(); e.stoppropagation(); window.location.hash = ''; }); }); result properties location.ancestororigins is a static domstring
list containing, in reverse order, the origins of all ancestor browsing contexts of the document associated with the given location object. location.href is a stringifier that returns a usvstring containing the entire url. if changed, the associated document navigates to the new page. it can be set from a different origin than the associated document. location.protocol is a usvstring containing th...
Long Tasks API - Web APIs
or longer. common examples include: long running event handlers. expensive reflows and other re-renders. work the browser does between different turns of the event loop that exceeds 50 ms. culprit browsing context container the "culprit browsing context container", or "the container" for short, is the top level page, iframe, embed or object that the task occurred within. ...
...ner", or "the container" for short, is the top level page, iframe, embed or object that the task occurred within. attributions a
list of containers that the task occurred within. for tasks that don't occur within the top level page, the containerid, containername and containersrc fields may provide information as to the source of the task. usage var observer = new performanceobserver(function(
list) { var perfentries =
list.getentries(); for (var i = 0; i < perfentries.length; i++) { // process long task notifications: // report back for analytics and monitoring // ... } }); // register observer for long task notifications observer.observe({entrytypes: ["longtask"]}); // long script execution after this will result in queueing // and receiving "longtask" ...
MIDIAccess - Web APIs
the midiaccess interface of the web midi api provides methods for
listing midi input and output devices, and obtaining access to those devices. properties midiaccess.inputs read only returns an instance of midiinputmap which provides access to any available midi input ports. midiaccess.outputs read only returns an instance of midioutputmap which provides access to any available midi output ports. midiaccess.sysexenabled read only a boolean attribute indicating whether system exclusive support is enabled on the current midiaccess instance. event handlers midiaccess.onstatechange called whenever a new midi port is added or an existing port changes state. ...
...ides access to any available midi output ports. midiaccess.sysexenabled read only a boolean attribute indicating whether system exclusive support is enabled on the current midiaccess instance. event handlers midiaccess.onstatechange called whenever a new midi port is added or an existing port changes state. ...
MediaDeviceInfo - Web APIs
properties mediadeviceinfo.deviceidread only returns a domstring that is an identifier for the represented device that is persisted across sessions. it is un-guessable by other applications and unique to the origin of the calling application. it is reset when the user clears cookies (for private browsing, a different identifier is used that is not persisted across sessions). ...
... device (for example "external usb webcam"). for security reasons, the label field is always blank unless an active media stream exists or the user has granted persistent permission for media device access. the set of device labels could otherwise be used as part of a fingerprinting mechanism to identify a user. methods none. example here's an example that uses enumeratedevices() to get a
list of devices. if (!navigator.mediadevices || !navigator.mediadevices.enumeratedevices) { console.log("enumeratedevices() not supported."); return; } //
list cameras and microphones. navigator.mediadevices.enumeratedevices() .then(function(devices) { devices.foreach(function(device) { console.log(device.kind + ": " + device.label + " id = " + device.deviceid); }); }) .
MediaDevices.enumerateDevices() - Web APIs
the mediadevices method enumeratedevices() requests a
list of the available media input and output devices, such as microphones, cameras, headsets, and so forth. the returned promise is resolved with a mediadeviceinfo array describing the devices. syntax var enumeratorpromise = navigator.mediadevices.enumeratedevices(); return value a promise that receives an array of mediadeviceinfo objects when the promise is fulfilled. each object in the array describes one of the available media input and output devices. if enumeration fails, the promise is rejected. example here's an example of using enumeratedevices(). it simply outputs a
list of the device ids, with their labels if available. if (!navigator.mediadevices || !navigator.mediadevices.enumeratedevices) { console.log("enumeratedev...
...n the array describes one of the available media input and output devices. if enumeration fails, the promise is rejected. example here's an example of using enumeratedevices(). it simply outputs a
list of the device ids, with their labels if available. if (!navigator.mediadevices || !navigator.mediadevices.enumeratedevices) { console.log("enumeratedevices() not supported."); return; } //
list cameras and microphones. navigator.mediadevices.enumeratedevices() .then(function(devices) { devices.foreach(function(device) { console.log(device.kind + ": " + device.label + " id = " + device.deviceid); }); }) .catch(function(err) { console.log(err.name + ": " + err.message); }); this might produce: videoinput: id = cso9c0ypaf274oucpua53cne0yhlir2yxci+sqfbzz8= audi...
msExtendedCode - Web APIs
dia element's error event will be fired. the element's error property will then contain an msextendedcode read-only property with platform-specific error code information. ...
...d-only property with platform-specific error code information. msextendedcode is a read-only proprietary property specific to internet explorer and microsoft edge. ...
MediaRecorder.onerror - Web APIs
thod, or indirectly due to a problem arising during the recording process. example this example creates a new mediarecorder instance and starts recording using the user agent's default media format. it returns either the mediarecorder or the name of the error that occurred if any exceptions are thrown during the setup process. ...
...ormat. it returns either the mediarecorder or the name of the error that occurred if any exceptions are thrown during the setup process. function recordstream(stream) { let recorder = null; let buffer
list = []; try { recorder = new mediarecorder(stream); } catch(err) { return err.name; /* return the error name */ } recorder.ondataavailable = function(event) { buffer
list.push(event.data); }; recorder.onerror = function(event) { let error = event.error; switch(error.name) { case invalidstateerror: shownotification("you can't record the video right " + "now. try again later."); break; case securityerror: shownotification("recording the specified source " + "is not al...
MediaRecorder - Web APIs
ume event, which occurs when media recording resumes after being paused. mediarecorder.onstart an eventhandler called to handle the start event, which occurs when media recording starts. mediarecorder.onstop an eventhandler called to handle the stop event, which occurs when media recording ends, either when the mediastream ends — or after the mediarecorder.stop() method is called. events
listen to these events using addevent
listener() or by assigning an event
listener to the oneventname property of this interface. error fired when an error occurs: for example because recording wasn't allowed or was attempted using an unsupported codec. also available via the onerror property. example if (navigator.mediadevices) { console.log('getusermedia supported.'); var constraints = {...
...unction(e) { console.log("data available after mediarecorder.stop() called."); var clipname = prompt('enter a name for your sound clip'); var clipcontainer = document.createelement('article'); var cliplabel = document.createelement('p'); var audio = document.createelement('audio'); var deletebutton = document.createelement('button'); clipcontainer.class
list.add('clip'); audio.setattribute('controls', ''); deletebutton.innerhtml = "delete"; cliplabel.innerhtml = clipname; clipcontainer.appendchild(audio); clipcontainer.appendchild(cliplabel); clipcontainer.appendchild(deletebutton); soundclips.appendchild(clipcontainer); audio.controls = true; var blob = new blob(chunks, { 'type' : 'audio/ogg; c...
MediaRecorderErrorEvent.error - Web APIs
enies permission to use an input device. this also happens when a mediastreamtrack within the stream is marked as isolated due to the peeridentity constraint on the source stream. example this function creates and returns a mediarecorder for a given mediastream, configured to buffer data into an array and to watch for errors. ...
...tes and returns a mediarecorder for a given mediastream, configured to buffer data into an array and to watch for errors. function recordstream(stream) { let recorder = null; let buffer
list = []; try { recorder = new mediarecorder(stream); } catch(err) { /* exception while trying to create the recorder; handle that */ } recorder.ondataavailable = function(event) { buffer
list.push(event.data); }; recorder.onerror = function(event) { let error = event.error; }; recorder.start(100); /* 100ms time slices per buffer */ return recorder; } specifications specification status comment mediastream recordingthe definition of 'mediarecordererrorevent.error' in that specification. working draft initial specification. ...
MediaSource.activeSourceBuffers - Web APIs
the activesourcebuffers read-only property of the mediasource interface returns a sourcebuffer
list object containing a subset of the sourcebuffer objects contained within sourcebuffers — the
list of objects providing the selected video track, enabled audio tracks, and shown/hidden text tracks. syntax var myactivesourcebuffers = mediasource.activesourcebuffers; value a sourcebuffer
list containing the sourcebuffer objects for each of the active tracks. example the following snippet is based on a simple example written by nick desaulniers (view the full demo live, or download the source for further investigation.) function sourceopen (_) { //console.log(this.readystate); // open var mediasource = this; var sourcebuffer = mediasource.addsourcebuffer(mimecodec); fetchab(asseturl, ...
... active tracks. example the following snippet is based on a simple example written by nick desaulniers (view the full demo live, or download the source for further investigation.) function sourceopen (_) { //console.log(this.readystate); // open var mediasource = this; var sourcebuffer = mediasource.addsourcebuffer(mimecodec); fetchab(asseturl, function (buf) { sourcebuffer.addevent
listener('updateend', function (_) { mediasource.endofstream(); console.log(mediasource.activesourcebuffers); // will contain the source buffer that was added above, // as it is selected for playing in the video player video.play(); //console.log(mediasource.readystate); // ended }); sourcebuffer.appendbuffer(buf); }); }; ... specifications spe...
MediaSource.sourceBuffers - Web APIs
the sourcebuffers read-only property of the mediasource interface returns a sourcebuffer
list object containing the
list of sourcebuffer objects associated with this mediasource. syntax var mysourcebuffers = mediasource.sourcebuffers; value a sourcebuffer
list. ...
...urcebuffer
list. example the following snippet is based on a simple example written by nick desaulniers (view the full demo live, or download the source for further investigation.) function sourceopen (_) { //console.log(this.readystate); // open var mediasource = this; var sourcebuffer = mediasource.addsourcebuffer(mimecodec); fetchab(asseturl, function (buf) { sourcebuffer.addevent
listener('updateend', function (_) { mediasource.endofstream(); console.log(mediasource.sourcebuffers); // will contain the source buffer that was added above video.play(); //console.log(mediasource.readystate); // ended }); sourcebuffer.appendbuffer(buf); }); }; ... specifications specification status comment media source extensionsthe defi...
MediaStream.onremovetrack - Web APIs
from the stream (by calling removetrack()). syntax mediastream.onremovetrack = eventhandler; value this should be set to a function which you provide that accepts as input a mediastreamtrackevent object representing the removetrack event which has occurred. the mediastreamtrack representing the track which was removed is specified in the event's track property. ...
... you provide that accepts as input a mediastreamtrackevent object representing the removetrack event which has occurred. the mediastreamtrack representing the track which was removed is specified in the event's track property. example this example adds a
listener which, when a track is removed from the stream, logs the track that was removed. stream.onremovetrack = function(event) { let track
list = document.getelementbyid("tracks"); let label = document.createelement("li"); label.innerhtml = "removed: " + event.track.kind + ": " + event.track.label; track
list.appendchild(label); }; specifications specification status comment media capture and streamsthe definition of 'mediastream.onremovetrack' in that specification. candidate recommendation ini...
MediaStreamConstraints.audio - Web APIs
0px; border: 1px solid black; font-size: 16px; text-align: center; padding-top: 2px; padding-bottom: 4px; color: white; background-color: darkgreen; } javascript content let audioelement = document.getelementbyid("audio"); let logelement = document.getelementbyid("log"); function log(msg) { logelement.innerhtml += msg + "<br>"; } document.getelementbyid("startbutton").addevent
listener("click", function() { navigator.mediadevices.getusermedia({ audio: true }).then(stream => audioelement.srcobject = stream) .catch(err => log(err.name + ": " + err.message)); }, false); here we see an event handler for a click event which uses getusermedia() to obtain an audio-only stream with no specific constraints, then attaches the resulting stream to an <audio> element once t...
...0px; border: 1px solid black; font-size: 16px; text-align: center; padding-top: 2px; padding-bottom: 4px; color: white; background-color: darkgreen; } javascript content let audioelement = document.getelementbyid("audio"); let logelement = document.getelementbyid("log"); function log(msg) { logelement.innerhtml += msg + "<br>"; } document.getelementbyid("startbutton").addevent
listener("click", function() { navigator.mediadevices.getusermedia({ audio: { samplesize: 8, echocancellation: true } }).then(stream => audioelement.srcobject = stream) .catch(err => log(err.name + ": " + err.message)); }, false); here we see an event handler for a click event which calls getusermedia(), specifying a set of audio constraints requesting that echo cancellati...
MediaStreamConstraints.video - Web APIs
0px; border: 1px solid black; font-size: 16px; text-align: center; padding-top: 2px; padding-bottom: 4px; color: white; background-color: darkgreen; } javascript content let videoelement = document.getelementbyid("video"); let logelement = document.getelementbyid("log"); function log(msg) { logelement.innerhtml += msg + "<br>"; } document.getelementbyid("startbutton").addevent
listener("click", function() { navigator.mediadevices.getusermedia({ video: true }).then(stream => videoelement.srcobject = stream) .catch(err => log(err.name + ": " + err.message)); }, false); here we see an event handler for a click event which uses getusermedia() to obtain a video-only stream with no specific constraints, then attaches the resulting stream to a <video> element once t...
...0px; border: 1px solid black; font-size: 16px; text-align: center; padding-top: 2px; padding-bottom: 4px; color: white; background-color: darkgreen; } javascript content let videoelement = document.getelementbyid("video"); let logelement = document.getelementbyid("log"); function log(msg) { logelement.innerhtml += msg + "<br>"; } document.getelementbyid("startbutton").addevent
listener("click", function() { navigator.mediadevices.getusermedia({ video: { width: 160, height: 120, framerate: 15 } }).then(stream => videoelement.srcobject = stream) .catch(err => log(err.name + ": " + err.message)); }, false); here we see an event handler for a click event which calls getusermedia(), specifying a set of video constraints that indicate ...
MediaStreamTrack: mute event - Web APIs
abled property, for which there are no events. bubbles no cancelable no interface event event handler property onmute examples in this example, event handlers are established for the mute and unmute events in order to detect when the media is not flowing from the source for the mediastreamtrack referenced by musictrack. ...
...vent handler property onmute examples in this example, event handlers are established for the mute and unmute events in order to detect when the media is not flowing from the source for the mediastreamtrack referenced by musictrack. musictrack.addevent
listener("mute", event => { document.getelementbyid("timeline-widget").style.backgroundcolor = "#aaa"; }, false); musictrack.addevent
listener("unmute", event => { document.getelementbyid("timeline-widget").style.backgroundcolor = "#fff"; }, false); with these event handlers in place, when the track musictrack enters its muted state, the element with the id timeline-widget gets its background color changed to #aaa. when the track exits the muted state—detected by the arrival of an unmute event—the background color is restored...
MediaStreamTrack.muted - Web APIs
sabled by setting enabled to false, it generates only empty frames (audio frames in which every sample is 0, or video frames in which every pixel is black). syntax const mutedflag = track.muted value a boolean which is true if the track is currently muted, or false if the track is currently unmuted. when possible, avoid polling muted to monitor the track's muting status. ...
...ck.muted value a boolean which is true if the track is currently muted, or false if the track is currently unmuted. when possible, avoid polling muted to monitor the track's muting status. instead, add event
listeners for the mute and unmute events. example this example counts the number of tracks in an array of mediastreamtrack objects which are currently muted. let mutedcount = 0; track
list.foreach((track) => { if (track.muted) { mutedcount += 1; } }); specifications specification status comment media capture and streamsthe definition of 'muted' in that specification. candidate recommendation initial definition. ...
MediaStreamTrack: unmute event - Web APIs
of as "muted" (that is, a user-controllable way to silence a track) is actually managed using the mediastreamtrack.enabled property, for which there are no events. examples in this example, event handlers are established for the mute and unmute events in order to detect when the media is not flowing from the source for the mediastreamtrack stored in the variable musictrack. ...
... which there are no events. examples in this example, event handlers are established for the mute and unmute events in order to detect when the media is not flowing from the source for the mediastreamtrack stored in the variable musictrack. musictrack.addevent
listener("mute", event => { document.getelementbyid("timeline-widget").style.backgroundcolor = "#aaa"; }, false); musictrack.addevent
listener("unmute", event => { document.getelementbyid("timeline-widget").style.backgroundcolor = "#fff"; }, false); with these event handlers in place, when the track musictrack enters its muted state, the element with the id timeline-widget gets its background color changed to #aaa. when the track exits the muted state—detected by the arrival of an unmuted event—the background color is restore...
Recording a media element - Web APIs
function stop(stream) { stream.gettracks().foreach(track => track.stop()); } this works by calling mediastream.gettracks(), using foreach() to call mediastreamtrack.stop() on each track in the stream. ...
...m" whose contents are the recorded video. lines 17-18 the size and type of the recorded media are output to the log area below the two videos and the download button. line 20 the catch() for all the promises outputs the error to the logging area by calling our log() function. handling the stop button the last bit of code adds a handler for the click event on the stop button using addevent
listener(): stopbutton.addevent
listener("click", function() { stop(preview.srcobject); }, false); this simply calls the stop() function we covered earlier. result when put all together with the rest of the html and the css not shown above, it looks and works like this: you can take a look at all the code, including the parts hidden above because they aren't critical to the explanation of how...
Using the MediaStream Recording API - Web APIs
m directly. this is your entry point into using the mediarecorder api — the stream is now ready to be captured into a blob, in the default encoding format of your browser. const mediarecorder = new mediarecorder(stream); there are a series of methods available in the mediarecorder interface that allow you to control recording of the media stream; in web dictaphone we just make use of two, and
listen to some events. first of all, mediarecorder.start() is used to start recording the stream once the record button is pressed: record.onclick = function() { mediarecorder.start(); console.log(mediarecorder.state); console.log("recorder started"); record.style.background = "red"; record.style.color = "black"; } when the mediarecorder is recording, the mediarecorder.state property will ...
... chunks we have received: mediarecorder.onstop = function(e) { console.log("recorder stopped"); const clipname = prompt('enter a name for your sound clip'); const clipcontainer = document.createelement('article'); const cliplabel = document.createelement('p'); const audio = document.createelement('audio'); const deletebutton = document.createelement('button'); clipcontainer.class
list.add('clip'); audio.setattribute('controls', ''); deletebutton.innerhtml = "delete"; cliplabel.innerhtml = clipname; clipcontainer.appendchild(audio); clipcontainer.appendchild(cliplabel); clipcontainer.appendchild(deletebutton); soundclips.appendchild(clipcontainer); const blob = new blob(chunks, { 'type' : 'audio/ogg; codecs=opus' }); chunks = []; const audiourl = window.ur...
MediaStream Recording API - Web APIs
r. recording stops automatically when the source media stops playing. you can stop recording at any time by calling mediarecorder.stop(). note: individual blobs containing slices of the recorded media will not necessarily be individually playable. the media needs to be reassembled before playback. if anything goes wrong during recording, an error event is sent to the mediarecorder. you can
listen for error events by setting up a onerror event handler. example here, we use an html canvas as source of the mediastream, and stop recording after 9 seconds. var canvas = document.queryselector("canvas"); // optional frames per second argument. var stream = canvas.capturestream(25); var recordedchunks = []; console.log(stream); var options = { mimetype: "video/webm; codecs=vp9" }; mediare...
...ee if a specific mime type is supported, that's possible as well. just call mediarecorder.istypesupported(). examining potential input sources if your goal is to record camera and/or microphone input, you may wish to examine the available input devices before beginning the process of constructing the mediarecorder. to do so, you'll need to call navigator.mediadevices.enumeratedevices() to get a
list of the available media devices. you can then examine that
list and identify the potential input sources, and even filter the
list based on desired criteria. in this code snippet, enumeratedevices() is used to examine the available input devices, locate those which are audio input devices, and create <option> elements that are then added to a <select> element representing an input source picker. ...
Media Source API - Web APIs
re are numerous available free and open source tools for transcoding content and preparing it for use with dash, dash file servers, and dash client libraries written in javascript. interfaces mediasource represents a media source to be played via an htmlmediaelement object. sourcebuffer represents a chunk of media to be passed into an htmlmediaelement via a mediasource object. sourcebuffer
list a simple container
list for multiple sourcebuffer objects. videoplaybackquality contains information about the quality of video being played by a <video> element, such as number of dropped or corrupted frames. returned by the htmlvideoelement.getvideoplaybackquality() method. trackdefault provides a sourcebuffer with kind, label, and language information for tracks that do not contain this i...
...ckquality contains information about the quality of video being played by a <video> element, such as number of dropped or corrupted frames. returned by the htmlvideoelement.getvideoplaybackquality() method. trackdefault provides a sourcebuffer with kind, label, and language information for tracks that do not contain this information in the initialization segments of a media chunk. trackdefault
list a simple container
list for multiple trackdefault objects. extensions to other interfaces url.createobjecturl() creates an object url pointing to a mediasource object that can then be specified as the src value of an html media element to play a media stream. htmlmediaelement.seekable when a mediasource object is played by an html media element, this property will return a timeranges obj...
MessageChannel() - Web APIs
in the following code block, you can see a new channel being created using the messagechannel.messagechannel constructor. when the iframe has loaded, we pass port2 to the iframe using messageport.postmessage along with a message. the handlemessage handler then responds to a message being sent back from the iframe (using messageport.onmessage), putting it into a paragraph. ...
...a message. the handlemessage handler then responds to a message being sent back from the iframe (using messageport.onmessage), putting it into a paragraph. messagechannel.port1 is
listened to, to check when the message arrives. var channel = new messagechannel(); var para = document.queryselector('p'); var ifr = document.queryselector('iframe'); var otherwindow = ifr.contentwindow; ifr.addevent
listener("load", iframeloaded, false); function iframeloaded() { otherwindow.postmessage('hello from the main page!', '*', [channel.port2]); } channel.port1.onmessage = handlemessage; function handlemessage(e) { para.innerhtml = e.data; } for a full working example, see our channel messaging basic demo on github (run it live too). specifications specification status comment ...
MessageChannel.port1 - Web APIs
ee a new channel being created using the messagechannel() constructor. when the <iframe> has loaded, we pass messagechannel.port2 to the <iframe> using messageport.postmessage along with a message. the handlemessage handler then responds to a message being sent back from the <iframe> (using messageport.onmessage), putting it into a paragraph. ...
...dlemessage handler then responds to a message being sent back from the <iframe> (using messageport.onmessage), putting it into a paragraph. the handlemessage method is associated to the port1 to
listen when the message arrives. var channel = new messagechannel(); var para = document.queryselector('p'); var ifr = document.queryselector('iframe'); var otherwindow = ifr.contentwindow; ifr.addevent
listener("load", iframeloaded, false); function iframeloaded() { otherwindow.postmessage('hello from the main page!', '*', [channel.port2]); } channel.port1.onmessage = handlemessage; function handlemessage(e) { para.innerhtml = e.data; } specifications specification status comment html living standardthe definition of 'port1' in that specification. living stand...
MessageChannel.port2 - Web APIs
in the following code block, you can see a new channel being created using the messagechannel.messagechannel constructor. when the iframe has loaded, we pass port2 to the iframe using messageport.postmessage along with a message. the handlemessage handler then responds to a message being sent back from the iframe (using messageport.onmessage), putting it into a paragraph. ...
...a message. the handlemessage handler then responds to a message being sent back from the iframe (using messageport.onmessage), putting it into a paragraph. messagechannel.port1 is
listened to, to check when the message arrives. var channel = new messagechannel(); var para = document.queryselector('p'); var ifr = document.queryselector('iframe'); var otherwindow = ifr.contentwindow; ifr.addevent
listener("load", iframeloaded, false); function iframeloaded() { otherwindow.postmessage('hello from the main page!', '*', [channel.port2]); } channel.port1.onmessage = handlemessage; function handlemessage(e) { para.innerhtml = e.data; } for a full working example, see our channel messaging basic demo on github (run it live too). specifications specification status comment ...
MessageChannel - Web APIs
nd transfer messagechannel.port2 to the iframe using the window.postmessage method along with a message. when a message is received back from the iframe, the onmessage function simply outputs the message to a paragraph. ...
... the window.postmessage method along with a message. when a message is received back from the iframe, the onmessage function simply outputs the message to a paragraph. var channel = new messagechannel(); var output = document.queryselector('.output'); var iframe = document.queryselector('iframe'); // wait for the iframe to load iframe.addevent
listener("load", onload); function onload() { //
listen for messages on port1 channel.port1.onmessage = onmessage; // transfer port2 to the iframe iframe.contentwindow.postmessage('hello from the main page!', '*', [channel.port2]); } // handle messages received on port1 function onmessage(e) { output.innerhtml = e.data; } for a full working example, see our channel messaging basic demo on github (run it live too). specifications ...
MessagePort.onmessage - Web APIs
the onmessage event handler of the messageport interface is an event
listener, called whenever an messageevent of type message is fired on the port — that is, when the port receives a message. note: this feature is available in web workers. syntax channel.onmessage = function() { ... }; example in the following code block, you can see a new channel being created using the messagechannel.messagechannel constructor. when the iframe has loaded, we pass messagechannel.port2 to the iframe using messageport.postmessage along with a message. the handlemessage handler then responds to a message being sent back from the iframe using onmessage, putting it into a paragraph — messagechannel.port1 is
listened to, to check when the message arrives. var channel = new messagechannel(); var para = do...
...along with a message. the handlemessage handler then responds to a message being sent back from the iframe using onmessage, putting it into a paragraph — messagechannel.port1 is
listened to, to check when the message arrives. var channel = new messagechannel(); var para = document.queryselector('p'); var ifr = document.queryselector('iframe'); var otherwindow = ifr.contentwindow; ifr.addevent
listener("load", iframeloaded, false); function iframeloaded() { otherwindow.postmessage('hello from the main page!', '*', [channel.port2]); } channel.port1.onmessage = handlemessage; function handlemessage(e) { para.innerhtml = e.data; } for a full working example, see our channel messaging basic demo on github (run it live too). specifications specification status comment ...
MouseEvent - Web APIs
essure applied to a touch or tablet device when generating the event; this value ranges between 0.0 (minimum pressure) and 1.0 (maximum pressure). instead of using this deprecated (and non-standard) property, you should instead use pointerevent and look at its pressure property. mouseevent.mozinputsource read only the type of device that generated the event (one of the moz_source_* constants
listed below). this lets you, for example, determine whether a mouse event was generated by an actual mouse or by a touch event (which might affect the degree of accuracy with which you interpret the coordinates associated with the event). mouseevent.webkitforce read only the amount of pressure applied when clicking mouseevent.x read only alias for mouseevent.clientx. mouseevent.y read only...
... working draft redefines mouseevent from long to double. this means that a pointerevent whose pointertype is mouse will be a double. pointer lockthe definition of 'mouseevent' in tha...
MutationObserver.observe() - Web APIs
subtree of nodes to be watched. options a mutationobserverinit object providing options that describe which dom mutations should be reported to mutationobserver’s callback. return value undefined. exceptions typeerror thrown in any of the following circumstances: the options are configured such that nothing will actually be monitored. (for example, if mutationobserverinit.child
list, mutationobserverinit.attributes, and mutationobserverinit.characterdata are all false.) the value of options.attributes is false (indicating that attribute changes are not to be monitored), but attributeoldvalue is true and/or attributefilter is present. the characterdataoldvalue option is true but mutationobserverinit.characterdata is false (indicating that character changes are not to be m...
... living standard ...
MutationObserver.takeRecords() - Web APIs
the most common use case for this is to immediately fetch all pending mutation records immediately prior to disconnecting the observer, so that any pending mutations can be processed when stopping down the observer. syntax const mutationrecords = mutationobserver.takerecords() parameters none. return value an array mutationrecord objects, each describing one change applied to the observed portion of the document's dom tree. ...
...m tree. note: the queue of mutations which have occurred, but not been delivered to the observer's callback is left empty after calling takerecords(). example in this example, we demonstrate how to handle any undelivered mutationrecords by calling takerecords() just before disconnecting the observer. const targetnode = document.queryselector("#someelement"); const observeroptions = { child
list: true, attributes: true } const observer = new mutationobserver(callback); observer.observe(targetnode, observeroptions); /* ...later, when it's time to stop observing... */ /* handle any still-pending mutations */ let mutations = observer.takerecords(); observer.disconnect(); if (mutations) { callback(mutations); } the code in lines 12–17 fetches any unprocessed mutation records, t...
MutationObserverInit - Web APIs
the mutationobserverinit dictionary describes the configuration of a mutation observer. as such, it's primarily used as the type of the options parameter on the mutationobserver.observe() method. properties at a minimum, one of child
list, attributes, and/or characterdata must be true when you call observe(). otherwise, a typeerror exception will be thrown. subtree optional set to true to extend monitoring to the entire subtree of nodes rooted at target. ...
...utes, and/or characterdata must be true when you call observe(). otherwise, a typeerror exception will be thrown. subtree optional set to true to extend monitoring to the entire subtree of nodes rooted at target. all of the other mutationobserverinit properties are then extended to all of the nodes in the subtree instead of applying solely to the target node. the default value is false. child
list optional set to true to monitor the target node (and, if subtree is true, its descendants) for the addition of new child nodes or removal of existing child nodes. the default value is false. attributes optional set to true to watch for changes to the value of attributes on the node or nodes being monitored. the default value is true if either of attributefilter or attributeoldvalue is specifie...
NavigationPreloadManager - Web APIs
ionpreloadmanager.setheadervalue() sets the value of the service-worker-navigation-preload header and returns an empty promise. navigationpreloadmanager.getstate() returns a promise that resolves to an object with properties indicating whether preload is enabled and the contents of the service-worker-navigation-preload. ...
...ng navigation preloading addevent
listener('activate', event => { event.waituntil(async function() { if (self.registration.navigationpreload) { // enable navigation preloads! await self.registration.navigationpreload.enable(); } }()); }); using a preloaded response the following example shows the implementation of a fetch event that uses a preloaded response. addevent
listener('fetch', event => { event.respondwith(async function() { // respond from the cache if we can const cachedresponse = await caches.match(event.request); if (cachedresponse) return cachedresponse; // else, use the preloaded response, if it's there const response = await event.preloadresponse; if (response) return response; // else try the network. return fetch...
Navigator.sendBeacon() - Web APIs
ing the document, which slows down the next navigation. there is nothing the next page can do to avoid this, so the new page seems slow, even though it's the previous page's fault. the following example shows theoretical analytics code that attempts to submit data to a server with a synchronous xmlhttprequest in an unload handler. this results in the next page load to be delayed. window.addevent
listener("unload", function logdata() { var xhr = new xmlhttprequest(); xhr.open("post", "/log", false); // third parameter of `false` means synchronous xhr.send(analyticsdata); }); this is what sendbeacon() replaces. with the sendbeacon() method, the data is transmitted asynchronously when the user agent has an opportunity to do so, without delaying unload or the next navigation. this solves ...
...igation. this solves all of the problems with submission of analytics data: the data is sent reliably it's sent asynchronously it doesn't impact the loading of the next page in addition, the code is simpler to write than any of the older techniques! the following example shows a theoretical analytics code pattern that submits data to a server using the sendbeacon() method. window.addevent
listener("unload", function logdata() { navigator.sendbeacon("/log", analyticsdata); }); the beacon sends an http request via the post method, with all relevant cookies available when called. specifications specification status comment beaconthe definition of 'sendbeacon()' in that specification. candidate recommendation initial definition ...
Navigator - Web APIs
navigator.mediacapabilities read only returns a mediacapabilities object that can expose information about the decoding and encoding capabilities for a given format and output capabilities. navigator.maxtouchpoints read only returns the maximum number of simultaneous touch contact points are supported by the current device. navigatorplugins.mimetypes read only returns an mimetypearray
listing the mime types supported by the browser. navigator.online read only returns a boolean indicating whether the browser is working online. navigator.permissions read only returns a permissions object that can be used to query and update permission status of apis covered by the permissions api. navigatorid.platform read only returns a string representing the platform of the browser. do ...
...owser is working online. navigator.permissions read only returns a permissions object that can be used to query and update permission status of apis covered by the permissions api. navigatorid.platform read only returns a string representing the platform of the browser. do not rely on this function to return a significant value. navigatorplugins.plugins read only returns a pluginarray
listing the plugins installed in the browser. navigatorid.product read only always returns 'gecko', on any browser. this property is kept only for compatibility purpose. navigator.serviceworker read only returns a serviceworkercontainer object, which provides access to registration, removal, upgrade, and communication with the serviceworker objects for the associated document. navigatorstorag...
NavigatorPlugins.plugins - Web APIs
returns a pluginarray object,
listing the plugin objects describing the plugins installed in the application. in firefox 29 and later, enumeration of the navigator.plugins array may be restricted as a privacy measure. applications that must check for the presence of a browser plugin should query navigator.plugins or navigator.mimetypes by exact name instead of enumerating the navigator.plugins array and comparing every plugin's name. this privacy change does not disable any plugins; it just hides some plugin names from enumeration. syntax var plugins = navigator.plugins; plugins is pluginarray object used to access plugin objects either by name or as a
list of items. the returned value is not a javascript array, but has the length property and supports accessing individual items using...
... specifications specification status comment html living standardthe definition of 'navigatorplugins.plugins' in that specification. living standard initial definition. ...
NavigatorPlugins - Web APIs
methods the navigatorplugins interface doesn't inherit any methods. ...
... methods the navigatorplugins interface doesn't inherit any methods. ...
Node.appendChild() - Web APIs
if the given child is a reference to an existing node in the document, appendchild() moves it from its current position to the new position (there is no requirement to remove the node from its parent node before appending it to some other node). this means that a node can't be in two points of the document simultaneously. so if the node already has a parent, the node is first removed, then appended at the new position. the node.clonenode() method can be used to make a copy of the node before appending it under the new parent. note that the copies made with clonenode will not be automatically kept in sync. ...
...o if the node already has a parent, the node is first removed, then appended at the new position. the node.clonenode() method can be used to make a copy of the node before appending it under the new parent. note that the copies made with clonenode will not be automatically kept in sync. if the given child is a documentfragment, the entire contents of the documentfragment are moved into the child
list of the specified parent node. newer api avaliable! the parentnode.append() method supports multiple arguments and appending strings. syntax element.appendchild(achild) parameters achild the node to append to the given parent node (commonly an element). return value the returned value is the appended child (achild), except when achild is a documentfragment, in which case the empty doc...
Node.insertBefore() - Web APIs
w parent.) this means that a node cannot be in two locations of the document simultaneously. note: the node.clonenode() can be used to make a copy of the node before appending it under the new parent. note that the copies made with clonenode() will not be automatically kept in sync. if the given child is a documentfragment, the entire contents of the documentfragment are moved into the child
list of the specified parent node. syntax let insertednode = parentnode.insertbefore(newnode, referencenode) insertednode the node being inserted (the same as newnode) parentnode the parent of the newly inserted node. newnode the node to be inserted. referencenode the node before which newnode is inserted. if this is null, then newnode is inserted at the end of parentnode's child nodes. ...
...p2) </script> note: there is no insertafter() method. it can be emulated by combining the insertbefore method with node.nextsibling. in the previous example, sp1 could be inserted after sp2 using: parentdiv.insertbefore(sp1, sp2.nextsibling) if sp2 does not have a next sibling, then it must be the last child — sp2.nextsibling returns null, and sp1 is inserted at the end of the child node
list (immediately after sp2). example 3 insert an element before the first child element, using the firstchild property. // get the parent element let parentelement = document.getelementbyid('parentelement') // get the parent's first child let thefirstchild = parentelement.firstchild // create a new element let newelement = document.createelement("div") // insert the new element before the first ...
Node.previousSibling - Web APIs
syntax previousnode = node.previoussibling; example <img id="b0"> <img id="b1"> <img id="b2"> console.log(document.getelementbyid("b1").previoussibling); // <img id="b0"> console.log(document.getelementbyid("b2").previoussibling.id); // "b1" notes gecko-based browsers insert text nodes into a document to represent whitespace in the source markup. ...
...es into a document to represent whitespace in the source markup. therefore a node obtained, for example, using node.firstchild or node.previoussibling may refer to a whitespace text node rather than the actual element the author intended to get. see whitespace in the dom and w3c dom 3 faq: why are some text nodes empty? for more information. to navigate the opposite way through the child nodes
list use node.nextsibling. specifications specification status comment domthe definition of 'node.previoussibling' in that specification. living standard no change document object model (dom) level 3 core specificationthe definition of 'node.previoussibling' in that specification. obsolete no change document object model (dom) level 2 core sp...
Notification.actions - Web APIs
note: device and user agent might be able to display only a limited number of actions (due to, e.g., limited screen space). this limit can be infered from notification.maxactions. ...
... note: device and user agent might be able to display only a limited number of actions (due to, e.g., limited screen space). this limit can be infered from notification.maxactions. ...
Notification.close() - Web APIs
eady read the notification on the webpage in the case of a messaging app or the following song is already playing in a music app). syntax notification.close(); parameters none. returns void. examples in the following snippet, we have a simple function that when called creates an options object and then a new notification. ...
...n options object and then a new notification. at the end of the function, it also calls close() inside a addevent
listener() function to remove the notification when the relevant content has been read on the webpage. function spawnnotification(thebody, theicon, thetitle) { var options = { body: thebody, icon: theicon }; var n = new notification(thetitle,options); document.addevent
listener('visibilitychange', function() { if (document.visibilitystate === 'visible') { // the tab has become visible so clear the now-stale notification. n.close(); } }); } specifications specification status comment notifications api living standard living standard ...
NotificationEvent.notification - Web APIs
notificationevent interface returns the instance of the notification that was clicked to fire the event. the notification provides read-only access to many properties that were set at the instantiation time of the notification such as tag and data attributes that allow you to store information for defered use in the notificationclick event. returns a notification object. example self.addevent
listener('notificationclick', function(event) { console.log('on notification click'); // data can be attached to the notification so that you // can process it in the notificationclick handler. console.log('notification tag:', event.notification.tag); console.log('notification data:', event.notification.data); event.notification.close(); // this looks to see if the current is already o...
...to the notification so that you // can process it in the notificationclick handler. console.log('notification tag:', event.notification.tag); console.log('notification data:', event.notification.data); event.notification.close(); // this looks to see if the current is already open and // focuses if it is event.waituntil(clients.matchall({ type: "window" }).then(function(client
list) { for (var i = 0; i < client
list.length; i++) { var client = client
list[i]; if (client.url == '/' && 'focus' in client) return client.focus(); } if (clients.openwindow) return clients.openwindow('/'); })); }); specifications specification status comment notifications apithe definition of 'notification' in that specification. ...
PannerNode.positionY - Web APIs
the orientation of the audio source (that is, the direction in which it's facing), given as (orientationx, orientationy, orientationz). depending on the directionality of the sound (as specified using the attributes coneinnerangle, coneouterangle, and codeoutergain), the orientation of the sound may alter the perceived volume of the sound as it's being played. if the sound is pointing toward the
listener, it will be louder than if the sound is pointed away from the
listener. the audioparam contained by this property is read only; however, you can still change the value of the parameter by assigning a new value to its audioparam.value property. syntax var positiony = pannernode.positiony; pannernode.positiony.value = newpositiony; value an audioparam whose value is the y coordinate of ...
... however, you can still change the value of the parameter by assigning a new value to its audioparam.value property. syntax var positiony = pannernode.positiony; pannernode.positiony.value = newpositiony; value an audioparam whose value is the y coordinate of the audio source's position, in 3d cartesian coordinates. example the following example starts an oscillator and pans it above the
listener after 1 second, below the
listener after 2 seconds, and back to the center after 3 seconds. note that in this case, the change will mainly affect the timbre of the oscillator, as it's a simple mono wave. const context = new audiocontext(); const osc = new oscillatornode(context); const panner = new pannernode(context); panner.panningmodel = 'hrtf'; panner.positiony.setvalueattime(1, cont...
PannerNode.positionZ - Web APIs
the positionz property of the pannernode interface specifies the z coordinate of the audio source's position in 3d cartesian coordinates, corresponding to the depth axis (behind-in front of the
listener). the complete vector is defined by the position of the audio source, given as (positionx, positiony, positionz), and the orientation of the audio source (that is, the direction in which it's facing), given as (orientationx, orientationy, orientationz). depending on the directionality of the sound (as specified using the attributes coneinnerangle, coneouterangle, and codeoutergain), the orientation of the sound may alter the perceived volume of the sound as it's being played. if the sound is pointing toward the
listener, it will be louder than if the sound is pointed away from the
listener. ...
...r, you can still change the value of the parameter by assigning a new value to its audioparam.value property. syntax var positionz = pannernode.positionz; pannernode.positionz.value = newpositionz; value an audioparam whose value is the z coordinate of the audio source's position, in 3d cartesian coordinates. example the following example starts an oscillator and moves it in front of the
listener after 1 second, behind the
listener after 2 seconds, and back to the
listener's position after 3 seconds. note that in this case, the change will mainly affect the timbre and perceived volume of the sound. const context = new audiocontext(); const osc = new oscillatornode(context); const panner = new pannernode(context); panner.panningmodel = 'hrtf'; panner.positionz.setvalueattime(1, co...
PannerNode.refDistance - Web APIs
the refdistance property of the pannernode interface is a double value representing the reference distance for reducing volume as the audio source moves further from the
listener – i.e. the distance at which the volume reduction starts taking effect. this value is used by all distance models. the refdistance property's default value is 1. syntax var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.refdistance = 1; value a non-negative number. if the value is set to less than 0, a rangeerror is thrown. exceptions rangeerror the property has been given a value that is outside the accepted range. example this example demonstrates how different values of refdistance affect how the volume of a sound decays as it moves away from the
listener. unlike rollo...
...offfactor, changing this value also delays the volume decay until the sound moves past the reference point. ...
ParentNode.append() - Web APIs
entnode.append(...nodesordomstrings) // returns undefined parameters nodes a set of node or domstring objects to insert. exceptions hierarchyrequesterror: node cannot be inserted at the specified point in the hierarchy. ...
...see symbol.unscopables for more information. ...
ParentNode.prepend() - Web APIs
re inserted as new text nodes. return value undefined. exceptions hierarchyrequesterror: node cannot be inserted at the specified point in the hierarchy. ...
...see symbol.unscopables for more information. ...
PaymentAddress.toJSON() - Web APIs
b-payments preference (needs to be set to enabled). to change preferences in chrome, visit chrome://flags.edge full support 15firefox full support 62notes disabled full support 62notes disabled notes available only in nightly builds. requires the comma-delineated
list in dom.payments.request.supportedregions to contain one or more of the supported 2-character iso locales, currently us and ca.disabled from version 62: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). to change preferences in firefox, visit about:config.ie no support noopera no support ...
... disabled from version 61: this feature is behind the #web-payments preference (needs to be set to enabled). to change preferences in chrome, visit chrome://flags.firefox android full support 62notes disabled full support 62notes disabled notes available only in nightly builds. requires the comma-delineated
list in dom.payments.request.supportedregions to contain one or more of the supported 2-character iso locales, currently us and ca.disabled from version 62: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). to change preferences in firefox, visit about:config.opera android no support nosafari ios f...
PaymentRequest.onpaymentmethodchange - Web APIs
ntmethodchange is invoked when the paymentmethodchange is fired, indicating that the user has changed payment methods within a given payment handler. for example, when using apple pay, the user can swipe to select different credit cards, debit cards, and so forth. each time the user does so, this event is fired. this event may not be fired by all payment handlers. syntax paymentrequest.addevent
listener('paymentmethodchange', paymentmethodchangeevent => { ... }); paymentrequest.onpaymentmethodchange = function(paymentmethodchangeevent) { ... }; value an event handler function which is to be called whenever the paymentmethodchange event is fired at the paymentrequest, indicating that the user has changed payment methods within the same payment handler. the paymentmethodchange event is tri...
...n which is to be called whenever the paymentmethodchange event is fired at the paymentrequest, indicating that the user has changed payment methods within the same payment handler. the paymentmethodchange event is triggered by a user-agent controlled interaction (i.e., the end-user switches from a debit to a credit card in the payment ui). to make sure you receive the event, you should add event
listeners to paymentrequest object after instantiation, but before you call show(). examples an example payment method change handler is shown below; this example handles changes made to the payment method when using apple pay, specifically: request.onpaymentmethodchange = ev => { const { type: cardtype } = ev.methoddetails; const newstuff = {}; if (ev.methodname === "https://apple.com/apple-...
PaymentRequest.onshippingaddresschange - Web APIs
the onshippingaddresschange event of the paymentrequest interface is fired whenever the user changes their shipping address, including when an address is added by the user for the first time. syntax paymentrequest.addevent
listener('shippingaddresschange', shippingaddresschangeevent => { ... }); paymentrequest.onshippingaddresschange = function(shippingaddresschangeevent) { ... }; examples the shippingaddresschange event is triggered by a user-agent controlled interaction. if the address stored by the user agent changes at any time during a payment process, the event is triggered. to make sure an updated address is included when sending payment information to the server, you should add event
listeners for a paymentrequest object after instantiation, but before the call to show(). // in...
...rocess, the event is triggered. to make sure an updated address is included when sending payment information to the server, you should add event
listeners for a paymentrequest object after instantiation, but before the call to show(). // initialization of paymentrequest arguments are excerpted for clarity. var payment = new paymentrequest(supportedinstruments, details, options); request.addevent
listener('shippingaddresschange', function(evt) { evt.updatewith(new promise(function(resolve) { updatedetails(details, request.shippingaddress, resolve); })); }); payment.show().then(function(paymentresponse) { // processing of paymentresponse exerpted for the same of clarity. }).catch(function(err) { console.error("uh oh, something bad happened", err.message); }); specifications ...
PaymentRequest.onshippingoptionchange - Web APIs
the onshippingoptionchange event of the paymentrequest interface is fired whenever the user changes a shipping option. syntax paymentrequest.addevent
listener('shippingoptionchange', shippingoptionchangeevent => { ... }); paymentrequest.onshippingoptionchange = function(shippingoptionchangeevent) { ... }; examples the shippingoptionchange event is triggered by a user-agent controlled interaction. if the option stored by the user agent changes at any time during a payment process, the event is triggered. to make sure an updated option is included when sending payment information to the server, you should add event
listeners for a paymentrequest object after instantiation, but before the call to show(). // initialization of paymentrequest arguments are excerpted for clarity. var reques...
... sure an updated option is included when sending payment information to the server, you should add event
listeners for a paymentrequest object after instantiation, but before the call to show(). // initialization of paymentrequest arguments are excerpted for clarity. ...
PaymentRequest: paymentmethodchange event - Web APIs
t, a paymentmethodchange event is fired to let you know about the change. bubbles no cancelable no interface paymentmethodchangeevent event handler property onpaymentmethodchange examples let's take a look at an example. this code creates a new paymentrequest, adds a handler for the paymentmethodchange event by calling the request's addevent
listener(), then calls show() to present the payment interface to the user. the code assumes the existence of a method detailsforshipping(), which returns a paymentdetailsupdate object containing the shipping options for the ground shipping method, in the form found in the paymentshippingoption dictionary. by doing so, the payment form defaults to the ground shipping method. const options = { requ...
...s a paymentdetailsupdate object containing the shipping options for the ground shipping method, in the form found in the paymentshippingoption dictionary. by doing so, the payment form defaults to the ground shipping method. ...
PaymentRequest: shippingoptionchange event - Web APIs
the string identifying the currently-selected shipping option can be found in the shippingoption property. ...
...r for the shippingoptionchange event. the code recalculates the total charge for the payment based on the selected shipping option. for example, if there are three options (such as "free ground shipping", "2-day air", and "next day"), each time the user chooses one of those options, this event handler is called to recalculate the total based on the changed shipping option. paymentrequest.addevent
listener("shippingoptionchange", event => { const value = calculatenewtotal(paymentrequest.shippingoption); const total = { currency: "eur", label: "total due", value, }; event.updatewith({ total }); }, false); after caling a custom function, calculatenewtotal(), to compute the updated total based on the newly-selected shipping option as specified by the shippingoption. the revis...
PaymentResponse.onpayerdetailchange - Web APIs
to their personal information while filling out a payment request form. syntax paymentresponse.onpayerdetailchange = eventhandlerfunction; value an event handler function which is called to handle the payerdetailchange event when the user makes changes to their personal information while editing a payment request form. examples in the example below, onpayerdetailchange is used to set up a
listener for the payerdetailchange event in order to validate the information entered by the user, requesting that any mistakes be corrected // options for paymentrequest(), indicating that shipping address, // payer email address, name, and phone number all be collected. const options = { requestshipping: true, requestpayeremail: true, requestpayername: true, requestpayerphone: true, }; con...
...ername)); oldpayername = payername; } if (oldpayeremail !== payeremail) { promisestovalidate.push(validateemail(payeremail)); oldpayeremail = payeremail; } if (oldpayerphone !== payerphone) { promisestovalidate.push(validatephone(payerphone)); oldpayerphone = payerphone; } // as each validation promise resolves, add the results of the // validation to the errors
list const errors = await promise.all(promisestovalidate).then(results => results.reduce((errors, result), object.assign(errors, result)) ); // if we found any errors, wait for them to be corrected if (object.getownpropertynames(errors).length) { await response.retry(errors); } else { // we have a good payment; send the data to the server await fetch("/pay-for-things/", { ...
PerformanceObserver - Web APIs
r object. methods performanceobserver.observe() specifies the set of entry types to observe. the performance observer's callback function will be invoked when a performance entry is recorded for one of the specified entrytypes performanceobserver.disconnect() stops the performance observer callback from receiving performance entries. ...
...erver's callback function will be invoked when a performance entry is recorded for one of the specified entrytypes performanceobserver.disconnect() stops the performance observer callback from receiving performance entries. performanceobserver.takerecords() returns the current
list of performance entries stored in the performance observer, emptying it out. example function perf_observer(
list, observer) { // process the "measure" event } var observer2 = new performanceobserver(perf_observer); observer2.observe({entrytypes: ["measure"]}); specifications specification status comment performance timeline level 2the definition of 'performanceobserver' in that specification. candidate recommendation initial definition of performanceobserver interface. ...
PointerEvent.pointerType - Web APIs
type. the supported values are the following strings: "mouse" the event was generated by a mouse device. "pen" the event was generated by a pen or stylus device. "touch" the event was generated by a touch, such as a finger. if the device type cannot be detected by the browser, the value can be an empty string (""). ...
...t be detected by the browser, the value can be an empty string (""). if the browser supports pointer device types other than those
listed above, the value should be vendor-prefixed to avoid conflicting names for different types of devices. example this example illustrates using the value of the pointertype property to call the appropriate pointer type processing function. ...
Proximity Events - Web APIs
will never fire them. proximity events when the device proximity sensor detects a change between the device and an object, it notifies the browser of that change. when the browser gets such a notification, it fires a deviceproximityevent for any change, and a userproximityevent event in the case of a more rough change. this event can be captured at the window object level by using the addevent
listener method (using the deviceproximity or userproximity event name) or by attaching an event handler to the window.ondeviceproximity or window.onuserproximity properties. once captured, the event object gives access to different kinds of information: the deviceproximityevent event provides an exact match for the distance between the device and the object through its value property. it also pro...
...nd the object through its value property. it also provides the closest and farthest distance the device is able to detect something through its min and max properties. the userproximityevent event provides a rough approximation of the distance, expressed through a boolean. the userproximityevent.near property is true if the object is close or false if the object is far. example window.addevent
listener('userproximity', function(event) { if (event.near) { // let's power off the screen navigator.mozpower.screenenabled = false; } else { // otherwise, let's power on the screen navigator.mozpower.screenenabled = true; } }); specifications specification status comment proximity sensorthe definition of 'proximity events' in that specification. ...
PublicKeyCredentialCreationOptions.extensions - Web APIs
backward compatibility with the legacy fido js api, knowing the user verification process, etc. note: an analogous option exists for the fetching operation (navigators.credentials.get()), see publickeycredentialrequestoptions.extensions. syntax extensions = publickeycredentialcreationoptions.extensions value an object with various keys and values. here is the current (as of march 2019)
list of potential extensions which may be used during the registration operation. warning! as of june 2020, only appid (used during creation with publickeycredentialrequestoptions.extensions) is supported by chrome and edge. firefox does not seem to support any extension. also chrome doesn't plan to support any other extension in future extension identifier type description ...
...arning! as of june 2020, only appid (used during creation with publickeycredentialrequestoptions.extensions) is supported by chrome and edge. firefox does not seem to support any extension. also chrome doesn't plan to support any other extension in future extension identifier type description authnsel array of buffersource authenticator selection. restricts the
list of authenticator models which may be used. if no matching authenticator is available, the credential is still generated with another available authenticator. exts boolean supported extensions. if true, the client outputs an array of strings containing the extensions which are supported by the authenticator. uvi boolean user verification index. if true, the client out...
PushEvent.data - Web APIs
the data read-only property of the pushevent interface returns a reference to a pushmessagedata object containing data sent to the pushsubscription. syntax var mypushdata = pushevent.data; value a pushmessagedata object. examples the following example takes data from a pushevent and displays it on all of the service workers' clients. ...
... working draft initial definition. browser compatibility the compatibility table on this page is gener...
PushEvent - Web APIs
ties inherits properties from its parent, extendableevent. additional properties: pushevent.data read only returns a reference to a pushmessagedata object containing data sent to the pushsubscription. methods inherits methods from its parent, extendableevent. examples the following example takes data from a pushevent and displays it on all of the service worker's clients. ...
... working draft initial definition. browser compatibility the compatibility table on this page is ...
RTCConfiguration.certificates - Web APIs
]; let certificates = rtcconfiguration.certificates; value an array of rtccertificate objects, each specifying one security certificate available for use when connecting to a remote peer. ...
...ection. see using certificates below for more information on why you might want to—or not to—explicitly provide certificates. description if this property isn't included in the configuration, a set of certificates is automatically generated for each instance of rtcpeerconnection. although a given dtls connection only uses a single certificate, providing multiple options in the certificates
list may improve the odds of establishing a connection by increasing the chances a mutually-compatible encryption algorithm and key size may be found. the method by which a browser decides which certificate to use is implementation-dependent. some browsers may simply choose the first
listed certificate and ignore the rest of the
list; others may take a different approach. using certificates when yo...
RTCDTMFSender: tonechange event - Web APIs
event handler property ontonechange to determine what tone started playing, or if a tone stopped playing, check the value of the event's tone property. examples this example establishes a handler for the tonechange event which updates an element to display the currently playing tone in its content, or, if all tones have played, the string "<none>". ...
...ntonechange to determine what tone started playing, or if a tone stopped playing, check the value of the event's tone property. examples this example establishes a handler for the tonechange event which updates an element to display the currently playing tone in its content, or, if all tones have played, the string "<none>". ...
RTCDTMFSender - Web APIs
see tonebuffer for details on the format of the tone buffer. methods rtcdtmfsender.insertdtmf() given a string describing a set of dtmf codes and, optionally, the duration of and inter-tone gap between the tones, insertdtmf() starts sending the specified tones.
...uffer. methods rtcdtmfsender.insertdtmf() given a string describing a set of dtmf codes and, optionally, the duration of and inter-tone gap between the tones, insertdtmf() starts sending the specified tones. calling insertdtmf() replaces any already-pending tones from the tonebuffer. you can abort sending queued tones by specifying an empty string ("") as the set of tones to play. events
listen to these events using addevent
listener() or by assigning an event
listener to the oneventname property of this interface. tonechange the tonechange event is sent to the rtcdtmfsender instance's event handler to indicate that a tone has either started or stopped playing. also available using the ontonechange event handler property. example see the article using dtmf with webrtc for a ful...
RTCPeerConnection.createDataChannel() - Web APIs
t to whatever maximum it deems appropriate. default: null. protocol optional the name of the sub-protocol being used on the rtcdatachannel, if any; otherwise, the empty string (""). default: empty string, "". this string may not be longer than 65,535 bytes. negotiated optional by default (false), data channels are negotiated in-band, where one side calls createdatachannel, and the other side
listens to the rtcdatachannelevent event using the ondatachannel eventhandler . alternatively (true), they can be negotiated out of-band, where both sides call createdatachannel with an agreed-upon id. default: false. id optional an 16-bit numeric id for the channel; permitted values are 0-65534. if you don't include this option, the user agent will select an id for you. the options which can be ...
...de this option, the user agent will select an id for you. the options which can be configured using the rtcdatachannelinit dictionary represent the script-settable subset of the properties on the rtcdatachannel interface. return value a new rtcdatachannel object with the specified label, configured using the options specified by options if that parameter is included; otherwise, the defaults
listed above are established. exceptions invalidstateerror the rtcpeerconnection is closed. typeerror this can happen in a couple of situations: the label and/or protocol string is too long; these cannot be longer than 65,535 bytes (bytes, rather than characters). the id is 65535. while this is a valid unsigned 16-bit value, it's not a permitted value for id. syntaxerror values were...
RTCPeerConnection.getSenders() - Web APIs
one for each track on the connection. the array is empty if there are no rtp senders on the connection. the order of the returned rtcrtpsenders is not defined by the specification, and may change from one call to getsenders() to the next. example in this example, a setmuting() function is shown. this function takes as input an rtcpeerconnection, pc, and a boolean, muting. ...
...e call to getsenders() to the next. example in this example, a setmuting() function is shown. this function takes as input an rtcpeerconnection, pc, and a boolean, muting. the function gets the
list of the peer connection's senders and iterates over every sender, setting the corresponding media track's enabled to the inverse of the specified muting. function setmuting(pc, muting) { let sender
list = pc.getsenders(); sender
list.foreach(sender) { sender.track.enabled = !muting; } } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.getsenders()' in that specification. candidate recommendation initial specification. ...
RTCPeerConnection: icecandidateerror event - Web APIs
icecandidateerror description the error object's errorcode property is one of the numeric stun error codes. there is one additional, webrtc-specific, error which lies outside the valid stun error code range: 701. error 701 indicates that none of the ice candidates were able to successfully make contact with the stun or turn server. the 701 error is fired only once per server url from the
list of available stun or turn servers provided when creating the rtcpeerconnection. these errors occur only when the connection's ice gathering state is gathering. example the following example establishes a handler for icecandidateerrors that occur on the rtcpeerconnection pc. this handler looks specifically for 701 errors that indicate that candidates couldn't reach the stun or turn server. when...
...ng. example the following example establishes a handler for icecandidateerrors that occur on the rtcpeerconnection pc. this handler looks specifically for 701 errors that indicate that candidates couldn't reach the stun or turn server. when this happens, the server url and the error message are passed to a function called reportconnectfail() to log or output the connection failure. pc.addevent
listener("icecandidateerror", (event) => { if (event.errorcode === 701) { reportconnectfail(event.url, event.errortext); } }); note that if multiple stun and/or turn servers are provided when creating the connection, this error may happen more than once, if more than one of those servers fails. each provided server is tried until a connection is established. specifications specifi...
RTCPeerConnection: negotiationneeded event - Web APIs
ched to the rtcpeerconnection when media is first added to the connection. this starts the process of ice negotiation by instructing your code to begin exchanging ice candidates through the signaling server. see signaling transaction flow in signaling and video calling for a description of the signaling process that begins with a negotiationneeded event. ...
...didates through the signaling server. see signaling transaction flow in signaling and video calling for a description of the signaling process that begins with a negotiationneeded event. examples in this example, we use addevent
listener() to create an event handler for negotiationneeded. its role is to create an sdp offer and send it through the signaling channel to the remote peer. ...
RTCRtpSender.setParameters() - Web APIs
the last set of parameters applied; this value is used to ensure that setparameters() can only be called to alter changes made by a specific previous call to getparameters(). return value a promise that resolves when the rtcrtpsender.track property is updated with the given parameters. ...
... when the rtcrtpsender.track property is updated with the given parameters. exceptions if an error occurs, the returned promise is rejected with the appropriate exception from the
list below. invalidmodificationerror one of the following problems was detected: the number of encodings specified in the parameters object's encodings property does not match the number of encodings currently
listed for the rtcrtpsender. you cannot change the number of encoding options once the sender has been created. the order of the specified encodings has changed from the current
list's order. an attempt has been made to alter a property that cannot be changed after the sender is first created. invalidstateerror the transceiver of which the rtcrtpsender is a part is not running, or has no par...
ReadableStream.getReader() - Web APIs
// result objects contain two properties: // done - true if the stream has already given you all its data. // value - some data. always undefined when done is true. ...
... // done - true if the stream has already given you all its data. // value - some data. always undefined when done is true. if (done) { console.log("stream complete"); para.textcontent = value; return; } // value for fetch streams is a uint8array charsreceived += value.length; const chunk = value; let
listitem = document.createelement('li');
listitem.textcontent = 'received ' + charsreceived + ' characters so far. current chunk = ' + chunk;
list2.appendchild(
listitem); result += chunk; // read some more, and call this function again return reader.read().then(processtext); }); } specifications specification status comment streamsthe definition of 'getreader()' in that specification. living s...
ReadableStreamDefaultReader.cancel() - Web APIs
ntain two properties: // done - true if the stream has already given you all its data. // value - some data. always undefined when done is true. ...
...the stream has already given you all its data. // value - some data. always undefined when done is true. if (done) { console.log("stream complete"); reader.cancel(); para.textcontent = result; return; } // value for fetch streams is a uint8array charsreceived += value.length; const chunk = value; let
listitem = document.createelement('li');
listitem.textcontent = 'received ' + charsreceived + ' characters so far. current chunk = ' + chunk;
list2.appendchild(
listitem); result += chunk; // read some more, and call this function again return reader.read().then(processtext); }); } specifications specification status comment streamsthe definition of 'cancel()' in that specification. living stan...
ReadableStreamDefaultReader.read() - Web APIs
// result objects contain two properties: // done - true if the stream has already given you all its data. // value - some data. always undefined when done is true. ...
... // done - true if the stream has already given you all its data. // value - some data. always undefined when done is true. if (done) { console.log("stream complete"); para.textcontent = result; return; } // value for fetch streams is a uint8array charsreceived += value.length; const chunk = value; let
listitem = document.createelement('li');
listitem.textcontent = 'received ' + charsreceived + ' characters so far. current chunk = ' + chunk;
list2.appendchild(
listitem); result += chunk; // read some more, and call this function again return reader.read().then(processtext); }); } example 2 - handling text line by line this example shows how you might fetch a text file and handle it as a stream of text lines. it deals w...
RelativeOrientationSensor - Web APIs
n phone demo, instantiates an relativeorientationsensor with a frequency of 60 times a second. note that the intel demo this is based on uses the absoluteoreintationsensor. on each reading it uses orientationsensor.quaternion to rotate a visual model of a phone. ...
...tationsensor. on each reading it uses orientationsensor.quaternion to rotate a visual model of a phone. const options = { frequency: 60, referenceframe: 'device' }; const sensor = new relativeorientationsensor(options); sensor.addevent
listener('reading', () => { // model is a three.js object instantiated elsewhere. model.quaternion.fromarray(sensor.quaternion).inverse(); }); sensor.addevent
listener('error', error => { if (event.error.name == 'notreadableerror') { console.log("sensor is not available."); } }); sensor.start(); permissions example using orientation sensors requires requsting permissions for multiple device sensors. becuase the permissions uses promises, a good way to request permissions is to use promise.all. const sensor = new relativeorientationsensor(); promi...
ReportingObserver - Web APIs
be used to collect and access reports. properties this interface has no properties defined on it. methods reportingobserver.disconnect() stops a reporting observer that had previously started observing from collecting reports. reportingobserver.observe() instructs a reporting observer to start collecting reports in its report queue. reportingobserver.takerecords() returns the current
list of reports contained in the observer's report queue, and empties the queue. events this interface has no events that fire on it. examples in our deprecation_report.html example, we create a simple reporting observer to observe usage of deprecated features on our web page: let options = { types: ['deprecation'], buffered: true } let observer = new reportingobserver(function(reports, obs...
... constructor, we can now click the button to display the report details. note: if you look at the complete source code, you'll notice that we actually call the deprecated getusermedia() method twice. after the first time we call reportingobserver.takerecords(), which returns the first generated report and empties the queue. because of this, when the button is pressed only the second report is
listed. specifications specification status comment reporting apithe definition of 'reportingobserver' in that specification. editor's draft initial definition. ...
SVGAnimationElement: beginEvent event - Web APIs
cx="0" cy="50" r="50" fill="blue" stroke="black" stroke-width="1"> <animatemotion path="m 0 0 h 300 z" dur="5s" repeatcount="indefinite" /> </circle> </svg> <hr> <ul> </ul> ul { height: 100px; border: 1px solid #ddd; overflow-y: scroll; padding: 10px 30px; } let svgelem = document.queryselector('svg'); let animateelem = document.queryselector('animatemotion'); let
list = document.queryselector('ul'); animateelem.addevent
listener('beginevent', () => { let
listitem = document.createelement('li');
listitem.textcontent = 'beginevent fired';
list.appendchild(
listitem); }) animateelem.addevent
listener('repeatevent', (e) => { let
listitem = document.createelement('li'); let msg = 'repeatevent fired'; if(e.detail) { msg += '; repeat number: ' + e.det...
....queryselector('ul'); animateelem.addevent
listener('beginevent', () => { let
listitem = document.createelement('li');
listitem.textcontent = 'beginevent fired';
list.appendchild(
listitem); }) animateelem.addevent
listener('repeatevent', (e) => { let
listitem = document.createelement('li'); let msg = 'repeatevent fired'; if(e.detail) { msg += '; repeat number: ' + e.detail; }
listitem.textcontent = msg;
list.appendchild(
listitem); }) event handler property equivalent note that you can also create an event
listener for the begin event using the onbegin event handler property: animateelem.onbegin = () => { console.log('beginevent fired'); } specifications specification status comment scalable vector graphics (svg) 2the definition of 'begin...
SVGAnimationElement: repeatEvent event - Web APIs
cx="0" cy="50" r="50" fill="blue" stroke="black" stroke-width="1"> <animatemotion path="m 0 0 h 300 z" dur="5s" repeatcount="indefinite" /> </circle> </svg> <hr> <ul> </ul> ul { height: 100px; border: 1px solid #ddd; overflow-y: scroll; padding: 10px 30px; } let svgelem = document.queryselector('svg'); let animateelem = document.queryselector('animatemotion'); let
list = document.queryselector('ul'); animateelem.addevent
listener('beginevent', () => { let
listitem = document.createelement('li');
listitem.textcontent = 'beginevent fired';
list.appendchild(
listitem); }) animateelem.addevent
listener('repeatevent', (e) => { let
listitem = document.createelement('li'); let msg = 'repeatevent fired'; if(e.detail) { msg += '; repeat number: ' + e.deta...
...t.queryselector('ul'); animateelem.addevent
listener('beginevent', () => { let
listitem = document.createelement('li');
listitem.textcontent = 'beginevent fired';
list.appendchild(
listitem); }) animateelem.addevent
listener('repeatevent', (e) => { let
listitem = document.createelement('li'); let msg = 'repeatevent fired'; if(e.detail) { msg += '; repeat number: ' + e.detail; }
listitem.textcontent = msg;
list.appendchild(
listitem); }) event handler property equivalent note that you can also create an event
listener for the repeat event using the onrepeat event handler property: animateelem.onrepeat = () => { console.log('repeatevent fired'); } specifications specification status comment scalable vector graphics (svg) 2the definition of 'r...
SVGAnimationElement - Web APIs
nt.getsimpleduration() returns a float representing the number of seconds for the simple duration for this animation. if the simple duration is undefined (e.g., the end time is indefinite), then a domexception with code not_supported_err is raised. svganimationelement.beginelement() creates a begin instance time for the current time. the new instance time is added to the begin instance times
list. the behavior of this method is equivalent to beginelementat(0). svganimationelement.beginelementat() creates a begin instance time for the current time plus the specified offset. the new instance time is added to the begin instance times
list. svganimationelement.endelement() creates an end instance time for the current time. the new instance time is added to the end instance times...
... the behavior of this method is equivalent to beginelementat(0). svganimationelement.beginelementat() creates a begin instance time for the current time plus the specified offset. the new instance time is added to the begin instance times
list. svganimationelement.endelement() creates an end instance time for the current time. the new instance time is added to the end instance times
list. the behavior of this method is equivalent to endelementat(0). svganimationelement.endelementat() creates a end instance time for the current time plus the specified offset. the new instance time is added to the end instance times
list. events
listen to these events using addevent
listener() or by assigning an event
listener to the on... handler property of this interface. beginevent ...
WebGLRenderingContext - Web APIs
er() compiles a webglshader. webglrenderingcontext.createprogram() creates a webglprogram. webglrenderingcontext.createshader() creates a webglshader. webglrenderingcontext.deleteprogram() deletes a webglprogram. webglrenderingcontext.deleteshader() deletes a webglshader. webglrenderingcontext.detachshader() detaches a webglshader. webglrenderingcontext.getattachedshaders() returns a
list of webglshader objects attached to a webglprogram. webglrenderingcontext.getprogramparameter() returns information about the program. webglrenderingcontext.getprograminfolog() returns the information log for a webglprogram object. webglrenderingcontext.getshaderparameter() returns information about the shader. webglrenderingcontext.getshaderprecisionformat() returns a webglshaderprecision...
... size, and position. ...
Clearing by clicking - Web APIs
var canvas = document.queryselector("#canvas-view"); var button = document.queryselector("#color-swit...
...px; height : 210px; margin : auto; padding : 0; border : none; background-color : black; } button { display : inline-block; font-size : inherit; margin : auto; padding : 0.6em; } window.addevent
listener("load", function setupwebgl (evt) { "use strict" // cleaning after ourselves. the event handler removes // itself, because it only needs to run once. window.removeevent
listener(evt.type, setupwebgl, false); // adding the same click event handler to both canvas and // button. var canvas = document.queryselector("#canvas-view"); var button = document.queryselector("#color-switcher"); canvas.addevent
listener("click", switchcolor, false); button.addevent
listener("click", switchcolor, false); // a variable to hold the webglrenderingcontext. var gl; /...
Color masking - Web APIs
: 210px; margin : auto; padding : 0; border : none; background-color : black; } button { display : inline-block; font-family : serif; font-size : inherit; font-weight : 900; color : white; margin : auto; padding : 0.6em 1.2em; } #red-toggle { background-color : red; } #green-toggle { background-color : green; } #blue-toggle { background-color : blue; } window.addevent
listener("load", function setupanimation (evt) { "use strict" window.removeevent
listener(evt.type, setupanimation, false); var canvas = document.queryselector("canvas"); var gl = canvas.getcontext("webgl") || canvas.getcontext("experimental-webgl"); if (!gl) { document.queryselector("p").innerhtml = "failed to get webgl context." + "your browser or device may not suppo...
... or device may not support webgl."; return; } gl.viewport(0, 0, gl.drawingbufferwidth, gl.drawingbufferheight); var timer = setinterval(drawanimation, 1000); var mask = [true, true, true]; var redtoggle = document.queryselector("#red-toggle"), greentoggle = document.queryselector("#green-toggle"), bluetoggle = document.queryselector("#blue-toggle"); redtoggle.addevent
listener("click", setcolormask, false); greentoggle.addevent
listener("click", setcolormask, false); bluetoggle.addevent
listener("click", setcolormask, false); function setcolormask(evt) { var index = evt.target === greentoggle && 1 || evt.target === bluetoggle && 2 || 0; mask[index] = !mask[index]; if (mask[index] === true) evt.target.innerhtml="on"; else...
Raining rectangles - Web APIs
rong>.</p> <canvas>your browser does not seem to support html5 canvas.</canvas> body { text-align : center; } canvas { display : block; width : 280px; height : 210px; margin : auto; padding : 0; border : none; background-color : black; } button { display : block; font-size : inherit; margin : auto; padding : 0.6em; } ;(function(){ "use strict" window.addevent
listener("load", setupanimation, false); var gl, timer, rainingrect, scoredisplay, missesdisplay; function setupanimation (evt) { window.removeevent
listener(evt.type, setupanimation, false); if (!(gl = getrenderingcontext())) return; gl.enable(gl.scissor_test); rainingrect = new rectangle(); timer = settimeout(drawanimation, 17); document.queryselector("canvas") .addeven...
...ner("load", setupanimation, false); var gl, timer, rainingrect, scoredisplay, missesdisplay; function setupanimation (evt) { window.removeevent
listener(evt.type, setupanimation, false); if (!(gl = getrenderingcontext())) return; gl.enable(gl.scissor_test); rainingrect = new rectangle(); timer = settimeout(drawanimation, 17); document.queryselector("canvas") .addevent
listener("click", playerclick, false); var displays = document.queryselectorall("strong"); scoredisplay = displays[0]; missesdisplay = displays[1]; } var score = 0, misses = 0; function drawanimation () { gl.scissor(rainingrect.position[0], rainingrect.position[1], rainingrect.size[0] , rainingrect.size[1]); gl.clear(gl.color_buffer_bit); rainingrect.position[1] -= rainingrect.vel...
WebGL constants - Web APIs
e passed into or returned by functions. all constants are of type glenum. standard webgl constants are installed on the webglrenderingcontext and webgl2renderingcontext objects, so that you use them as gl.constant_name: var canvas = document.getelementbyid('mycanvas'); var gl = canvas.getcontext('webgl'); gl.getparameter(gl.line_width); some constants are also provided by webgl extensions. a
list is provided below. var debuginfo = gl.getextension('webgl_debug_renderer_info'); var vendor = gl.getparameter(debuginfo.unmasked_vendor_webgl); the webgl tutorial has more information, examples, and resources on how to get started with webgl. table of contents standard webgl 1 constants standard webgl 2 constants webgl extension constants standard webgl 1 constants these constants are ...
... attached correctly. returns false if errors occurred. active_attributes 0x8b89 passed to getprogramparameter to get the number of attributes active in a program. active_uniforms 0x8b86 passed to getprogramparamter to get the number of uniforms active in a program. max_vertex_attribs 0x8869 the maximum number of entries possible in the vertex attribute
list. max_vertex_uniform_vectors 0x8dfb max_varying_vectors 0x8dfc max_combined_texture_image_units 0x8b4d max_vertex_texture_image_units 0x8b4c max_texture_image_units 0x8872 implementation dependent number of maximum texture units. at least 8. max_fragment_uniform_vectors 0x8dfd shader_type ...
Adding 2D content to a WebGL context - Web APIs
create a buffer for the square's positions. const positionbuffer = gl.createbuffer(); // select the positionbuffer as the one to apply buffer // operations to from here out. gl.bindbuffer(gl.array_buffer, positionbuffer); // now create an array of positions for the square. ...
...it starts by calling the gl object's createbuffer() method to obtain a buffer into which we'll store the vertex positions. this is then bound to the context by calling the bindbuffer() method. ...
Animating textures in WebGL - Web APIs
we set it to autoplay, mut...
...we set it to autoplay, mute the sound, and loop the video. we then set up two events to make sure the video is playing and the t...
Using WebGL extensions - Web APIs
note: in webgl, unlike in other gl apis, extensions are only available if explicitly requested. canonical extension names, vendor prefixes and preferences extensions may be supported by browser vendors before being officially ratified (but only when they are in draft stage). in that case, their name can be prefixed by the vendor prefix (moz_, webkit_, etc.) or the extension is only available once a browser preference has been toggled. ...
...nsions which originated with the opengl es or opengl apis, but whose behavior has been significantly altered. querying available extensions the webgl context supports querying what extensions are available. var available_extensions = gl.getsupportedextensions(); the webglrenderingcontext.getsupportedextensions() method returns an array of strings, one for each supported extension. ...
Using WebRTC data channels - Web APIs
negotiations for you, causing the remote peer to create a data channel and linking the two together across the network. the rtcdatachannel object is returned immediately by createdatachannel(); you can tell when the connection has been made successfully by watching for the open event to be sent to the rtcdatachannel. let datachannel = pc.createdatachannel("myapp channel"); datachannel.addevent
listener("open", (event) => { begintransmission(datachannel); }); manual negotiation to manually negotiate the data channel connection, you need to first create a new rtcdatachannel object using the createdatachannel() method on the rtcpeerconnection, specifying in the options a negotiated property set to true. this signals to the peer connection to not attempt to negotiate the channel on your be...
... then negotiate the connection out-of-band, using a web server or other means. this process should signal to the remote peer that it should create its own rtcdatachannel with the negotiated property also set to true, using the same id. this will link the two objects across the rtcpeerconnection. let datachannel = pc.createdatachannel("myapp channel", { negotiated: true }); datachannel.addevent
listener("open", (event) => { begintransmission(datachannel); }); requestremotechannel(datachannel.id); in this code snippet, the channel is created with negotiated set to true, then a function called requestremotechannel() is used to trigger negotiation, to create a remote channel with the same id as the local channel. doing this lets you create data channels with each peer using different prope...
WebRTC API - Web APIs
used for back-channel information, metadata exchange, game status packets, file transfers, or even as a primary channel for data transfer. more details and links to relevant guides and tutorials needed webrtc reference because webrtc provides interfaces that work together to accomplish a variety of tasks, we have divided up the reference by category. please see the sidebar for an alphabetical
list. connection setup and management these interfaces, dictionaries, and types are used to set up, open, and manage webrtc connections. included are interfaces representing peer media connections, data channels, and interfaces used when exchanging information on the capabilities of each peer in order to select the best possible configuration for a two-way media connection. interfaces rtcpeercon...
... webrtc. media capture and streams candidate recommendation the initial definition of the object conveying the stream of media content. media capture from dom elements working draft the initial definition on how to obtain stream of content from dom elements in additions to these specifications defining the api needed to use webrtc, there are several protocols,
listed under resources. see also mediadevices mediastreamevent mediastreamconstraints mediastreamtrack messageevent mediastream media capture and streams api firefox multistream and renegotiation for jitsi videobridge peering through the webrtc fog with socketpeer inside the party bus: building a web app with multiple live video streams + interactive graphics web media technologies ...
Web Video Text Tracks Format (WebVTT) - Web APIs
instead use the escape sequence "&" for ampersand and "<" for less-than. it is also recommended that you use the greater-than escape sequence ">" instead of the greater-than character (>) to avoid confusion with tags. if you are using the webvtt file for metadata these restrictions do not apply. in addition to the three escape sequences mentioned above, there are fours others. they are
listed in the table below. table 6 - escape sequences name character escape sequence ampersand & & less-than < < greater-than > > left-to-right mark ‎ right-to-left mark ‏ non-breaking space cue payload text tags there are a number of tags, such as...
...e in this interface are: getcueashtml to get the html of that cue. vtt constructor for creating new objects of cues. autokeyword. directionsetting: to set the direction of caption or text in a file. linealignment: to adjust the line alignment. positionalignsetting: to adjust the position of text. vttregion the methods used for region are
listed below along with description of their functionality: scrollsetting: for adjusting the scrolling setting of all nodes present in given region. vtt region constructor: for construction of new vtt regions. tutorial on how to write a webvtt file there are few steps that can be followed to write a simple webvtt file. before start, it must be noted that you can make us...
Lighting a WebXR setting - Web APIs
ting, have a model of a ceiling lamp at the location of your light source. there are exceptions, such as the ambient lighting that simply adds a baseline amount of lighting to your setting, and the sun, which is a directional light (that is, a light source where every light ray is parallel, coming from somewhere in the sky and ending somewhere within your scene). try to place light sources in rea
listic locations for the setting and the mood you're trying to create. a scene intended to feel like a naturally-lit, real-world setting doesn't have studio lighting. it has sunlight, possibly light reflected off of objects or water within the scene, and so forth, but not lamps directed at the faces of objects or people in the scene. realism in player interactions with light if your light source is ...
...hat from the true value. there are many ways this could be done. spherical harmonics precision browsers can mitigate the risk of fingerprinting by reducing the precision of spherical harmonics. when performing real-time rendering—as is the case with any virtual or augmented reality application—spherical harmonic lighting is used to simplify and accelerate the process of generating highly rea
listic shadows and shading. 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. decoupling orientation from lighting in an ar application that uses geolocation to determine orientation and potentially position information, avoiding having that information directly correl...
WebXR performance guide - Web APIs
an inordinate amount of memory, the sheer number of vectors and matrices and other structures that are used to build each frame of a 3d scene means the memory management becomes a problem eventually if you keep allocating and de-allocating memory objects. consider the following function drawscene(gl, view, programinfo, buffers, texture, deltatime) { ... for (object in scene) { let vertex
list = ... let normalmatrix = mat4.create(); let modelviewmatrix = mat4.create(); let objectmatrix = mat4. // apply rotation updates to the object if needed mat4.rotate( } } this renders a scene. but it's inefficient, because it allocates as local variables a number of things, including at least two matrices, an array of vertices, and more. that means that for every frame, the...
...tes as local variables a number of things, including at least two matrices, an array of vertices, and more. that means that for every frame, the javascript runtime has to allocate memory for those and set them up—possibly triggering garbage collection—and then when each interaction of the loop is completed, the memory is released. a simple change can optimize this significantly: const vertex
list = ... const normalmatrix = mat4.create(); const modelviewmatrix = mat4.create(); function drawscene(gl, view, programinfo, buffers, texture, deltatime) { ... for (object in scene) { ... } } now, instead of allocating variables every loop iteration, we're using global constants(or class member constants). this has multiple benefits: the memory allocated for each value or structure w...
Starting up and shutting down a WebXR session - Web APIs
he source for the xr system by creating an xrwebgllayer and passing set the value of the session's renderstate property baselayer. perform calculations for the initial position and scale of your objects as needed. begin the frame rendering cycle. ...
...en a bounded reference space (a reference space whose xrreferencespacetype is bounded-floor) has its geometry as specified by the xrboundedreferencespace's property boundsgeometry change. for more common causes of reference space resets and more details and sample code, see the documentation for the reset event. detecting when the available set of webxr input controls changes webxr maintains a
list of input controls which is specific to the webxr system. these devices include things such as the handheld controllers, motion-sensing cameras, motion-sensitive gloves and other feedback devices. when the user connects or disconnects a webxr controller device, the inputsourceschange event is dispatched to the xrsession. this is an opportunity to notify the user of the device's availability, begin...
Basic concepts behind Web Audio API - Web APIs
copies the current waveform, or time-domain, data into a float32array array passed into it. analysernode.getbytetimedomaindata() copies the current waveform, or time-domain, data into a uint8array (unsigned byte array) passed into it. note: for more information, see our visualizations with web audio api article. spatialisations an audio spatialisation (handled by the pannernode and audio
listener nodes in the web audio api) allows us to model the position and behavior of an audio signal at a certain point in space, and the
listener hearing that audio. the panner's position is described with right-hand cartesian coordinates; its movement using a velocity vector, necessary for creating doppler effects, and its directionality using a directionality cone.the cone can be very large, e.g. ...
...s us to model the position and behavior of an audio signal at a certain point in space, and the
listener hearing that audio. the panner's position is described with right-hand cartesian coordinates; its movement using a velocity vector, necessary for creating doppler effects, and its directionality using a directionality cone.the cone can be very large, e.g. for omnidirectional sources. the
listener's position is described using right-hand cartesian coordinates; its movement using a velocity vector and the direction the
listener's head is pointing using two direction vectors: up and front. these respectively define the direction of the top of the
listener's head, and the direction the
listener's nose is pointing, and are at right angles to one another. note: for more information, se...
Web Audio API best practices - Web APIs
n audio context (either offline or online) it is created with a state, which can be suspended, running, or closed. when working with an audiocontext, if you create the audio context from inside a click event the state should automatically be set to running. here is a simple example of creating the context from inside a click event: const button = document.queryselector('button'); button.addevent
listener('click', function() { const audioctx = new audiocontext(); }, false); if however, you create the context outside of a user gesture, its state will be set to suspended and it will need to be started after user interaction. we can use the same click event example here, test for the state of the context and start it, if it is suspended, using the resume() method. const audioctx = new audi...
...; if however, you create the context outside of a user gesture, its state will be set to suspended and it will need to be started after user interaction. we can use the same click event example here, test for the state of the context and start it, if it is suspended, using the resume() method. const audioctx = new audiocontext(); const button = document.queryselector('button'); button.addevent
listener('click', function() { // check if context is in suspended state (autoplay policy) if (audioctx.state === 'suspended') { audioctx.resume(); } }, false); you might instead be working with an offlineaudiocontext, in which case you can resume the suspended audio context with the startrendering() method. user control if your website or application contains sound, you shou...
Using IIR filters - Web APIs
st soundsource = audiocontext.createbuffersource(); soundsource.buffer = audiobuffer; soundsource.connect(audiocontext.destination); soundsource.start(); return soundsource; } this function is called when the play button is pressed. the play button html looks like this: <button class="button-play" role="switch" data-playing="false" aria-pressed="false">play</button> and the click event
listener starts like so: playbutton.addevent
listener('click', function() { if (this.dataset.playing === 'false') { srcnode = playsourcenode(audioctx, sample); ... }, false); the toggle that turns the iir filter on and off is set up in the similar way. first, the html: <button class="button-filter" role="switch" data-filteron="false" aria-pressed="false" aria-describedby="label" ...
...ample); ... }, false); the toggle that turns the iir filter on and off is set up in the similar way. first, the html: <button class="button-filter" role="switch" data-filteron="false" aria-pressed="false" aria-describedby="label" disabled></button> the filter button's click handler then connects the iirfilter up to the graph, between the source and the detination: filterbutton.addevent
listener('click', function() { if (this.dataset.filteron === 'false') { srcnode.disconnect(audioctx.destination); srcnode.connect(iirfilter).connect(audioctx.destination); ... }, false); frequency response we only have one method available on iirfilternode instances, getfrequencyresponse(), this allows us to see what is happening to the frequencies of the audio being pass...
Web Audio API - Web APIs
to the destination. timing is controlled with high precision and low latency, allowing developers to write code that responds accurately to events and is able to target specific samples, even at a high sample rate. so applications such as drum machines and sequencers are well within reach. the web audio api also allows us to control how audio is spatialized. using a system based on a source-
listener model, it allows control of the panning model and deals with distance-induced attenuation induced by a moving source (or moving
listener). you can read about the theory of the web audio api in a lot more detail in our article basic concepts behind web audio api. web audio api target audience the web audio api can seem intimidating to those that aren't familiar with audio or music terms, ...
...annelsplitternode interface separates the different channels of an audio source out into a set of mono outputs. channelmergernode the channelmergernode interface reunites different mono inputs into a single output. each input will be used to fill a channel of the output. audio spatialization these interfaces allow you to add audio spatialization panning effects to your audio sources. audio
listener the audio
listener interface represents the position and orientation of the unique person
listening to the audio scene used in audio spatialization. pannernode the pannernode interface represents the position and behavior of an audio source signal in 3d space, allowing you to create complex panning effects. stereopannernode the stereopannernode interface represents a simple stereo panner ...
Using the Web Storage API - Web APIs
o the storage object (note that this event is not fired for sessionstorage changes). this won't work on the same page that is making the changes — it is really a way for other pages on the domain using the storage to sync any changes that are made. pages on other domains can't access the same storage objects. ...
... window.addevent
listener('storage', function(e) { document.queryselector('.my-key').textcontent = e.key; document.queryselector('.my-old').textcontent = e.oldvalue; document.queryselector('.my-new').textcontent = e.newvalue; document.queryselector('.my-url').textcontent = e.url; document.queryselector('.my-storage').textcontent = json.stringify(e.storagearea); }); here we add an event
listener to the window object that fires when the storage object associated with the current origin is changed. as you can see above, the event object associated with this event has a number of properties containing useful information — the key of the data that changed, the old value before the change, the new value after that change, the url of the document that changed the storage, and the storage...
Functions and classes available to Web Workers - Web APIs
workers run in another global context, dedicatedworkerglobalscope, different from the current window. by default, methods and properties of window are not available to them, but dedicatedworkerglobalscope, like window, implements windowtimers and windowbase64. ...
...t context. it allows access to a cryptographically strong random number generator and to cryptographic primitives. ? no support ? ? customevent the customevent interface represents events initialized by an application for any purpose. 48 (48) (yes) (yes) (yes) domrequest and domcursor respectively, these objects represents an ongoing operation (with
listeners for reacting to the operation completely successfully, or failing, for example), and an ongoing operation over a
list of results. 41 (41) ? ? ? fetch the fetch spec provides an up-to-date definition of, and api for, fetching resources (e.g. across the network.) 39 (39) (mostly in 34 (34) behind pref, although a few features are later.) no support 4...
Window: DOMContentLoaded event - Web APIs
initial html document has been completely loaded and parsed, without waiting for stylesheets, images, and subframes to finish loading. bubbles yes cancelable yes (although specified as a simple event that isn't cancelable) interface event event handler property none the original target for this event is the document that has loaded. ...
...ded. you can
listen for this event on the window interface to handle it in the capture or bubbling phases. for full details on this event please see the page on the document: domcontentloaded event. a different event, load, should be used only to detect a fully-loaded page. it is a common mistake to use load where domcontentloaded would be more appropriate. ...
Window: afterprint event - Web APIs
the afterprint event is fired after the associated document has started printing or the print preview has been closed. ...
... the afterprint event is fired after the associated document has started printing or the print preview has been closed. ...
Window: animationcancel event - Web APIs
such that the animation is removed, or when the animating node is hidden using css. therefore, either directly or because any of its containing nodes are hidden. bubbles yes cancelable no interface animationevent event handler property onanimationcancel the original target for this event is the element that had the animation applied. ...
... no interface animationevent event handler property onanimationcancel the original target for this event is the element that had the animation applied. you can
listen for this event on the window interface to handle it in the capture or bubbling phases. for full details on this event please see the page on htmlelement: animationcancel. examples this code adds a
listener to the animationcancel event. window.addevent
listener('animationcancel', () => { console.log('animation canceled'); }); the same, but using the onanimationcancel property instead of addevent
listener(): window.onanimationcancel = () => { console.log('animation canceled'); }; see a live example of this event. specifications specification status comment css ...
Window: animationend event - Web APIs
aborts before reaching completion, such as if the element is removed from the dom or the animation is removed from the element, the animationend event is not fired. bubbles yes cancelable no interface animationevent event handler property onanimationend the original target for this event is the element that had the animation applied. ...
...cancelable no interface animationevent event handler property onanimationend the original target for this event is the element that had the animation applied. you can
listen for this event on the window interface to handle it in the capture or bubbling phases. for full details on this event please see the page on htmlelement: animationend. examples this example
listens for the animationend event: window.addevent
listener('animationend', () => { console.log('animation ended'); }); the same, but using the onanimationend event handler property: window.onanimationend = () => { console.log('animation ended'); }; see a live example of this event. specifications specification status comment css animations working draft ini...
Window: animationiteration event - Web APIs
s. this event does not occur at the same time as the animationend event, and therefore does not occur for animations with an animation-iteration-count of one. bubbles yes cancelable no interface animationevent event handler property onanimationiteration the original target for this event is the element that had the animation applied. ...
...s event is the element that had the animation applied. you can
listen for this event on the window interface to handle it in the capture or bubbling phases. for full details on this event please see the page on htmlelement: animationiteration. examples this code uses animationiteration to keep track of the number of iterations an animation has completed: let iterationcount = 0; window.addevent
listener('animationiteration', () => { iterationcount++; console.log(`animation iteration count: ${iterationcount}`); }); the same, but using the onanimationiteration event handler property: let iterationcount = 0; window.onanimationiteration = () => { iterationcount++; console.log(`animation iteration count: ${iterationcount}`); }; see a live example of this event. specifications ...
Window: animationstart event - Web APIs
o fire with an elapsedtime equal to the absolute value of the delay (and, correspondingly, the animation will begin playing at that time index into the sequence). bubbles yes cancelable no interface animationevent event handler property onanimationstart the original target for this event is the element that had the animation applied. ...
... cancelable no interface animationevent event handler property onanimationstart the original target for this event is the element that had the animation applied. you can
listen for this event on the window interface to handle it in the capture or bubbling phases. for full details on this event please see the page on htmlelement: animationstart. examples this
listens for the animationstart event and logs a message when it is fired: window.addevent
listener('animationstart', () => { console.log('animation started'); }); the same, but using onanimationstart: window.onanimationstart = () => { console.log('animation started'); }; see a live example of this event. specifications specification status comment css animations ...
Window: appinstalled event - Web APIs
the appinstalled event of the web manifest api is fired when the browser has successfully installed a page as an application. ...
... the appinstalled event of the web manifest api is fired when the browser has successfully installed a page as an application. ...
Window: beforeprint event - Web APIs
the beforeprint event is fired when the associated document is about to be printed or previewed for printing. ...
... the beforeprint event is fired when the associated document is about to be printed or previewed for printing. ...
Window: beforeunload event - Web APIs
splay the returned string in the confirmation dialog, enabling the event handler to display a custom message to the user. however, this is deprecated and no longer supported in most browsers. to combat unwanted pop-ups, browsers may not display prompts created in beforeunload event handlers unless the page has been interacted with, or may even not display them at all. attaching an event handler/
listener to window or document's beforeunload event prevents browsers from using in-memory page navigation caches, like firefox's back-forward cache or webkit's page cache. the html specification states that calls to window.alert(), window.confirm(), and window.prompt() methods may be ignored during this event. see the html specification for more details. examples the html specification states that...
...'s page cache. the html specification states that calls to window.alert(), window.confirm(), and window.prompt() methods may be ignored during this event. see the html specification for more details. examples the html specification states that authors should use the event.preventdefault() method instead of using event.returnvalue. however, this is not supported by all browsers. window.addevent
listener('beforeunload', (event) => { // cancel the event as stated by the standard. event.preventdefault(); // chrome requires returnvalue to be set. event.returnvalue = ''; }); specifications specification status comment html living standardthe definition of 'beforeunload' in that specification. living standard html5the definition of 'beforeunlo...
Window: blur event - Web APIs
the blur event fires when an element has lost focus. the opposite of blur is focus. bubbles no cancelable no interface focusevent event handler property onblur sync / async sync composed yes examples live example this example changes the appearance of a document when it loses focus. it uses addevent
listener() to monitor focus and blur events. html <p id="log">click on this document to give it focus.</p> css .paused { background: #ddd; color: #555; } javascript function pause() { document.body.class
list.add('paused'); log.textcontent = 'focus lost!'; } function play() { document.body.class
list.remove('paused'); log.textcontent = 'this document has focus. click outside the document to lose focu...
...o give it focus.</p> css .paused { background: #ddd; color: #555; } javascript function pause() { document.body.class
list.add('paused'); log.textcontent = 'focus lost!'; } function play() { document.body.class
list.remove('paused'); log.textcontent = 'this document has focus. click outside the document to lose focus.'; } const log = document.getelementbyid('log'); window.addevent
listener('blur', pause); window.addevent
listener('focus', play); result specifications specification status comment ui events working draft added info that this event is composed. document object model (dom) level 3 events specification obsolete initial definition ...
Window: copy event - Web APIs
the copy event fires when the user initiates a copy action through the browser's user interface. bubbles yes cancelable yes interface clipboardevent event handler property oncopy the original target for this event is the element that was the intended target of the copy action. ...
... yes interface clipboardevent event handler property oncopy the original target for this event is the element that was the intended target of the copy action. you can
listen for this event on the window interface to handle it in the capture or bubbling phases. for full details on this event please see the page on the element: copy event. ...
Window: cut event - Web APIs
the cut event is fired when the user has initiated a "cut" action through the browser's user interface. bubbles yes cancelable yes interface clipboardevent event handler property oncut the original target for this event is the element that was the intended target of the cut action. ...
...ble yes interface clipboardevent event handler property oncut the original target for this event is the element that was the intended target of the cut action. you can
listen for this event on the window interface to handle it in the capture or bubbling phases. for full details on this event please see the page on the element: cut event. ...
Window.devicePixelRatio - Web APIs
cks the value of devicepixelratio any time it changes. let pixelratiobox = document.queryselector(".pixel-ratio"); let mqstring = `(resolution: ${window.devicepixelratio}dppx)`; const updatepixelratio = () => { let pr = window.devicepixelratio; let prstring = (pr * 100).tofixed(0); pixelratiobox.innertext = `${prstring}% (${pr.tofixed(2)})`; } updatepixelratio(); matchmedia(mqstring).add
listener(updatepixelratio); the string mqstring is set up to be the media query itself. the media query, which begins as (resolution: 1dppx) (for standard displays) or (resolution: 2dppx) (for retina/hidpi displays), checks to see if the current display resolution matches a specific number of device dots per px. the updatepixelratio() function fetches the current value of devicepixelratio, then se...
...e updatepixelratio() function fetches the current value of devicepixelratio, then sets the innertext of the element pixelratiobox to a string which displays the ratio both as a percentage and as a raw decimal value with up to two decimal places. then the updatepixelratio() function is called once to display the starting value, after which the media query is created using matchmedia() and addevent
listener() is called to set up updatepixelratio() as a handler for the change event. html the html creates the boxes containing the instructions and the pixel-ratio box that will display the current pixel ratio information. <div class="container"> <div class="inner-container"> <p>this example demonstrates the effect of zooming the page in and out (or moving it to a screen with a differ...
Window: focus event - Web APIs
the focus event fires when an element has received focus. the opposite of focus is blur. bubbles no cancelable no interface focusevent event handler property onfocus sync / async sync composed yes examples live example this example changes the appearance of a document when it loses focus. it uses addevent
listener() to monitor focus and blur events. html <p id="log">click on this document to give it focus.</p> css .paused { background: #ddd; color: #555; } javascript function pause() { document.body.class
list.add('paused'); log.textcontent = 'focus lost!'; } function play() { document.body.class
list.remove('paused'); log.textcontent = 'this document has focus. click outside the document ...
...o give it focus.</p> css .paused { background: #ddd; color: #555; } javascript function pause() { document.body.class
list.add('paused'); log.textcontent = 'focus lost!'; } function play() { document.body.class
list.remove('paused'); log.textcontent = 'this document has focus. click outside the document to lose focus.'; } const log = document.getelementbyid('log'); window.addevent
listener('blur', pause); window.addevent
listener('focus', play); result specifications specification status comment ui events working draft added info that this event is composed. document object model (dom) level 3 events specification obsolete initial definition ...
Window: hashchange event - Web APIs
the hashchange event is fired when the fragment identifier of the url has changed (the part of the url beginning with and following the # symbol). ...
... the hashchange event is fired when the fragment identifier of the url has changed (the part of the url beginning with and following the # symbol). ...
Window: load event - Web APIs
all dependent resources such as stylesheets and images. this is in contrast to domcontentloaded, which is fired as soon as the page dom has been loaded, without waiting for resources to finish loading. ...
...eas: "control log"; } .controls { grid-area: control; display: flex; align-items: center; justify-content: center; } .event-log { grid-area: log; } .event-log-contents { resize: none; } label, button { display: block; } #reload { height: 2rem; } js const log = document.queryselector('.event-log-contents'); const reload = document.queryselector('#reload'); reload.addevent
listener('click', () => { log.textcontent =''; window.settimeout(() => { window.location.reload(true); }, 200); }); window.addevent
listener('load', (event) => { log.textcontent = log.textcontent + 'load\n'; }); document.addevent
listener('readystatechange', (event) => { log.textcontent = log.textcontent + `readystate: ${document.readystate}\n`; }); document.addevent
listener('domc...
Window.ondragdrop - Web APIs
ll not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. removed in firefox 50, and never implemented in any other browser. use the modern standard html5 drag and drop feature instead. summary an event handler for drag and drop events sent to the window. syntax window.ondragdrop = funcref; window.addevent
listener("dragdrop", funcref, usecapturing); funcref the event handler function to be registered. the window.ondragdrop property and the ondragdrop attribute are not implemented in gecko (bug 112288), you have to use addevent
listener. see addevent
listener for details. example fire an alert on dragdrop in this example, an event
listener is added to the window (the event target). if, from an ...
...rop in this example, an event
listener is added to the window (the event target). if, from an external source, a tab, a link, marked text or a file is dragged and dropped onto this window, the alert is fired. note how event.stoppropagation(); prevents the browser from loading the dropped tab, link or file. <html> <head><title>dragdroptest</title> <script type="text/javascript"> window.addevent
listener("dragdrop", testfunc, false); function testfunc(event) { alert("dragdrop!"); event.stoppropagation(); } </script> </head> <body> i am bodytext </body> </html> specification not part of specification. ...
Window.open() - Web APIs
ecified resource; if the name doesn't indicate an existing context, a new window is created and is given the name specified by windowname. this name can be used as the target for the target attribute of <a> or <form> elements. the name should not contain whitespace. keep in mind that this will not be used as the window's title. windowfeatures optional a domstring containing a comma-separated
list of window features given with their corresponding values in the form "name=value". these features include options such as the window's default size and position, whether or not to include toolbar, and so forth. there must be no whitespace in the string. see window features below for documentation of each of the features that can be specified. return value a windowproxy object, which is basical...
...er. this function is the lonely key to get back the handle on a window if the developer has access only to its name (the name can be saved with cookies or local storage but not the window object handle). for now 10/01/2017 the differencies of behavior found recently have not still been tested for others browsers. window features windowfeatures is an optional string containing a comma-separated
list of requested features of the new window. after a window is opened, javascript can't be used to change the features. if windowname does not specify an existing window and the windowfeatures parameter is not provided (or if the windowfeatures parameter is an empty string), then the new secondary window will render the default toolbars of the main window. tip: note that in some browsers, users can...
Window: orientationchange event - Web APIs
the orientationchange event is fired when the orientation of the device has changed. ...
... the orientationchange event is fired when the orientation of the device has changed. ...
Window: pageshow event - Web APIs
ow or tab restoring a frozen page on mobile oses returning to the page using the browser's forward or back buttons during the initial page load, the pageshow event fires after the load event. bubbles no cancelable no interface pagetransitionevent event handler property onpageshow examples this example sets up event handlers for events
listed in the array events. the handler, eventlogger(), logs the type of event that occurred to the console, and includes the value of the persisted flag on pageshow and pagehide events. javascript const events = [ "pagehide", "pageshow", "unload", "load" ]; const eventlogger = event => { switch (event.type) { case "pagehide": case "pageshow": let ispersisted = event.persisted ?
...try loading new pages into this tab, then navigating forward and backward through history, noting the events’ output to the log.</p> results specifications specification status comment html living standardthe definition of 'pageshow' in that spe...
Window: paste event - Web APIs
the paste event is fired when the user has initiated a "paste" action through the browser's user interface. bubbles yes cancelable yes interface clipboardevent event handler property onpaste the original target for this event is the element that was the intended target of the paste action. ...
... yes interface clipboardevent event handler property onpaste the original target for this event is the element that was the intended target of the paste action. you can
listen for this event on the window interface to handle it in the capture or bubbling phases. for full details on this event please see the page on the element: paste event. ...
Window: storage event - Web APIs
the storage event of the window interface fires when a storage area (localstorage) has been modified in the context of another document. bubbles no cancelable no interface storageevent event handler property onstorage examples log the sample
list item to the console when the storage event fires: window.addevent
listener('storage', () => { // when local storage changes, dump the
list to // the console. ...
...cument. bubbles no cancelable no interface storageevent event handler property onstorage examples log the sample
list item to the console when the storage event fires: window.addevent
listener('storage', () => { // when local storage changes, dump the
list to // the console. console.log(json.parse(window.localstorage.getitem('sample
list'))); }); the same action can be achieved using the onstorage event handler property: window.onstorage = () => { // when local storage changes, dump the
list to // the console. console.log(json.parse(window.localstorage.getitem('sample
list'))); }; specifications specification status html living standardthe definition of 'storage' in that specification. living sta...
Window: transitioncancel event - Web APIs
the transitioncancel event is fired when a css transition is canceled. see globaleventhandlers.ontransitioncancel for more information. bubbles yes cancelable no interface transitionevent event handler property globaleventhandlers.ontransitioncancel the original target for this event is the element that had the transition applied. ...
...e transitionevent event handler property globaleventhandlers.ontransitioncancel the original target for this event is the element that had the transition applied. you can
listen for this event on the window interface to handle it in the capture or bubbling phases. for full details on this event please see the page on htmlelement: transitioncancel. examples this code adds a
listener to the transitioncancel event: window.addevent
listener('transitioncancel', () => { console.log('transition canceled'); }); the same, but using the ontransitioncancel property instead of addevent
listener(): window.ontransitioncancel = () => { console.log('transition canceled'); }; see a live example of this event. specifications specification status comment ...
Window: transitionend event - Web APIs
state, and when it fully reverts to the default or non-transitioned state. if there is no transition delay or duration, if both are 0s or neither is declared, there is no transition, and none of the transition events are fired. if the transitioncancel event is fired, the transitionend event will not fire. the original target for this event is the element that had the transition applied. ...
...sition events are fired. if the transitioncancel event is fired, the transitionend event will not fire. the original target for this event is the element that had the transition applied. you can
listen for this event on the window interface to handle it in the capture or bubbling phases. for full details on this event please see the page on htmlelement: transitionend. examples this code adds a
listener to the transitionend event: window.addevent
listener('transitionend', () => { console.log('transition ended'); }); the same, but using the ontransitionend property instead of addevent
listener(): window.ontransitionend = () => { console.log('transition ended'); }; see a live example of this event. specifications specification status comment css transitionst...
Window: transitionrun event - Web APIs
the transitionrun event is fired when a css transition is first created, i.e. before any transition-delay has begun. bubbles yes cancelable no interface transitionevent event handler property ontransitionrun the original target for this event is the element that had the transition applied. ...
...le no interface transitionevent event handler property ontransitionrun the original target for this event is the element that had the transition applied. you can
listen for this event on the window interface to handle it in the capture or bubbling phases. for full details on this event please see the page on htmlelement: transitionrun. examples this code adds a
listener to the transitionrun event: window.addevent
listener('transitionrun', () => { console.log('transition is running but hasn't necessarily started transitioning yet'); }); the same, but using the ontransitionrun property instead of addevent
listener(): window.ontransitionrun = () => { console.log('transition started running'); }; see a live example of this event. specifications ...
Window: transitionstart event - Web APIs
the transitionstart event is fired when a css transition has actually started, i.e., after any transition-delay has ended. bubbles yes cancelable no interface transitionevent event handler property globaleventhandlers.ontransitionstart the original target for this event is the element that had the transition applied. ...
...ace transitionevent event handler property globaleventhandlers.ontransitionstart the original target for this event is the element that had the transition applied. you can
listen for this event on the window interface to handle it in the capture or bubbling phases. for full details on this event please see the page on htmlelement: transitionstart. examples this code adds a
listener to the transitionstart event: window.addevent
listener('transitionstart', () => { console.log('started transitioning'); }); the same, but using the ontransitionstart property instead of addevent
listener(): window.ontransitionrun = () => { console.log('started transitioning'); }; see a live example of this event. specifications specification status comment ...
WindowClient.focus() - Web APIs
he focus() method of the windowclient interface gives user input focus to the current client and returns a promise that resolves to the existing windowclient. syntax windowclient.focus().then(function(windowclient) { // do something with your windowclient once it has been focused }); parameters none. return value a promise that resolves to the existing windowclient. ...
.... return value a promise that resolves to the existing windowclient. example self.addevent
listener('notificationclick', function(event) { console.log('on notification click: ', event.notification.tag); event.notification.close(); // this looks to see if the current is already open and // focuses if it is event.waituntil(clients.matchall({ type: "window" }).then(function(client
list) { for (var i = 0; i < client
list.length; i++) { var client = client
list[i]; if (client.url == '/' && 'focus' in client) return client.focus(); } if (clients.openwindow) return clients.openwindow('/'); })); }); specifications specification status comment service workersthe definition of 'focus()' in that specification. working d...
WindowEventHandlers.onbeforeprint - Web APIs
ised before the print dialog window is opened. the beforeprint and afterprint events allow pages to change their content before printing starts (perhaps to remove a banner, for example) and then revert those changes after printing has completed. in general, you should prefer the use of an @media print css at-rule, but it may be necessary to use these events in some cases. ...
...should prefer the use of an @media print css at-rule, but it may be necessary to use these events in some cases. syntax window.addevent
listener("beforeprint", function(event) { ... }); window.onbeforeprint = function(event) { ... }; polyfill safari does not implement these events, but you can create an equivalent result to the beforeprint event with window.matchmedia('print'). var mediaquery
list = window.matchmedia('print'); mediaquery
list.add
listener(function(mql) { if(mql.matches) { console.log('webkit equivalent of onbeforeprint'); } }); specification specification status comment html living standardthe definition of 'onbeforeprint' in that specification. living standard ...
WindowOrWorkerGlobalScope.caches - Web APIs
the cachestorage object associated with the current context. this object enables functionality such as storing assets for offline use, and generating custom responses to requests. syntax var mycachestorage = self.caches; // or just caches value a cachestorage object. example the following example shows how you'd use a cache in a service worker context to store assets offline. ...
...e object. example the following example shows how you'd use a cache in a service worker context to store assets offline. this.addevent
listener('install', function(event) { event.waituntil( caches.open('v1').then(function(cache) { return cache.addall([ '/sw-test/', '/sw-test/index.html', '/sw-test/style.css', '/sw-test/app.js', '/sw-test/image-
list.js', '/sw-test/star-wars-logo.jpg', '/sw-test/gallery/', '/sw-test/gallery/bountyhunters.jpg', '/sw-test/gallery/mylittlevader.jpg', '/sw-test/gallery/snowtroopers.jpg' ]); }) ); }); specifications specification status comment service workersthe definition of 'caches' in that specification. working draft defined i...
WritableStream.WritableStream() - Web APIs
nction called sendmessage(), passing the newly created stream and a string. inside this function it calls the stream's getwriter() method, which returns an instance of writablestreamdefaultwriter. a foreach() call is used to write each chunk of the string to the stream. finally, write() and close() return promises that are processed to deal with success or failure of chunks and streams. ...
...-8"); const queuingstrategy = new countqueuingstrategy({ highwatermark: 1 }); let result = ""; const writablestream = new writablestream({ // implement the sink write(chunk) { return new promise((resolve, reject) => { var buffer = new arraybuffer(2); var view = new uint16array(buffer); view[0] = chunk; var decoded = decoder.decode(view, { stream: true }); var
listitem = document.createelement('li');
listitem.textcontent = "chunk decoded: " + decoded;
list.appendchild(
listitem); result += decoded; resolve(); }); }, close() { var
listitem = document.createelement('li');
listitem.textcontent = "[message received] " + result;
list.appendchild(
listitem); }, abort(err) { console.log("sink error:", err); } }, ...
WritableStream.getWriter() - Web APIs
nction called sendmessage(), passing the newly created stream and a string. inside this function it calls the stream's getwriter() method, which returns an instance of writablestreamdefaultwriter. a foreach() call is used to write each chunk of the string to the stream. finally, write() and close() return promises that are processed to deal with success or failure of chunks and streams. ...
...-8"); const queuingstrategy = new countqueuingstrategy({ highwatermark: 1 }); let result = ""; const writablestream = new writablestream({ // implement the sink write(chunk) { return new promise((resolve, reject) => { var buffer = new arraybuffer(2); var view = new uint16array(buffer); view[0] = chunk; var decoded = decoder.decode(view, { stream: true }); var
listitem = document.createelement('li');
listitem.textcontent = "chunk decoded: " + decoded;
list.appendchild(
listitem); result += decoded; resolve(); }); }, close() { var
listitem = document.createelement('li');
listitem.textcontent = "[message received] " + result;
list.appendchild(
listitem); }, abort(err) { console.log("sink error:", err); } }, ...
WritableStream - Web APIs
nction called sendmessage(), passing the newly created stream and a string. inside this function it calls the stream's getwriter() method, which returns an instance of writablestreamdefaultwriter. a foreach() call is used to write each chunk of the string to the stream. finally, write() and close() return promises that are processed to deal with success or failure of chunks and streams. ...
...-8"); const queuingstrategy = new countqueuingstrategy({ highwatermark: 1 }); let result = ""; const writablestream = new writablestream({ // implement the sink write(chunk) { return new promise((resolve, reject) => { var buffer = new arraybuffer(2); var view = new uint16array(buffer); view[0] = chunk; var decoded = decoder.decode(view, { stream: true }); var
listitem = document.createelement('li');
listitem.textcontent = "chunk decoded: " + decoded;
list.appendchild(
listitem); result += decoded; resolve(); }); }, close() { var
listitem = document.createelement('li');
listitem.textcontent = "[message received] " + result;
list.appendchild(
listitem); }, abort(err) { console.log("sink error:", err); } }, ...
WritableStreamDefaultWriter.WritableStreamDefaultWriter() - Web APIs
nction called sendmessage(), passing the newly created stream and a string. inside this function it calls the stream's getwriter() method, which returns an instance of writablestreamdefaultwriter. a foreach() call is used to write each chunk of the string to the stream. finally, write() and close() return promises that are processed to deal with success or failure of chunks and streams. ...
...-8"); const queuingstrategy = new countqueuingstrategy({ highwatermark: 1 }); let result = ""; const writablestream = new writablestream({ // implement the sink write(chunk) { return new promise((resolve, reject) => { var buffer = new arraybuffer(2); var view = new uint16array(buffer); view[0] = chunk; var decoded = decoder.decode(view, { stream: true }); var
listitem = document.createelement('li');
listitem.textcontent = "chunk decoded: " + decoded;
list.appendchild(
listitem); result += decoded; resolve(); }); }, close() { var
listitem = document.createelement('li');
listitem.textcontent = "[message received] " + result;
list.appendchild(
listitem); }, abort(err) { console.log("sink error:", err); } }, ...
WritableStreamDefaultWriter.close() - Web APIs
nction called sendmessage(), passing the newly created stream and a string. inside this function it calls the stream's getwriter() method, which returns an instance of writablestreamdefaultwriter. a foreach() call is used to write each chunk of the string to the stream. finally, write() and close() return promises that are processed to deal with success or failure of chunks and streams. ...
...-8"); const queuingstrategy = new countqueuingstrategy({ highwatermark: 1 }); let result = ""; const writablestream = new writablestream({ // implement the sink write(chunk) { return new promise((resolve, reject) => { var buffer = new arraybuffer(2); var view = new uint16array(buffer); view[0] = chunk; var decoded = decoder.decode(view, { stream: true }); var
listitem = document.createelement('li');
listitem.textcontent = "chunk decoded: " + decoded;
list.appendchild(
listitem); result += decoded; resolve(); }); }, close() { var
listitem = document.createelement('li');
listitem.textcontent = "[message received] " + result;
list.appendchild(
listitem); }, abort(err) { console.log("sink error:", err); } }, ...
WritableStreamDefaultWriter.write() - Web APIs
nction called sendmessage(), passing the newly created stream and a string. inside this function it calls the stream's getwriter() method, which returns an instance of writablestreamdefaultwriter. a foreach() call is used to write each chunk of the string to the stream. finally, write() and close() return promises that are processed to deal with success or failure of chunks and streams. ...
...-8"); const queuingstrategy = new countqueuingstrategy({ highwatermark: 1 }); let result = ""; const writablestream = new writablestream({ // implement the sink write(chunk) { return new promise((resolve, reject) => { var buffer = new arraybuffer(2); var view = new uint16array(buffer); view[0] = chunk; var decoded = decoder.decode(view, { stream: true }); var
listitem = document.createelement('li');
listitem.textcontent = "chunk decoded: " + decoded;
list.appendchild(
listitem); result += decoded; resolve(); }); }, close() { var
listitem = document.createelement('li');
listitem.textcontent = "[message received] " + result;
list.appendchild(
listitem); }, abort(err) { console.log("sink error:", err); } }, ...
WritableStreamDefaultWriter - Web APIs
on called sendmessage(), passing the newly created stream and a string. inside this function it calls the stream's getwriter() method, which returns an instance of writablestreamdefaultwriter. a foreach() call is used to write each chunk of the string to the stream. finally, write() and close() return promises that are processed to deal with success or failure of chunks and streams. ...
...t queuingstrategy = new countqueuingstrategy({ highwatermark: 1 }); let result = ""; const writablestream = new writablestream({ // implement the sink write(chunk) { return new promise((resolve, reject) => { var buffer = new arraybuffer(2); var view = new uint16array(buffer); view[0] = chunk; var decoded = decoder.decode(view, { stream: true }); var
listitem = document.createelement('li');
listitem.textcontent = "chunk decoded: " + decoded;
list.appendchild(
listitem); result += decoded; resolve(); }); }, close() { var
listitem = document.createelement('li');
listitem.textcontent = "[message received] " + result;
list.appendchild(
listitem); }, abort(err) { console.log("sink error:", ...
XMLHttpRequest: abort event - Web APIs
11rem; margin: .5rem; } js const xhrbuttonsuccess = document.queryselector('.xhr.success'); const xhrbuttonerror = document.queryselector('.xhr.error'); const xhrbuttonabort = document.queryselector('.xhr.abort'); const log = document.queryselector('.event-log'); function handleevent(e) { log.textcontent = log.textcontent + `${e.type}: ${e.loaded} bytes transferred\n`; } function add
listeners(xhr) { xhr.addevent
listener('loadstart', handleevent); xhr.addevent
listener('load', handleevent); xhr.addevent
listener('loadend', handleevent); xhr.addevent
listener('progress', handleevent); xhr.addevent
listener('error', handleevent); xhr.addevent
listener('abort', handleevent); } function runxhr(url) { log.textcontent = ''; const xhr = new xmlhttprequest(); ...
...hr) { xhr.addevent
listener('loadstart', handleevent); xhr.addevent
listener('load', handleevent); xhr.addevent
listener('loadend', handleevent); xhr.addevent
listener('progress', handleevent); xhr.addevent
listener('error', handleevent); xhr.addevent
listener('abort', handleevent); } function runxhr(url) { log.textcontent = ''; const xhr = new xmlhttprequest(); add
listeners(xhr); xhr.open("get", url); xhr.send(); return xhr; } xhrbuttonsuccess.addevent
listener('click', () => { runxhr('https://mdn.mozillademos.org/files/16553/dgszyjnxcaipwzy.jpg'); }); xhrbuttonerror.addevent
listener('click', () => { runxhr('https://somewhere.org/i-dont-exist'); }); xhrbuttonabort.addevent
listener('click', () => { runxhr('https://mdn.mozillademos.org/f...
XMLHttpRequest: error event - Web APIs
11rem; margin: .5rem; } js const xhrbuttonsuccess = document.queryselector('.xhr.success'); const xhrbuttonerror = document.queryselector('.xhr.error'); const xhrbuttonabort = document.queryselector('.xhr.abort'); const log = document.queryselector('.event-log'); function handleevent(e) { log.textcontent = log.textcontent + `${e.type}: ${e.loaded} bytes transferred\n`; } function add
listeners(xhr) { xhr.addevent
listener('loadstart', handleevent); xhr.addevent
listener('load', handleevent); xhr.addevent
listener('loadend', handleevent); xhr.addevent
listener('progress', handleevent); xhr.addevent
listener('error', handleevent); xhr.addevent
listener('abort', handleevent); } function runxhr(url) { log.textcontent = ''; const xhr = new xmlhttprequest(); ...
...hr) { xhr.addevent
listener('loadstart', handleevent); xhr.addevent
listener('load', handleevent); xhr.addevent
listener('loadend', handleevent); xhr.addevent
listener('progress', handleevent); xhr.addevent
listener('error', handleevent); xhr.addevent
listener('abort', handleevent); } function runxhr(url) { log.textcontent = ''; const xhr = new xmlhttprequest(); add
listeners(xhr); xhr.open("get", url); xhr.send(); return xhr; } xhrbuttonsuccess.addevent
listener('click', () => { runxhr('https://mdn.mozillademos.org/files/16553/dgszyjnxcaipwzy.jpg'); }); xhrbuttonerror.addevent
listener('click', () => { runxhr('https://somewhere.org/i-dont-exist'); }); xhrbuttonabort.addevent
listener('click', () => { runxhr('https://mdn.mozillademos.org/f...
XMLHttpRequest: load event - Web APIs
11rem; margin: .5rem; } js const xhrbuttonsuccess = document.queryselector('.xhr.success'); const xhrbuttonerror = document.queryselector('.xhr.error'); const xhrbuttonabort = document.queryselector('.xhr.abort'); const log = document.queryselector('.event-log'); function handleevent(e) { log.textcontent = log.textcontent + `${e.type}: ${e.loaded} bytes transferred\n`; } function add
listeners(xhr) { xhr.addevent
listener('loadstart', handleevent); xhr.addevent
listener('load', handleevent); xhr.addevent
listener('loadend', handleevent); xhr.addevent
listener('progress', handleevent); xhr.addevent
listener('error', handleevent); xhr.addevent
listener('abort', handleevent); } function runxhr(url) { log.textcontent = ''; const xhr = new xmlhttprequest(); ...
...hr) { xhr.addevent
listener('loadstart', handleevent); xhr.addevent
listener('load', handleevent); xhr.addevent
listener('loadend', handleevent); xhr.addevent
listener('progress', handleevent); xhr.addevent
listener('error', handleevent); xhr.addevent
listener('abort', handleevent); } function runxhr(url) { log.textcontent = ''; const xhr = new xmlhttprequest(); add
listeners(xhr); xhr.open("get", url); xhr.send(); return xhr; } xhrbuttonsuccess.addevent
listener('click', () => { runxhr('https://mdn.mozillademos.org/files/16553/dgszyjnxcaipwzy.jpg'); }); xhrbuttonerror.addevent
listener('click', () => { runxhr('https://somewhere.org/i-dont-exist'); }); xhrbuttonabort.addevent
listener('click', () => { runxhr('https://mdn.mozillademos.org/f...
XMLHttpRequest: loadend event - Web APIs
11rem; margin: .5rem; } js const xhrbuttonsuccess = document.queryselector('.xhr.success'); const xhrbuttonerror = document.queryselector('.xhr.error'); const xhrbuttonabort = document.queryselector('.xhr.abort'); const log = document.queryselector('.event-log'); function handleevent(e) { log.textcontent = log.textcontent + `${e.type}: ${e.loaded} bytes transferred\n`; } function add
listeners(xhr) { xhr.addevent
listener('loadstart', handleevent); xhr.addevent
listener('load', handleevent); xhr.addevent
listener('loadend', handleevent); xhr.addevent
listener('progress', handleevent); xhr.addevent
listener('error', handleevent); xhr.addevent
listener('abort', handleevent); } function runxhr(url) { log.textcontent = ''; const xhr = new xmlhttprequest(); ...
...hr) { xhr.addevent
listener('loadstart', handleevent); xhr.addevent
listener('load', handleevent); xhr.addevent
listener('loadend', handleevent); xhr.addevent
listener('progress', handleevent); xhr.addevent
listener('error', handleevent); xhr.addevent
listener('abort', handleevent); } function runxhr(url) { log.textcontent = ''; const xhr = new xmlhttprequest(); add
listeners(xhr); xhr.open("get", url); xhr.send(); return xhr; } xhrbuttonsuccess.addevent
listener('click', () => { runxhr('https://mdn.mozillademos.org/files/16553/dgszyjnxcaipwzy.jpg'); }); xhrbuttonerror.addevent
listener('click', () => { runxhr('https://somewhere.org/i-dont-exist'); }); xhrbuttonabort.addevent
listener('click', () => { runxhr('https://mdn.mozillademos.org/f...
XMLHttpRequest: loadstart event - Web APIs
11rem; margin: .5rem; } js const xhrbuttonsuccess = document.queryselector('.xhr.success'); const xhrbuttonerror = document.queryselector('.xhr.error'); const xhrbuttonabort = document.queryselector('.xhr.abort'); const log = document.queryselector('.event-log'); function handleevent(e) { log.textcontent = log.textcontent + `${e.type}: ${e.loaded} bytes transferred\n`; } function add
listeners(xhr) { xhr.addevent
listener('loadstart', handleevent); xhr.addevent
listener('load', handleevent); xhr.addevent
listener('loadend', handleevent); xhr.addevent
listener('progress', handleevent); xhr.addevent
listener('error', handleevent); xhr.addevent
listener('abort', handleevent); } function runxhr(url) { log.textcontent = ''; const xhr = new xmlhttprequest(); ...
...hr) { xhr.addevent
listener('loadstart', handleevent); xhr.addevent
listener('load', handleevent); xhr.addevent
listener('loadend', handleevent); xhr.addevent
listener('progress', handleevent); xhr.addevent
listener('error', handleevent); xhr.addevent
listener('abort', handleevent); } function runxhr(url) { log.textcontent = ''; const xhr = new xmlhttprequest(); add
listeners(xhr); xhr.open("get", url); xhr.send(); return xhr; } xhrbuttonsuccess.addevent
listener('click', () => { runxhr('https://mdn.mozillademos.org/files/16553/dgszyjnxcaipwzy.jpg'); }); xhrbuttonerror.addevent
listener('click', () => { runxhr('https://somewhere.org/i-dont-exist'); }); xhrbuttonabort.addevent
listener('click', () => { runxhr('https://mdn.mozillademos.org/f...
XMLHttpRequest: progress event - Web APIs
11rem; margin: .5rem; } js const xhrbuttonsuccess = document.queryselector('.xhr.success'); const xhrbuttonerror = document.queryselector('.xhr.error'); const xhrbuttonabort = document.queryselector('.xhr.abort'); const log = document.queryselector('.event-log'); function handleevent(e) { log.textcontent = log.textcontent + `${e.type}: ${e.loaded} bytes transferred\n`; } function add
listeners(xhr) { xhr.addevent
listener('loadstart', handleevent); xhr.addevent
listener('load', handleevent); xhr.addevent
listener('loadend', handleevent); xhr.addevent
listener('progress', handleevent); xhr.addevent
listener('error', handleevent); xhr.addevent
listener('abort', handleevent); } function runxhr(url) { log.textcontent = ''; const xhr = new xmlhttprequest(); ...
...hr) { xhr.addevent
listener('loadstart', handleevent); xhr.addevent
listener('load', handleevent); xhr.addevent
listener('loadend', handleevent); xhr.addevent
listener('progress', handleevent); xhr.addevent
listener('error', handleevent); xhr.addevent
listener('abort', handleevent); } function runxhr(url) { log.textcontent = ''; const xhr = new xmlhttprequest(); add
listeners(xhr); xhr.open("get", url); xhr.send(); return xhr; } xhrbuttonsuccess.addevent
listener('click', () => { runxhr('https://mdn.mozillademos.org/files/16553/dgszyjnxcaipwzy.jpg'); }); xhrbuttonerror.addevent
listener('click', () => { runxhr('https://somewhere.org/i-dont-exist'); }); xhrbuttonabort.addevent
listener('click', () => { runxhr('https://mdn.mozillademos.org/f...
XMLHttpRequest.upload - Web APIs
progress onprogress periodically delivered to indicate the amount of progress made so far. ...
... progress onprogress periodically delivered to indicate the amount of progress made so far. ...
XRInputSourceArray.entries() - Web APIs
e over the key/value pairs in the input source array. each item in the array is an xrinputsource object. most frequently, you will use this in tandem with statements such as for...of. syntax let inputsourceiterator = xrinputsourcearray.entries(); for (let entry of xrinputsourcearray.entries()) { /* ... */ } parameters none. return value an iterator which can be used to walk through the
list of xrinputsource objects included in the input source array. examples this example snippet gets the
list of inputs for a session and tries to handle each type of input device it supports using. let sources = xrsession.inputsources; for (let input of sources.entries()) { if (input.gamepad) { checkgamepad(input.gamepad); } else { if (input.targetraymode === "tracked-pointer" && ...
... specifications specification status comment webxr device apithe definition of 'xrinputsourcearray' in th...
XRInputSourceEvent() - Web APIs
ourceevent() constructor creates and returns a new xrinputsourceevent object describing an event (state change) which has occurred on a webxr user input device represented by an xrinputsource. syntax newinputsourceevent = new xrinputsourceevent(type, eventinitdict); parameters type a domstring indicating which of the input source events the new object will represent. permitted values are
listed under event types below. eventinitdict an object based on the xrinputsourceeventinit dictionary which contains the values to assign to the new event's properties. return value a new xrinputsourceevent object representing the event described by the given type and eventinitdict. event types select sent to an xrsession when the sending input source has fully completed a primary action.
...ing primary squeeze action is disconnected. squeezestart sent to an xrsession when an input source begins its primary squeeze action, indicating that the user has begun to grab, squeeze, or grip the controller. examples the code below sets up handlers for primary action events in order to determine when the user clicks on (shoots at/pokes at/whatever) objects in the scene. xrsession.addevent
listener("select", event => { let targetraypose = event.frame.getpose(event.inputsource.targetrayspace, myrefspace); if (targetraypose) { let hit = myhittest(targetraypose.transform); if (hit) { /* handle the hit */ } } }); specifications specification status comment webxr device apithe definition of 'xrinputsourceevent' in that specification. ...
XRInputSourcesChangeEvent.added - Web APIs
it looks for new and removed devices whose targetraymode is tracked-pointer. ...
...t of zero or more input sources, each identified using an xrinputsource object, which have been newly made available for use. syntax let addedinputs = xrinputsourceschangeevent.added; value an array of zero or more xrinputsource objects, each representing one input device added to the xr system. examples the example below creates a handler for the inputsourceschange event that processes the
lists of added and removed from the webxr system. it looks for new and removed devices whose targetraymode is tracked-pointer. xrsession.oninputsourcescchange = event => { for (let input of event.added) { if (input.targetraymode == "tracked-pointer") { addedpointerdevice(input); } } for (let input of event.removed) { if (input.targetraymode == "tracked-pointer") { remove...
XRInputSourcesChangeEventInit.removed - Web APIs
specifications specification status comment webxr device apithe definition of 'xrinputsourceschangeeventinit.removed' in that specification. working draft ...
... specifications specification status comment webxr device apithe definition of 'xrinputsourceschangeeventinit.removed' in that specification. working draft initial definition. ...
XRPermissionDescriptor.optionalFeatures - Web APIs
the xrpermissiondescriptor dictionary's optionalfeatures property is used to specify a
list of webxr features which your app or site would like to use but can operate without if permission isn't granted to use them. syntax xrpermissiondescriptor = { mode: xrsessionmode, requiredfeatures: reqfeature
list, optionalfeatures: optfeature
list }; xrpermissiondescriptor.optionalfeatures = optfeature
list; optfeature
list = xrpermissiondescriptor.optionalfeatures; value an array of strings taken from the xrreferencespacetype enumerated type, indicating set of features that your app would like to use, but can operate without if permission to use them isn't available. while further features may be defined in future editions of webxr, currently all permitted values come from the xrreferences...
...pacetype enumerated type, indicating reference spaces the app rquires to be available. the reference space returned by xrsession.requestreferencespace() is either xrreferencespace or xrboundedreferencespace. the "interface" column in the table below indicates which of the two types is returned for each reference space type constant.. reference space descriptors the types of reference space are
listed in the table below, with brief information about their use cases and which interface is used to implement them. xrreferencespacetype description interface bounded-floor similar to the local type, except the user is not expected to move outside a predetermined boundary, given by the boundsgeometry in the returned object. xrboundedreferencespace local ...
XRReferenceSpace: reset event - Web APIs
able to regain tracking within the same tracking area. nor will be be fired at an unbounded reference space as it makes small adjustments to its native origin over time to maintain the space's stability in the vicinity of the user; only large discontinuities will trigger a reset. examples to add a handler for the reset event, you can use either of two approaches. ...
...acking area. nor will be be fired at an unbounded reference space as it makes small adjustments to its native origin over time to maintain the space's stability in the vicinity of the user; only large discontinuities will trigger a reset. examples to add a handler for the reset event, you can use either of two approaches. first, you can use the addevent
listener() method: viewerrefspace.addevent
listener("reset", (event) => { /* perform reset related tasks */ }); the second option is to set the xrreferencespace object's onreset event handler property: viewerrefspace.onreset = (event) => { /* perform reset related tasks */ }; specifications specification status comment webxr device apithe definition of 'reset event' in that specification. working draft i...
XRReferenceSpace - Web APIs
. reset the reset event is sent to an xrreferencespace object when the browser detects a discontinuity has occurred wherein the tracked object's origin relative to the user's environment or location. this can happen, for example, after the user recalibrates their xr device, or if the device automatically adjusts its origin after losing and regaining tracking. in addition to using addevent
listener(), you can establish a reset event handler by setting the onreset event handler property. reference space types the reference space returned by xrsession.requestreferencespace() is either xrreferencespace or xrboundedreferencespace. the "interface" column in the table below indicates which of the two types is returned for each reference space type constant.. reference space descriptors ...
...event handler by setting the onreset event handler property. reference space types the reference space returned by xrsession.requestreferencespace() is either xrreferencespace or xrboundedreferencespace. the "interface" column in the table below indicates which of the two types is returned for each reference space type constant.. reference space descriptors the types of reference space are
listed in the table below, with brief information about their use cases and which interface is used to implement them. xrreferencespacetype description interface bounded-floor similar to the local type, except the user is not expected to move outside a predetermined boundary, given by the boundsgeometry in the returned object. xrboundedreferencespace local ...
XRSession: end event - Web APIs
xr session has ended, either because the web application has chosen to stop the session, or because the user agent terminated the session. ...
...eb application has chosen to stop the session, or because the user agent terminated the session. bubbles no cancelable no interface xrsessionevent event handler xrsession.onend example to be informed when a webxr session comes to an end, you can add a handler to your xrsession instance using addevent
listener(), like this: xrsession.addevent
listener("end", function(event) { /* the session has shut down */ }); alternatively, you can use the xrsession.onend event handler property to establish a handler for the end event: xrsession.onend = function(event) { /* the session has shut down */ } specifications specification status comment webxr device apithe definition of 'end event' in that specification. ...
XRSession.inputSources - Web APIs
the read-only inputsources property of the xrsession interface returns an xrinputsourcearray object which
lists all controllers and input devices which are expressly associated with the xr device and are currently available. these controllers may include handheld controllers, xr-equipped gloves, optically tracked hands, and gaze-based input methods. keyboards, gamepads, and mice are not considered webxr input sources. note: traditional gamepad controllers are supported using the gamepad api. syntax inputsources = xrsession.inputsources; value an xrinputsourcearray object
listing all of the currently-connected input controllers which are linked specifically to the xr device currently in use. the returned object is live; as devices are connected to and removed from the user's system, t...
...xr input sources. note: traditional gamepad controllers are supported using the gamepad api. syntax inputsources = xrsession.inputsources; value an xrinputsourcearray object
listing all of the currently-connected input controllers which are linked specifically to the xr device currently in use. the returned object is live; as devices are connected to and removed from the user's system, the
list's contents update to reflect the changes. usage notes you can add a handler for the xrsession event inputsourceschange to be advised when the contents of the session's connected devices
list changes. you can then either get the value of inputsources to examine the
list, or you can refer to a reference to the
list that you've previously saved. specifications specification status ...
XRSession.oninputsourceschange - Web APIs
the oninputsourcechange attribute of the xrsession object is the event handler for the inputsourcechange event, which is dispatched when session's
list of active xr input sources has changed. the
list itself is accessible via xrsession.inputsources. note: the xrinputsource objects in xrsession.inputsources array are "live", so values within them are updated in-place. therefore if you wish to compare input states between frames, you should make a copy of the content of the state in question. syntax xrsession.oninputsourceschange = function(event) { ... ...
...es. note: the xrinputsource objects in xrsession.inputsources array are "live", so values within them are updated in-place. therefore if you wish to compare input states between frames, you should make a copy of the content of the state in question. syntax xrsession.oninputsourceschange = function(event) { ... } example xrsession.oninputsourceschange = function(event) { console.log("the
list of active xr input sources has changed.") } specifications specification status comment webxr device apithe definition of 'xrsession.oninputsourceschange' in that specification. working draft initial definition. ...
XRSession.requestReferenceSpace() - Web APIs
d. the string must be one of those found in the xrreferencespacetype enumerated type. the reference space returned by xrsession.requestreferencespace() is either xrreferencespace or xrboundedreferencespace. the "interface" column in the table below indicates which of the two types is returned for each reference space type constant.. reference space descriptors the types of reference space are
listed in the table below, with brief information about their use cases and which interface is used to implement them. xrreferencespacetype description interface bounded-floor similar to the local type, except the user is not expected to move outside a predetermined boundary, given by the boundsgeometry in the returned object. xrboundedreferencespace local ...
...en the viewer and an input, or when working with offset spaces. otherwise, typically, one of the other reference space types will be used more often. xrreferencespace return value a promise that resolves with an xrreferencespace object. exceptions rather than throwing true exceptions, requestreferencespace() rejects the returned promise with a domexception whose name is found in the
list below: notsupportederror the requested reference space is not supported. specifications specification status comment webxr device apithe definition of 'requestreferencespace()' in that specification. working draft initial definition. ...
XRSession: select event - Web APIs
ing system or handheld controller with an accelerometer. bubbles yes cancelable no interface xrinputsourceevent event handler property onselect for details on how the selectstart, select, and selectend events work, and how you should react to them, see primary actions in inputs and input sources. ...
...t, select, and selectend events work, and how you should react to them, see primary actions in inputs and input sources. examples the following example uses addevent
listener() to set up a handler for the select event. the handler fetches the pose representing the target ray for tracked-pointer inputs and sends the pose's transform to a function called myhandleselectwithray(). ...
XRSessionEvent - Web APIs
from its parent interface, event. session event types the following events are represented using the xrsessionevent interface, and are permitted values for its type property. end fired at the session when it has ended, after being terminated by the application or the user agent. visibilitychange fired at the session whenever its visibility state changes. ...
... at the session whenever its visibility state changes. examples this example creates a
listiener that watches for the visibility state of the session to change. it reacts by calling a function mysessionvisible() with a boolean indicating whether or not the session is visible; this function might, for instance, spin up or reconfigure a worker that handles rendering the scene. xrsession.addevent
listener("visibilitystate", e => { switch(e.session.visibilitystate) { case "visible": case "visible-blurred": mysessionvisible(true); break; case "hidden": mysessionvisible(false); break; } }); specifications specification status comment webxr device apithe definition of 'xrsessionevent' in that specification. working draft ...
XRSystem: requestSession() - Web APIs
number of reasons, which are covered in more detail in permissions and security in webxr device api. examples creating an immersive vr session the following example calls requestsession() requesting an "immersive-vr" session. if the promise resolves, it sets up a session and initiates the animation loop. navigator.xr.requestsession("immersive-vr") .then((xrsession) => { xrsession.addevent
listener('end', onxrsessionended); // do necessary session setup here. // begin the session’s animation loop. xrsession.requestanimationframe(onxranimationframe); }).catch(function(error) { // "immersive-vr" sessions are not supported console.warn("'immersive-vr' isn't supported, or an error occurred activating vr!"); }); verifying webxr support and using a button to start vr mode the fo...
...ion before enabling controls for entering xr. adding controls is a necessary step because entering xr requires a user action. finally, the onbuttonclicked() method calls requestsession() using the same session option passed to issessionsupported(). ...
Using the group role - Accessibility
ll send out an accessible group event to assistive technology products which can then notify the user about it. a group should be used to form a logical collection of items with related functionality, such as children in a tree widget forming a collection of siblings in a hierarchy, or a collection of items having the same container in a directory. however, when a group is used in the context of
list, authors must limit its children to
listitem elements. group elements may be nested. proper handling of a group by assistive technologies is determined by the context in which it is provided. if an author believes a section is significant enough to warrant inclusion in the page's table of contents, they should assign the section a role of region or a standard landmark role. possible effects on...
...e effects on user agents and assistive technology when the group role is added to an element, or such an element becomes visible, the user agent should do the following: expose the element as having a group role in the operating system's accessibility api. fire an accessible group event using the operating system's accessibility api if it supports it. assistive technology products should
listen for such an event and notify the user accordingly: screen readers should announce the group when focus first lands on a control inside it, and if aria-describedby has been set, the description may be spoken. following this the focused control may be announced. screen magnifiers may enlarge the group. note: opinons may differ on how assistive technology should handle this technique. the in...
Using the log role - Accessibility
possible effects on user agents and assistive technology when the log role is added to an element, or such an element becomes visible, the user agent should do the following: expose the element as having a log role in the operating system's accessibility api. fire an accessible log event using the operating system's accessibility api if it supports it. assistive technology products should
listen for such an event and notify the user accordingly: screen readers should announce changes inside a log when the user is idle, unless aria-live=”assertive” has been set and in which case the user may be interrupted. screen magnifiers may visually indicate that a log update has occurred. note: opinons may differ on how assistive technology should handle this technique. the information p...
... role is added directly into the html source code. <div id="liveregion" class="region" role="log"></div> example 2: snippet from an example application this snippet creates the chat log in an ajax chat application. <div id="chatarea" role="log"> <ul id="chatregion" aria-live="polite" aria-atomic="false"> <li>please choose a user name to begin using ajax chat.</li> </ul> <ul id="user
listregion" aria-live="off" aria-relevant="additions removals text"> </ul> </div> working examples: http://websiteaccessibility.donaldevans.com/2011/07/12/aria-log/ notes using the log role on an element implies that element has aria-live="polite". with an area that has scrolling text, such as a stock ticker, the marquee role should be used instead. aria attributes used log relate...
ARIA: timer role - Accessibility
a timer's inner text should be an updating current time measurement. ...
...a timer's inner text should be an updating current time measurement. while the value does not necessarily need to be machine parsable, it should continuously update at regular intervals unless the timer is paused or reaches its end-point. ...
ARIA: Complementary role - Accessibility
ll-out boxes. if possible, use the html <aside> element instead. <div role="complementary"> <h2>our partners</h2> <!-- complementary section content --> </div> this is a sidebar containing links to event sponsors. description the complementary role is a landmark role. landmarks can be used by assistive technology to quickly identify and navigate to large sections of the document. content
listed within a container with the complementary landmark role should make sense if separated from the main content of the document. using the <aside> element will automatically communicate a section has a role of complementary. developers should always prefer using the correct semantic html element over using aria. examples <div role="complementary"> <h2>trending articles</h2> <ul> <li>...
...-> </aside> redundant descriptions screen readers will announce the type of role the landmark is. because of this, you do not need to describe what the landmark is in its label. for example, a declaration of role="complementary" with an of aria-label="sidebar" may be announced redundantly as, "complementary sidebar". added benefits certain technologies such as browser extensions can generate
lists of all landmark roles present on a page, allowing non-screen reader users to also quickly identify and navigate to large sections of the document. landmarks browser extension specifications specification status accessible rich internet applications (wai-aria) 1.1the definition of 'aria: complementary role' in that specification. recommendation wai-aria auth...
ARIA: grid role - Accessibility
="' + newrow + '"][data-col="' + newcol + '"]'); if (tgt && (tgt.getattribute('role')==='gridcell') ) { array.prototype.foreach.call(document.queryselectorall('[role=gridcell]'), function(el, i){ el.setattribute('tabindex', '-1'); }); tgt.setattribute('tabindex', '0'); tgt.focus(); return true; } else { return false; } } document.queryselector('table').addevent
listener("keydown", function(event) { switch (event.key) { case "arrowright": moveto(parseint(event.target.dataset.row, 10), parseint(event.target.dataset.col, 10) + 1); break; case "arrowleft": moveto(parseint(event.target.dataset.row, 10), parseint(event.target.dataset.col, 10) - 1); break; case "arrowdown": moveto(parseint(event.target.dataset.row, 10) + ...
...="' + newrow + '"][data-col="' + newcol + '"]'); if (tgt && (tgt.getattribute('role')==='gridcell') ) { array.prototype.foreach.call(document.queryselectorall('[role=gridcell]'), function(el, i){ el.setattribute('tabindex', '-1'); }); tgt.setattribute('tabindex', '0'); tgt.focus(); return true; } else { return false; } } document.queryselector('table').addevent
listener("keydown", function(event) { switch (event.key) { case "arrowright": moveto(parseint(event.target.dataset.row, 10), parseint(event.target.dataset.col, 10) + 1); break; case "arrowleft": moveto(parseint(event.target.dataset.row, 10), parseint(event.target.dataset.col, 10) - 1); break; case "arrowdown": moveto(parseint(event.target.dataset.row, 10) + ...
ARIA: Region role - Accessibility
age. by classifying and labeling sections of a page, structural information conveyed visually through layout is represented programmatically. screen readers use landmark roles to provide keyboard navigation to important sections of a page. the region role should be reserved for sections of content sufficiently important that users will likely want to navigate to the section easily and to have it
listed in a summary of the page. a region role is a more generic term, and should only be used if the section needing to be identified is not accurately described by one of the other landmark roles, such as banner, main, contentinfo, complementary, or navigation. every element with a region role should include a label that describes the purpose of the content in the region, preferably with an aria-la...
...ontent area with tabindex="0", add role="region" to convey to screen reader users that is a generic region. this is done to allow keyboard-only users to scroll regions with overflow text. svg role="region" can be declared on areas of svg along with an aria-label to allow individual sections of the svg to be described. added benefits certain technologies such as browser extensions can generate
lists of all landmark roles present on a page, allowing non-screen reader users to also quickly identify and navigate to large sections of the document. landmarks browser extension specifications specification status accessible rich internet applications (wai-aria) 1.1the definition of 'aria region role' in that specification. recommendation wai-aria authoring pr...
Web applications and ARIA FAQ - Accessibility
/ html5 <progress> is supported, so update the value attribute instead. progressbar.setattribute("value", percentcomplete); } progressbar.textcontent = percentcomplete + "% complete"; } function initdemo() { setupprogress(); // setup the progress bar. // bind a click handler to the button, which will update the progress bar to 75%. document.getelementbyid("update-button").addevent
listener("click", function (e) { updateprogress(75); e.preventdefault(); }, false); } initdemo(); how do assistive technologies work? assistive technologies use an api built into each operating system specifically designed to describe the roles, states, and structure of an application's user interface. for example, a screen reader uses this api to read the user interface with a text-to-sp...
... and help from real users. there's more to accessibility than just supporting screen readers. try testing with a variety of usability and accessibility techniques. other helpful testing tools and techniques for aria-enabled applications and widgets: yahoo!'s aria bookmarklets fluid project's simple accessibility evaluation techniques where do aria discussions happen? wai-xtech mailing
list -- holds discussions on aria specs. free-aria google group -- for developers and users of free tools and resources. where can i learn more about aria? an overview of accessible web applications and widgets accessible forms the w3c's wai-aria frequently asked questions webaim's accessibility of rich internet applications ...
Cognitive accessibility - Accessibility
the browser's default :focus styling, unless you're making focus even more obvious. link text conveys meaning the link's text should clearly and concisely communicate what the user should expect to be navigated to next if they choose to activate it. poorly phrased link text may confuse users as to its purpose or destination. some forms of assistive technology allow users to navigate by
lists of all the links present on the page. links will be removed from the context of their surrounding non-link content, making the need for understandable link text even more important. an example of a poor experience is a page full of links whose text reads, "click here." without indicating where "here" will take you, the link's purpose is unclear. for screen readers, it is vital that linked text ...
...r content. for example, this document has an average grade level of about 11. this means it should be easily understood by a native english speaker aged 16 to 17. some tools can even provide suggestions to help simplify it. pronunciation there are multiple techniques that can help teach people how to pronounce words: provide the pronunciation immediately following the word. link to a
list of pronunciations. provide a glossary with pronunciation. use the <ruby> element to illustrate how a word is pronounced. providing guidance on how to pronounce words helps many different kinds of people, including those who prefer to read aloud, non-native language speakers, and people who may unfamiliar with the meaning of a term in context. another solution is to use glyphs or diacritical ...
Operable - Accessibility
ts surroundings (e.g. the surrounding text). exceptions are where the link purpose is ambiguous to all users (see ambiguous to users in general for a useful explanation of this). see meaningful text labels. also note that you should minimize instances where multiple copies of the same text are linked to different places. this can cause problems for screenreader users, who will often bring up a
list of the links out of context — several links all labelled "click here", "click here", "click here" would be confusing. 2.4.5 multiple navigation mechanisms (aa) you should provide at least two general navigation mechanisms to find pages on your web site, for example navigation menu, breadcrumb trail, site search, site map,
list of related links, etc. the only exception to t...
...aaa) this criterion builds on 2.4.4, stating that to conform to aaa, the purpose/destination of a link should be determinable from the link text alone, even if out of context. see meaningful text labels. also note that you should minimize instances where multiple copies of the same text are linked to different places. this can cause problems for screenreader users, who will often bring up a
list of the links out of context — several links all labelled "click here", "click here", "click here" would be confusing. 2.4.10 section headings (aaa) as well as creating a useful document structure, headings should also accurately describe and break up content areas into logical sections. note that this criterion refers to headings and titles in general web content (e.g. hea...
-moz-context-properties - CSS: Cascading Style Sheets
privileged contexts in firefox to share the values of specified properties of the element with a child svg image. if you reference an svg image in a webpage (such as with the <img> element or as a background image), the svg image can coordinate with the embedding element (its context) to have the image adopt property values set on the embedding element. to do this the embedding element needs to
list the properties that are to be made available to the image by
listing them as values of the -moz-context-properties property, and the image needs to opt in to using those properties by using values such as the context-fill value. syntax /* keyword values */ -moz-context-properties: fill; -moz-context-properties: fill, stroke; /* global values */ -moz-context-properties: inherit; -moz-context-pr...
...dded svg. stroke expose the stroke value set on the image to the embedded svg. fill-opacity expose the fill-opacity value set on the image to the embedded svg. stroke-opacity expose the stoke-opacity value set on the image to the embedded svg. formal definition initial valuenoneapplies toany element that can have an image applied to it, for example as a background-image, border-image, or
list-style-image.inheritedyescomputed valueas specifiedanimation typediscrete formal syntax none | [ fill | fill-opacity | stroke | stroke-opacity ]# examples exposing fill and stroke to an svg image in this example we have a simple svg embedded using an <img> element. you first need to specify on the embedding element the properties whose values you wish to expose to the embedded svg, using the...
::marker - CSS: Cascading Style Sheets
::marker { color: blue; font-size: 1.2em; } allowable properties only certain css properties can be used in a rule with ::marker as a selector: all font properties the white-space property color text-combine-upright, unicode-bidi and direction properties the content property all animation and transition properties the specification states that additional css properties may be supported in future. ...
... supported in future. syntax ::marker examples html <ul> <li>peaches</li> <li>apples</li> <li>plums</li> </ul> css ul li::marker { color: red; font-size: 1.5em; } result specifications specification status comment css pseudo-elements level 4the definition of '::marker' in that specification. working draft no significant change. css
lists module level 3the definition of '::marker' in that specification. working draft initial definition. ...
Syntax - CSS: Cascading Style Sheets
null declaration. white spaces around declarations are ignored. the last declaration of a block doesn't need to be terminated by a semi-colon, though it is often considered good style to do it as it prevents forgetting to add it when extending the block with another declaration. a css declaration block is visualized in the diagram below. note: the content of a css declaration block, that is a
list of semi-colon-separated declarations, without the initial and closing braces, can be put inside an html style attribute. css rulesets if style sheets could only apply a declaration to each element of a web page, they would be pretty useless. the real goal is to apply different declarations to different parts of the document. css allows this by associating conditions with declarations blocks. e...
...ch, this doesn't apply to the validity of the ruleset itself. this leads to an important consequence: if one single basic selector is invalid, like when using an unknown pseudo-element or pseudo-class, the whole selector is invalid and therefore the entire rule is ignored (as invalid too). css statements rulesets are the main building blocks of a style sheet, which often consists of only a big
list of them. but there is other information that a web author wants to convey in the style sheet, like the character set, other external style sheets to import, font face or
list counter descriptions and many more. it will use other and specific kinds of statements to do that. a statement is a building block that begins with any non-space characters and ends at the first closing brace or semi-colon ...
Visual formatting model - CSS: Cascading Style Sheets
ubtly different; see the block boxes section below for more details. the principal box when an element generates one or more boxes, one of them is the principal box, which contains its descendant boxes and generated content in the box tree, and is also the box involved in any positioning scheme. some elements may generate additional boxes in addition to the principal box, for example display:
list-item generates more than one box (e.g. a principal block box and a child marker box). and some values (such as none or contents) cause the element and/or its descendants to not generate any boxes at all. anonymous boxes an anonymous box is created when there is not an html element to use for the box. this situation happens when, for example, you declare display: flex on a parent element, and di...
...g context, however, the children behave as flex or grid items rather than items in normal flow. the interactions between block-level and inline-level boxes are described in the mdn documentation for display. in addition, the references for specific values of display explain how these formatting contexts work in terms of box layout. css grid layout css flexible box layout css table layout
lists independent formatting contexts elements either participate in the formating context of their containing block or establish an independent formatting context. a grid container, for example, establishes a new grid formatting context for its children. independent formatting contexts contain floats, and margins do not collapse across formatting context boundaries. therefore, creating a new bloc...
align-content - CSS: Cascading Style Sheets
working draft adds the [ first | ...
... working draft adds the [ first | last ]? baseline, start, end, left, right, unsafe | safe values. css flexible box layout modulethe ...
align-items - CSS: Cascading Style Sheets
working draft update to latest syntax...
... working draft update to latest syntax definitions. css flexible box layout modulethe definition of 'align-items' in that specification...
background-repeat - CSS: Cascading Style Sheets
px. no-repeat the image is not repeated (and hence the background image painting area will not necessarily be entirely covered). the position of the non-repeated background image is defined by the background-position css property. formal definition initial valuerepeatapplies toall elements. ...
... specifications specification status comment css backgrounds and borders module level 3the definition of 'background-repeat' in that specification. candidate recommendation adds support for multiple background images, the two-value syntax allowing distinct repetition behavior for the horizontal and v...
<blend-mode> - CSS: Cascading Style Sheets
values normal the final color is the top color, regardless of what the bottom color is. the effect is like two opaque pieces of paper overlapping. ...
... candidate recommendation initial definition. ...
border-image-repeat - CSS: Cascading Style Sheets
when one value is specified, it applies the same behavior on all four sides. when two values are specified, the first applies to the top and bottom, the second to the left and right. values stretch the source image's edge regions are stretched to fill the gap between each border. repeat the source image's edge regions are tiled (repeated) to fill the gap between each ...
... candidate recommendation initial definition ...
clip-path - CSS: Cascading Style Sheets
values <clip-source> a <url> referencing an svg <clippath> element. <basic-shape> a shape whose size and position is defined by the <geometry-box> value. if no geometry box is specified, the border-box will be used as the reference box. <geometry-box> if specified in combination with a <basic-shape>, this value defines the reference box for the basic shape. if specified by itsel...
... candidate recommendation extends its application to html elements. the clip-path property replaces the deprecated clip pr...
conic-gradient() - CSS: Cascading Style Sheets
ient line emerging from the center of the gradient. with conic gradients, the colors transition as as if spun around the center of a circle, starting at the top and going clockwise. in a radial gradient, the colors transition from the center of an ellipse, outward, in all directions. a conic gradient is specified by indicating a rotation angle, the center of the gradient, and then specifying a
list of color-stops. unlike linear and radial gradients, whose color-stops are placed by specifying a length, the color-stops of a conic gradient are specified with an angle. units include deg for degrees, grad for gradients, rad for radians, and turn for turns. there are 360 degrees, 400 gradians, 2π radians, and 1 turn in a circle. browsers supporting conic gradients also accept percent values, wit...
...angles for two adjacent color stops are the same. the easiest way to do this is to use multip position colors stops. the following two declarations are equivalent: conic-gradient(#fff 0.09turn, #bbb 0.09turn, #bbb 0.27turn, #666 0.27turn, #666 0.54turn, #000 0.54turn); conic-gradient(#fff 0turn 0.09turn, #bbb 0.09turn 0.27turn, #666 0.27turn 0.54turn, #000 0.54turn 1turn); color stops should be
listed in ascending order. subsequent color stops of lower value will override the value of the previous color stop creating a hard transition. the following changes from red to yellow at the 30% mark, and then transitions from yellow to blue over 35% of the gradient conic-gradient(red .8rad, yellow .6rad, blue 1.3rad); there are other effects you can create with conic gradients. oddly, a checkerbo...
counters() - CSS: Cascading Style Sheets
t> examples default value compared to upper roman html <ol> <li> <ol> <li></li> <li></li> <li></li> </ol> </li> <li></li> <li></li> <li> <ol> <li></li> <li> <ol> <li></li> <li></li> <li></li> </ol> </li> </ol> </li> </ol> css ol { counter-reset:
listcounter; } li { counter-increment:
listcounter; } li::marker { content: counters(
listcounter, '.', upper-roman) ') '; } li::before { content: counters(
listcounter, ".") " == " counters(
listcounter, ".", lower-roman) ; } result decimal-leading-zero compared to lower-alpha html <ol> <li> <ol> <li></li> <li></li> <li></li> </ol> </li> <li></li> ...
... working draft no change css level 2 (revision 1)the definition of 'css counters' in that specification. recommendation initial definition ...
<custom-ident> - CSS: Cascading Style Sheets
mal digit, nor a hyphen (-) followed by a decimal digit or another hyphen. to prevent ambiguity, each property that uses <custom-ident> forbids the use of specific values: animation-name forbids the global css values (unset, initial, and inherit), as well as none. counter-reset counter-increment forbids the global css values (unset, initial, and inherit), as well as none. @counter-style
list-style-type forbids the global css values (unset, initial, and inherit), as well as the values none, inline, and outside. also, quite a few predefined values are implemented by the different browsers: disc, circle, square, decimal, cjk-decimal, decimal-leading-zero, lower-roman, upper-roman, lower-greek, lower-alpha, lower-latin, upper-alpha, upper-latin, arabic-indic, armenian, bengali, cambodia...
...ent css values and units module level 4the definition of '<custom-ident>' in that specification. editor's draft css will change module level 1the definition of '<custom-ident> for will-change' in that specification. candidate recommendation defines which values are excluded for will-change. css counter styles level 3the definition of '<custom-ident> for
list-style-type' in that specification. candidate recommendation uses <custom-ident> instead of a finite
list of keywords. defines which values are excluded for
list-style-type and @counter-style. css
lists module level 3the definition of '<custom-ident> for counter-*' in that specification. working draft renames <identifier> to <custom-ident>. adds its usage to the new counter-se...
<filter-function> - CSS: Cascading Style Sheets
each function requires an argument which, if invalid, results in no filter being applied. blur() blurs the image. brightness() makes the image brighter or darker. contrast() increases or decreases the image's contrast. ...
...} input { width: 60% } output { width: 5%; text-align: center; } select { width: 40%; margin-left: 2px; } javascript const selectelem = document.queryselector('select'); const divelem = document.queryselector('div'); const slider = document.queryselector('input'); const output = document.queryselector('output'); const curvalue = document.queryselector('p code'); selectelem.addevent
listener('change', () => { setslider(selectelem.value); setdiv(selectelem.value); }); slider.addevent
listener('input', () => { setdiv(selectelem.value); }); function setslider(filter) { if(filter === 'blur') { slider.value = 0; slider.min = 0; slider.max = 30; slider.step = 1; slider.setattribute('data-unit', 'px'); } else if(filter === 'brightness' || filter === 'contr...
font-kerning - CSS: Cascading Style Sheets
teractive-examples and send us a pull request. kerning defines how letters are spaced. in well-kerned fonts, this feature makes character spacing more uniform and pleasant to read than it would otherwise be. in the image below, for instance, the examples on the left do not use kerning, while the ones on the right do: syntax the font-kerning property is specified as one of the keyword values
listed below. values auto the browser determines whether font kerning should be used or not. for example, some browsers will disable kerning on small fonts, since applying it could harm the readability of text. normal font kerning information stored in the font must be applied. none font kerning information stored in the font is disabled. formal definition initial valueautoapplies toall el...
...ing kerning html <div id="kern"></div> <div id="nokern"></div> <textarea id="input">av t. ij</textarea> css div { font-size: 2rem; font-family: serif; } #nokern { font-kerning: none; } #kern { font-kerning: normal; } javascript let input = document.getelementbyid('input'); let kern = document.getelementbyid('kern'); let nokern = document.getelementbyid('nokern'); input.addevent
listener('keyup', function() { kern.textcontent = input.value; /* update content */ nokern.textcontent = input.value; }); kern.textcontent = input.value; /* initialize content */ nokern.textcontent = input.value; specifications specification status comment css fonts module level 3the definition of 'font-kerning' in that specification. candidate recommendation ...
font-style - CSS: Cascading Style Sheets
both italic and oblique faces are simulated by artificially sloping the glyphs of the regular face (use font-synthesis to control this behavior). syntax font-style: normal; font-style: italic; font-style: oblique; font-style: oblique 10deg; /* global values */ font-style: inherit; font-style: initial; font-style: unset; the font-style property is specified as a single keyword chosen from the
list of values below, which can optionally include an angle if the keyword is oblique. values normal selects a font that is classified as normal within a font-family. italic selects a font that is classified as italic. if no italic version of the face is available, one classified as oblique is used instead. if neither is available, the style is artificially simulated. oblique selects a font t...
... mdn understanding wcag, guideline 1.4 explanations w3c understanding wcag 2.1 formal definition initial valuenormalapplies toall elements. it also applies to ::first-letter and ::first-line.inh...
font-variant - CSS: Cascading Style Sheets
their initial value. <common-lig-values>, <discretionary-lig-values>, <historical-lig-values>, <contextual-alt-values> specifies the keywords related to the font-variant-ligatures longhand property. the possible values are: common-ligatures, no-common-ligatures, discretionary-ligatures, no-discretionary-ligatures, historical-ligatures, no-historical-ligatures, contextual, and no-contextual. sty
listic(), 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. <numeric-figure-values>, <numeric-spaci...
...jis83, jis90, jis04, simplified, traditional, full-width, proportional-width, ruby. formal definition initial valuenormalapplies toall elements. ...
symbols() - CSS: Cascading Style Sheets
unlike @counter-style, symbols() is anonymous (i.e., it can only be used once). although less powerful, it is shorter and easier to write than @counter-style. syntax symbols() = symbols( <symbols-type>? [ <string> | <image> ]+ ); <symbols-type> can be one of the following: cyclic: the system cycles through the given values in the order of their definition, and returns to the start when it reaches the end. numeric: the system interprets the given values as the successive units of a place-value numbering system. ...
...ng system but without 0. symbolic: the system cycles through the values, printing them an additional time at each cycle (one time for the first cycle, two times for the second, etc.). fixed: the system cycles through the given values once, then falls back to arabic numerals. examples html <ol> <li>one</li> <li>two</li> <li>three</li> <li>four</li> <li>five</li> </ol> css ol {
list-style: symbols(cyclic "*" "†" "‡"); } result specifications specification status comment css counter styles level 3the definition of 'symbols()' in that specification. candidate recommendation initial defintion. ...
<transform-function> - CSS: Cascading Style Sheets
each function applies a geometric operation in either 2d or 3d. ...
...tey(-90deg) translatez(50px); } .top { background: rgba(210,210,0,.7); transform: rotatex(90deg) translatez(50px); } .bottom { background: rgba(210,0,210,.7); transform: rotatex(-90deg) translatez(50px); } .select-form { margin-top: 50px; } javascript const selectelem = document.queryselector('select'); const example = document.queryselector('#example-element'); selectelem.addevent
listener('change', () => { if(selectelem.value === 'choose a function') { return; } else { example.style.transform = `rotate3d(1, 1, 1, 30deg) ${selectelem.value}`; settimeout(function() { example.style.transform = 'rotate3d(1, 1, 1, 30deg)'; }, 2000) } }) result specifications specification status comment css transforms level 2the definitio...
transform - CSS: Cascading Style Sheets
s */ transform: translatex(10px) rotate(10deg) translatey(5px); transform: perspective(500px) translate(10px, 0, 20px) rotatey(3deg); /* global values */ transform: inherit; transform: initial; transform: unset; the transform property may be specified as either the keyword value none or as one or more <transform-function> values. if perspective() is one of multiple function values, it must be
listed first. 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. none specifies that no transform should be applied. accessibility concerns scaling/zooming animations are problematic for accessibility, as...
...g wcag, guideline 2.3 explanations understanding success criterion 2.3.3 | w3c understanding wcag 2.1 formal definition initial valuenoneapplies totransformable elementsinheritednopercentagesrefer to the size of bounding boxcomputed valueas specified, but with relative lengths converted into absolute lengthsanimation typea transformcreates stacking contextyes formal syntax none | <transform-
list>where <transform-
list> = <transform-function>+where <transform-function> = <matrix()> | <translate()> | <translatex()> | <translatey()> | <scale()> | <scalex()> | <scaley()> | <rotate()> | <skew()> | <skewx()> | <skewy()> | <matrix3d()> | <translate3d()> | <translatez()> | <scale3d()> | <scalez()> | <rotate3d()> | <rotatex()> | <rotatey()> | <rotatez()> | <perspective()>where <matrix()> = matrix(...
url() - CSS: Cascading Style Sheets
rty for which it is a value, the resource sought can be an image, font, or a stylesheet. the url() functional notation is the value for the <url> data type. ...
...star.svg) url(star.svg) url(star.svg) url(star.svg); /* at-rules */ @document url("https://www.example.com/") { ... } @import url("https://www.example.com/style.css"); @namespace url(http://www.w3.org/1999/xhtml); relative urls, if used, are relative to the url of the stylesheet (not to the url of the web page). the url() function can be included as a value for background, background-image,
list-style,
list-style-image, content, cursor, border, border-image, border-image-source, mask, mask-image, src as part of a @font-face block, and @counter-style/symbol in css level 1, the url() functional notation described only true urls. in css level 2, the definition of url() was extended to describe any uri, including urns. css values and units level 3 returned to the narrower, initial definitio...
<url> - CSS: Cascading Style Sheets
uri or url? there is a difference between a uri and a url. a uri simply identifies a resource. a url is a type of uri, and describes the location of a resource. a uri can be either a url or a name (urn) of a resource. in css level 1, the url() functional notation described only true urls. in css level 2, the definition of url() was extended to describe any uri, whether a url or a urn. ...
...\) before any parentheses, whitespace characters, single quotes (') and double quotes (") that are part of the url. <a_css_property>: url("http://mysite.example.com/mycursor.png") <a_css_property>: url('http://mysite.example.com/mycursor.png') <a_css_property>: url(http://mysite.example.com/mycursor.png) examples .topbanner { background: url("topbanner.png") #00d no-repeat fixed; } ul {
list-style: square url(http://www.example.com/redball.png); } specifications specification status comment css values and units module level 4the definition of '<url>' in that specification. editor's draft css values and units module level 3the definition of '<url>' in that specification. candidate recommendation no significant change from css level ...
white-space - CSS: Cascading Style Sheets
reak within themselves, use overflow-wrap, word-break, or hyphens instead. syntax /* keyword values */ white-space: normal; white-space: nowrap; white-space: pre; white-space: pre-wrap; white-space: pre-line; white-space: break-spaces; /* global values */ white-space: inherit; white-space: initial; white-space: unset; the white-space property is specified as a single keyword chosen from the
list of values below. values normal sequences of white space are collapsed. newline characters in the source are handled the same as other white space. lines are broken as necessary to fill line boxes. nowrap collapses white space as for normal, but suppresses line breaks (text wrapping) within the source. pre sequences of white space are preserved. lines are only broken at newline characters...
...ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. duis aute irure dolor in reprehenderit in voluptate velit esse ci...
will-change - CSS: Cascading Style Sheets
pediscrete formal syntax auto | <animateable-feature>#where <animateable-feature> = scroll-position | contents | <custom-ident> examples via script this is an example showing how to apply the will-change property through scripting, which is probably what you should be doing in most cases. ...
...eature>#where <animateable-feature> = scroll-position | contents | <custom-ident> examples via script this is an example showing how to apply the will-change property through scripting, which is probably what you should be doing in most cases. ...
Ajax - Developer guides
to the server to receive new data; that is, the page requests data from the server. with server-sent events, it's possible for a server to send new data to a web page at any time, by pushing messages to the web page. these incoming messages can be treated as events + data inside the web page. see also: using server-sent events. pure-ajax navigation example this article provides a working (minima
list) example of a pure-ajax website composed only of three pages. sending and receiving binary data the responsetype property of the xmlhttprequest object can be set to change the expected response type from the server. possible values are the empty string (default), arraybuffer, blob, document, json, and text. the response property will contain the entity body according to responsetype, as an arra...
...xml document. as well as this, it can also be used to test addressed nodes within a document to determine whether they match a pattern or not. filereader api the filereader api lets web applications asynchronously read the contents of files (or raw data buffers) stored on the user's computer, using file or blob objects to specify the file or data to read. file objects may be obtained from a file
list object returned as a result of a user selecting files using the <input> element, from a drag and drop operation's datatransfer object, or from the mozgetasfile() api on an htmlcanvaselement. html in xmlhttprequest the xmlhttprequest specification adds html parsing support to xmlhttprequest, which originally supported only xml parsing. this feature allows web apps to obtain an html resource as a...
Web Audio playbackRate explained - Developer guides
note: try out this example live, and try adjusting the playback rate control to see the effect. defaultplaybackrate and ratechange in addition to playbackrate, w...
... note: try out this example live, and try adjusting the playback rate control to see the effect. defaultplaybackrate and ratechange in addition to playbackrate, we also have a defaultplaybackrate property available, which lets us set the default playback rate: the playback rat...
Writing Web Audio API code that works in every browser - Developer guides
lps you to write code in the new style. for example, the way to create instances of gainnode used to be var gain = audiocontext.creategainnode(); but nowadays it is just var gain = audiocontext.creategain(); since the old method names are not present in firefox, existing code may crash with something like creategainnode is not a function, and you now know why. there's a section in the spec that
lists the old names and their updated equivalences; be sure to check it out and change your code accordingly. you can also check this article on porting which covers more cases and has many code samples. things that are not ready yet second, ensure that your project doesn't use node types that are not implemented yet in firefox: mediastreamaudiosourcenode, mediaelementaudiosourcenode and oscillatornod...
...mpting to use a pannernode with that configuration simply resulted in silence or a mono output coming out from that node, depending on the build you used. today the support is already present in nightly, but not quite yet in aurora. in the meantime, you can explicitly specify 'equalpower' instead: var panner = new audiocontext.pannernode(); panner.panningmodel = 'equalpower'; note that there's a
list of projects built with the web audio api, specifying which ones use the standard audiocontext and which browsers do they work on. if you're a person that learns by example, it might be interesting to have a look at their source and see how they have resolved the compatibility issues. ...
Media events - Developer guides
event name description abort sent when playback is aborted; for example, if the media is playing and is restarted from the beginning, this event is sent. canplay sent when enough data is available that the media can be played, at least for a couple of frames. this corresponds to the have_future_data readystate. ...
...ge sent when the audio volume changes (both when the volume is set and when the muted attribute is changed). waiting sent when the requested operation (such as playback) is delayed pending the completion of another operation (such as a seek). you can easily watch for these events, using code such as the following: var v = document.getelementsbytagname("video")[0]; v.addevent
listener("seeked", function() { v.play(); }, true); v.currenttime = 10.0; this example fetches the first video element in the document and attaches an event
listener to it, watching for the seeked event, which is sent whenever a seek operation completes. the
listener simply calls the element's play() method, which starts playback. then, in line 3, the example sets the element's currenttime attribu...
Using device orientation with 3D transforms - Developer guides
coordinate system is inverted, such that translatey(100px) moves an element 100px down, so the rotatey value should be -gamma finally, the order of the three different rotations is very important to accurately convert an orientation to a 3d rotation: rotatez, then rotatex and then rotatey. here's a simple code snippet to sum it up: var elem = document.getelementbyid("view3d"); window.addevent
listener("deviceorientation", function(e) { // remember to use vendor-prefixed transform property elem.style.transform = "rotatez(" + ( e.alpha - 180 ) + "deg) " + "rotatex(" + e.beta + "deg) " + "rotatey(" + ( -e.gamma ) + "deg)"; }); orientation compensation compensating the orientation of the device can be useful to create parallax effects or augmented reality. this is achieved b...
... ( e.alpha - 180 ) + "deg) " + "rotatex(" + e.beta + "deg) " + "rotatey(" + ( -e.gamma ) + "deg)"; }); orientation compensation compensating the orientation of the device can be useful to create parallax effects or augmented reality. ...
Event developer guide - Developer guides
ing, characterization, and use of a large number of incidents of different types. the overview page provides an introduction to the design pattern and a summary of the types of incidents which are defined and reacted to by modern web browsers. the custom events page describes how the event code design pattern can be used in custom code to define new event types emitted by user objects, register
listener functions to handle those events, and trigger the events in user code. the remaining pages describe how to use events of different kinds defined by web browsers. unfortunately, these events have been defined piece by piece as web browsers have evolved so that there is no satisfying systematic characterization of the events built-in or defined by modern web browsers. the device on which the ...
...you need to know about events will go under here. docs creating and triggering eventsthis article demonstrates how to create and dispatch dom events. such events are commonly called synthetic events, as opposed to the events fired by the browser itself.dom on-event handlersthe web platform provides several ways to get notified of dom events. two common styles are: the generalized addevent
listener() and a set of specific on-event handlers.media eventsvarious events are sent when handling media that are embedded in html documents using the <audio> and <video> elements; this section
lists them and provides some helpful information about using them.mouse gesture eventsgecko 1.9.1 added support for several mozilla-specific dom events used to handle mouse gestures. these are special movemen...
Constraint validation - Developer guides
must be an absolute url, as defined in the url living standard. typemismatch constraint violation <input type="email"> the value must be a syntactically valid email address, which generally has the format username@hostname.tld. typemismatch constraint violation for both of these input types, if the multiple attribute is set, several values can be set, as a comma-separated
list, for this input. if any of these do not satisfy the condition described here, the type mismatch constraint violation is triggered. note that most input types don't have intrinsic constraints, as some are simply barred from constraint validation or have a sanitization algorithm transforming incorrect values to a correct default. validation-related attributes in addition to the type attribute de...
...will not prevent form submission in most browsers. <input> <output> <select> submit buttons (created with either a <button> element with the submit type, or an input element with the submit type. other types of buttons do not participate in constraint validation. <textarea> the validitystate interface describes the object returned by the validity property of the element types
listed above. it represents various ways that an entered value can be invalid. together, they help explain why an element's value fails to validate, if it's not valid. ...
Localizations and character encodings - Developer guides
ation for minority language in russia, it is appropriate to copy the settings from the russian localization. setting some encodings to be more easily selectable from the character encoding menu the preference intl.charsetmenu.browser.static in intl.properties makes some character encodings more easily available in the character encoding menu in the browser. ...
... it is appropriate to copy the settings from the russian localization. setting some encodings to be more easily selectable from the character encoding menu the preference intl.charsetmenu.browser.static in intl.properties makes some character encodings more easily available in the character encoding menu in the browser. the value should be a comma-separated
list of canonical encoding names. the
list should include at least the fallback encoding, windows-1252 and utf-8. for locales where there are multiple common legacy encodings, all those encodings should be included. for example, the fallback encoding for japanese is shift_jis, but there are other legacy encodings: iso-2022-jp and euc-jp. therefore, it makes sense for the
list to be shift_jis, euc-jp, iso-2022-jp, windows-1252, utf-8. ...
Mobile Web Development - Developer guides
ent as a background for some text using a vendor-prefixed property like -webkit-linear-gradient, it's best to include the other vendor-prefixed versions of the linear-gradient() property. if you don't do that, at least make sure that the default background contrasts with the text: that way, the page will at least be usable in a browser which is not targeted by your linear-gradient rule. see this
list of gecko-specific properties, and this
list of webkit-specific properties, and peter beverloo's table of vendor-specific properties. using tools like css lint can help find problems like this in code, and preprocessors like sass and less can help you to produce cross-browser code. take care with user agent sniffing it's preferable for web sites to detect specific device features such as screen...
...of webkit-specific properties, and peter beverloo's table of vendor-specific properties. using tools like css lint can help find problems like this in code, and preprocessors like sass and less can help you to produce cross-browser code. take care with user agent sniffing it's preferable for web sites to detect specific device features such as screen size and touch screens using the techniques
listed above, and adapt themselves accordingly. but sometimes this is impractical, and web sites resort to parsing the browser's user agent string to try to distinguish between desktops, tablets, and phones, to serve different content to each type of device. if you do this, make sure your algorithm is correct, and you aren't serving the wrong type of content to a device because you don't understand a...
HTML attribute: accept - HTML: Hypertext Markup Language
the accept property is an attribute of the file <input> type. it was supported on the <form> element, but was removed in favor of file in html5. because a given file type may be identified in more than one manner, it's useful to provide a thorough set of type specifiers when you need files of specific type, or use the wild card to denote a type of any format is acceptable. ...
...ften you won't want the user to be able to pick any arbitrary type of file; instead, you often want them to select files of a specific type or types. for example, if your file input lets users upload a profile picture, you probably want them to select web-compatible image formats, such as jpeg or png. acceptable file types can be specified with the accept attribute, which takes a comma-separated
list of allowed file extensions or mime types. some examples: accept="image/png" or accept=".png" — accepts png files. accept="image/png, image/jpeg" or accept=".png, .jpg, .jpeg" — accept png or jpeg files. accept="image/*" — accept any file with an image/* mime type. (many mobile devices also let the user take a picture with the camera when this is used.) accept=".doc,.docx,.xml,applicat...
Allowing cross-origin use of images and canvas - HTML: Hypertext Markup Language
ng to download the image data. starting the download the code that starts the download (say, when the user clicks a "download" button), looks like this: function startdownload() { let imageurl = "https://cdn.glitch.com/4c9ebeb9-8b9a-4adc-ad0a-238d9ae00bb5%2fmdn_logo-only_color.svg?1535749917189"; downloadedimg = new image; downloadedimg.crossorigin = "anonymous"; downloadedimg.addevent
listener("load", imagereceived, false); downloadedimg.src = imageurl; } we're using a hard-coded url here (imageurl), but that could easily come from anywhere. to begin downloading the image, we create a new htmlimageelement object by using the image() constructor. the image is then configured to allow cross-origin downloading by setting its crossorigin attribute to "anonymous" (that is, allow non-...
...url; } we're using a hard-coded url here (imageurl), but that could easily come from anywhere. to begin downloading the image, we create a new htmlimageelement object by using the image() constructor. the image is then configured to allow cross-origin downloading by setting its crossorigin attribute to "anonymous" (that is, allow non-authenticated downloading of the image cross-origin). an event
listener is added for the load event being fired on the image element, which means the image data has been received. finally, the image's src attribute is set to the url of the image to download; this triggers the download to begin. receiving and saving the image the code that handles the newly-downloaded image is found in the imagereceived() method: function imagereceived() { let canvas = docum...
<h1>–<h6>: The HTML Section Heading elements - HTML: Hypertext Markup Language
he person navigating this way may be left wondering where the missing heading is. don't <h1>heading level 1</h1> <h3>heading level 3</h3> <h4>heading level 4</h4> do <h1>heading level 1</h1> <h2>heading level 2</h2> <h3>heading level 3</h3> nesting headings may be nested as subsections to reflect the organization of the content of the page. ...
... sectioning content can be labeled using a combination of the aria-labelledby and id attributes, with the label concisely describing the purpose of the section. this technique is useful for situations where there is more than one sectioning element on the same page. example <header> <nav aria-labelledby="primary-navigation"> ...
<area> - HTML: Hypertext Markup Language
a> for a full description of the download attribute. href the hyperlink target for the area. its value is a valid url. this attribute may be omitted; if so, the <area> element does not represent a hyperlink. hreflang indicates the language of the linked resource. allowed values are determined by bcp47. use this attribute only if the href attribute is present. ping contains a space-separated
list of urls to which, when the hyperlink is followed, post requests with the body ping will be sent by the browser (in the background). typically used for tracking. referrerpolicy a string indicating which referrer to use when fetching the resource: "no-referrer" meaning that the referer: header will not be sent. "no-referrer-when-downgrade" meaning that no referer: header will be sent when...
... "unsafe-url" meaning that the referrer will include the origin and the path (but not the fragment, password, or username). this case is unsafe because it can leak origins and paths from tls-protected resources to insecure origins. rel for anchors containing the href attribute, this attribute specifies the relationship of the target object to the link object. the value is a space-separated
list of link types values. the values and their semantics will be registered by some authority that might have meaning to the document author. the default relationship, if no other is given, is void. use this attribute only if the href attribute is present. shape the shape of the associated hot spot. the specifications for html defines the values rect, which defines a rectangular region; circle, whi...
<button>: The Button element - HTML: Hypertext Markup Language
he platform the user agent runs on, but you can change buttons’ appearance with css. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories flow content, phrasing content, interactive content,
listed, labelable, and submittable form-associated element, palpable content. permitted content phrasing content but there must be no interactive content tag omission none, both the starting and ending tag are mandatory. permitted parents any element that accepts phrasing content. implicit aria role button permitted aria roles checkbox, link,...
...er. this is the default if the attribute is not specified for buttons associated with a <form>, or if the attribute is an empty or invalid value. reset: the button resets all the controls to their initial values, like <input type="reset">. (this behavior tends to annoy users.) button: the button has no default behavior, and does nothing when pressed by default. it can have client-side scripts
listen to the element's events, which are triggered when the events occur. value defines the value associated with the button’s name when it’s submitted with the form data. this value is passed to the server in params when the form is submitted. notes a submit button with the attribute formaction set, but without an associated form does nothing. you have to set a form owner, either by wra...
<dialog>: The Dialog element - HTML: Hypertext Markup Language
> <output aria-live="polite"></output> javascript var updatebutton = document.getelementbyid('updatedetails'); var favdialog = document.getelementbyid('favdialog'); var outputbox = document.queryselector('output'); var selectel = document.queryselector('select'); var confirmbtn = document.getelementbyid('confirmbtn'); // "update details" button opens the <dialog> modally updatebutton.addevent
listener('click', function onopen() { if (typeof favdialog.showmodal === "function") { favdialog.showmodal(); } else { alert("the <dialog> api is not supported by this browser"); } }); // "favorite animal" input sets the value of the submit button selectel.addevent
listener('change', function onselect(e) { confirmbtn.value = selectel.value; }); // "confirm" button of form triggers "clos...
... living standard html 5.2the definition of '<dialog>' in that specification. recommendation ...
<dt>: The Description Term element - HTML: Hypertext Markup Language
it is usually followed by a <dd> element; however, multiple <dt> elements in a row indicate several terms that are all defined by the immediate next <dd> element. the subsequent <dd> (description details) element provides the definition or other related text associated with the term specified using <dt>. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories none. ...
... tag omission must have a start tag. the end tag may be omitted if this element is immediately followed by another <dt> or a <dd> element, or if there is no more content in the parent element. permitted parents before a <dt> or a <dd> element, inside a <dl> or (in whatwg html) a <div> that is inside a <dl>. implicit aria role term permitted aria roles
listitem dom interface htmlelement up to gecko 1.9.2 (firefox 4) inclusive, firefox implements the htmlspanelement interface for this element. attributes this element only includes the global attributes. example for an example, see the example provided for the <dl> element. specifications specification status comment html living standardthe definitio...
<img>: The Image Embed element - HTML: Hypertext Markup Language
referrer/cors control for security and privacy: see crossorigin and referrerpolicy. use both width and height to set the intrinsic size of the image, allowing it to take up space before it loads, to mitigate content layout shifts. responsive image hints with sizes and srcset (see also the <picture> element and our responsive images tutorial). supported image formats the html standard doesn't
list what image formats to support, so each user agent supports different formats. a complete guide to image formats supported by web browsers is available. below is a
list of the image formats that are most commonly used on the web, as well as some older formats that should no longer be used, despite existing content possibly still using them. abbreviation file format mime type fil...
...e referer header will always include the origin, path and query string, but not the fragment, password, or username. this is unsafe because it can leak information from tls-protected resources to insecure origins. sizes one or more strings separated by commas, indicating a set of source sizes. each source size consists of: a media condition. this must be omitted for the last item in the
list. a source size value. media conditions describe properties of the viewport, not of the image. for example, (max-height: 500px) 1000px proposes to use a source of 1000px width, if the viewport is not higher than 500px. source size values specify the intended display size of the image. user agents use the current source size to select one of the sources supplied by the srcset attribute, whe...
<input type="week"> - HTML: Hypertext Markup Language
in week and year values, a pop-up calendar interface to select them more visually, and an "x" button to clear the control's value. the edge week control is somewhat more elaborate, opening up week and year pickers with sliding reels. value a domstring representing a week and year, or empty events change and input supported common attributes autocomplete,
list, readonly, and step idl attributes value, valueasdate, valueasnumber, and
list. methods select(), stepdown(), and stepup() value a domstring representing the value of the week/year entered into the input. the format of the date and time value used by this input type is described in format of a valid week string in date and time formats used in html. you can set a ...
...-formatted data is submitted (or data which is too large, of the wrong type, and so forth). handling browser support as mentioned above, the major problem with using week inputs right now is browser support: safari and firefox don't support it on desktop, and old versions of ie don't support it. mobile platforms such as android and ios make really good use of such input types, providing specia
list ui controls that make it really easy to select values in a touchscreen environment. for example, the week picker on chrome for android looks like this: non-supporting browsers gracefully degrade to a text input, but this creates problems both in terms of consistency of user interface (the presented control will be different), and data handling. the second problem is the more serious. as menti...
<nav>: The Navigation Section element - HTML: Hypertext Markup Language
ow content. implicit aria role navigation permitted aria roles no role permitted dom interface htmlelement attributes this element only includes the global attributes. usage notes it's not necessary for all links to be contained in a <nav> element. <nav> is intended only for major block of navigation links; typically the <footer> element often has a
list of links that don't need to be in a <nav> element. a document may have several <nav> elements, for example, one for site navigation and one for intra-page navigation. aria-labelledby can be used in such case to promote accessibility, see example. user agents, such as screen readers targeting disabled users, can use this element to determine whether to omit the initial rendering of navigation-on...
...elements, for example, one for site navigation and one for intra-page navigation. aria-labelledby can be used in such case to promote accessibility, see example. user agents, such as screen readers targeting disabled users, can use this element to determine whether to omit the initial rendering of navigation-only content. examples in this example, a <nav> block is used to contain an unordered
list (<ul>) of links. with appropriate css, this can be presented as a sidebar, navigation bar, or drop-down menu. <nav class="menu"> <ul> <li><a href="#">home</a></li> <li><a href="#">about</a></li> <li><a href="#">contact</a></li> </ul> </nav> specifications specification status comment html living standardthe definition of '<nav>' in that specificatio...
<object> - HTML: Hypertext Markup Language
y a plugin. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories flow content; phrasing content; embedded content, palpable content; if the element has a usemap attribute, interactive content;
listed, submittable form-associated element. permitted content zero or more <param> elements, then transparent. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that accepts embedded content. implicit aria role no corresponding role permitted aria roles application, document, image dom ...
...the starting and ending tag are mandatory. permitted parents any element that accepts embedded content. implicit aria role no corresponding role permitted aria roles application, document, image dom interface htmlobjectelement attributes this element includes the global attributes. archivehtml 4 onlyobsolete since html5 a space-separated
list of uris for archives of resources for the object. borderdeprecated since html4.01obsolete since html5 the width of a border around the control, in pixels. classidhtml 4 onlyobsolete since html5 the uri of the object's implementation. it can be used together with, or in place of, the data attribute. codebasehtml 4 onlyobsolete since html5 the base path used to resolve relative uris specified...
<option>: The HTML Option element - HTML: Hypertext Markup Language
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories none. permitted content text, possibly with escaped characters (like é). tag omission the start tag is mandatory. ...
... content categories none. permitted content text, possibly with escaped characters (like é). tag omission the start tag is mandatory. the end tag is optional if this element is immediately followed by another <option> element or an <optgroup>, or if the parent element has no more content. permitted parents a <select>, an <optgroup> or a <data
list> element. implicit aria role option permitted aria roles no role permitted dom interface htmloptionelement attributes this element includes the global attributes. disabled if this boolean attribute is set, this option is not checkable. often browsers grey out such control and it won't receive any browsing event, like mouse clicks or focus-related on...
<output>: The Output element - HTML: Hypertext Markup Language
the html output element (<output>) is a container element into which a site or app can inject the results of a calculation or the outcome of a user action. content categories flow content, phrasing content,
listed, labelable, resettable form-associated element, palpable content. permitted content phrasing content. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that accepts phrasing content. ...
...permitted content phrasing content. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that accepts phrasing content. implicit aria role status permitted aria roles any dom interface htmloutputelement attributes this element includes the global attributes. for a space-separated
list of other elements’ ids, indicating that those elements contributed input values to (or otherwise affected) the calculation. form the <form> element to associate the output with (its form owner). the value of this attribute must be the id of a <form> in the same document. (if this attribute is not set, the <output> is associated with its ancestor <form> element, if any.) this attribute lets y...
<script>: The Script element - HTML: Hypertext Markup Language
d resource has been delivered free of unexpected manipulation. see subresource integrity. nomodule this boolean attribute is set to indicate that the script should not be executed in browsers that support es2015 modules — in effect, this can be used to serve fallback scripts to older browsers that do not support modular javascript code. nonce a cryptographic nonce (number used once) to white
list scripts in a script-src content-security-policy. the server must generate a unique nonce value each time it transmits a policy. it is critical to provide a nonce that cannot be guessed as bypassing a resource's policy is otherwise trivial. referrerpolicy indicates which referrer to send when fetching the script, or resources fetched by the script: no-referrer: the referer header will not be...
...the value of this attribute will be in one of the following categories: omitted or a javascript mime type: this indicates the script is javascript. the html5 specification urges authors to omit the attribute rather than provide a redundant mime type. in earlier browsers, this identified the scripting language of the embedded or imported (via the src attribute) code. javascript mime types are
listed in the specification. module: causes the code to be treated as a javascript module. the processing of the script contents is not affected by the charset and defer attributes. for information on using module, see our javascript modules guide. unlike classic scripts, module scripts require the use of the cors protocol for cross-origin fetching. any other value: the embedded content is treated...
<td>: The Table Data Cell element - HTML: Hypertext Markup Language
any dom interface htmltabledatacellelement attributes this element includes the global attributes. colspan this attribute contains a non-negative integer value that indicates for how many columns the cell extends. its default value is 1. values higher than 1000 will be considered as incorrect and will be set to the default value (1). headers this attribute contains a
list of space-separated strings, each corresponding to the id attribute of the <th> elements that apply to this element. rowspan this attribute contains a non-negative integer value that indicates for how many rows the cell extends. its default value is 1; if its value is set to 0, it extends until the end of the table section (<thead>, <tbody>, <tfoot>, even if implicitly defined), that the cell be...
... bug 2212). the default value when this attribute is not specified is left. note: to achieve the same effect as the left, center, right or justify values, apply the css text-align property to the element. to achieve the same effect as the char value, give the text-align property the same value you would use for the char. unimplemented in css3. axis this attribute contains a
list of space-separated strings. each string is the id of a group of cells that this header applies to. bgcolor this attribute defines the background color of each cell in a column. it is a 6-digit hexadecimal rgb code, prefixed by a '#'. one of the predefined color kewords can also be used. to achieve a similar effect, use the css background-color property. char the content in the ce...
<th> - HTML: Hypertext Markup Language
ion of the cell's content. some user-agents, such as speech readers, may present this description before the content itself. colspan this attribute contains a non-negative integer value that indicates for how many columns the cell extends. its default value is 1. values higher than 1000 will be considered as incorrect and will be set to the default value (1). headers this attribute contains a
list of space-separated strings, each corresponding to the id attribute of the <th> elements that apply to this element. rowspan this attribute contains a non-negative integer value that indicates for how many rows the cell extends. its default value is 1; if its value is set to 0, it extends until the end of the table section (<thead>, <tbody>, <tfoot>, even if implicitly defined), that the cell be...
... do not use this attribute as it is obsolete in the latest standard. to achieve the same effect as the left, center, right or justify values, apply the css text-align property to the element. to achieve the same effect as the char value, give the text-align property the same value you would use for the char. unimplemented in css3. axis obsolete since html5 this attribute contains a
list of space-separated strings. each string is the id of a group of cells that this header applies to. note: do not use this attribute as it is obsolete in the latest standard: use the scope attribute instead. bgcolor this attribute defines the background color of each cell in a column. it consists of a 6-digit hexadecimal code as defined in srgb and is prefixed by '#'. this attribute may be u...
<title>: The Document Title element - HTML: Hypertext Markup Language
age notes the <title> element is always used within a page's <head> block. page titles and seo the contents of a page title can have significant implications for search engine optimization (seo). in general, a longer, descriptive title performs better than short or generic titles. the content of the title is one of the components used by search engine algorithms to decide the order in which to
list pages in search results. also, the title is the initial "hook" by which you grab the attention of readers glancing at the search results page. a few guidelines and tips for composing good titles: avoid one- or two-word titles. use a descriptive phrase, or a term-definition pairing for glossary or reference-style pages. search engines typically display about the first 55–60 characters of a ...
...ry or reference-style pages. search engines typically display about the first 55–60 characters of a page title. text beyond that may be lost, so try not to have titles longer than that. if you must use a longer title, make sure the important parts come earlier and that nothing critical is in the part of the title that is likely to be dropped. don't use "keyword blobs." if your title is just a
list of words, algorithms often reduce your page's position in the search results. try to make sure your titles are as unique as possible within your own site. duplicate—or near-duplicate—titles can contribute to inaccurate search results. example <title>awesome interesting stuff</title> this example establishes a page whose title (as displayed at the top of the window or in the window's tab...
<track>: The Embed Text Track element - HTML: Hypertext Markup Language
textual description of the video content. suitable for users who are blind or where the video cannot be seen. chapters chapter titles are intended to be used when the user is navigating the media resource. metadata tracks used by scripts. not visible to the user. label a user-readable title of the text track which is used by the browser when
listing available text tracks. src address of the track (.vtt file). must be a valid url. this attribute must be specified and its url value must have the same origin as the document — unless the <audio> or <video> parent element of the track element has a crossorigin attribute. srclang language of the track text data. it must be a valid bcp 47 language tag. if the kind attribute is set to subti...
... cuechange event every time the currently-presented cue is changed. this happens even if the track isn't associated with a media element. if the track is associated with a media element, using the <track> element as a child of the <audio> or <video> element, the cuechange event is also sent to the htmltrackelement. ...
accesskey - HTML: Hypertext Markup Language
what may work for one combination of operating system, assistive technology...
...bout this feature, the user might accidentally activate accesskeys. because of these issues, it is generally advised not to use accesskeys for most general-purpose websites and web apps. webaim: keyboard accessibility - accesskey specifications specification status comment html 5.2the definition of 'accesskey' in that specification. recommendation more rea
listic behavior described for what is implemented in reality. html living standardthe definition of 'accesskey' in that specification. living standard no change from latest w3c html 5.1 spec. html 5.1the definition of 'accesskey' in that specification. recommendation no change from html5. html5the definition of 'accesskey' in that specification. recommendation...
Inline elements - HTML: Hypertext Markup Language
ne and block-level elements: content model generally, inline elements may contain only data and other inline elements. you can't put block elements inside inline elements. formatting by default, inline elements do not force a new line to begin in the document flow. block elements, on the other hand, typically cause a line break to occur (although, as usual, this can be changed using css). ...
...e a line break to occur (although, as usual, this can be changed using css). ...
Microformats - HTML: Hypertext Markup Language
developer</a> on <time class="dt-published" datetime="2013-06-13 12:00:00">13<sup>th</sup> june 2013</time> </p> <p class="p-summary">in which ...
...tent"> <p>blah blah blah</p> </div> </article> </div> properties property description p-name name of the feed p-author author of the feed, optionally embed an h-card children nested h-entry objects representing the items of the feed h-event the h-event is for events on the web. ...
Common MIME types - HTTP
here is a
list of mime types, associated by type of documents, ordered by their common extensions. two primary mime types are important for the role of default types: text/plain is the default value for textual files. a textual file should be human-readable and must not contain binary data. application/octet-stream is the default value for all other cases. an unknown file type should use this type. browsers pay a particular care when manipulating these files, attempting to safeguard the user to prevent dangerous behaviors. iana is the official registry of mime media types and maintains a
list of all the official mime types. ...
...an-readable and must not contain binary data. application/octet-stream is the default value for all other cases. an unknown file type should use this type. browsers pay a particular care when manipulating these files, attempting to safeguard the user to prevent dangerous behaviors. iana is the official registry of mime media types and maintains a
list of all the official mime types. ...
Content Security Policy (CSP) - HTTP
ource of the content, even when it's not coming from where it seems to be coming from. csp makes it possible for server administrators to reduce or eliminate the vectors by which xss can occur by specifying the domains that the browser should consider to be valid sources of executable scripts. a csp compatible browser will then only execute scripts loaded in source files received from those allow
listed domains, ignoring all other script (including inline scripts and event-handling html attributes). as an ultimate form of protection, sites that want to never allow scripts to be executed can opt to globally disallow script execution. mitigating packet sniffing attacks in addition to restricting the domains from which content can be loaded, the server can specify which protocols are allowed t...
...tring containing the policy directives describing your content security policy. writing a policy a policy is described using a series of policy directives, each of which describes the policy for a certain resource type or policy area. your policy should include a default-src policy directive, which is a fallback for other resource types when they don't have policies of their own (for a complete
list, see the description of the default-src directive). a policy needs to include a default-src or script-src directive to prevent inline scripts from running, as well as blocking the use of eval(). a policy needs to include a default-src or style-src directive to restrict inline styles from being applied from a <style> element or a style attribute. there are specific directives for a wide variety of...
Accept-Encoding - HTTP
ion requirement. typically, microsoft recommends not to compress if a server uses more than 80% of its computational power. as long as the identity value, meaning no encoding, is not explicitly forbidden, by an identity;q=0 or a *;q=0 without another explicitly set value for identity, the server must never send back a 406 not acceptable error. notes: an iana registry maintains a complete
list of official content encodings. two others content encoding, bzip and bzip2, are sometimes used, though not standard. they implement the algorithm used by these two unix programs. note that the first one was discontinued due to patent licensing problems. header type request header forbidden header name yes syntax accept-encoding: gzip accept-encoding: compress...
... format using the lempel-ziv-welch (lzw) algorithm. deflate a compression format using the zlib structure, with the deflate compression algorithm. br a compression format using the brotli algorithm. identity indicates the identity function (i.e. no compression, nor modification). this value is always considered as acceptable, even if not present. * matches any content encoding not already
listed in the header. this is the default value if the header is not present. it doesn't mean that any algorithm is supported; merely that no preference is expressed. ;q= (qvalues weighting) any value is placed in an order of preference expressed using a relative quality value called weight. examples accept-encoding: gzip accept-encoding: gzip, compress, br accept-encoding: br;q=1.0, gzip;q=0.8...
Access-Control-Allow-Origin - HTTP
cors and caching if the server sends a response with an access-control-allow-origin value that is an explicit origin (rather than the "*" wildcard), then the response should also include a vary response header with the value origin — to indicate ...
... cors and caching if the server sends a response with an access-control-allow-origin value that is an explicit origin (rather than the "*" wildcard), then the response should also include a vary response header with the value origin — to indicate to browsers that server responses can differ based on the value ...
Connection - HTTP
keep-alive are prohibited in http/2. chrome and firefox ignore them in http/2 responses, but safari conforms to the http/2 spec requirements and won’t load any response which contains them. except for the standard hop-by-hop headers (keep-alive, transfer-encoding, te, connection, trailer, upgrade, proxy-authorization and proxy-authenticate), any hop-by-hop headers used by the message must be
listed in the connection header, so that the first proxy knows it has to consume them and not forward them further. standard hop-by-hop headers can be
listed too (it is often the case of keep-alive, but this is not mandatory). header type general header forbidden header name yes syntax connection: keep-alive connection: close directives close indicates that eithe...
...y-hop headers can be
listed too (it is often the case of keep-alive, but this is not mandatory). header type general header forbidden header name yes syntax connection: keep-alive connection: close directives close indicates that either the client or the server would like to close the connection. this is the default on http/1.0 requests. any comma-separated
list of http headers [usually keep-alive only] indicates that the client would like to keep the connection open. having a persistent connection is the default on http/1.1 requests. the
list of headers are the name of the header to be removed by the first non-transparent proxy or cache in-between: these headers define the connection between the emitter and the first entity, not the destination node. ...
Content-Language - HTTP
is written in, use the lang attribute instead). if no content-language is specified, the default is that the content is intended for all language audiences. multiple language tags are also possible, as well as applying the content-language header to various media types and not only to textual documents. header type entity header forbidden header name no cors-safe
listed response header yes cors-safe
listed request header yes, with the additional restriction that values can only be 0-9, a-z, a-z, space or *,-.;=. syntax content-language: de-de content-language: en-us content-language: de-de, en-ca directives language-tag multiple language tags are separated by comma. each language tag is a sequence of one or more case-insensitive sub...
...onsists of a primary language subtag that identifies a broad family of related languages (e.g., "en" = english), which is optionally followed by a series of subtags that refine or narrow that language's range (e.g., "en-ca" = the variety of english as communicated in canada). note: language tags are formaly defined in rfc 5646, which rely on the iso 639 standard (quite often the iso 639-1 code
list) for language codes to be used. examples indicating the language a document is written in the global lang attribute is used on html elements to indicate the language of an entire html document or parts of it. <html lang="de"> do not use this meta element like this for stating a document language: <!-- /!\ this is bad practice --> <meta http-equiv="content-language" content="de"> indicatin...
CSP: base-uri - HTTP
or javascript: urls, this is a safer method than using the unsafe-inline expression. 'unsafe-inline' allows the use of inline resources, such as inline <script> elements, javascript: urls, inline event handlers, and inline <style> elements. the single quotes are required. 'none' refers to the empty set; that is, no urls match. the single quotes are required. 'nonce-<base64-value>' an allow-
list for specific inline scripts using a cryptographic nonce (number used once). the server must generate a unique nonce value each time it transmits a policy. it is critical to provide an unguessable nonce, as bypassing a resource’s policy is otherwise trivial. see unsafe inline script for an example. specifying nonce makes a modern browser ignore 'unsafe-inline' which could still be set for older ...
...example. in csp 2.0, this applied only to inline scripts. csp 3.0 allows it in the case of script-src for external scripts. 'strict-dynamic' the strict-dynamic source expression specifies that the trust explicitly given to a script present in the markup, by accompanying it with a nonce or a hash, shall be propagated to all the scripts loaded by that root script. at the same time, any allow-
list or source expressions such as 'self' or 'unsafe-inline' are ignored. see script-src for an example. 'report-sample' requires a sample of the violating code to be included in the violation report. examples meta tag configuration <meta http-equiv="content-security-policy" content="base-uri 'self'"> apache configuration <ifmodule mod_headers.c> header set content-security-policy "base-...
CSP: default-src - HTTP
or javascript: urls, this is a safer method than using the unsafe-inline expression. 'unsafe-inline' allows the use of inline resources, such as inline <script> elements, javascript: urls, inline event handlers, and inline <style> elements. the single quotes are required. 'none' refers to the empty set; that is, no urls match. the single quotes are required. 'nonce-<base64-value>' an allow-
list for specific inline scripts using a cryptographic nonce (number used once). the server must generate a unique nonce value each time it transmits a policy. it is critical to provide an unguessable nonce, as bypassing a resource’s policy is otherwise trivial. see unsafe inline script for an example. specifying nonce makes a modern browser ignore 'unsafe-inline' which could still be set for older ...
...example. in csp 2.0, this applied only to inline scripts. csp 3.0 allows it in the case of script-src for external scripts. 'strict-dynamic' the strict-dynamic source expression specifies that the trust explicitly given to a script present in the markup, by accompanying it with a nonce or a hash, shall be propagated to all the scripts loaded by that root script. at the same time, any allow-
list or source expressions such as 'self' or 'unsafe-inline' are ignored. see script-src for an example. 'report-sample' requires a sample of the violating code to be included in the violation report. examples no inheritance with default-src if there are other directives specified, default-src does not influence them. the following header: content-security-policy: default-src 'self'; scri...
CSP: form-action - HTTP
or javascript: urls, this is a safer method than using the unsafe-inline expression. 'unsafe-inline' allows the use of inline resources, such as inline <script> elements, javascript: urls, inline event handlers, and inline <style> elements. the single quotes are required. 'none' refers to the empty set; that is, no urls match. the single quotes are required. 'nonce-<base64-value>' an allow-
list for specific inline scripts using a cryptographic nonce (number used once). the server must generate a unique nonce value each time it transmits a policy. it is critical to provide an unguessable nonce, as bypassing a resource’s policy is otherwise trivial. see unsafe inline script for an example. specifying nonce makes a modern browser ignore 'unsafe-inline' which could still be set for older ...
...example. in csp 2.0, this applied only to inline scripts. csp 3.0 allows it in the case of script-src for external scripts. 'strict-dynamic' the strict-dynamic source expression specifies that the trust explicitly given to a script present in the markup, by accompanying it with a nonce or a hash, shall be propagated to all the scripts loaded by that root script. at the same time, any allow-
list or source expressions such as 'self' or 'unsafe-inline' are ignored. see script-src for an example. 'report-sample' requires a sample of the violating code to be included in the violation report. examples meta tag configuration <meta http-equiv="content-security-policy" content="form-action 'none'"> apache configuration <ifmodule mod_headers.c> header set content-security-policy "fo...
CSP: img-src - HTTP
or javascript: urls, this is a safer method than using the unsafe-inline expression. 'unsafe-inline' allows the use of inline resources, such as inline <script> elements, javascript: urls, inline event handlers, and inline <style> elements. the single quotes are required. 'none' refers to the empty set; that is, no urls match. the single quotes are required. 'nonce-<base64-value>' an allow-
list for specific inline scripts using a cryptographic nonce (number used once). the server must generate a unique nonce value each time it transmits a policy. it is critical to provide an unguessable nonce, as bypassing a resource’s policy is otherwise trivial. see unsafe inline script for an example. specifying nonce makes a modern browser ignore 'unsafe-inline' which could still be set for older ...
...example. in csp 2.0, this applied only to inline scripts. csp 3.0 allows it in the case of script-src for external scripts. 'strict-dynamic' the strict-dynamic source expression specifies that the trust explicitly given to a script present in the markup, by accompanying it with a nonce or a hash, shall be propagated to all the scripts loaded by that root script. at the same time, any allow-
list or source expressions such as 'self' or 'unsafe-inline' are ignored. see script-src for an example. 'report-sample' requires a sample of the violating code to be included in the violation report. examples violation cases given this csp header: content-security-policy: img-src https://example.com/ the following <img> is blocked and won't load: <img src="https://not-example.com/foo.j...
CSP: navigate-to - HTTP
or javascript: urls, this is a safer method than using the unsafe-inline expression. 'unsafe-inline' allows the use of inline resources, such as inline <script> elements, javascript: urls, inline event handlers, and inline <style> elements. the single quotes are required. 'none' refers to the empty set; that is, no urls match. the single quotes are required. 'nonce-<base64-value>' an allow-
list for specific inline scripts using a cryptographic nonce (number used once). the server must generate a unique nonce value each time it transmits a policy. it is critical to provide an unguessable nonce, as bypassing a resource’s policy is otherwise trivial. see unsafe inline script for an example. specifying nonce makes a modern browser ignore 'unsafe-inline' which could still be set for older ...
...example. in csp 2.0, this applied only to inline scripts. csp 3.0 allows it in the case of script-src for external scripts. 'strict-dynamic' the strict-dynamic source expression specifies that the trust explicitly given to a script present in the markup, by accompanying it with a nonce or a hash, shall be propagated to all the scripts loaded by that root script. at the same time, any allow-
list or source expressions such as 'self' or 'unsafe-inline' are ignored. see script-src for an example. 'report-sample' requires a sample of the violating code to be included in the violation report. examples meta tag configuration <meta http-equiv="content-security-policy" content="navigate-to 'none'"> violation case using a <form> element with an action set to inline javascript will ...
CSP: prefetch-src - HTTP
or javascript: urls, this is a safer method than using the unsafe-inline expression. 'unsafe-inline' allows the use of inline resources, such as inline <script> elements, javascript: urls, inline event handlers, and inline <style> elements. the single quotes are required. 'none' refers to the empty set; that is, no urls match. the single quotes are required. 'nonce-<base64-value>' an allow-
list for specific inline scripts using a cryptographic nonce (number used once). the server must generate a unique nonce value each time it transmits a policy. it is critical to provide an unguessable nonce, as bypassing a resource’s policy is otherwise trivial. see unsafe inline script for an example. specifying nonce makes a modern browser ignore 'unsafe-inline' which could still be set for older ...
...in csp 2.0, this applied only to inline scripts. csp 3.0 allows it in the case of script-src for external scripts. example prefetch resources do not match header given a page with the following content security policy: content-security-policy: prefetch-src https://example.com/ fetches for the following code will return network errors, as the urls provided do not match prefetch-src's source
list: <link rel="prefetch" src="https://example.org/"></link> <link rel="prerender" src="https://example.org/"></link> specification specification status comment content security policy level 3the definition of 'prefetch-src' in that specification. working draft initial definition. ...
CSP: script-src-attr - HTTP
or javascript: urls, this is a safer method than using the unsafe-inline expression. 'unsafe-inline' allows the use of inline resources, such as inline <script> elements, javascript: urls, inline event handlers, and inline <style> elements. the single quotes are required. 'none' refers to the empty set; that is, no urls match. the single quotes are required. 'nonce-<base64-value>' an allow-
list for specific inline scripts using a cryptographic nonce (number used once). the server must generate a unique nonce value each time it transmits a policy. it is critical to provide an unguessable nonce, as bypassing a resource’s policy is otherwise trivial. see unsafe inline script for an example. specifying nonce makes a modern browser ignore 'unsafe-inline' which could still be set for older ...
...example. in csp 2.0, this applied only to inline scripts. csp 3.0 allows it in the case of script-src for external scripts. 'strict-dynamic' the strict-dynamic source expression specifies that the trust explicitly given to a script present in the markup, by accompanying it with a nonce or a hash, shall be propagated to all the scripts loaded by that root script. at the same time, any allow-
list or source expressions such as 'self' or 'unsafe-inline' are ignored. see script-src for an example. 'report-sample' requires a sample of the violating code to be included in the violation report. examples fallback to script-src if script-src-attr is absent, user agent falls back to the script-src directive, and if that is absent as well, to default-src. todo: add comprehensive examp...
CSP: script-src-elem - HTTP
or javascript: urls, this is a safer method than using the unsafe-inline expression. 'unsafe-inline' allows the use of inline resources, such as inline <script> elements, javascript: urls, inline event handlers, and inline <style> elements. the single quotes are required. 'none' refers to the empty set; that is, no urls match. the single quotes are required. 'nonce-<base64-value>' an allow-
list for specific inline scripts using a cryptographic nonce (number used once). the server must generate a unique nonce value each time it transmits a policy. it is critical to provide an unguessable nonce, as bypassing a resource’s policy is otherwise trivial. see unsafe inline script for an example. specifying nonce makes a modern browser ignore 'unsafe-inline' which could still be set for older ...
...example. in csp 2.0, this applied only to inline scripts. csp 3.0 allows it in the case of script-src for external scripts. 'strict-dynamic' the strict-dynamic source expression specifies that the trust explicitly given to a script present in the markup, by accompanying it with a nonce or a hash, shall be propagated to all the scripts loaded by that root script. at the same time, any allow-
list or source expressions such as 'self' or 'unsafe-inline' are ignored. see script-src for an example. 'report-sample' requires a sample of the violating code to be included in the violation report. examples fallback to script-src if script-src-elem is absent, user agent falls back to the script-src directive, and if that is absent as well, to default-src. todo: add comprehensive examp...
Feature-Policy: accelerometer - HTTP
the http feature-policy header accelerometer directive controls whether the current document is allowed to gather information about the acceleration of the device through the accelerometer interface. syntax feature-policy: accelerometer <allow
list>; <allow
list> an allow
list is a
list of origins that takes one or more of the following values, separated by spaces: *: the feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin. 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. 'src': (in an iframe allow attribute only) the feature will be allowed in this iframe, as long as the document loaded into it comes from the same origin as the url in the iframe's src a...
...is disabled in top-level and nested browsing contexts. <origin(s)>: the feature is allowed for specific origins (for example, https://example.com). origins should be separated by a space. the values * (enable for all origins) or 'none' (disable for all origins) may only be used alone, while 'self' and 'src' may be used with one or more origins. features are each defined to have a default allow
list, which is one of: *: the feature is allowed by default in top-level browsing contexts and all nested browsing contexts (iframes). 'self': the feature is allowed by default in top-level browsing contexts and in nested browsing contexts (iframes) in the same origin. the feature is not allowed in cross-origin documents in nested browsing contexts. 'none': the feature is disabled in top-level an...
Feature-Policy: ambient-light-sensor - HTTP
the http feature-policy header ambient-light-sensor directive controls whether the current document is allowed to gather information about the amount of light in the environment around the device through the ambientlightsensor interface. syntax feature-policy: ambient-light-sensor <allow
list>; <allow
list> an allow
list is a
list of origins that takes one or more of the following values, separated by spaces: *: the feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin. 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. 'src': (in an iframe allow attribute only) the feature will be allowed in this iframe, as long as the document loaded into it comes from the...
...is disabled in top-level and nested browsing contexts. <origin(s)>: the feature is allowed for specific origins (for example, https://example.com). origins should be separated by a space. the values * (enable for all origins) or 'none' (disable for all origins) may only be used alone, while 'self' and 'src' may be used with one or more origins. features are each defined to have a default allow
list, which is one of: *: the feature is allowed by default in top-level browsing contexts and all nested browsing contexts (iframes). 'self': the feature is allowed by default in top-level browsing contexts and in nested browsing contexts (iframes) in the same origin. the feature is not allowed in cross-origin documents in nested browsing contexts. 'none': the feature is disabled in top-level an...
Feature-Policy: autoplay - HTTP
the htmlmediaelement interface. when this policy is enabled and there were no user gestures, the promise returned by htmlmediaelement.play() will reject with a domexception. the autoplay attribute on <audio> and <video> elements will be ignored. for more details on autoplay and autoplay blocking, see the article autoplay guide for media and web audio apis. syntax feature-policy: autoplay <allow
list>; <allow
list> an allow
list is a
list of origins that takes one or more of the following values, separated by spaces: *: the feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin. 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. 'src': (in an iframe allow attrib...
...is disabled in top-level and nested browsing contexts. <origin(s)>: the feature is allowed for specific origins (for example, https://example.com). origins should be separated by a space. the values * (enable for all origins) or 'none' (disable for all origins) may only be used alone, while 'self' and 'src' may be used with one or more origins. features are each defined to have a default allow
list, which is one of: *: the feature is allowed by default in top-level browsing contexts and all nested browsing contexts (iframes). 'self': the feature is allowed by default in top-level browsing contexts and in nested browsing contexts (iframes) in the same origin. the feature is not allowed in cross-origin documents in nested browsing contexts. 'none': the feature is disabled in top-level an...
Feature-Policy: battery - HTTP
the http feature-policy header battery directive controls whether the current document is allowed to gather information about the acceleration of the device through the batterymanager interface obtained via navigator.getbattery(). syntax feature-policy: battery <allow
list>; <allow
list> an allow
list is a
list of origins that takes one or more of the following values, separated by spaces: *: the feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin. 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. 'src': (in an iframe allow attribute only) the feature will be allowed in this iframe, as long as the document loaded into it comes from the same origin as the ...
...is disabled in top-level and nested browsing contexts. <origin(s)>: the feature is allowed for specific origins (for example, https://example.com). origins should be separated by a space. the values * (enable for all origins) or 'none' (disable for all origins) may only be used alone, while 'self' and 'src' may be used with one or more origins. features are each defined to have a default allow
list, which is one of: *: the feature is allowed by default in top-level browsing contexts and all nested browsing contexts (iframes). 'self': the feature is allowed by default in top-level browsing contexts and in nested browsing contexts (iframes) in the same origin. the feature is not allowed in cross-origin documents in nested browsing contexts. 'none': the feature is disabled in top-level an...
Feature-Policy: camera - HTTP
the http feature-policy header camera directive controls whether the current document is allowed to use video input devices. when this policy is enabled, the promise returned by mediadevices.getusermedia() will reject with a notallowederror. syntax feature-policy: camera <allow
list>; <allow
list> an allow
list is a
list of origins that takes one or more of the following values, separated by spaces: *: the feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin. 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. 'src': (in an iframe allow attribute only) the feature will be allowed in this iframe, as long as the document loaded into it comes from the same origin...
...is disabled in top-level and nested browsing contexts. <origin(s)>: the feature is allowed for specific origins (for example, https://example.com). origins should be separated by a space. the values * (enable for all origins) or 'none' (disable for all origins) may only be used alone, while 'self' and 'src' may be used with one or more origins. features are each defined to have a default allow
list, which is one of: *: the feature is allowed by default in top-level browsing contexts and all nested browsing contexts (iframes). 'self': the feature is allowed by default in top-level browsing contexts and in nested browsing contexts (iframes) in the same origin. the feature is not allowed in cross-origin documents in nested browsing contexts. 'none': the feature is disabled in top-level an...
Feature-Policy: document-domain - HTTP
the http feature-policy header document-domain directive controls whether the current document is allowed to set document.domain. when this policy is enabled, attempting to set document.domain will fail and cause a securityerror domexception to be be thrown. syntax feature-policy: document-domain <allow
list>; <allow
list> an allow
list is a
list of origins that takes one or more of the following values, separated by spaces: *: the feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin. 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. 'src': (in an iframe allow attribute only) the feature will be allowed in this iframe, as long as the document loade...
...is disabled in top-level and nested browsing contexts. <origin(s)>: the feature is allowed for specific origins (for example, https://example.com). origins should be separated by a space. the values * (enable for all origins) or 'none' (disable for all origins) may only be used alone, while 'self' and 'src' may be used with one or more origins. features are each defined to have a default allow
list, which is one of: *: the feature is allowed by default in top-level browsing contexts and all nested browsing contexts (iframes). 'self': the feature is allowed by default in top-level browsing contexts and in nested browsing contexts (iframes) in the same origin. the feature is not allowed in cross-origin documents in nested browsing contexts. 'none': the feature is disabled in top-level an...
Feature-Policy: fullscreen - HTTP
ludes same-origin frames. if both this directive (i.e. via the allow attribute) and the allowfullscreen attribute are present on an <iframe> element, this directive takes precedence. there was a bug whereby the fullscreen directive didn't work unless the allowfullscreen attribute was also present, but this has been fixed as of firefox 80 (bug 1608358). syntax feature-policy: fullscreen <allow
list>; <allow
list> an allow
list is a
list of origins that takes one or more of the following values, separated by spaces: *: the feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin. 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. 'src': (in an iframe allow attrib...
...is disabled in top-level and nested browsing contexts. <origin(s)>: the feature is allowed for specific origins (for example, https://example.com). origins should be separated by a space. the values * (enable for all origins) or 'none' (disable for all origins) may only be used alone, while 'self' and 'src' may be used with one or more origins. features are each defined to have a default allow
list, which is one of: *: the feature is allowed by default in top-level browsing contexts and all nested browsing contexts (iframes). 'self': the feature is allowed by default in top-level browsing contexts and in nested browsing contexts (iframes) in the same origin. the feature is not allowed in cross-origin documents in nested browsing contexts. 'none': the feature is disabled in top-level an...
Feature-Policy: geolocation - HTTP
ntposition() and watchposition() will cause those functions' callbacks to be invoked with a positionerror code of permission_denied. by default, the geolocation api can be used within top-level documents and their same-origin child frames. this directive allows or prevents cross-origin frames from accessing geolocation. this includes same-origin frames. syntax feature-policy: geolocation <allow
list>; <allow
list> an allow
list is a
list of origins that takes one or more of the following values, separated by spaces: *: the feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin. 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. 'src': (in an iframe allow attrib...
...is disabled in top-level and nested browsing contexts. <origin(s)>: the feature is allowed for specific origins (for example, https://example.com). origins should be separated by a space. the values * (enable for all origins) or 'none' (disable for all origins) may only be used alone, while 'self' and 'src' may be used with one or more origins. features are each defined to have a default allow
list, which is one of: *: the feature is allowed by default in top-level browsing contexts and all nested browsing contexts (iframes). 'self': the feature is allowed by default in top-level browsing contexts and in nested browsing contexts (iframes) in the same origin. the feature is not allowed in cross-origin documents in nested browsing contexts. 'none': the feature is disabled in top-level an...
Feature-Policy: gyroscope - HTTP
the http feature-policy header gyroscope directive controls whether the current document is allowed to gather information about the orientation of the device through the gyroscope interface. syntax feature-policy: gyroscope <allow
list>; <allow
list> an allow
list is a
list of origins that takes one or more of the following values, separated by spaces: *: the feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin. 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. 'src': (in an iframe allow attribute only) the feature will be allowed in this iframe, as long as the document loaded into it comes from the same origin as the url in the iframe's src attribute. 'n...
...is disabled in top-level and nested browsing contexts. <origin(s)>: the feature is allowed for specific origins (for example, https://example.com). origins should be separated by a space. the values * (enable for all origins) or 'none' (disable for all origins) may only be used alone, while 'self' and 'src' may be used with one or more origins. features are each defined to have a default allow
list, which is one of: *: the feature is allowed by default in top-level browsing contexts and all nested browsing contexts (iframes). 'self': the feature is allowed by default in top-level browsing contexts and in nested browsing contexts (iframes) in the same origin. the feature is not allowed in cross-origin documents in nested browsing contexts. 'none': the feature is disabled in top-level an...
Feature-Policy: magnetometer - HTTP
the http feature-policy header magnetometer directive controls whether the current document is allowed to gather information about the orientation of the device through the magnetometer interface. syntax feature-policy: magnetometer <allow
list>; <allow
list> an allow
list is a
list of origins that takes one or more of the following values, separated by spaces: *: the feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin. 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. 'src': (in an iframe allow attribute only) the feature will be allowed in this iframe, as long as the document loaded into it comes from the same origin as the url in the iframe's src attri...
...is disabled in top-level and nested browsing contexts. <origin(s)>: the feature is allowed for specific origins (for example, https://example.com). origins should be separated by a space. the values * (enable for all origins) or 'none' (disable for all origins) may only be used alone, while 'self' and 'src' may be used with one or more origins. features are each defined to have a default allow
list, which is one of: *: the feature is allowed by default in top-level browsing contexts and all nested browsing contexts (iframes). 'self': the feature is allowed by default in top-level browsing contexts and in nested browsing contexts (iframes) in the same origin. the feature is not allowed in cross-origin documents in nested browsing contexts. 'none': the feature is disabled in top-level an...
Feature-Policy: microphone - HTTP
the http feature-policy header microphone directive controls whether the current document is allowed to use audio input devices. when this policy is enabled, the promise returned by mediadevices.getusermedia() will reject with a notallowederror. syntax feature-policy: microphone <allow
list>; <allow
list> an allow
list is a
list of origins that takes one or more of the following values, separated by spaces: *: the feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin. 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. 'src': (in an iframe allow attribute only) the feature will be allowed in this iframe, as long as the document loaded into it comes fr...
...is disabled in top-level and nested browsing contexts. <origin(s)>: the feature is allowed for specific origins (for example, https://example.com). origins should be separated by a space. the values * (enable for all origins) or 'none' (disable for all origins) may only be used alone, while 'self' and 'src' may be used with one or more origins. features are each defined to have a default allow
list, which is one of: *: the feature is allowed by default in top-level browsing contexts and all nested browsing contexts (iframes). 'self': the feature is allowed by default in top-level browsing contexts and in nested browsing contexts (iframes) in the same origin. the feature is not allowed in cross-origin documents in nested browsing contexts. 'none': the feature is disabled in top-level an...
Feature-Policy: unsized-media - HTTP
-policy header unsized-media directive controls whether the current document is allowed to change the size of media elements after the initial layout is complete. this restriction solves "layout instability" problem caused by providing default dimensions for images whose size is not specified in advance so that image doesn't change size after loading. syntax feature-policy: unsized-media <allow
list>; <allow
list> an allow
list is a
list of origins that takes one or more of the following values, separated by spaces: *: the feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin. 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. 'src': (in an iframe allow attrib...
...is disabled in top-level and nested browsing contexts. <origin(s)>: the feature is allowed for specific origins (for example, https://example.com). origins should be separated by a space. the values * (enable for all origins) or 'none' (disable for all origins) may only be used alone, while 'self' and 'src' may be used with one or more origins. features are each defined to have a default allow
list, which is one of: *: the feature is allowed by default in top-level browsing contexts and all nested browsing contexts (iframes). 'self': the feature is allowed by default in top-level browsing contexts and in nested browsing contexts (iframes) in the same origin. the feature is not allowed in cross-origin documents in nested browsing contexts. 'none': the feature is disabled in top-level an...
Feature-Policy: vibrate - HTTP
the http feature-policy header vibrate directive controls whether the current document is allowed to trigger device vibrations via navigator.vibrate() method of vibration api. syntax feature-policy: vibrate <allow
list>; <vibrate> an allow
list is a
list of origins that takes one or more of the following values, separated by spaces: *: the feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin. 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. 'src': (in an iframe allow attribute only) the feature will be allowed in this iframe, as long as the document loaded into it comes from the same origin as the url in the iframe's src attribute. 'none': the feature...
...is disabled in top-level and nested browsing contexts. <origin(s)>: the feature is allowed for specific origins (for example, https://example.com). origins should be separated by a space. the values * (enable for all origins) or 'none' (disable for all origins) may only be used alone, while 'self' and 'src' may be used with one or more origins. features are each defined to have a default allow
list, which is one of: *: the feature is allowed by default in top-level browsing contexts and all nested browsing contexts (iframes). 'self': the feature is allowed by default in top-level browsing contexts and in nested browsing contexts (iframes) in the same origin. the feature is not allowed in cross-origin documents in nested browsing contexts. 'none': the feature is disabled in top-level an...
web-share - HTTP
the http feature-policy header web-share directive controls controls whether the current document is allowed to use the navigator.share() of web share api to share text, links, images, and other content to arbitrary destiations of user's choice. syntax feature-policy: web-share <allow
list>; <allow
list> an allow
list is a
list of origins that takes one or more of the following values, separated by spaces: *: the feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin. 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. 'src': (in an iframe allow attribute only) the feature will be allowed in this iframe, as long as the document loaded into it comes from the sa...
...is disabled in top-level and nested browsing contexts. <origin(s)>: the feature is allowed for specific origins (for example, https://example.com). origins should be separated by a space. the values * (enable for all origins) or 'none' (disable for all origins) may only be used alone, while 'self' and 'src' may be used with one or more origins. features are each defined to have a default allow
list, which is one of: *: the feature is allowed by default in top-level browsing contexts and all nested browsing contexts (iframes). 'self': the feature is allowed by default in top-level browsing contexts and in nested browsing contexts (iframes) in the same origin. the feature is not allowed in cross-origin documents in nested browsing contexts. 'none': the feature is disabled in top-level an...
Strict-Transport-Security - HTTP
ct-transport-security header, allowing access via http. preloading strict transport security google maintains an hsts preload service. by following the guidelines and successfully submitting your domain, browsers will never connect to your domain using an insecure connection. while the service is hosted by google, all browsers have stated an intent to use (or actually started using) the preload
list. however, it is not part of the hsts specification and should not be treated as official. information regarding the hsts preload
list in chrome : https://www.chromium.org/hsts consultation of the firefox hsts preload
list : nsstspreload
list.inc examples all present and future subdomains will be https for a max-age of 1 year. this blocks access to pages or sub domains that can only be serve...
...nt and future subdomains will be https for a max-age of 1 year. this blocks access to pages or sub domains that can only be served over http. strict-transport-security: max-age=31536000; includesubdomains in the following example, max-age is set to 2 years, raised from what was a former limit max-age of 1 year. note that 1 year is acceptable for a domain to be included in browsers' hsts preload
lists. 2 years is, however, the recommended goal as a website's final hsts configuration as explained on https://hstspreload.org. it also suffixed with preload which is necessary for inclusion in most major web browsers' hsts preload
lists, e.g. chromium, edge, & firefox. strict-transport-security: max-age=63072000; includesubdomains; preload specifications specification status comme...
Redirections in HTTP - HTTP
cation did not intend to allow method changes, but there are existing user agents that do change their method. 307 was created to remove the ambiguity of the behavior when using non-get methods. special redirections 304 (not modified) redirects a page to the locally cached copy (that was stale), and 300 (multiple choice) is a manual redirection: the body, presented by the browser as a web page,
lists the possible redirections and the user clicks on one to select it. code text typical use case 300 multiple choice not many: the choices are
listed in an html page in the body. machine-readable choices are encouraged to be sent as link headers with rel=alternate. 304 not modified sent for revalidated conditional requests. indicates that the cached...
...ttp status code to use or the permanent keyword) can be used to set up a different redirect: redirect permanent / https://www.example.com # …acts the same as: redirect 301 / https://www.example.com the mod_rewrite module can also create redirects. it is more flexible, but a bit more complex. nginx in nginx, you create a specific server block for the content you want to redirect: server {
listen 80; server_name example.com; return 301 $scheme://www.example.com$request_uri; } to apply a redirect to a directory or only certain pages, use the rewrite directive: rewrite ^/images/(.*)$ https://images.example.com/$1 redirect; rewrite ^/images/(.*)$ https://images.example.com/$1 permanent; iis in iis, you use the <httpredirect> element to configure redirections. redirection loops red...
406 Not Acceptable - HTTP
proactive content negotiation headers include: accept accept-charset accept-encoding accept-language in practice, this error is very rarely used. instead of responding using this error code, which would be cryptic for the end user and difficult to fix, servers ignore the relevant header and serve an actual page to the user. ...
...his error is very rarely used. instead of responding using this error code, which would be cryptic for the end user and difficult to fix, servers ignore the relevant header and serve an actual page to the user. it is assumed that even if the user won't be completely happy, they will prefer this to an error code. if a server returns such an error status, the body of the message should contain the
list of the available representations of the resources, allowing the user to choose among them. status 406 not acceptable specifications specification title rfc 7231, section 6.5.6: 406 not acceptable hypertext transfer protocol (http/1.1): semantics and content ...
Keyed collections - JavaScript
e pairs in which the keys are objects only and the values can be arbitrary values. the object references in the keys are held weakly, meaning that they are a target of garbage collection (gc) if there is no other reference to the object anymore. the weakmap api is the same as the map api. one difference to map objects is that weakmap keys are not enumerable (i.e., there is no method giving you a
list of the keys). if they were, the
list would depend on the state of garbage collection, introducing non-determinism. for more information and example code, see also "why weakmap?" on the weakmap reference page. one use case of weakmap objects is to store private data for an object, or to hide implementation details. the following example is from nick fitzgerald's blog post "hiding implementation ...
...tion, and objects are not enumerable. the main differences to the set object are: in contrast to sets, weaksets are collections of objects only, and not of arbitrary values of any type. the weakset is weak: references to objects in the collection are held weakly. if there is no other reference to an object stored in the weakset, they can be garbage collected. that also means that there is no
list of current objects stored in the collection. weaksets are not enumerable. the use cases of weakset objects are limited. they will not leak memory, so it can be safe to use dom elements as a key and mark them for tracking purposes, for example. key and value equality of map and set both the key equality of map objects and the value equality of set objects, are based on the "same-value-zero alg...
Unicode property escapes - JavaScript
and non-binary values \p{unicodebinarypropertyname} // negation: \p is negated \p \p{unicodepropertyvalue} \p{unicodebinarypropertyname} general_category (gc) script (sc) script_extensions (scx) see also propertyvaluealiases.txt unicodebinarypropertyname the name of a binary property. e.g.: ascii, alpha, math, diacritic, emoji, hex_digit, math, white_space, etc. see unicode data prop
list.txt for more info. unicodepropertyname the name of a non-binary property: unicodepropertyvalue one of the tokens
listed in the values section, below. many values have aliases or shorthand (e.g. the value decimal_number for the general_category property may be written nd, digit, or decimal_number). for most values, the unicodepropertyname part and equals sign may be omitted. if a unicodeproper...
... tc39 proposal on unicode property escapes for more info. examples general categories general categories are used to classify unicode characters and subcategories are available to define a more precise categorization. it is possible to use both short or long forms in unicode property escapes. they can be used to match letters, numbers, symbols, punctuations, spaces, etc. for a more exhaustive
list of general categories, please refer to the unicode specification. // finding all the letters of a text let story = "it’s the cheshire cat: now i shall have somebody to talk to."; // most explicit form story.match(/\p{general_category=letter}/gu); // it is not mandatory to use the property name for general categories story.match(/\p{letter}/gu); // this is equivalent (short alias): story.mat...
JavaScript error reference - JavaScript
below, you'll find a
list of errors which are thrown by javascript. these errors can be a helpful debugging aid, but the reported problem isn't always immediately clear. the pages below will provide additional details about these errors. each error is an object based upon the error object, and has a name and a message. errors displayed in the web console may include a link to the corresponding page below to help you quickly comprehend the problem in your code. for a beginner's introductory tutorial on fixing javascript errors, see what went wrong? troubleshooting javascript.
list of errors in this
list, each page is
listed by name (the type of error) and message (a more detailed human-readable error message). together, these two properties provide a starting point toward understanding and...
...can't have an initializersyntaxerror: applying the "delete" operator to an unqualified name is deprecatedsyntaxerror: for-in loop head declarations may not have initializerssyntaxerror: function statement requires a namesyntaxerror: identifier starts immediately after numeric literalsyntaxerror: illegal charactersyntaxerror: invalid regular expression flag "x"syntaxerror: missing ) after argument
listsyntaxerror: missing ) after conditionsyntaxerror: missing : after property idsyntaxerror: missing ; before statementsyntaxerror: missing = in const declarationsyntaxerror: missing ] after element
listsyntaxerror: missing formal parametersyntaxerror: missing name after . operatorsyntaxerror: missing variable namesyntaxerror: missing } after function bodysyntaxerror: missing } after property
listsy...
Arrow function expressions - JavaScript
ow function expressions are ill suited as methods, and they cannot be used as constructors. syntax basic syntax (param1, param2, …, paramn) => { statements } (param1, param2, …, paramn) => expression // equivalent to: => { return expression; } // parentheses are optional when there's only one parameter name: (singleparam) => { statements } singleparam => { statements } // the parameter
list for a function with no parameters should be written with a pair of parentheses. () => { statements } advanced syntax // parenthesize the body of a function to return an object literal expression: params => ({foo: bar}) // rest parameters and default parameters are supported (param1, param2, ...rest) => { statements } (param1 = defaultvalue1, param2, …, paramn = defaultvaluen) => { statement...
...e written with a pair of parentheses. () => { statements } advanced syntax // parenthesize the body of a function to return an object literal 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 ...
Default parameters - JavaScript
, g]; } withdefaults.call({value: '=^_^='}); // [undefined, 5, 5, ":p", {value:"=^_^="}, arguments, "=^_^="] withoutdefaults.call({value: '=^_^='}); // [undefined, 5, 5, ":p", {value:"=^_^="}, arguments, "=^_^="] scope effects if default parameters are defined for one or more parameter, then a second scope (environment record) is created, specifically for the identifiers within the parameter
list. this scope is a parent of the scope created for the function body. 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. it also means that variables declared inside the function body using var will mask parameters of the same name, instead of the usual behavio...
...ked, because the default parameter value does not have access to the child scope of the function body: function f(a = go()) { // throws a `referenceerror` when `f` is invoked. function go() { return ':p' } } ...and this function will print undefined because variable var a is hoisted only to the top of the scope created for the function body (and not the parent scope created for the parameter
list): function f(a, b = () => console.log(a)) { var a = 1 b() // prints `undefined`, because default parameter values exist in their own scope } parameters without defaults after default parameters parameters are still set left-to-right, overwriting default parameters even if there are later parameters without defaults. function f(x = 1, y) { return [x, y] } f() // [1, undefined] f(2) ...
Array.prototype.length - JavaScript
the highest index in the array. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. description the value of the length property is an integer with a positive sign and a value less than 2 to the 32nd power (232). ...
...e is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. description the value of the length property is an integer with a positive sign and a value less than 2 to the 32nd power (232). var name
lista = new array(4294967296); //2 to the 32nd power = 4294967296 var name
listc = new array(-100) //negative sign console.log(name
lista.length); //rangeerror: invalid array length console.log(name
listc.length); //rangeerror: invalid array length var name
listb = []; name
listb.length = math.pow(2,32)-1; //set array length less than 2 to the 32nd power console.log(name
listb.length); //4294967295 you can set the length property to truncate an array at any time. when you ...
Array.prototype.map() - JavaScript
// this step can be combined with c // c. if kpresent is true, then if (k in o) { // i. let kvalue be the result of calling the get internal // method of o with argument pk. kvalue = o[k]; // ii. let mappedvalue be the result of calling the call internal // method of callback with t as the this value and argument //
list containing kvalue, k, and o. mappedvalue = callback.call(t, kvalue, k, o); // iii. call the defineownproperty internal method of a with arguments // pk, property descriptor // { value: mappedvalue, // writable: true, // enumerable: true, // configurable: true }, // and false. // in browsers that support object.definep...
...ding representing the character values: let map = array.prototype.map let a = map.call('hello world', function(x) { return x.charcodeat(0) }) // a now equals [72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100] using map generically queryselectorall this example shows how to iterate through a collection of objects collected by queryselectorall. this is because queryselectorall returns a node
list (which is a collection of objects). in this case, we return all the selected options' values on the screen: let elems = document.queryselectorall('select option:checked') let values = array.prototype.map.call(elems, function(obj) { return obj.value }) an easier way would be the array.from() method. tricky use case (inspired by this blog post) it is common to use the callback with one arg...
Array.prototype.slice() - JavaScript
gine: {cylinders: 4, size: 2.2}}, 2] mycar[0].color = red newcar[0].color = red the new color of my honda is purple mycar[0].color = purple newcar[0].color = purple array-like objects slice method can also be called to convert array-like objects/collections to a new array. you just bind the method to the object. the arguments inside a function is an example of an 'array-like object'. function
list() { return array.prototype.slice.call(arguments) } let
list1 =
list(1, 2, 3) // [1, 2, 3] binding can be done with the call() method of function.prototype and it can also be reduced using [].slice.call(arguments) instead of array.prototype.slice.call. anyway, it can be simplified using bind. let unboundslice = array.prototype.slice let slice = function.prototype.call.bind(unboundslice) fu...
...return array.prototype.slice.call(arguments) } let
list1 =
list(1, 2, 3) // [1, 2, 3] binding can be done with the call() method of function.prototype and it can also be reduced using [].slice.call(arguments) instead of array.prototype.slice.call. anyway, it can be simplified using bind. let unboundslice = array.prototype.slice let slice = function.prototype.call.bind(unboundslice) function
list() { return slice(arguments) } let
list1 =
list(1, 2, 3) // [1, 2, 3] specifications specification ecmascript (ecma-262)the definition of 'array.prototype.slice' in that specification. ...
Array - JavaScript
neither the length of a javascript array nor the types of its elements are fixed. since an array's length can change at any time, and data can be stored at non-contiguous locations in the array, javascript arrays are not guaranteed to be dense; this depends on how the programmer chooses to use them. ...
...oses to use them. in general, these are convenient characteristics; but if these features are not desirable for your particular use, you might consider using typed arrays. arrays cannot use strings as element indexes (as in an associative array) but must use integers. setting or accessing via non-integers using bracket notation (or dot notation) will not set or retrieve an element from the array
list itself, but will set or access a variable associated with that array's object property collection. the array's object properties and
list of array elements are separate, and the array's traversal and mutation operations cannot be applied to these named properties. common operations create an array let fruits = ['apple', 'banana'] console.log(fruits.length) // 2 access an array item using th...
Object.getOwnPropertyNames() - JavaScript
able: false } }); my_obj.foo = 1; console.log(object.getownpropertynames(my_obj).sort()); // logs ["foo", "getfoo"] if you want only the enumerable properties, see object.keys() or use a for...in loop (note that this will also return enumerable properties found along the prototype chain for the object unless the latter is filtered with hasownproperty()). ...
... var target = myobject; var enum_and_nonenum = object.getownpropertynames(target); var enum_only = object.keys(target); var nonenum_only = enum_and_nonenum.filter(function(key) { var indexinenum = enum_only.indexof(key); if (indexinenum == -1) { // not found in enum_only keys, ...
handler.apply() - JavaScript
the handler.apply() method is a trap for a function call. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax const p = new proxy(target, { apply: function(target, thisarg, arguments
list) { } }); parameters the following parameters are passed to the apply() method. this is bound to the handler. target the target object. thisarg the this argument for the call. arguments
list the
list of arguments for the call. return value the apply() method can return any value. description the handler.apply() method is a trap for a function call. interceptions this trap can intercept these operations: pr...
...ction.prototype.apply() and function.prototype.call() reflect.apply() invariants if the following invariants are violated, the proxy will throw a typeerror. the target must be a callable itself. that is, it must be a function object. examples trapping a function call the following code traps a function call. const p = new proxy(function() {}, { apply: function(target, thisarg, arguments
list) { console.log('called: ' + arguments
list.join(', ')); return arguments
list[0] + arguments
list[1] + arguments
list[2]; } }); console.log(p(1, 2, 3)); // "called: 1, 2, 3" // 6 specifications specification ecmascript (ecma-262)the definition of '[[call]]' in that specification. ...
Proxy - JavaScript
/* var doccookies = ... get the "doccookies" object here: https://developer.mozilla.org/docs/dom/document.coo...
... /* var doccookies = ... get the "doccookies" object here: https://developer.mozilla.org/docs/dom/document.cookie#a_little_framework.3a_a_complete_cookies_reader.2fwriter_...
Reflect.construct() - JavaScript
as a function. it is equivalent to calling new target(...args). it gives also the added option to specify a different prototype. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax reflect.construct(target, arguments
list[, newtarget]) parameters target the target function to call. arguments
list an array-like object specifying the arguments with which target should be called. newtarget optional the constructor whose prototype should be used. see also the new.target operator. if newtarget is not present, its value defaults to target. return value a new instance of target (or newtarget, if present), ini...
... exceptions a typeerror, if target or newtarget are not constructors. description reflect.construct() allows you to invoke a constructor with a variable number of arguments. ...
String.prototype.split() - JavaScript
the division is done by searching for a pattern; where the pattern is provided as the first parameter in the method's call. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax str.split([separator[, limit]]) parameters separator optional the pattern describing where each split should occur. the separator can be a simple string or it can be a regular expression. ...
...jan,feb,mar,apr,may,jun,jul,aug,sep,oct,nov,dec" the separator is: "," the array has 12 elements: jan / feb / mar / apr / may / jun / jul / aug / sep / oct / nov / dec removing spaces from a string in the following example, split() looks for zero or more spaces, followed by a semicolon, followed by zero or more spaces—and, when found, removes the spaces and the semicolon from the string. name
list is the array returned as a result of split(). const names = 'harry trump ;fred barney; helen rigby ; bill abel ;chris hand ' console.log(names) const re = /\s*(?:;|$)\s*/ const name
list = names.split(re) console.log(name
list) this logs two lines; the first line logs the original string, and the second line logs the resulting array. harry trump ;fred barney; helen rigby ; bill abel ;chris h...
Symbol.for() - JavaScript
and send us a pull request. syntax symbol.for(key); parameters key string, required. the key for the symbol (and also used for the description of the symbol). return value an existing symbol with the given key if found; otherwise, a new symbol is created and returned. description in contrast to symbol(), the symbol.for() function creates a symbol available in a global symbol registry
list. ...
... [[symbol]] a symbol that is stored globally. ...
WeakMap - JavaScript
correspond to both arrays. getting values from the map would involve iterating through all keys to find a match, then using the index of this match to retrieve the corresponding value from the array of values. such an implementation would have two main inconveniences: the first one is an o(n) set and search (n being the number of keys in the map) since both operations must iterate through the
list of keys to find a matching value. the second inconvenience is a memory leak because the arrays ensure that references to each key and each value are maintained indefinitely. these references prevent the keys from being garbage collected, even if there are no other references to the object. this would also prevent the corresponding values from being garbage collected. by contrast, native weakma...
...ction in case there would be no other reference to the key object. this also avoids preventing garbage collection of values in the map. native weakmaps can be particularly useful constructs when mapping keys to information about the key that is valuable only if the key has not been garbage collected. because the references are weak, weakmap keys are not enumerable. there is no method to obtain a
list of the keys. if they were, the
list would depend on the state of garbage collection, introducing non-determinism. if you want to have a
list of keys, you should use a map. constructor weakmap() creates a new weakmap object. instance methods weakmap.prototype.delete(key) removes any value associated to the key. weakmap.prototype.has(key) will return false afterwards. weakmap.prototype.
Object initializer - JavaScript
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...ate will be a string after json.parse(). json.parse() will reject computed property names and an error will be thrown. examples creating objects an empty object with no properties can be created like this: let object = {} however, the advantage of the literal or initializer notation is, that you are able to quickly create objects with properties inside the curly braces. you simply notate a
list of key: value pairs delimited by commas. the following code creates an object with three properties and the keys are "foo", "age" and "baz". the values of these keys are a string "bar", the number 42, and another object. let object = { foo: 'bar', age: 42, baz: {myprop: 12} } accessing properties once you have created an object, you might want to read or change them. object properties c...
Spread syntax (...) - JavaScript
alls replace apply() it is common to use function.prototype.apply() in cases where you want to use the elements of an array as arguments to a function. function myfunction(x, y, z) { } const args = [0, 1, 2]; myfunction.apply(null, args); with spread syntax the above can be written as: function myfunction(x, y, z) { } const args = [0, 1, 2]; myfunction(...args); any argument in the argument
list can use spread syntax, and the spread syntax can be used multiple times. function myfunction(v, w, x, y, z) { } const args = [0, 1]; myfunction(-1, ...args, 2, ...[3]); apply for new operator when calling a constructor with new it's not possible to directly use an array and apply() (apply() does a [[call]] and not a [[construct]]). however, an array can be easily used with new thanks to spread...
...sting array as one part of it, the array literal syntax is no longer sufficient and imperative code must be used instead using a combination of push(), splice(), concat(), etc. with spread syntax this becomes much more succinct: const parts = ['shoulders', 'knees']; const lyrics = ['head', ...parts, 'and', 'toes']; // ["head", "shoulders", "knees", "and", "toes"] just like spread for argument
lists, ... can be used anywhere in the array literal, and may be used more than once. copy an array const arr = [1, 2, 3]; const arr2 = [...arr]; // like arr.slice() arr2.push(4); // arr2 becomes [1, 2, 3, 4] // arr remains unaffected note: spread syntax effectively goes one level deep while copying an array. therefore, it may be unsuitable for copying multidimensional arrays, as the following...
new operator - JavaScript
the new operator lets developers create an instance of a user-defined object type or of one of the built-in object types that has a constructor function. syntax new constructor[([arguments])] parameters constructor a class or function that specifies the type of the object instance. arguments a
list of values that the constructor will be called with. description the new keyword does the following things: creates a blank, plain javascript object; links (sets the constructor of) this object to another object; passes the newly created object from step 1 as the this context; returns this if the function doesn't return an object. creating a user-defined object requires two steps: define the object type by writing a function. create an instance of the object with new. ...
...roperties. an object can have a property that is itself another object. see the examples below. when the code new foo(...) is executed, the following things happen: a new object is created, inheriting from foo.prototype. the constructor function foo is called with the specified arguments, and with this bound to the newly created object. new foo is equivalent to new foo(), i.e. if no argument
list is specified, foo is called without arguments. the object (not null, false, 3.1415 or other primitive types) returned by the constructor function becomes the result of the whole new expression. if the constructor function doesn't explicitly return an object, the object created in step 1 is used instead. (normally constructors don't return a value, but they can choose to do so if they want to ove...
for...of - JavaScript
it invokes a custom iteration hook with statements to be executed for the value of each distinct property of the object. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...nst value of iterable) { console.log(value); } // 1 // 2 // 3 iterating over the arguments object you can iterate over the arguments object to examine all of the parameters passed into a javascript function: (function() { for (const argument of arguments) { console.log(argument); } })(1, 2, 3); // 1 // 2 // 3 iterating over a dom collection iterating over dom collections like node
list: the following example adds a read class to paragraphs that are direct descendants of an article: // note: this will only work in platforms that have // implemented node
list.prototype[symbol.iterator] const articleparagraphs = document.queryselectorall('article > p'); for (const paragraph of articleparagraphs) { paragraph.class
list.add('read'); } closing iterators in for...of loops, abrupt...
shortcuts - Web app manifests
tory no the shortcuts member defines an array of shortcuts or links to key tasks or pages within a web app. a user agent can use these values to assemble a context menu to be displayed by the operating system when a user engages with the web app's icon. when user invokes a shortcut, the user agent will navigate to the address given by shortcut's url member. ...
...e these values to assemble a context menu to be displayed by the operating system when a user engages with the web app's icon. when user invokes a shortcut, the user agent will navigate to the address given by shortcut's url member. examples the following is a
list of shortcuts a calendar app might have: "shortcuts" : [ { "name": "today's agenda", "url": "/today", "description": "
list of events planned for today" }, { "name": "new event", "url": "/create/event" }, { "name": "new reminder", "url": "/create/reminder" } ] specification specification status comment feedback web app manifestthe definition of 'shortcuts' in that specification. working draft initial definition. web app...
MathML attribute reference - MathML
more details for each attribute are available on particular element pages. notes: the mathml <mstyle> and <math> elements accept all attributes of all mathml presentation elements. see values for notes on values and units in mathml. the attributes background, color, fontfamily, fontsize, fontstyle, fontweight and xlink:href are deprecated. the xlink attributes on mathml elements: xlink:actuate, xlink:href, xlink:show and xlink:type are deprecated as well. name elements accepting attribute description accent <mo>, <mover>, <munderover> a boolean value specifying whether the operator should be treated as an accent. ...
...maximum size of the operator. unimplemented minlabelspacing <mtable> a length value specifing the minimum space between a label and the adjacent cell in the row. minsize <mo> the minimum size of the operator. movablelimits <mo> specifies whether attached under- and overscripts move to sub- and superscript positions. notation <menclose> a
list of notations, separated by white space, to apply to the child elements. numalign <mfrac> the alignment of the numerator over the fraction. open <mfenced> a string for the opening delimiter. unimplemented overflow <math> if an expression is too long to fit in the allowed width, this attribute sets the preferred handling. unimplemented positio...
Authoring MathML - MathML
mathematical notations are even more complex with structures like fractions, square roots or matrices that are likely to require their own tags. ...
...complex with structures like fractions, square roots or matrices that are likely to require their own tags. as a consequence, good mathml authoring tools are more important and we describe some tools below. in particular, the mozilla mathml team has been developing texzilla, a javascript unicode latex-to-mathml converter that is intended to be used in many scenarios described here. of course, the
list is by no means exhaustive and you are invited to check out the w3c mathml software
list where you can find various other tools. note that by design, mathml is well-integrated in html5 and in particular you can use usual web features like css, dom, javascript or svg. this is out of the scope of this document but anyone with basic knowledge of web languages will easily be able to mix these feature...
Privacy, permissions, and information security
depth about the various security and privacy features available to users on the web, let's define some important terms. personally identifiable information personally identifiable information (pii) is information which can be used, in whole or in part, to track down and/or identify a specific person. as such, pii extends beyond the web to all aspects of life. for example, if a site leaks a
list of users' names and zip codes online, a bad actor could almost certainly track down at least some percentage of those users by simply using the corresponding phone books. personally identification can include information like usernames, real names, passwords, phone numbers or addresses (or even portions of them), information about medical history, social security numbers, driver licenses, or an...
...ecurity and privacy breaches. these start at the web server, include the very communication layer used over the network, and then extend through the web browser's security offerings before reaching your web app code and the efforts it takes to secure itself and the data the user entrusts to it. there are several web technologies and features at play to manage privacy and security. the following
list includes features affecting both, since many of these features are used for both. web technologies and features used to enforce security and privacy technology or feature description certificate transparency an open standard for monitoring and auditing certificates, creating a database of public logs that can be used to help identify incorrect or malicious certificat...
Installing and uninstalling web apps - Progressive web apps (PWAs)
eans, and what you need to do as a developer to let your users take advantage of it. why installation? the option to install a web application is part of the progressive web app philosophy—giving web apps the same user experience advantages as native apps so they can be competitive. installed applications are more conveniently invoked as they have a presence in a device’s home screen or app
list or bar. this makes it simple for a user to use a gesture to access an app by tapping or clicking its icon. the application itself may then manifest as in a chromeless view (without the full browser chrome) but it nevertheless is executing effectively as a tab within the browser. for users, the experience of a seemingly-native pwa is more comfortable and convenient than a typical web site. by red...
...wser built into the device has some support for web applications, including support for the add to home screen feature. to add a web app to the home screen (also known as the launcher or springboard), tap the sharing button () at the bottom of the screen: this calls up the sharing panel. among the options should be the "add to home screen" option, unless it's been specifically removed from the
list by the user editing the optons displayed: choosing "add to home screen" here presents the confirmation dialog box, which not only confirms that the user wants to add the app to the home screen, but also lets the user customize its name. upon clicking "add," the app is included on the home screen. the installed web application regardless of which browser and device you're using, when you c...
PWA developer guide - Progressive web apps (PWAs)
<<<--- web app basics introduction and getting started with pwa development some description installing and uninstalling web apps an introductory guide to how a web app can be installed on the user's device... ...
...<<<--- web app basics introduction and getting started with pwa development some description installing and uninstalling web apps an introductory guide to how a web app can be installed on the user's device... ...
SVG Conditional Processing Attributes - SVG: Scalable Vector Graphics
ould be rendered. externalresourcesrequired requiredextensions requiredfeatures systemlanguage attributes externalresourcesrequired deprecated since svg 2 if set to true, it indicates that the browser must wait for all the external resources necessary to render that element to be loaded before processing the associated element. ...
...uired deprecated since svg 2 if set to true, it indicates that the browser must wait for all the external resources necessary to render that element to be loaded before processing the associated element. value: false|true; animatable: no requiredextensions
list all the browser specific capabilities that must be supported by the borwser to be allowed to render the associated element. value: a
list of space-separated uri; animatable: no requiredfeatures deprecated since svg 2
list all the features, as defined is the svg 1.1 specification, that must be supported by the borwser to be allowed to render the associated element.. value: a
list of space-separated uri; animatable: no systemlanguage indicates which language the user must have chosen to render the associated element. value: a l...
display - SVG: Scalable Vector Graphics
<rect x="20" y="20" width="60" height="60" fill="yellow"></rect> <!-- here the yellow rectangle is not displayed --> <rect x="120" y="0" width="100" height="100" fill="skyblue"></rect> <rect x="140" y="20" width="60" height="60" fill="yellow" display="none"></rect> </svg> usage notes default value inline value [ <display-outside> | <display-inside> ] | <display-
listitem> | <display-internal> | <display-box> | <display-legacy>where <display-outside> = block | inline | run-in<display-inside> = flow | flow-root | table | flex | grid | ruby<display-
listitem> = <display-outside>? && [ flow | flow-root ]? &&
list-item<display-internal> = table-row-group | table-header-group | table-footer-group | table-row | table-cell | table-column-group | table-column | table-c...
... specifications specification status comment scalable vector graphics (svg) 2the definition of 'display' in that specification. ...
kernelMatrix - SVG: Scalable Vector Graphics
the kernelmatrix attribute defines the
list of numbers that make up the kernel matrix for the <feconvolvematrix> element. values are separated by space characters and/or a comma. the number of entries in the
list must equal to <orderx> by <ordery> as defined in the order attribute. only one element is using this attribute: <feconvolvematrix> html, body, svg { height: 100%; } <svg viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <filter id="convolvematrix1" x="0" y="0" width="100%" height="100%"> <feconvolvematrix kernelmatrix="1 1 0 0 0 0 0 0 -1"/> </filter> <filter id="convolvematrix2" x="0" y="0" width="100%" height="100%"> <feconvolvematrix kernelmatrix="-1 0 0 0 0 0 0 0 1"/> </filter> <image xlink:href="//developer.mozilla.org/files/6457/mdn_logo_only_...
...0 0 0 1"/> </filter> <image xlink:href="//developer.mozilla.org/files/6457/mdn_logo_only_color.png" width="200" height="200" style="filter:url(#convolvematrix1);"/> <image xlink:href="//developer.mozilla.org/files/6457/mdn_logo_only_color.png" width="200" height="200" style="filter:url(#convolvematrix2); transform:translatex(220px);"/> </svg> usage notes value <
list of numbers> default value none animatable yes <
list of numbers> the
list of <number>s that make up the kernel matrix for the convolution. values are separated by space characters and/or a comma. the number of entries in the
list must equal <orderx> times <ordery>. if the result of orderx * ordery is not equal to the the number of entries in the value
list, th...
keyPoints - SVG: Scalable Vector Graphics
red"> <animatemotion dur="3s" repeatcount="indefinite" keypoints="0;0.5;1" keytimes="0;0.15;1" calcmode="linear"> <mpath xlink:href="#motionpath"/> </animatemotion> </circle> </svg> usage notes value <number> [; <number>]* ;? default value none animatable no <number> [; <number>] ;? ...
...ault value none animatable no <number> [; <number>] ;? this value defines a semicolon-separated
list of floating point values between 0 and 1 and indicates how far along the motion path the object shall move at the moment in time specified by corresponding keytimes value. the distance is calculated along the path specified by the path attribute. each progress value in the
list corresponds to a value in the keytimes attribute
list. if a
list of key points is specified, there must be exactly as many values in the keypoints
list as in the keytimes
list. if there's a semicolon at the end of the value, optionally followed by white space, both the semicolon and the trailing white space are ignored. if there are any errors in the value specification (i.e. bad values, too...
keySplines - SVG: Scalable Vector Graphics
this attribute is ignored unless the calcmode attribute is set to spline. if there are any errors in the keysplines specification (bad values, too many or too few values), the animation will not occur. ...
... <control-point> each control point description is a set of four values: x1 y1 x2 y2, describing the bézier control points for one time segment. the keytimes values that define the associated segment are the bézier "anchor points", and the keysplines values are the control points. thus, there must be one fewer sets of control points than there are keytimes. ...
patternTransform - SVG: Scalable Vector Graphics
the patterntransform attribute defines a
list of transform definitions that are applied to a pattern tile. only one element is using this attribute: <pattern> html,body,svg { height:100% } <svg viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <!-- apply a transform on the tile --> <pattern id="p1" width=".25" height=".25" patterntransform="rotate(20) skewx(30) scale(1 0.5)"> <circle cx="10" cy="10" r="10" /> </pattern> <!-- apply the transformed pattern tile --> <rect x="10" y="10" width="80" height="80" fill="url(#p1)" /> </svg> pattern for <pattern>, patterntransform defines a
list of transform definitions that are applied to a pattern tile. note: as of svg2, it is also allowe...
.../> </svg> pattern for <pattern>, patterntransform defines a
list of transform definitions that are applied to a pattern tile. note: as of svg2, it is also allowed to use the css transform property. however, the current state of implementation isn't very good. for backward compatibility reason, it is highly suggested to keep using the patterntransform attribute. 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. specifications specification status comment scalable vector graphics (svg) 2the definition of 'patterntransform' in that specification. candidate recommendation ...
string - SVG: Scalable Vector Graphics
the available types are: "woff", "woff2", "truetype", "opentype", "embedded-opentype", and "svg". see the src descriptor of the @font-face at-rule for more information. ...
... the available types are: "woff", "woff2", "truetype", "opentype", "embedded-opentype", and "svg". see the src descriptor of the @font-face at-rule for more information. ...
stroke-dasharray - SVG: Scalable Vector Graphics
thus, 5,3,2 is equivalent to 5,3,2,5,3,2. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contr...
...thus, 5,3,2 is equivalent to 5,3,2,5,3,2. ...
systemLanguage - SVG: Scalable Vector Graphics
the systemlanguage attribute represents a
list of supported language tags. this
list is matched against the language defined in the user preferences. 35 elements are using this attribute: <a>, <altglyph>, <animate>, <animatecolor>, <animatemotion>, <animatetransform>, <audio>, <canvas>, <circle>, <clippath>, <cursor>, <defs>, <discard>, <ellipse>, <foreignobject>, <g>, <iframe>, <image>, <line>, <mask>, <path>, <pattern>, <polygon>, <polyline>, <rect>, <set>, <svg>, <switch>, <text>, <textpath>, <tref>, <tspan>, <unknown>, <use>, and <video> usage notes value <language-tags> default value none animatable no <language-tags> the value is a set of comma-separated tokens, each of which must be a language-tag value, as defined in bcp 47. systemlan...
...t imply that if a user understands a language with a certain tag, that the user will also understand all languages with the tag as prefix. if the attribute is not present, then it implicitly evaluates to "true". if a null string or empty string value is given, the attribute evaluates to "false". the prefix rule simply allows the use of prefix tags if this is the case. multiple languages may be
listed for content that is intended for multiple audiences. for example, content that is presented simultaneously in the original maori and english versions, would call for: <text systemlanguage="mi, en"><!-- content goes here --></text> however, just because multiple languages are present within the object on which the systemlanguage test attribute is placed, this does not mean that it is intended ...
transform - SVG: Scalable Vector Graphics
html,body,svg { height:100% } <svg viewbox="-40 0 150 100" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <g fill="grey" transform="rotate(-10 50 100) translate(-36 45.5) skewx(40) scale(1 0.5)"> <path id="heart" d="m 10,30 a 20,20 0,0,1 50,30 a 20,20 0,0,1 90,30 q 90,60 50,90 q 10,60 10,30 z" /> </g> <use xlink:href="#heart" fill="none" stroke="red"/> </svg> note: as of svg2, transform is a presentation attribute, meaning it can be used as a css property. ...
...ircle>, <clippath>, <defs>, <ellipse>, <foreignobject>, <g>, <image>, <line>, <path>, <polygon>, <polyline>, <rect>, <switch>, <text>, and <use>). also, as a legacy from svg 1.1, <lineargradient> and <radialgradient> support the gradienttransform attribute, and <pattern> supports the patterntransform attribute, both of which act exactly like the transform attribute. 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. however, the compatibility isn't guaranteed. matrix the matrix(<a> <b> <c> <d> <e> <f>) transform function specifies a transformation in ...
<a> - SVG: Scalable Vector Graphics
user will be prompted to save it as a local file. value type: <string> ; default value: none; animatable: no href the url or url fragment the hyperlink points to. value type: <url> ; default value: none; animatable: yes hreflang the human language of the url or url fragment that the hyperlink points to. value type: <string> ; default value: none; animatable: yes ping a space-separated
list of urls to which, when the hyperlink is followed, post requests with the body ping will be sent by the browser (in the background). typically used for tracking. for a more widely-supported feature addressing the same use cases, see navigator.sendbeacon(). value type: <
list-of-urls> ; default value: none; animatable: no referrerpolicy which referrer to send when fetching the url. value type:...
... value type: _self|_parent|_top|_blank|<name> ; default value: _self; animatable: yes type a mime type for the linked url. value type: <string> ; default value: none; animatable: yes xlink:href deprecated since svg 2 the url or url fragment that the hyperlink points to. ...
<pattern> - SVG: Scalable Vector Graphics
e <pattern>. value type: userspaceonuse|objectboundingbox; default value: userspaceonuse; animatable: yes note: this attribute has no effect if a viewbox attribute is specified on the <pattern> element. patterntransform this attribute contains the definition of an optional additional transformation from the pattern coordinate system onto the target coordinate system. value type: <transform-
list>; default value: none; animatable: yes patternunits this attribute defines the coordinate system for attributes x, y, width , and height. value type: userspaceonuse|objectboundingbox; default value: objectboundingbox; animatable: yes preserveaspectratio this attribute defines how the svg fragment must be deformed if it is embedded in a container with a different aspect ratio. value type: (n...
...this attribute defines how the svg fragment must be deformed if it is embedded in a container with a different aspect ratio. value type: (none| xminymin| xmidymin| xmaxymin| xminymid| xmidymid| xmaxymid| xminymax| xmidymax| xmaxymax) (meet|slice)? ; default value: xmidymid meet; animatable: yes viewbox this attribute defines the bound of the svg viewport for the pattern fragment. value type: <
list-of-numbers> ; default value: none; animatable: yes width this attribute determines the width of the pattern tile. value type: <length>|<percentage> ; default value: 0; animatable: yes x this attribute determines the x coordinate shift of the pattern tile. value type: <length>|<percentage> ; default value: 0; animatable: yes xlink:href deprecated since svg 2 this attribute reference a temp...
SVG 1.1 Support in Firefox - SVG: Scalable Vector Graphics
tus of the native support. element notes structure module svg implemented. currentscale and currenttranslate dom attributes are implemented, but there is no pan and zoom user interface. svgsvgelement unimplemented attributes: contentscripttype, contentstyletype, viewport, currentview unimplemented bindings: getintersection
list, getenclosure
list, checkintersection, checkenclosure g implemented. defs implemented. desc implemented. only stored in the dom, no user interface. title implemented. the title is displayed as a tooltip when the mouse hovers over the svg object. ...
...5). conditional processing module switch implemented. image module image implemented. style module style implemented. shape module path implemented. svgpathelement interface unimplemented attributes: normalizedpathseg
list, animatednormalizedpathseg
list rect implemented. circle implemented. line implemented. ellipse implemented. polyline implemented. polygon implemented. text module text...
Texts - SVG: Scalable Vector Graphics
ont-weight="bold" fill="red">bold and red</tspan> </text> <style><![cdata[ text{ dominant-baseline: hanging; font: 28px verdana, helvetica, arial, sans-serif; } ]]></style> </svg> the tspan element has the following custom attributes: x set a new absolute x coordinate for the containing text. this overwrites the default current text position. the attribute may also contain a
list of numbers, that are one by one applied to the single characters of the tspan element. dx start drawing the text with a horizontal offset dx from the default current position. here, too, you may provide a
list of values that are applied to consecutive characters, hence piling up the offset over time. likewise, there are y and dy for vertical displacement. rotate rotate all characters by th...
...that are one by one applied to the single characters of the tspan element. dx start drawing the text with a horizontal offset dx from the default current position. here, too, you may provide a
list of values that are applied to consecutive characters, hence piling up the offset over time. likewise, there are y and dy for vertical displacement. rotate rotate all characters by this degree. a
list of numbers makes each character rotate to its respective value, with remaining characters rotating according to the last value. textlength this is a more obscure attribute giving the calculated length of the string. it is meant to allow the rendering engine to fine-tune the positions of the glyphs when its own measured text length doesn't meet the one provided here. textpath this element fet...
Mixed content - Web security
lace an image served over http with an inappropriate image or message to the user. the attacker could also infer information about the user's activities by watching which images are served to the user; often images are only served on a specific page within a website. if the attacker observes http requests to certain images, they could determine which webpage the user is visiting. passive content
list this section
lists all types of http requests which are considered passive content: <img> (src attribute) <audio> (src attribute) <video> (src attribute) <object> subresources (when an <object> performs http requests) mixed active content mixed active content is content that has access to all or parts of the document object model of the https page. this type of mixed content can alter t...
...ata exposed to that site may be. the webpage may have public data visible to the world or private data visible only when authenticated. if the webpage is public and has no sensitive data about the user, using mixed active content still provides the attacker with the opportunity to redirect the user to other http pages and steal http cookies from those sites. active content examples this section
lists some types of http requests which are considered active content: <script> (src attribute) <link> (href attribute) (this includes css stylesheets) <iframe> (src attribute) xmlhttprequest requests fetch() requests all cases in css where a <url> value is used (@font-face, cursor, background-image, and so forth). <object> (data attribute) navigator.sendbeacon (url attribute) other resour...
Web Components
syntax (see classes for more information). register your new custom element using the customelementregistry.define() method, passing it the element name to be defined, the class or function in which its functionality is specified, and optionally, what element it inherits from. if required, attach a shadow dom to the custom element using element.attachshadow() method. add child elements, event
listeners, etc., to the shadow dom using regular dom methods. if required, define an html template using <template> and <slot>. again use regular dom methods to clone the template and attach it to your shadow dom. use your custom element wherever you like on your page, just like you would any regular html element. tutorials using custom elements a guide showing how to use the features of custo...
...nt object in the case of the normal dom, or the shadowroot in the case of a shadow dom. event extensions extensions to the event interface related to shadow dom: event.composed: returns a boolean which indicates whether the event will propagate across the shadow dom boundary into the standard dom (true), or not (false). event.composedpath: returns the event’s path (objects on which
listeners will be invoked). this does not include nodes in shadow trees if the shadow root was created with shadowroot.mode closed. html templates <template> contains an html fragment that is not rendered when a containing document is initially loaded, but can be displayed at runtime using javascript, mainly used as the basis of custom element structures. the associated dom interface is html...
Functions - XPath
for further information on using xpath/xslt functions, please see the for further reading page. ...
...for further information on using xpath/xslt functions, please see the for further reading page. ...
<xsl:output> - XSLT: Extensible Stylesheet Language Transformations
trols the characteristics of the output document. to function correctly in netscape, this element, with the method attribute, must be used. as of 7.0, method="text" works as expected. syntax <xsl:output method="xml" | "html" | "text" version=string encoding=string omit-xml-declaration="yes" | "no" standalone="yes" | "no" doctype-public=string doctype-system=string cdata-section-elements=
list-of-names indent="yes" | "no" media-type=string /> required attributes none. optional attributes method specifies output format. version specifies the value of the version attribute of the xml or html declaration in the output document. this attribute is only used when method="html" or method="xml". encoding specifies the value of the encoding attribute in the output document. ...
...resent, indicates that a standalone declaration should occur in the output document and gives its value. acceptable values are "yes" or "no". doctype-public specifies the value of the public attribute of the doctype declaration in the output document. doctype-system specifies the value of the system attribute of the doctype declaration in the output document. cdata-section-elements
lists elements whose text contents should be written as cdata sections. elements should be whitespace separated. indent (not supported.) specifies if the output should be indented to indicate its hierarchic structure. media-type (not supported.) specifies the output document mime type. type top-level, must be the child <xsl:stylesheet> or <xsl:transform>. defined xslt, section 16. geck...
<xsl:stylesheet> - XSLT: Extensible Stylesheet Language Transformations
eet> element (or the equivalent <xsl:transform> element) is the outermost element of a stylesheet. namespace declaration a pseudo-attribute required to identify the document as an xslt stylesheet. typically this is xmlns:xsl="http://www.w3.org/1999/xsl/transform". syntax <xsl:stylesheet version="number" xmlns:xsl="http://www.w3.org/1999/xsl/transform" id="name" extension-element-prefixes="
list-of-names" exclude-result-prefixes="
list-of-names"> entire stylesheet </xsl:stylesheet> required attributes version specifies the version of xslt required by this stylesheet. optional attributes exclude-result-prefixes specifies any namespace used in this document that should not be sent to the output document. the
list is whitespace separated. extension-element-prefixes specifies ...
... default-collation specifies the default collation used by all xpath expressions appearing in attributes or text value templates that have the element as an ancestor, unless overridden by another default-collation attribute on an inner element. ...
Web technology for developers
the open web presents incredible opportunities for developers. to take full advantage of these technologies, you need to know how to use them. below you'll find links to our web technology documentation. documentation for web developers web developer reference a
list of all references for web technologies, including those for html, css, and so on. web developer guide the web developer guide provides useful how-to content to help you actually use web technologies to do what you want or need to do. tutorials for web developers a
list of tutorials to take you step-by-step through learning apis, technologies, or broad topic areas. developing web applications documentation for web application developers; web apps are true write-once, deploy anywhere apps for mobile, desktop, an...
...many of these samples can also be used in xulrunner applications, as well as in actual mozilla code itself. view all... ...
Compiling a New C/C++ Module to WebAssembly - WebAssembly
let's look at how this works. to start with, save the following code as hello3.c in a new directory: #include <stdio.h> #include <emscripten/emscripten.h> int main(int argc, char ** argv) { printf("hello world\n"); } #ifdef __cplusplus extern "c" { #endif voi...
... our new myfunction() function from javascript. first of all, open up your hello3.html file in a text editor. add a <button> element as shown below, just above the first opening <script type='text/javascript'> tag. <button class="mybutton">run myfunction</button> now add the following code at the end of the first <script> element: document.queryselector('.mybutton') .addevent
listener('click', function() { alert('check console'); var result = module.ccall( 'myfunction', // name of c function null, // return type null, // argument types null // arguments ); }); this illustrates how ccall() is used to call the exported function. ...