Search completed in 2.21 seconds.
3695 results for "DOM":
Your results are loading. Please wait...
DOMPoint.DOMPoint() - Web APIs
WebAPIDOMPointDOMPoint
the dompoint() constructor creates and returns a new dompoint object, given the values for some or all of its properties.
... you can also create a dompoint by calling the dompoint.frompoint() static function.
... that function accepts as input a dompointinit compatible object, including a dompoint or dompointreadonly.
...And 6 more matches
DOMRect.DOMRect() - Web APIs
WebAPIDOMRectDOMRect
the domrect() constructor creates a new domrect object.
... syntax var mydomrect = new domrect(x, y, width, height); parameters x the x coordinate of the domrect's origin.
... y the y coordinate of the domrect's origin.
...And 3 more matches
Mozilla DOM Hacking Guide
mozilla gives you the opportunity not only to use very powerful and complete dom support, but also to work on a world-class implementation of one of the greatest internet technologies ever created.
... mozilla's dom is coded almost entirely in c++.
...in this document i will try to outline the main aspects of the implementation, beginning with the class info mechanism, which lies at the heart of the dom, then with the description of various interfaces and classes.
...And 137 more matches
nsIDOMWindowUtils
dom/interfaces/base/nsidomwindowutils.idlscriptable this interface is a dom utility interface that provides useful dom methods and attributes.
...to get this interface, use: var domwindowutils = window.windowutils; method overview void activatenativemenuitemat(in astring indexstring); void clearmozafterpaintevents(); pruint32 comparecanvases(in nsidomhtmlcanvaselement acanvas1, in nsidomhtmlcanvaselement acanvas2, out unsigned long amaxdifference); double computeanimationdistance(in nsidomelement element, in astring property, in astring value1, in astring value2); nsicompositionstringsynthesizer createcompositionstringsynthesizer(); obsolete since gecko 38.0 void disablenontestmouseevents(...
...in boolean adisable); boolean dispatchdomeventviapresshell(in nsidomnode atarget, in nsidomevent aevent, in boolean atrusted); 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 nsicyclecollectorlistener alistener); short getcursortype(); astring getdocumentmetadata(in astring aname); nsidomwindow getouterwindowwithid(in unsigned long long aouterwindowid); long getpccountscriptcount(); astring getpccountscr...
...And 63 more matches
Introduction to the DOM - Web APIs
the document object model (dom) is the data representation of the objects that comprise the structure and content of a document on the web.
... in this guide, we'll briefly introduce the dom.
... we'll look at how the dom represents an html or xml document in memory and how you use apis to create web content and applications.
...And 48 more matches
Introduction to XPCOM for the DOM
warning: this document has not yet been reviewed by the dom gurus, it might contain some errors.
... this document is an introduction to the use of xpcom in the context of the dom code.
... the use of xpcom and nscomptr's described in this document covers about 80% of what you need to know to read the dom code, and even write some.
...And 44 more matches
What is a Domain Name? - Learn web development
objective: learn what domain names are, how they work, and why they are important.
... summary domain names are a key part of the internet infrastructure.
... to solve all those problems we use human-readable addresses called domain names.
...And 35 more matches
Introduction to DOM Inspector - Firefox Developer Tools
the dom inspector is a mozilla extension that you can access from the tools > web development menu in seamonkey, or by selecting the dom inspector menu item from the tools menu in firefox and thunderbird, 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.
...And 35 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(); nsidomnodelist getelementsbyattribute(in domstring name, in domstring value); nsidomnodelist 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.
... classname domstring gets/sets the value of the element's class attribute.
...And 29 more matches
Internationalized Domain Names (IDN) Support in Mozilla Browsers
introduction netscape 7.1 is the first commercial browser that has built-in support for internationalized domain name under the new ietf rfc's established in 2003.
... an internationalized domain name (idn) is a domain/host name which uses non-ascii characters.
... until recently domain names allowed only a subset of 7-bit ascii characters.
...And 27 more matches
nsIDOMWindowInternal
dom/interfaces/base/nsidomwindowinternal.idlscriptable this interface is part of a chain of interfaces used to represent a window in the dom.
... 66 introduced gecko 1.0 deprecated gecko 8.0 inherits from: nsidomwindow last changed in gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4) in gecko 8.0 this interface was merged into the nsidomwindow interface.
...add-ons should be updated to use nsidomwindow instead.
...And 25 more matches
DOMMatrixReadOnly - Web APIs
the dommatrixreadonly interface represents a read-only 4×4 matrix, suitable for 2d and 3d operations.
... the dommatrix interrface—which is based upon dommatrixreadonly—adds mutability, allowing you to alter the matrix after creating it.
... dommatrixreadonly.flipx() returns a new dommatrix created by flipping the source matrix around its x-axis.
...And 24 more matches
dominant-baseline - SVG: Scalable Vector Graphics
the dominant-baseline attribute specifies the dominant baseline, which is the baseline used to align the box’s text and inline-level contents.
...a scaled-baseline-table is a compound value with three components: a baseline-identifier for the dominant-baseline, a baseline-table, and a baseline-table font-size.
... note: as a presentation attribute, dominant-baseline can be used as a css property.
...And 24 more matches
nsIDOMWindow
dom/interfaces/base/nsidomwindow.idlscriptable this interface is the primary interface for a window object.
... 66 introduced gecko 1.0 deprecated gecko 44 inherits from: nsisupports last changed in gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4) starting with firefox 44, this file is empty as its features were either no longer used or are only available from c++ code; see dom/base/nspidomwindow.h for those.
... while this interface is not officially defined by any standard bodies, it originates from the de-facto dom level 0 standard.
...And 22 more matches
DOMMatrix - Web APIs
WebAPIDOMMatrix
the dommatrix interface represents 4×4 matrices, suitable for 2d and 3d operations including rotation and translation.
... it is a mutable version of the dommatrixreadonly interface.
... constructor dommatrix() creates and returns a new dommatrix object.
...And 22 more matches
inIDOMUtils
layout/inspector/inidomutils.idlscriptable dom utility functions.
... inherits from: nsisupports last changed in gecko 22.0 (firefox 22.0 / thunderbird 22.0 / seamonkey 2.19) implemented by: @mozilla.org/inspector/dom-utils;1 as a service: var inidomutils = components.classes["@mozilla.org/inspector/dom-utils;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); nsidomnodelist 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 domstring apseudo); nsidomnode getparentfornode(in nsidomnode anode, in boolean ashowinganonymouscontent); unsigned long getruleline(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); nsidomfontfacelist getusedfon...
...And 21 more matches
nsIDOMMozNetworkStatsManager
please check dom/network/interfaces/nsidomnetworkstatsmanager.idl to make sure this data is accurate.
... dom/network/interfaces/nsidomnetworkstatsmanager.idlscriptable interface that provides access to network usage statistics.
...to create an instance, use: var networkstatsmanager = components.classes["@mozilla.org/networkstatsmanager;1"] .createinstance(components.interfaces.nsidomnetworkstatsmanager); furthermore, the networkstatsmanager is published through a moznetworkstats child object within the navigator object.
...And 20 more matches
DOM Inspector internals - Firefox Developer Tools
there are three main facets to dom inspector.
...this is the two-pane inspector that appears when ctrl+shift+i (or cmd+shift+i) is pressed from one of the applications for which dom inspector has explicit support (i.e., menuitems placed via overlay).
... besides the dom inspector's primary ui, there are a couple other top-level inspectors which differ slightly (the object inspector and dom inspector sidebar used in seamonkey).
...And 20 more matches
Using shadow DOM - Web Components
the shadow dom api is a key part of this, providing a way to attach a hidden separated dom to an element.
... this article covers the basics of using the shadow dom.
... note: shadow dom is supported by default in firefox (63 and onwards), chrome, opera, and safari.
...And 20 more matches
Using the W3C DOM - Archive of obsolete content
some browsers have non-standard properties, such as internet explorer's document.all[], that are not part of the w3c document object model (dom) standards and may cause javascript errors in standards-compliant browsers.
... the w3c document object model provides interfaces dom elements to scriptable objects.
... w3c dom standards are well supported by modern browsers, however the standards are moving target so support for newer features should be tested before use.
...And 19 more matches
nsIDOMNSHTMLDocument
dom/interfaces/html/nsidomnshtmldocument.idlscriptable this interface defines methods and properties supported by gecko on the document object that are not part of dom level 2.
... inherits from: nsisupports last changed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) method overview void captureevents(in long eventflags); void clear(); boolean execcommand(in domstring commandid, in boolean doshowui, in domstring value); boolean execcommandshowhelp(in domstring commandid); obsolete since gecko 14.0 domstring getselection(); nsidomdocument open(in acstring acontenttype, in boolean areplace); boolean querycommandenabled(in domstring commandid); boolean querycommandindeterm(in domstring commandid); boolean querycommandstate(in domstring commandid); boolean querycommandsupported(in domstring commandid); domstring querycommandtext(in domstring commandid); obso...
...lete since gecko 14.0 domstring querycommandvalue(in domstring commandid); void releaseevents(in long eventflags); void routeevent(in nsidomevent evt); void write(); obsolete since gecko 2.0 void writeln(); obsolete since gecko 2.0 attributes attribute type description alinkcolor domstring same as body.alink bgcolor domstring same as body.bgcolor compatmode domstring returns "backcompat" if the document is in quirks mode or "css1compat" if the document is in full standards or almost standards mode.
...And 18 more matches
JavaScript-DOM Prototypes in Mozilla
prototype setup on an xpconnect wrapped dom node in mozilla when a dom node is accessed from javascript in mozilla, the native c++ dom node is wrapped using xpconnect and the wrapper is exposed to javascript as the javascript representation of the dom node.
... var obj = document.images[0]; here, obj will not really have any properties (except for the standard jsobject properties such as constructor, and the non-standard __parent__, __proto__, etc.), all the dom functionality of obj comes from obj's prototype (obj.__proto__) that xpconnect sets up when exposing the first image in document to javascript.
...one of these interfaces is nsidomhtmlimageelement, others are nsidomnshtmlimageelement (netscape extensions to the standard interface), nsidomeventtarget, nsidomeventlistener, nsidom3node, and so on.
...And 17 more matches
nsIDOMElement
dom/interfaces/core/nsidomelement.idlscriptable this interface 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); nsidomnodelist getelementsbytagname(in domstring name); nsidomnodelist 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 dom...
...string name, in domstring value) nsidomattr setattributenode(in nsidomattr newattr) nsidomattr setattributenodens(in nsidomattr newattr) void setattributens(in domstring namespaceuri, in domstring qualifiedname, in domstring value) attributes attribute type description tagname domstring the element tag name.
...And 17 more matches
Dominators view - Firefox Developer Tools
the dominators view is new in firefox 46.
... starting in firefox 46, the memory tool includes a new view called the dominators view.
... if you already know what shallow size, retained size, and dominators are, skip to the dominators ui section.
...And 16 more matches
The HTML DOM API - Web APIs
the html dom api is made up of the interfaces that define the functionality of each of the elements in html, as well as any supporting types and interfaces they rely upon.
... the functional areas included in the html dom api include: access to and control of html elements via the dom.
... html dom concepts and usage in this article, we'll focus on the parts of the html dom that involve engaging with html elements.
...And 16 more matches
Subdomain takeovers - Web security
a subdomain takeover occurs when an attacker gains control over a subdomain of a target domain.
... typically, this happens when the subdomain has a canonical name (cname) in the domain name system (dns), but no host is providing content for it.
...an attacker can take over that subdomain by providing their own virtual host and then hosting their own content for it.
...And 16 more matches
DOMTokenList - Web APIs
the domtokenlist interface represents a set of space-separated tokens.
...domtokenlist is always case-sensitive.
... properties domtokenlist.length read only is an integer representing the number of objects stored in the object.
...And 15 more matches
Appendix E: DOM Building and Insertion (HTML & XUL) - Archive of obsolete content
many add-ons need to dynamically generate dom content, either xul or html, from their scripts.
... building dom trees in most cases, dom trees should be built exclusively with dom creation methods.
... the following methods will all safely create a dom tree without risk of remote execution.
...And 12 more matches
nsIDOMNode
dom/interfaces/core/nsidomnode.idlscriptable this interface is the primary datatype for the entire document object model.
... inherits from: nsisupports last changed in gecko 0.9.6 method overview nsidomnode appendchild(in nsidomnode newchild) nsidomnode clonenode(in boolean deep); boolean hasattributes(); boolean haschildnodes(); nsidomnode insertbefore(in nsidomnode newchild, in nsidomnode refchild) boolean issupported(in domstring feature, in domstring version); void normalize(); nsidomnode removechild(in nsidomnode oldchild) nsidomnode replacechild(in nsidomnode newchild, in nsidomnode oldchild) attributes attribute type description attributes nsidomnamednodemap read only.
... childnodes nsidomnodelist read only.
...And 12 more matches
nsIDOMOfflineResourceList
the nsidomofflineresourcelist interface provides access to the application cache that allows web content's resources to be cached locally for use while offline.
... dom/interfaces/offline/nsidomofflineresourcelist.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 attribute type description mozitems nsidomofflineresourcelist the list of dynamically-managed entries in the offline resource list.
...And 12 more matches
nsIDOMEvent
dom/interfaces/events/nsidomevent.idlscriptable this interface is the primary data type for all events in the document object model.
... inherits from: nsisupports last changed in gecko 16.0 (firefox 16.0 / thunderbird 16.0 / seamonkey 2.13) note: as of gecko 16.0, the nsiprivatedomevent interface was merged into this interface.
... nseventptr getinternalnsevent(); violates the xpcom interface guidelines boolean getpreventdefault(); deprecated since gecko 16.0 void initevent(in domstring eventtypearg, in boolean canbubblearg, in boolean cancelablearg); boolean isdispatchstopped(); violates the xpcom interface guidelines void preventbubble(); obsolete since gecko 24 void preventcapture(); obsolete since gecko 24 void preventdefault(); void serialize(in ipcmessageptr amsg, in boolean aserializeinterfacetype); violates the xpcom in...
...And 11 more matches
DOMParser - Web APIs
WebAPIDOMParser
the domparser interface provides the ability to parse xml or html source code from a string into a dom document.
... you can perform the opposite operation—converting a dom tree into xml or html source—using the xmlserializer interface.
... in the case of an html document, you can also replace portions of the dom with new dom trees built from html by setting the value of the element.innerhtml and outerhtml properties.
...And 11 more matches
DOMPoint - Web APIs
WebAPIDOMPoint
a dompoint object represents a 2d or 3d point in a coordinate system; it includes values for the coordinates in up to three dimensions, as well as an optional perspective value.
... dompoint is based on dompointreadonly but allows its properties' values to be changed.
... constructor dompoint() creates and returns a new dompoint object given the values of zero or more of its coordinate components and optionally the w perspective value.
...And 11 more matches
Using the W3C DOM Level 1 Core - Web APIs
the w3c's dom level 1 core is an api for manipulating the dom trees of html and xml documents (among other tree-like types of documents).
... due to the ubiquity of the dom, this api is supported in all major browsers, including mozilla firefox and microsoft internet explorer, and serves as a base for scripting on the web.
... what is a dom tree?
...And 11 more matches
XDomainRequest - Web APIs
xdomainrequest is an implementation of http access control (cors) that worked in internet explorer 8 and 9.
... syntax var xdr = new xdomainrequest(); returns a new xdomainrequest object, which can then be used to make and manage these requests.
... properties xdomainrequest.timeout gets or sets the amount of time until a request times out.
...And 11 more matches
nsIDOMGeoPositionAddress
dom/interfaces/geolocation/nsidomgeopositionaddress.idlscriptable this interface describes the geographical address of a location, including street, city, and country information, for example.
... 1.0 66 introduced gecko 1.9.2 obsolete gecko 14.0 inherits from: nsisupports last changed in gecko 11 (firefox 11 / thunderbird 11 / seamonkey 2.8) this object is obtained from an nsidomgeopositionaddress object via its address attribute.
... note: this needs to be moved into the dom reference.
...And 10 more matches
DOM Inspector - Firefox Developer Tools
the dom inspector (also known as domi) is a developer tool used to inspect, browse, and edit the document object model of documents - usually web pages or xul windows.
... the dom hierarchy can be navigated using a two-paned window that allows a variety of different views on the document and all nodes within.
...if you are looking for the dom inspector that's built into firefox, see the documentation for the page inspector.
...And 10 more matches
Crypto.getRandomValues() - Web APIs
the crypto.getrandomvalues() method lets you get cryptographically strong random values.
... the array given as the parameter is filled with random numbers (random in its cryptographic meaning).
... to guarantee enough performance, implementations are not using a truly random number generator, but they are using a pseudo-random number generator seeded with a value with enough entropy.
...And 10 more matches
DOMRect - Web APIs
WebAPIDOMRect
a domrect represents a rectangle.
... the type of box represented by the domrect is specified by the method or property that returned it.
... it inherits from its parent, domrectreadonly.
...And 10 more matches
Traversing an HTML table with JavaScript and DOM Interfaces - Web APIs
introduction this article is an overview of some powerful, fundamental dom level 1 methods and how to use them from javascript.
...the dom methods presented here are not specific to html; they also apply to xml.
... the dom methods presented here are part of the document object model (core) level 1 specification.
...And 10 more matches
HTML to DOM - Archive of obsolete content
although you can now natively parse html using domparser and xmlhttprequest, this is a new feature that is not yet supported by all browsers in use in the wild.
... safely parsing simple html to dom when using xmlhttprequest to get the html of a remote webpage, it is often advantageous to turn that html string into dom for easier manipulation.
... the function below will safely parse simple html and return a dom object which can be manipulated like web page elements.
...And 9 more matches
DOMPointReadOnly - Web APIs
the dompointreadonly interface specifies the coordinate and perspective fields used by dompoint to define a 2d or 3d point in a coordinate system.
... there are two ways to create a new dompointreadonly instance.
... first, you can use its constructor, passing in the values of the parameters for each dimension and, optionally, the perspective: /* 2d */ const point = new dompointreadonly(50, 50); /* 3d */ const point = new dompointreadonly(50, 50, 25); /* 3d with perspective */ const point = new dompointreadonly(100, 100, 100, 1.0); the other option is to use the static dompointreadonly.frompoint() method: const point = dompointreadonly.frompoint({x: 100, y: 100, z: 50; w: 1.0}); constructor dompointreadonly() creates a new dompointreadonly object given the values of its coordinates and perspective.
...And 9 more matches
Math.random() - JavaScript
the math.random() function returns a floating-point, pseudo-random number in the range 0 to less than 1 (inclusive of 0, but not 1) with approximately uniform distribution over that range — which you can then scale to your desired range.
... the implementation selects the initial seed to the random number generation algorithm; it cannot be chosen or reset by the user.
... math.random() does not provide cryptographically secure random numbers.
...And 9 more matches
Math.random() - JavaScript
the math.random() function returns a floating-point, pseudo-random number in the range 0 to less than 1 (inclusive of 0, but not 1) with approximately uniform distribution over that range — which you can then scale to your desired range.
... the implementation selects the initial seed to the random number generation algorithm; it cannot be chosen or reset by the user.
... math.random() does not provide cryptographically secure random numbers.
...And 9 more matches
Appendix F: Monitoring DOM changes - Archive of obsolete content
dom mutation events were introduced to html several years ago in order to allow web applications to monitor changes to the dom by other scripts.
...event listeners for those events are the preferred method for detecting dom modifications when feasible.
... monkey patching in many instances, especially when dealing with chrome code, the best way to modify actions which result in dom mutations is by wrapping the functions that trigger those changes.
...And 8 more matches
nsIDOMGeoGeolocation
summary the nsidomgeogeolocation interface provides access to geolocation information.
... dom/interfaces/geolocation/nsidomgeogeolocation.idlscriptable please add a summary to this article.
...starting in gecko 1.9.2, you can access this service using: var geolocation = components.classes["@mozilla.org/geolocation;1"] .getservice(components.interfaces.nsidomgeogeolocation); note: if nsidgeogeolocation throws an exception when importing, try using this: var geolocation = components.classes["@mozilla.org/geolocation;1"] .getservice(components.interfaces.nsisupports); method overview void clearwatch(in unsigned short watchid); void getcurrentposition(in nsidomgeopositioncallback successcallback, [optional] in nsidomgeopositionerrorc...
...And 8 more matches
nsIDOMParser
note: if you're a web developer, please refer to the domparser documentation instead.
... creating a domparser to create a domparser object from a web page or a chrome script running in a window, simply use new domparser().
... when you create a domparser from a privileged script, you can pass parameters to the constructor, more on that below.
...And 8 more matches
DOMRectReadOnly - Web APIs
the domrectreadonly interface specifies the standard properties used by domrect to define a rectangle whose properties are immutable.
... constructor domrectreadonly() defined to create a new domrectreadonly object.
... properties domrectreadonly.x read only the x coordinate of the domrect's origin.
...And 8 more matches
Document Object Model (DOM) - Web APIs
the document object model (dom) connects web pages to scripts or programming languages by representing the structure of a document—such as the html representing a web page—in memory.
... the dom represents a document with a logical tree.
...dom methods allow programmatic access to the tree.
...And 8 more matches
Domain - MDN Web Docs Glossary: Definitions of Web-related terms
a domain is an authority within the internet that controls its own resources.
... its "domain name" is a way to address this authority as part of the hierarchy in a url - usually the most memorable part of it, for instance a brand name.
... a fully qualified domain name (fqdn) contains all necessary parts to look up this authority by name unambigously using the dns system of the internet.
...And 7 more matches
PR_GetRandomNoise
produces a random value for use as a seed value for another random number generator.
... syntax #include <prrng.h> nspr_api(prsize) pr_getrandomnoise( void *buf, prsize size ); parameters the function has these parameters: buf a pointer to a caller-supplied buffer to contain the generated random number.
... size the size, in bytes, of the requested random number.
...And 7 more matches
nsIDOMFontFace
layout/inspector/public/nsidomfontface.idlscriptable describes a single font face.
...it's returned in a list you can get using inidomutils.getusedfontfaces().
... attribute type description cssfamilyname domstring a family name that could be used in css font-family (not necessarily the actual name that was used, due to aliases, generics, localized names, and so on).
...And 7 more matches
nsIDOMStorage
dom/interfaces/storage/nsidomstorage.idlscriptable this interface represents the storage space used for session storage in the dom.
... 1.0 66 introduced gecko 1.8.1 inherits from: nsisupports last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) a dom window's session storage object can be retrieved from the window's sessionstorage attribute.
...method overview void clear(); domstring getitem(in domstring key); domstring key(in unsigned long index); void removeitem(in domstring key); void setitem(in domstring key, in domstring data); attributes attribute type description length unsigned long the number of keys stored in the session store.
...And 7 more matches
nsIDOMXPathEvaluator
dom/interfaces/xpath/nsidomxpathevaluator.idlscriptable this interface is used to evaluate xpath expressions against a dom node.
... inherits from: nsisupports last changed in gecko 1.7 implemented by: @mozilla.org/dom/xpath-evaluator;1.
... to create an instance, use: var domxpathevaluator = components.classes["@mozilla.org/dom/xpath-evaluator;1"] .createinstance(components.interfaces.nsidomxpathevaluator); method overview nsidomxpathexpression createexpression(in domstring expression, in nsidomxpathnsresolver resolver) nsidomxpathnsresolver creatensresolver(in nsidomnode noderesolver); nsisupports evaluate(in domstring expression, in nsidomnode contextnode, in nsidomxpathnsresolver resolver, in unsigned short type, in nsisupports result) methods createexpression() creates an nsidomxpathexpression which can then be used for (repeated) evaluations.
...And 7 more matches
DOMQuad - Web APIs
WebAPIDOMQuad
a domquad is a collection of four dompoints defining the corners of an arbitrary quadrilateral.
... returning domquads lets getboxquads() return accurate information even when arbitrary 2d or 3d transforms are present.
... it has a handy bounds attribute returning a domrectreadonly for those cases where you just want an axis-aligned bounding rectangle.
...And 7 more matches
Document: DOMContentLoaded event - Web APIs
the domcontentloaded event fires when the initial html document has been completely loaded and parsed, without waiting for stylesheets, images, and subframes to finish loading.
...it is a common mistake to use load where domcontentloaded would be more appropriate.
... synchronous javascript pauses parsing of the dom.
...And 7 more matches
nsIDOMStorage2
the nsidomstorage2 interface represents the storage space used for local storage in the dom.
...a dom window's local storage object can be retrieved from the window's localstorage attribute.
... dom/public/idl/storage/nsidomstorage2.idlscriptable please add a summary to this article.
...And 6 more matches
nsIDOMXPathResult
dom/interfaces/xpath/nsidomxpathresult.idlscriptable this interface describes an xpath result returned by nsidomxpathevaluator or document.evaluate inherits from: nsisupports last changed in gecko 1.7 method overview nsidomnode iteratenext(); nsidomnode snapshotitem(in unsigned long index); attributes attribute type description booleanvalue boolean if resulttype is boolean_type, the boolean value.
... singlenodevalue nsidomnode if resulttype is any_unordered_node_type or first_ordered_node_type, a single dom node.
... stringvalue domstring if resulttype is string_type, the boolean value.
...And 6 more matches
DOM Property Viewer - Firefox Developer Tools
the dom property viewer is new in firefox 48.
... the dom property viewer lets you inspect the properties of the dom as an expandable tree structure, starting from the window object of the current page or the selected iframe.
... enabling the dom property viewer the dom property viewer is not enabled by default.
...And 6 more matches
DOMImplementation - Web APIs
the domimplementation interface represents an object providing methods which are not dependent on any particular document.
... domimplementation.createdocument() creates and returns an xmldocument.
... domimplementation.createdocumenttype() creates and returns a documenttype.
...And 6 more matches
DOMPointInit - Web APIs
the dompointinit dictionary is used to provide the values of the coordinates and perspective when creating and jsonifying a dompoint or dompointreadonly object.
... it's used as an input parameter to the dompoint/dompointreadonly method frompoint().
... properties dompointinit.x an unrestricted floating-point value indicating the x-coordinate of the point in space.
...And 6 more matches
Examples of web and XML development using the DOM - Web APIs
this chapter provides some longer examples of web and xml development using the dom.
...20px-wide" onclick="setborderwidth(20);" /> <input type="button" value="make border 5px-wide" onclick="setborderwidth(5);" /> </form> </body> </html> example 3: manipulating styles in this simple example, some basic style properties of an html paragraph element are accessed using the style object on the element and that object's css style properties, which can be retrieved and set from the dom.
...les[j].selectortext + "\n" ); } } for a document with a single stylesheet in 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.
...And 6 more matches
Domain sharding - MDN Web Docs Glossary: Definitions of Web-related terms
browsers limit the number of active connections for each domain.
... to enable concurrent downloads of assets exceeding that limit, domain sharding splits content across multiple subdomains.
... when multiple domains are used to serve multiple assets, browsers are able to download more resources simultaneously, resulting in a faster page load time and improved user experience.
...And 5 more matches
nsIDOMStorageEventObsolete
dom/interfaces/storage/nsidomstorageeventobsolete.idlscriptable this interface represents an event that occurs to notify interested parties about changes to the contents of a dom storage space; it is used for both session storage and local storage.
... 1.0 66 introduced gecko 1.8 obsolete gecko 2.0 inherits from: nsidomevent last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) when a dom storage event is received, the recipient can check its domain attribute to determine which domain's data store has changed.
... if the value of the domain attribute is "#session", then the session storage has changed.
...And 5 more matches
nsIDOMStorageManager
dom/interfaces/storage/nsidomstoragemanager.idlscriptable this interface provides methods for managing data stored in the offline apps cache.
... 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) implemented by @mozilla.org/dom/storagemanager;1 as a service: var domstoragemanager = components.classes["@mozilla.org/dom/storagemanager;1"] .getservice(components.interfaces.nsidomstoragemanager); method overview void clearofflineapps(); nsidomstorage getlocalstorageforprincipal(in nsiprincipal aprincipal, in domstring adocumenturi); long getusage(in astring aownerdomain); methods clearofflineapps() clears keys owned by offline applications.
... all data owned by a domain with the "offline-app" permission is removed from the database.
...And 5 more matches
DOM Inspector FAQ - Firefox Developer Tools
inspect a url this just focuses the dom inspector's address bar, which allow you to inspect arbitrary documents which can be accessed via a url.
... why do some nodes in the document dom nodes viewer appear in red?
... these nodes are anonymous content nodes, meaning they are not in the dom generated by the original document.
...And 5 more matches
DOMException - Web APIs
the domexception interface represents an abnormal event (called an exception) that occurs as a result of calling a method or accessing a property of a web api.
... constructor domexception() returns a domexception object with a specified message and name.
... properties domexception.code read only returns a short that contains one of the error code constants, or 0 if none match.
...And 5 more matches
DOMLocator - Web APIs
returned by domerror.location.
... properties domlocator.linenumber read only returns a positive integer or -1.
... domlocator.columnnumber read only returns a positive integer or -1.
...And 5 more matches
DOMPoint.fromPoint() - Web APIs
the static dompoint method frompoint() creates and returns a new mutable dompoint object given a source point.
... the source point is specified as a dompointinit-compatible object, which includes both dompoint and dompointreadonly.
... you can also create a new dompoint object using the new dompoint() constructor.
...And 5 more matches
How whitespace is handled by HTML, CSS, and in the DOM - Web APIs
the presence of whitespace in the dom can cause layout problems and make manipulation of the content tree difficult in unexpected ways, depending on where it is located.
... any whitespace characters that are outside of html elements in the original document are represented in the dom.
... take the following document, for example: <!doctype html> <html> <head> <title>my document</title> </head> <body> <h1>header</h1> <p> paragraph </p> </body> </html> the dom tree for this looks like so: conserving whitespace characters in the dom is useful in many ways, but there are certain places where this makes certain layouts more difficult to implement, and causes problems for developers who want to iterate through nodes in the dom.
...And 5 more matches
Cross-domain Content Scripts - Archive of obsolete content
by default, content scripts don't have any cross-domain privileges.
... in particular, they can't: access content hosted in an iframe, if that content is served from a different domain make cross-domain xmlhttprequests however, you can enable these features for specific domains by adding them to your add-on's package.json under the "cross-domain-content" key, which itself lives under the "permissions" key: "permissions": { "cross-domain-content": ["http://example.org/", "http://example.com/"] } the domains listed must include the scheme and fully qualified domain name, and these must exactly match the domains serving the content - so in the example above, the content script will not be allowed to access content served from https://example.com/.
... cross-domain iframes the following "main.js" creates a page-worker which loads a local html file called "page.html", attaches a content script called "page.js" to the page, waits for messages from the script, and logs the payload.
...And 4 more matches
FC_GenerateRandom
name fc_generaterandom - generate a random number.
... syntax ck_rv fc_generaterandom( ck_session_handle hsession, ck_byte_ptr prandomdata, ck_ulong ulrandomlen ); parameters hsession [in] session handle.
... prandomdata [out] pointer to the location to receive the random data.
...And 4 more matches
nsIDOMChromeWindow
dom/interfaces/base/nsidomchromewindow.idlscriptable this interface is implemented on the window object in chrome.
... inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void beginwindowmove(in nsidomevent mousedownevent); void getattention(); void getattentionwithcyclecount(in long acyclecount); void maximize(); void minimize(); void notifydefaultbuttonloaded(in nsidomelement defaultbutton); void restore(); void setcursor(in domstring cursor); attributes attribute type description browserdomwindow nsibrowserdomwindow the related nsibrowserdomwindow instance which provides access to yet another layer of utility functions by chrome script.
... it will be null for domwindows not corresponding to browsers.
...And 4 more matches
nsIDOMWindow2
dom/interfaces/base/nsidomwindow2.idlscriptable this interface is the primary interface for a dom window object.
... inherits from: nsidomwindow last changed in gecko 1.9 (firefox 3) because nsidomwindow is frozen, this interface was introduced in firefox 3 (gecko 1.9) to allow dom windows to take on new features.
... dom windows implement nsidomwindow2, which is a subclass of nsidomwindow.
...And 4 more matches
Break on DOM mutation - Firefox Developer Tools
a dom mutation breakpoint pauses the code when the dom node on which you have set the breakpoint is modified.
... you set a dom mutation breakpoint in the page inspector.
... navigate to the dom node in which you are interested and use the context menu to set the breakpoint.
...And 4 more matches
DOMException() - Web APIs
the domexception() constructor returns a domexception object with a specified message and name.
... syntax var domexception = new domexception(); var domexception = new domexception(message); var domexception = new domexception(message, name); parameters message optional a description of the exception.
... name optional returns a domstring that contains one of the strings associated with an error constant.
...And 4 more matches
DOMImplementation.createDocumentType() - Web APIs
the domimplementation.createdocumenttype() method returns a documenttype object which can either be used with domimplementation.createdocument upon document creation or can be put into the document via methods like node.insertbefore() or node.replacechild().
... syntax var doctype = document.implementation.createdocumenttype(qualifiednamestr, publicid, systemid); parameters qualifiednamestr is a domstring containing the qualified name, like svg:svg.
... publicid is a domstring containing the public identifier.
...And 4 more matches
DOMImplementation.hasFeature() - Web APIs
the domimplementation.hasfeature() method returns a boolean flag indicating if a given feature is supported.
... syntax const flag = document.implementation.hasfeature(feature, version); parameters feature a domstring representing the feature name.
... version a domstring representing the version of the specification defining the feature.
...And 4 more matches
DOMPointInit.w - Web APIs
WebAPIDOMPointInitw
the dompointinit dictionary's w property is used to specify the w perspective value of a point in space when either creating or serializing to json a dompoint or dompointreadonly object.
... syntax var dompointinit = { w: wperspective }; dompointinit.w = wperspective; var wperspective = dompointinit.w; value a double-precision floating-point value indicating the point's w perspective value.
... there are two methods which use dompointinit: the static function dompointreadonly.frompoint() takes an object that complies with dompointinit as its sole input parameter, to specify the coordinates and perspective value of the new point to be created.
...And 4 more matches
DOMPointInit.y - Web APIs
WebAPIDOMPointInity
the dompointinit dictionary's y property is used to specify the y-coordinate of a point in 2d or 3d space when either creating or serializing to json a dompoint or dompointreadonly object.
... syntax var dompointinit = { y: ypos }; dompointinit.y = ypos; var ypos = dompointinit.y; value a double-precision floating-point value indicating the point's y-coordinate.
... if this property is missing when the dompointinit object is passed into frompoint(), the value is assumed to be 0 by default.
...And 4 more matches
DOMPointInit.z - Web APIs
WebAPIDOMPointInitz
the dompointinit dictionary's z property is used to specify the z-coordinate of a point in 2d or 3d space when either creating or serializing to json a dompoint or dompointreadonly object.
... syntax var dompointinit = { z: zpos }; dompointinit.z = zpos; var zpos = dompointinit.z; value a double-precision floating-point value indicating the point's z-coordinate.
... there are two methods which use dompointinit: the static function dompointreadonly.frompoint() takes an object that complies with dompointinit as its sole input parameter, to specify the coordinates and perspective value of the new point to be created.
...And 4 more matches
DOMPointReadOnly.fromPoint() - Web APIs
the static dompointreadonly method frompoint() creates and returns a new dompointreadonly object given a source point.
... the source point is specified as a dompointinit-compatible object, which includes both dompoint and dompointreadonly.
... you can also create a new dompointreadonly object using the new dompointreadonly() constructor.
...And 4 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.
...And 4 more matches
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.
... idl definition interface nsidomdocumentxbl { nodelist getanonymousnodes(in element elt); element getanonymouselementbyattribute(in element elt, in domstring 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.
...And 3 more matches
DOM (Document Object Model) - MDN Web Docs Glossary: Definitions of Web-related terms
the dom (document object model) is an api that represents and interacts with any html or xml document.
... the dom is a document model loaded in the browser and representing the document as a node tree, where each node represents part of the document (e.g.
... the dom is one of the most-used apis on the web because it allows code running in a browser to access and interact with every node in the document.
...And 3 more matches
Second-level Domain - MDN Web Docs Glossary: Definitions of Web-related terms
an sld (second level domain) is the domain name that is located right before a tld.
... for example, in mozilla.org, mozilla is the second level domain of the .org tld.
... a domain name is not limited to a tld and an sld.
...And 3 more matches
FC_SeedRandom
name fc_seedrandom() - mix additional seed material into the random number generator.
... syntax ck_rv fc_seedrandom( ck_session_handle hsession, ck_byte_ptr pseed, ck_ulong usseedlen ); parameters hsession [in] session handle.
... description fc_seedrandom() mixes additional seed material into the token's random number generator.
...And 3 more matches
nsIDOMFontFaceList
layout/inspector/public/nsidomfontfacelist.idlscriptable a list of nsidomfontface objects, each representing a single font face.
... 1.0 66 introduced gecko 7.0 inherits from: nsisupports last changed in gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4) method overview nsidomfontface item(in unsigned long index); attributes attribute type description length unsigned long the number of items in the list.
... methods item() returns the nsidomfontface object at the specified index into the list.
...And 3 more matches
nsIDOMHTMLAudioElement
the nsidomhtmlaudioelement interface is used to implement the html5 <audio> element.
... dom/interfaces/html/nsidomhtmlaudioelement.idlscriptable please add a summary to this article.
... last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) inherits from: nsidomhtmlmediaelement method overview unsigned long long mozcurrentsampleoffset(); void mozsetup(in pruint32 channels, in pruint32 rate); [implicit_jscontext] unsigned long mozwriteaudio(in jsval data); methods mozcurrentsampleoffset() non-standard this feature is non-standard and is not on a standards track.
...And 3 more matches
nsIDOMHTMLSourceElement
the nsidomhtmlsourceelement interface is the dom interface to the source child of the audio and video media elements in html.
... dom/interfaces/html/nsidomhtmlsourceelement.idlscriptable please add a summary to this article.
... last changed in gecko 1.9.1.2 inherits from: nsidomhtmlelement the source element allows authors to specify multiple media resources for media elements.
...And 3 more matches
nsIDOMMouseScrollEvent
dom/interfaces/events/nsidommousescrollevent.idlscriptable this interface represents a mouse scroll wheel event.
... 1.0 66 introduced gecko 1.9.1 inherits from: nsidommouseevent last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) gecko 1.9.2 note prior to gecko 1.9.2, this inherited from nsisupports instead of from nsidommouseevent.
... method overview void initmousescrollevent(in domstring typearg, in boolean canbubblearg, in boolean cancelablearg, in nsidomabstractview viewarg, in long detailarg, in long screenxarg, in long screenyarg, in long clientxarg, in long clientyarg, in boolean ctrlkeyarg, in boolean altkeyarg, in boolean shiftkeyarg, in boolean metakeyarg, in unsigned short buttonarg, in nsidomeventtarget relatedtargetarg, in long axis); attributes attribute type description axis long indicates which mouse wheel axis changed; this will be either horizontal_axis or vertical_axis.
...And 3 more matches
nsIDOMMozTouchEvent
the nsidommoztouchevent interface describes a raw touch event.
... dom/interfaces/events/nsidommoztouchevent.idlscriptable please add a summary to this article.
... last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) inherits from: nsidommouseevent method overview void initmoztouchevent(in domstring typearg, in boolean canbubblearg, in boolean cancelablearg, in nsidomabstractview viewarg, in long detailarg, in long screenxarg, in long screenyarg, in long clientxarg, in long clientyarg, in boolean ctrlkeyarg, in boolean altkeyarg, in boolean shiftkeyarg, in boolean metakeyarg, in unsigned short buttonarg, in n...
...And 3 more matches
nsIDOMStorageWindow
dom/interfaces/storage/nsidomstoragewindow.idlscriptable this interface provides access to a dom window's client side storage objects.
... all dom windows inherit from this interface.
... 1.0 66 introduced gecko 1.8.1 obsolete gecko 8.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) in gecko 8.0 this interface has been merged into nsidomwindow, and this interface has been removed.
...And 3 more matches
nsIDOMXPathExpression
dom/interfaces/xpath/nsidomxpathexpression.idlscriptable represents a compiled xpath query returned from nsidomxpathevaluator.createexpression or document.createexpression inherits from: nsisupports last changed in gecko 1.7 method overview nsisupports evaluate(in nsidomnode contextnode, in unsigned short type, in nsisupports result) methods evaluate() evaluate the xpath expression.
... nsisupports evaluate( in nsidomnode contextnode, in unsigned short type, in nsisupports result ); parameters contextnode a dom node to evaluate the xpath expression against.
... type a number that corresponds to one of the type constants of nsidomxpathresult.
...And 3 more matches
nsIDOMXULLabeledControlElement
dom/interfaces/xul/nsidomxullabeledcontrolel.idlscriptable this interface is used as a basis for labeled control elements in xul.
... inherits from: nsidomxulcontrolelement last changed in gecko 1.7 attributes attribute type description accesskey domstring this should be set to a character that is used as a shortcut key.
... command domstring this property reflects the element's command attribute.
...And 3 more matches
Dominators - Firefox Developer Tools
this article provides an introduction to the concepts of reachability, shallow versus retained size, and dominators, as they apply in garbage-collected languages like javascript.
... you can see the dominators in a page using the dominators view in the memory tool.
... dominators a related concept is that of the dominator.
...And 3 more matches
AnalyserNode.getFloatTimeDomainData() - Web APIs
the getfloattimedomaindata() method of the analysernode interface copies the current waveform, or time-domain, data into a float32array array passed into it.
... syntax var audioctx = new audiocontext(); var analyser = audioctx.createanalyser(); var dataarray = new float32array(analyser.fftsize); // float32array needs to be the same length as the fftsize analyser.getfloattimedomaindata(dataarray); // fill the float32array with data returned from getfloattimedomaindata() parameters array the float32array that the time domain data will be copied to.
... example the following example shows basic usage of an audiocontext to create an analysernode, then requestanimationframe and <canvas> to collect time domain data repeatedly and draw an "oscilloscope style" output of the current audio input.
...And 3 more matches
DOMImplementation.createDocument() - Web APIs
the domimplementation.createdocument() method creates and returns an xmldocument.
... syntax var doc = document.implementation.createdocument(namespaceuri, qualifiednamestr, documenttype); parameters namespaceuri is a domstring containing the namespace uri of the document to be created, or null if the document doesn't belong to one.
... qualifiednamestr is a domstring containing the qualified name, that is an optional prefix and colon plus the local root element name, of the document to be created.
...And 3 more matches
DOMMatrixReadOnly.scale() - Web APIs
the scale() method of the dommatrixreadonly interface creates a new matrix being the result of the original matrix with a scale transform applied.
... dommatrix.scale(scalex[, scaley][, scalez][, originx][, originy][, originz]) parameters scalex a multiplier for the scale value on the x-axis.
... return value returns a dommatrix containing a new matrix being the result of the matrix x and y dimensions being scaled by the given factor, centered on the origin given.
...And 3 more matches
DOMRectReadOnly() - Web APIs
the domrectreadonly() constructor creates a new domrectreadonly object.
... syntax const mydomrectreadonly = new domrectreadonly(x, y, width, height) parameters x the x coordinate of the domrectreadonly's origin.
... y the y coordinate of the domrectreadonly's origin.
...And 3 more matches
DOMTokenList.replace() - Web APIs
the replace() method of the domtokenlist interface replaces an existing token with a new token.
... syntax tokenlist.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.
...And 3 more matches
How to create a DOM tree - Web APIs
this page describes how to use the dom core api in javascript to create and modify dom objects.
... dynamically creating a dom tree consider the following xml document: <?xml version="1.0"?> <people> <person first-name="eric" middle-initial="h" last-name="jung"> <address street="321 south st" city="denver" state="co" country="usa"/> <address street="123 main st" city="arlington" state="ma" country="usa"/> </person> <person first-name="jed" last-name="brown"> <address street="321 north st" city="atlanta" state="ga" country="usa"/> <address street="123 west st" city="seattle" state="wa" country="usa"/> <address street="321 south avenue" city="denver" state="co" country="usa"/> </person> </people> the w3c dom api, supported by mozill...
...; var addresselem5 = doc.createelement("address"); addresselem5.setattribute("street", "321 south avenue"); addresselem5.setattribute("city", "denver"); addresselem5.setattribute("state", "co"); addresselem5.setattribute("country", "usa"); personelem2.appendchild(addresselem5); peopleelem.appendchild(personelem1); peopleelem.appendchild(personelem2); doc.appendchild(peopleelem); see also the dom chapter of the xul tutorial.
...And 3 more matches
<content>: The Shadow DOM Content Placeholder element (obsolete) - HTML: Hypertext Markup Language
WebHTMLElementcontent
the html <content> element—an obsolete part of the web components suite of technologies—was used inside of shadow dom as an insertion point, and wasn't meant to be used in ordinary html.
... it has now been replaced by the <slot> element, which creates a point in the dom at which a shadow dom can be inserted.
... dom interface htmlcontentelement attributes this element includes the global attributes.
...And 3 more matches
nsIDOMGeoPositionCallback
the nsidomgeopositioncallback interface is called when updated position information is available.
... you need to implement this interface to accept callbacks after using nsidomgeolocation.watchposition().
... dom/interfaces/geolocation/nsidomgeopositioncallback.idlscriptable please add a summary to this article.
...And 2 more matches
nsIDOMSerializer
content/base/public/nsidomserializer.idlscriptable this interface is really a placeholder till the w3c dom working group defines a mechanism for serializing dom nodes.
... an instance of this interface can be used to serialize a dom document or any dom subtree.
...to create an instance, use: var domserializer = components.classes["@mozilla.org/xmlextras/xmlserializer;1"] .createinstance(components.interfaces.nsidomserializer); method overview void serializetostream(in nsidomnode root, in nsioutputstream stream, in autf8string charset); astring serializetostring(in nsidomnode root); methods serializetostream() the subtree rooted by the specified element is serialized to a byte stream using the character set specified.
...And 2 more matches
AnalyserNode.getByteTimeDomainData() - Web APIs
the getbytetimedomaindata() method of the analysernode interface copies the current waveform, or time-domain, data into a uint8array (unsigned byte array) passed into it.
... syntax const audioctx = new audiocontext(); const analyser = audioctx.createanalyser(); const dataarray = new uint8array(analyser.fftsize); // uint8array should be the same length as the fftsize analyser.getbytetimedomaindata(dataarray); // fill the uint8array with data returned from getbytetimedomaindata() parameters array the uint8array that the time domain data will be copied to.
... return value void | none example the following example shows basic usage of an audiocontext to create an analysernode, then requestanimationframe and <canvas> to collect time domain data repeatedly and draw an "oscilloscope style" output of the current audio input.
...And 2 more matches
ConstrainDOMString - Web APIs
the constraindomstring dictionary is used to specify a constraint for a property whose value is a string.
... properties the value of a constraindomstring can be any of the following: a single domstring an array of domstring objects an object with one or both of the following properties: exact either a single domstring which must be the value of the property, or an array of domstring objects one of which must be the property's value.
... ideal either a single domstring or an arrray of domstrings specifying ideal values for the property.
...And 2 more matches
DOMHighResTimeStamp - Web APIs
the domhighrestimestamp type is a double and is used to store a time value in milliseconds.
... value the value of a domhighrestimestamp is a double-precision floating-point number which describes the number of milliseconds (accurate to within 5 microseconds if the device supports it) elapsed between two points in time.
... specifications specification status comment high resolution time level 2the definition of 'domhighrestimestamp' in that specification.
...And 2 more matches
DOMPointReadOnly.toJSON() - Web APIs
the dompointreadonly method tojson() returns a dompointinit object giving the json form of the point object.
... syntax pointjson = dompointreadonly.tojson(); parameters none.
... return value a new dompointinit object whose properties are set to the values in the dompoint or dompointreadonly on which the method was called.
...And 2 more matches
DOMTokenList.item() - Web APIs
WebAPIDOMTokenListitem
the item() method of the domtokenlist interface returns an item in the list by its index.
... syntax tokenlist.item(index) parameters index a domstring representing the index of the item you want to return.
... return value a domstring representing the returned item.
...And 2 more matches
Document.domain - Web APIs
WebAPIDocumentdomain
the domain property of the document interface gets/sets the domain portion of the origin of the current document, as used by the same origin policy.
... syntax const domainstring = document.domain document.domain = domainstring value the domain portion of the current document's origin.
... exceptions securityerror an attempt has been made to set domain under one of the following conditions: the document is inside a sandboxed <iframe> the document has no browsing context the document's effective domain is null the given value is not equal to the document's effective domain (or it is not a registerable domain suffix of it) the document-domain feature-policy is enabled examples getting the domain for the uri http://developer.mozilla.org/docs/web, this example sets currentdomain to the string "developer.mozilla.org".
...And 2 more matches
PerformanceResourceTiming.domainLookupEnd - Web APIs
the domainlookupend read-only property returns the timestamp immediately after the browser finishes the domain name lookup for the resource.
... if the user agent has the domain information in cache, domainlookupstart and domainlookupend represent the times when the user agent starts and ends the domain data retrieval from the cache.
... syntax resource.domainlookupend; return value a domhighrestimestamp representing the time immediately after the browser finishes the domain name lookup for the resource.
...And 2 more matches
DOM onevent handlers - Developer guides
the web platform provides several ways to be notified of dom events.
... registering onevent handlers the onevent handlers are properties on certain dom elements to manage how that element reacts to events.
...when the element is built from the html, the value of its onevent attributes are copied to the dom object that represents the element, so that accessing the attributes' values using javascript will get the value set in the html.
...And 2 more matches
PyDOM - Archive of obsolete content
introduction this is the documentation for the binding of python and the mozilla dom.
...note that you can stick arbitrary values on any dom object - this is what js calls 'expandos'.
... for example, let's say you have xul similar to pyxultest: top-level script code says something like: button = document.getelementbyid("some-button") button.foo = 0 and the button itself might look like: <button id="some-button" label="click here" onclick="event.target.foo += 1; print 'foo is now', event.target.foo"/> note that (a) we have stuck an arbitrary attribute on a dom element and (b) in all cases (e.g., event handler and top-level script), the dom node needs to be explicitly specified - the globals are the window itself.
...related topics pyxpcom: create and use xpcom components with python python-spidermonkey pydom samples: sample applications that use pydom pythonext: a firefox/xulrunner extension that can be used to install pydom ...
Domain name - MDN Web Docs Glossary: Definitions of Web-related terms
a domain name is a website's address on the internet.
... domain names are used in urls to identify to which server belong a specific webpage.
... the domain name consists of a hierarchial sequence of names (labels) separated by periods (dots) and ending with an extension.
... learn more general knowledge domain name on wikipedia understanding domain names ...
Random Number Generator - MDN Web Docs Glossary: Definitions of Web-related terms
a prng (pseudorandom number generator) is an algorithm that outputs numbers in a complex, seemingly unpredictable pattern.
... truly random numbers (say, from a radioactive source) are utterly unpredictable, whereas all algorithms are predictable, and a prng returns the same numbers when passed the same starting parameters or seed.
... learn more general knowledge pseudorandom number generator on wikipedia math.random(), a built-in javascript prng function.
... crypto.getrandomvalues(): this is intended to provide cryptographically secure numbers.
nsIDOMEventGroup
dom/interfaces/events/nsidomeventgroup.idlscriptable this interface is the interface implemented by all event targets in the document object model.
... inherits from: nsisupports last changed in gecko 1.7 method overview boolean issameeventgroup(in nsidomeventgroup other); methods issameeventgroup() reports whether or not another event group is the same as this one.
... boolean issameeventgroup( in nsidomeventgroup other ); parameters other instance of nsidomeventgroup object to compare against.
...see also document object model (dom) level 3 events specification ...
nsIDOMFile
the nsidomfile interface retrieves data from a file submitted to a form using the input type "file".
... content/base/public/nsidomfile.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 this interface implements the dom file object; for complete documentation, read up on that.
... see also nsidomfilelist nsidomfileexception datatransfer drag and drop ...
nsIDOMFileReader
the nsidomfilereader interface provides a way to read data from a file specified by an nsidomfile.
... content/base/public/nsidomfilereader.idlscriptable please add a summary to this article.
...to create an instance, use: var filereader = components.classes["@mozilla.org/files/filereader;1"].createinstance(components.interfaces.nsidomfilereader); this interface implements the dom filereader object; see that documentation for details.
... examples os.file for the main thread - example - save canvas to disk see also file api specification working draft nsidomfile nsidomfilelist nsidomfileexception ...
nsIDOMGeoPosition
dom/interfaces/geolocation/nsidomgeoposition.idlscriptable this interface describes a geographical location at a specific time.
... 1.0 66 introduced gecko 1.9.1 inherits from: nsisupports last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) attributes attribute type description address nsidomgeopositionaddress the address of the user's current location, if available.
... coords nsidomgeopositioncoords the user's current position information.
... timestamp domtimestamp the time at which the reading was taken.
nsIDOMGeoPositionErrorCallback
the nsidomgeopositionerrorcallback interface is used to represent an object that receives callback notifications when geolocation errors occur.
... dom/interfaces/geolocation/nsidomgeopositionerrorcallback.idlscriptable please add a summary to this article.
... last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) method overview void handleevent(in nsidomgeopositionerror position); methods handleevent() called to handle a geolocation error.
... void handleevent( in nsidomgeoposition position ); parameters position the error that occurred, as an nsidomgeopositionerror object.
nsIDOMHTMLTimeRanges
the nsidomhtmltimeranges interface represents a set of time ranges in media; it's primarily used by the nsidomhtmlmediaelement interface, and implements the dom timeranges interface.
... each time range represented by an nsidomhtmltimeranges object has an index number; you call the start() and end() methods to obtain the start and end times of each range, specifying the index number of the range to look up.
... dom/interfaces/html/nsidomhtmltimeranges.idlscriptable please add a summary to this article.
... last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) inherits from: nsisupports method overview float start(in unsigned long index); float end(in unsigned long index); attributes attribute type description length unsigned long the number of ranges represented by the nsidomhtmltimeranges object.
nsIDOMOrientationEvent
the nsidomorientationevent interface describes the event that can be delivered to dom windows, providing information from the device's accelerometer, allowing code to determine the orientation of the device.
... dom/interfaces/events/nsidomorientationevent.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: nsidomevent method overview void initorientationevent(in domstring eventtypearg, in boolean canbubblearg, in boolean cancelablearg, in double x, in double y, in double z); attributes attribute type description x double the amount of tilt along the x axis.
...void initprogressevent( in domstring eventtypearg, in boolean canbubblearg, in boolean cancelablearg, in double x, in double y, in double z ); parameters eventtypearg the type of event.
nsIDOMProgressEvent
dom/interfaces/events/nsidomprogressevent.idlscriptable this interface represents the events sent with progress information while uploading data using the xmlhttprequest object.
... 1.0 66 introduced gecko 1.9.1 deprecated gecko 22 inherits from: nsidomevent last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) the nsidomprogressevent is used in the media elements (<video> and <audio>) to inform interested code of the progress of the media download.
... method overview void initprogressevent(in domstring typearg, in boolean canbubblearg, in boolean cancelablearg, in boolean lengthcomputablearg, in unsigned long long loadedarg, in unsigned long long totalarg); deprecated since gecko 22.0 attributes attribute type description lengthcomputable boolean specifies whether or not the total size of the transfer is known.
... void initprogressevent( in domstring typearg, in boolean canbubblearg, in boolean cancelablearg, in boolean lengthcomputablearg, in unsigned long long loadedarg, in unsigned long long totalarg ); parameters typearg the type of event.
nsIDOMSimpleGestureEvent
dom/interfaces/events/nsidomsimplegestureevent.idlscriptable this interface describes a mouse or trackpad gesture event.
... 1.0 66 introduced gecko 1.9.1 inherits from: nsidommouseevent last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) the nsidomsimplegestureevent interface is the datatype for all mozilla-specific simple gesture events in the document object model.
... method overview void initsimplegestureevent(in domstring typearg, in boolean canbubblearg, in boolean cancelablearg, in nsidomabstractview viewarg, in long detailarg, in long screenxarg, in long screenyarg, in long clientxarg, in long clientyarg, in boolean ctrlkeyarg, in boolean altkeyarg, in boolean shiftkeyarg, in boolean metakeyarg, in unsigned short buttonarg, in nsidomeventtarget relatedtargetarg, in unsigned long directionarg, in double de...
... void initsimplegestureevent( in domstring typearg, in boolean canbubblearg, in boolean cancelablearg, in nsidomabstractview viewarg, in long detailarg, in long screenxarg, in long screenyarg, in long clientxarg, in long clientyarg, in boolean ctrlkeyarg, in boolean altkeyarg, in boolean shiftkeyarg, in boolean metakeyarg, in unsigned short buttonarg, in nsidomeventtarget relatedtargetarg, in unsigned l...
nsIDOMStorageList
dom/interfaces/storage/nsidomstoragelist.idlscriptable this interface is used to access the contextual storage areas used by globalstorage by domain.
... 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 nsidomstorage nameditem(in domstring domain); methods nameditem() called when the list of available access points changes.
... nsidomstorage nameditem( in domstring domain ); parameters domain the name of the domain for whom to return the storage object.
... return value the nsidomstorage object representing the data store for the specified domain.see also dom storage structured client-side storage (html 5 specification) nsidomwindow ...
nsIDOMXULSelectControlItemElement
dom/interfaces/xul/nsidomxulselectcntrlitemel.idlscriptable please add a summary to this article.
... inherits from: nsidomxulelement last changed in gecko 1.7 attributes attribute type description accesskey domstring command domstring control nsidomxulselectcontrolelement read only.
... crop domstring disabled boolean image domstring label domstring selected boolean read only.
... value domstring ...
nsIRandomGenerator
netwerk/base/public/nsirandomgenerator.idlscriptable interface used to generate random data.
... 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview void generaterandombytes(in unsigned long alength, [retval, array, size_is(alength)] out octet abuffer); methods generaterandombytes() generates the specified amount of random bytes.
... void generaterandombytes( in unsigned long alength, [retval, array, size_is(alength)] out octet abuffer ); parameters alength the length of the data to generate.
... abuffer a buffer that contains random bytes of size alength.
Highlight and inspect DOM nodes - Firefox Developer Tools
if you hover over a dom node in the watch expresions, it will be highlighted in the page.
... when you are working with dom notes in the debugger, you can easily highlight the node on the page or view it in the page inspector.
... a dom object in the watch expressions area, for example, includes a target.
... also, when you view the details of a dom node in the code panel, objects that you can highlight in the list will also have a target next to them.
DOMImplementationList - Web APIs
returned by domimplementationsource.getdomimplementationlist() and domimplementationregistry.getdomimplementationlist() .
... properties domimplementationlist.length read only returns an integer.
... methods domimplementationlist.item() returns the pos item.
... specifications specification status comment document object model (dom) level 3 core specificationthe definition of 'domimplementationlist' in that specification.
DOMMatrix() - Web APIs
the dommatrix constructor creates a new dommatrix object which represents 4x4 matrices, suitable for 2d and 3d operations..
... syntax var dommatrix = new dommatrix([init]) parameters init optional a string containing a sequence of numbers or an array of numbers specifying the matrix you want to create, or a css transform string.
... example this example creates a dommatrix to use as an argument for calling point.matrixtransform().
... var point = new dompoint(5, 4); var scalex = 2; var scaley = 3; var translatex = 12; var translatey = 8; var angle = math.pi / 2; var matrix = new dommatrix([ math.sin(angle) * scalex, math.cos(angle) * scalex, -math.sin(angle) * scaley, math.cos(angle) * scaley, translatex, translatey ]); var transformedpoint = point.matrixtransform(matrix); specifications specification status comment geometry interfaces module level 1the definition of 'dommatrix' in that specification.
DOMMatrixReadOnly.translate() - Web APIs
the translate() method of the dommatrixreadonly interface creates a new matrix being the result of the original matrix with a translation applied.
... dommatrix.translate(translatex, translatey[, translatez]) parameters translatex a number representing the abscissa (x-coordinate) of the translating vector.
... return value returns a dommatrix containing a new matrix being the result of the matrix being translated by the given vector.
... const matrix = new dommatrixreadonly().translate(25, 25); document.queryselector('#transformed').setattribute('transform', matrix.tostring()); screenshotlive sample specifications specification status comment geometry interfaces module level 1the definition of 'dommatrixreadonly.translate()' in that specification.
DOMPointInit.x - Web APIs
WebAPIDOMPointInitx
the dompointinit dictionary's x property is used to specify the x component of a point in 2d or 3d space when either creating or serializing a dompoint or dompointreadonly.
... syntax var dompointinit = { x: xpos }; dompointinit.x = xpos; var xpos = dompointinit.x; value a double-precision floating-point value indicating the point's x coordinate.
... if this property is missing when the dompointinit object is passed into frompoint(), the value is assumed to be 0 by default.
... dompointinit is used as an input when calling either dompointreadonly.frompoint() or dompoint.frompoint(), and is returned by the dompointreadonly.tojson() and dompoint.tojson() methods.
DOMPointReadOnly() - Web APIs
the dompointreadonly() constructor returns a new dompointreadonly object representing a point in 2d or 3d space, optionally with perspective, whose values cannot be altered by script code.
... syntax point = new dompointreadonly(x, y, z, w); parameters x optional the value of the horizontal coordinate, x, as a floating point number.
... return value a new dompointreadonly object representing the specified location in space.
... var point2d = new dompointreadonly(50, 25); var point3d = new dompointreadonly(50, 0, 10); var perspectivepoint3d = new dompointreadonly(50, 50, 25, 0.5); specifications specification status comment geometry interfaces module level 1the definition of 'dompointreadonly' in that specification.
DOMString - Web APIs
WebAPIDOMString
domstring is a utf-16 string.
... as javascript already uses such strings, domstring is mapped directly to a string.
... passing null to a method or parameter accepting a domstring typically stringifies to "null".
... specifications specification status comment web idlthe definition of 'domstring' in that specification.
DOMStringList - Web APIs
a type returned by some apis which contains a list of domstring (strings).
... properties domstringlist.length read only returns the length of the list.
... methods domstringlist.item() returns a domstring.
... domstringlist.contains() returns boolean indicating if the given string is in the list specifications specification status comment html living standardthe definition of 'domstringlist' in that specification.
DOMTokenList.add() - Web APIs
WebAPIDOMTokenListadd
the add() method of the domtokenlist interface adds the given token to the list.
... syntax tokenlist.add(token1[, token2[, ...tokenn]]); parameters tokenn a domstring representing the token (or tokens) to add to the tokenlist.
... return value undefined examples in the following example we retrieve the list of classes set on a <span> element as a domtokenlist using element.classlist.
... first, the html: <span class="a b c"></span> now the javascript: let span = document.queryselector("span"); let classes = span.classlist; classes.add("d"); span.textcontent = classes; the output looks like this: you can add multiple tokens as well: span.classlist.add("d", "e", "f"); specifications specification status comment domthe definition of 'add()' in that specification.
DOMTokenList.contains() - Web APIs
the contains() method of the domtokenlist interface returns a boolean — true if the underlying list contains the given token, otherwise false.
... syntax tokenlist.contains(token); parameters token a domstring representing the token you want to check for the existance of in the list.
... examples in the following example we retrieve the list of classes set on a <span> element as a domtokenlist using element.classlist.
...<span class="a b c"></span> now the javascript: let span = document.queryselector("span"); let classes = span.classlist; let result = classes.contains("c"); if (result) { span.textcontent = "the classlist contains 'c'"; } else { span.textcontent = "the classlist does not contain 'c'"; } the output looks like this: specifications specification status comment domthe definition of 'contains()' in that specification.
DOMTokenList.entries() - Web APIs
the domtokenlist.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.
... examples in the following example we retrieve the list of classes set on a <span> element as a domtokenlist using element.classlist.
... first, the html: <span class="a b c"></span> now the javascript: let span = document.queryselector("span"); let classes = span.classlist; let iterator = classes.entries(); for (let value of iterator) { span.textcontent += value + ' ++ '; } the output looks like this: specifications specification status comment domthe definition of 'entries() (as iterable<node>)' in that specification.
DOMTokenList.remove() - Web APIs
the remove() method of the domtokenlist interface removes the specified tokens from the list.
... syntax tokenlist.remove(token1[, token2[, ...tokenn]]); parameters tokenn a domstring representing the token you want to remove from the list.
... return value undefined examples in the following example we retrieve the list of classes set on a <span> element as a domtokenlist using element.classlist.
...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.classlist; classes2.remove("c", "b"); span2.textcontent = classes; specifications specification status comment domthe definition of 'remove()' in that specification.
DOMTokenList.toggle() - Web APIs
the toggle() method of the domtokenlist interface removes a given token from the list and returns false.
... syntax tokenlist.toggle(token [, force]); parameters token a domstring representing the token you want to toggle.
... examples in the following example we retrieve the list of classes set on a <span> element as a domtokenlist using element.classlist.
...("span"); let classes = span.classlist; span.addeventlistener('click', function() { let result = classes.toggle("c"); if (result) { span.textcontent = `'c' added; classlist is now "${classes}".`; } else { span.textcontent = `'c' removed; classlist is now "${classes}".`; } }) the output looks like this: specifications specification status comment domthe definition of 'toggle()' in that specification.
DOMTokenList.values() - Web APIs
the values() method of the domtokenlist interface returns an iterator allowing developers to go through all values contained in the domtokenlist.
... the individual values are domstring objects.
... examples in the following example we retrieve the list of classes set on a <span> element as a domtokenlist using element.classlist.
... first, the html: <span class="a b c"></span> now the javascript: var span = document.queryselector("span"); var classes = span.classlist; 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.
DOMUserData - Web APIs
domuserdata refers to application data.
...it is returned or used as an argument by node.setuserdata(), node.getuserdata(), used as the third argument to handle() on userdatahandler, and is used or returned by various domconfiguration methods.
... domuserdata is not persisted nor serialized and will not be present after the application has restarted or after a crash.
... specifications specification status comment document object model (dom) level 3 core specificationthe definition of 'domuserdata' in that specification.
PerformanceNavigationTiming.domComplete - Web APIs
the domcomplete read-only property returns a timestamp representing the time value equal to the time immediately before the user agent sets the current document readiness of the current document to complete.
... syntax perfentry.domcomplete; return value a timestamp representing a time value equal to the time immediately before the user agent sets the current document readiness of the current document to complete.
... function print_nav_timing_data() { // use getentriesbytype() to just get the "navigation" events var perfentries = performance.getentriesbytype("navigation"); for (var i=0; i < perfentries.length; i++) { console.log("= navigation entry[" + i + "]"); var p = perfentries[i]; // dom properties console.log("dom content loaded = " + (p.domcontentloadedeventend - p.domcontentloadedeventstart)); console.log("dom complete = " + p.domcomplete); console.log("dom interactive = " + p.interactive); // document load and unload time console.log("document load = " + (p.loadeventend - p.loadeventstart)); console.log("document unload = " + (p.unloadeventend - p.unloadeventstart)); // other prop...
...erties console.log("type = " + p.type); console.log("redirectcount = " + p.redirectcount); } } specifications specification status comment navigation timing level 2the definition of 'domcomplete' in that specification.
PerformanceNavigationTiming.domContentLoadedEventEnd - Web APIs
the domcontentloadedeventend read-only property returns a timestamp representing the time value equal to the time immediately after the current document's domcontentloaded event completes.
... syntax perfentry.domcontentloadedeventend; return value a timestamp representing the time value equal to the time immediately after the current document's domcontentloaded event completes.
... function print_nav_timing_data() { // use getentriesbytype() to just get the "navigation" events var perfentries = performance.getentriesbytype("navigation"); for (var i=0; i < perfentries.length; i++) { console.log("= navigation entry[" + i + "]"); var p = perfentries[i]; // dom properties console.log("dom content loaded = " + (p.domcontentloadedeventend - p.domcontentloadedeventstart)); console.log("dom complete = " + p.domcomplete); console.log("dom interactive = " + p.dominteractive); // document load and unload time console.log("document load = " + (p.loadeventend - p.loadeventstart)); console.log("document unload = " + (p.unloadeventend - p.unloadeventstart)); // other p...
...roperties console.log("type = " + p.type); console.log("redirectcount = " + p.redirectcount); } } specifications specification status comment navigation timing level 2the definition of 'domcontentloadedeventend' in that specification.
PerformanceNavigationTiming.domContentLoadedEventStart - Web APIs
the domcontentloadedeventstart read-only property returns a timestamp representing the time value equal to the time immediately before the user agent fires the domcontentloaded event at the current document.
... syntax perfentry.domcontentloadedeventstart; return value a timestamp representing the time value equal to the time immediately before the user agent fires the domcontentloaded event at the current document.
... function print_nav_timing_data() { // use getentriesbytype() to just get the "navigation" events var perfentries = performance.getentriesbytype("navigation"); for (var i=0; i < perfentries.length; i++) { console.log("= navigation entry[" + i + "]"); var p = perfentries[i]; // dom properties console.log("dom content loaded = " + (p.domcontentloadedeventend - p.domcontentloadedeventstart)); console.log("dom complete = " + p.domcomplete); console.log("dom interactive = " + p.interactive); // document load and unload time console.log("document load = " + (p.loadeventend - p.loadeventstart)); console.log("document unload = " + (p.unloadeventend - p.unloadeventstart)); // other prop...
...erties console.log("type = " + p.type); console.log("redirectcount = " + p.redirectcount); } } specifications specification status comment navigation timing level 2the definition of 'domcontentloadedeventstart' in that specification.
PerformanceNavigationTiming.domInteractive - Web APIs
the dominteractive read-only property returns a timestamp representing the time value equal to the time immediately before the user agent sets the current document readiness of the current document to interactive.
... syntax perfentry.dominteractive; return value a timestamp representing the time value equal to the time immediately before the user agent sets the current document readiness of the current document to interactive.
... function print_nav_timing_data() { // use getentriesbytype() to just get the "navigation" events var perfentries = performance.getentriesbytype("navigation"); for (var i=0; i < perfentries.length; i++) { console.log("= navigation entry[" + i + "]"); var p = perfentries[i]; // dom properties console.log("dom content loaded = " + (p.domcontentloadedeventend - p.domcontentloadedeventstart)); console.log("dom complete = " + p.domcomplete); console.log("dom interactive = " + p.dominteractive); // document load and unload time console.log("document load = " + (p.loadeventend - p.loadeventstart)); console.log("document unload = " + (p.unloadeventend - p.unloadeventstart)); // other p...
...roperties console.log("type = " + p.type); console.log("redirectcount = " + p.redirectcount); } } specifications specification status comment navigation timing level 2the definition of 'dominteractive' in that specification.
PerformanceResourceTiming.domainLookupStart - Web APIs
the domainlookupstart read-only property returns the timestamp immediately before the browser starts the domain name lookup for the resource.
... syntax resource.domainlookupstart; return value a domhighrestimestamp immediately before the browser starts the domain name lookup for the resource.
...entries() { // use getentriesbytype() to just get the "resource" events var p = performance.getentriesbytype("resource"); for (var i=0; i < p.length; i++) { print_start_and_end_properties(p[i]); } } function print_start_and_end_properties(perfentry) { // print timestamps of the performanceentry *start and *end properties properties = ["connectstart", "connectend", "domainlookupstart", "domainlookupend", "fetchstart", "redirectstart", "redirectend", "requeststart", "responsestart", "responseend", "secureconnectionstart"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in perfentry; if (supported) { var value = per...
..." + properties[i] + " = not supported"); } } } specifications specification status comment resource timing level 1the definition of 'domainlookupstart' in that specification.
Window: DOMContentLoaded event - Web APIs
the domcontentloaded event fires when the initial html document has been completely loaded and parsed, without waiting for stylesheets, images, and subframes to finish loading.
...for full details on this event please see the page on the document: domcontentloaded event.
...it is a common mistake to use load where domcontentloaded would be more appropriate.
... examples basic usage window.addeventlistener('domcontentloaded', (event) => { console.log('dom fully loaded and parsed'); }); specifications specification status html living standard living standard ...
XDomainRequest.onprogress - Web APIs
this method is called periodically as an event handler for progress events on xdomainrequests, so that code can monitor progress while loading content.
... note: while handling this event, you can look at xdomainrequest.responsetext to get the response so far.
... once loading is complete, the xdomainrequest.onload event handler gets called.
... example var xdr = new xdomainrequest(); xdr.open("post", "http://example.com/api/method"); xdr.onprogress = function(){ //handle partial response with xdr.responsetext } xdr.onload = function(){ //handle response with xdr.responsetext } xdr.send("param1=value1&param2=value2"); specification not part of any specification.
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 <allowlist>; <allowlist> an allowlist is a list of origins that takes one or more of the following values, separated by spaces: *: the feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin.
... specifications specification status comment html living standardthe definition of 'document-domain' in that specification.
DOMSubtreeModified - Archive of obsolete content
example the following code will display the time of last dom change on the title bar of the page.
... this event has been deprecated in favor of the mutation observer api this event can cause infinite loops if you decide to change the dom inside the event handler, hence it has been disabled in a number of browsers (see domattrmodified and domsubtreemodified events are no longer fired when style attribute is changed via cssom for example).
... document.body.addeventlistener('domsubtreemodified', function () { document.title = 'dom changed at ' + new date(); }, false); ...
DOMMenuItemActive - Archive of obsolete content
the dommenuitemactive event is executed when a <menu> or a <menuitem> has been hovered or highlighted.
... general info specification xul interface event bubbles yes cancelable yes target element default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree).
... type read only domstring the type of event.
DOMMenuItemInactive - Archive of obsolete content
the dommenuiteminactive event is executed when a <menu> or a <menuitem> in no longer hovered or highlighted.
... general info specification xul interface event bubbles yes cancelable yes target element default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree).
... type read only domstring the type of event.
Randomizing gameplay - Game development
to fix this and improve playability we should make the rebound angles more random, and in this article we'll look at how.
... making rebounds more random we can change the ball's velocity depending on the exact spot it hits the paddle, by modifying the x velocity each time the ballhitpaddle() function is run using a line along the lines of the below.
...it's not completely random of course, but it does make the gameplay a bit more unpredictable and therefore more interesting.
Dominator - MDN Web Docs Glossary: Definitions of Web-related terms
in graph theory, node a dominates node b if every path from the root node to b passes through a.
...so objects that a dominates contribute to the retained size of a: that is, the total amount of memory that could be freed if a itself were freed.
... learn more general knowledge dominator on wikipedia technical reference dominators garbage collection ...
nsIDOMFileException
the nsidomfileexception interface represents exceptions that can be raised by calls to the methods in the nsidomfile interface.
... content/base/public/nsidomfileexception.idlscriptable please add a summary to this article.
... see also nsidomfile nsidomfilelist nsidomfilereader ...
nsIDOMGeoPositionError
the nsidomgeopositionerror interface represents an error that occurred while performing geolocation operations.
... dom/interfaces/geolocation/nsidomgeopositionerror.idlscriptable please add a summary to this article.
... message domstring human readable error message.
nsIDOMJSWindow
one of the interfaces implemented by the window dom object.
... this is only a magic interface to provide the js implementation of a dom window and it should never be used by embedders, the ordinary dom documentation should cover the rest.
... the interface is defined in dom/interfaces/base/nsidomjswindow.idl.
nsIDOMMozNetworkStats
dom/network/interfaces/nsidomnetworkstats.idlscriptable interface of the network stats object.
...to create an instance, use: var networkstatsmanager = components.classes["@mozilla.org/networkstats;1"] .createinstance(components.interfaces.nsidomnetworkstats); attributes attribute type description connectiontype domstring connection type of the stats.
... data nsidommoznetworkstatsdata array stats samples.
nsIDOMNavigatorDesktopNotification
dom/interfaces/notification/nsidomnavigatordesktopnotification.idlscriptable property that extends the navigator object.
...attributes attribute type description moznotification nsidomdesktopnotificationcenter read only.
... see also nsidomdesktopnotificationcenter ...
nsIDOMStorageItem
dom/interfaces/storage/nsidomstorageitem.idlscriptable this interface represents an object in dom storage.
... value domstring the value associated with the item.
... see also dom storage structured client-side storage (html 5 specification) nsidomstorage nsidomstorage2 ...
nsIDOMUserDataHandler
dom/interfaces/core/nsidomuserdatahandler.idlscriptable the callback function for the setuserdata method.
... 1.0 66 introduced gecko 1.5 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview void handle(in unsigned short operation, in domstring key, in nsivariant data, in nsidomnode src, in nsidomnode dst); constants constant value description node_cloned 1 the node was cloned.
...void handle( in unsigned short operation, in domstring key, in nsivariant data, in nsidomnode src, in nsidomnode dst ); parameters operation one of the node_* operation type constants from the above table.
nsIDOMXULSelectControlElement
dom/interfaces/xul/nsidomxulselectcntrlel.idlscriptable please add a summary to this article.
... inherits from: nsidomxulcontrolelement last changed in gecko 1.9 (firefox 3) method overview nsidomxulselectcontrolitemelement appenditem(in domstring label, in domstring value); long getindexofitem(in nsidomxulselectcontrolitemelement item); nsidomxulselectcontrolitemelement getitematindex(in long index); nsidomxulselectcontrolitemelement insertitemat(in long index, in domstring label, in domstring value); nsidomxulselectcontrolitemelement removeitemat(in long index); attributes attribute type description itemcount unsigned long read only.
... selectedindex long selecteditem nsidomxulselectcontrolitemelement value domstring methods appenditem() nsidomxulselectcontrolitemelement appenditem( in domstring label, in domstring value ); parameters label value return value getindexofitem() long getindexofitem( in nsidomxulselectcontrolitemelement item ); parameters item return value getitematindex() nsidomxulselectcontrolitemelement getitematindex( in long index ); parameters index return value insertitemat() nsidomxulselectcontrolitemelement insertitemat( in long index, in domstring label, in domstring value ); parameters index label value return value removeitemat() nsidomxulselectcontrolitemelement removeitemat( in long index ); parameters index return value ...
Blocking By Domain - Plugins
rather than block plugins entirely, firefox is limiting the impact of plugins by blocking certain domains from using plugins.
... criteria in order to improve firefox security and performance, there are two major categories of sites mozilla may choose to add to plugin domain blocking: sites commonly embedded in a 3rd-party context web sites which are commonly embedded into other sites using iframes can have a large impact on browser security and also cause many sites to show plugin activation prompts.
... any concerns or questions about the plugin block lists should be directed to plugin-blocking-by-domain@mozilla.com.
DOMError - Web APIs
WebAPIDOMError
the domerror interface describes an error object that contains an error name.
... properties domerror.name read only returns a domstring representing one of the error type names (see below).
... domerror.message read only returns a domstring representing a message or description associated with the given error type name.
DOMException.code - Web APIs
WebAPIDOMExceptioncode
the code read-only property of the domexception interface returns a short that contains one of the error code constants, or 0 if none match.
...new dom exceptions don't use this anymore: they put this info in the domexception.name attribute.
... syntax var domexceptioncode = domexceptioninstance.code; value a short number.
DOMImplementation.createHTMLDocument() - Web APIs
the domimplementation.createhtmldocument() method creates a new html document.
... syntax const newdoc = document.implementation.createhtmldocument(title) parameters title optional (except in ie) a domstring containing the title to give the new html document.
... view live examples the returned document is pre-constructed with the following html: <!doctype html> <html> <head> <title>title</title> </head> <body> </body> </html> specifications specification status comment domthe definition of 'domimplementation.createhtmldocument' in that specification.
DOMMatrixReadOnly() - Web APIs
the dommatrixreadonly constructor creates a new dommatrixreadonly object which represents 4x4 matrices, suitable for 2d and 3d operations.
... syntax var dommatrixreadonly = new dommatrixreadonly([init]) parameters init optional either a string containing a sequence of numbers or an array of integers specifying the matrix you want to create.
... specifications specification status comment geometry interfaces module level 1the definition of 'dommatrixreadonly' in that specification.
DOMMatrixReadOnly.flipX() - Web APIs
the flipx() method of the dommatrixreadonly interface creates a new matrix being the result of the original matrix flipped about the x-axis.
... syntax dommatrix.flipx() return value returns a dommatrix containing a new matrix being the result of the original matrix flipped about the x-axis, which is equivalent to multiplying the matrix by dommatrix(-1, 0, 0, 1, 0, 0).
... const flipped = document.getelementbyid('flipped'); const matrix = new dommatrixreadonly(); const flippedmatrix = matrix.flipx(); flipped.setattribute('transform', flippedmatrix.tostring()); screenshotlive sample specifications specification status comment geometry interfaces module level 1the definition of 'dommatrixreadonly.flipx()' in that specification.
DOMParser() - Web APIs
the domparser() constructor creates a new domparser object.
... syntax var parser = new domparser(); parameters none.
... return value a new domparser object.
DOMPointReadOnly.w - Web APIs
the dompointreadonly interface's w property holds the point's perspective value, w, for a read-only point in space.
... if your script needs to be able to change the value of this property, you should instead use the dompoint object.
... syntax const perspective = somedompointreadonly.w value a double-precision floating-point value indicating the w perspective value for the point.
DOMPointReadOnly.x - Web APIs
the dompointreadonly interface's x property holds the horizontal coordinate, x, for a read-only point in space.
... this property cannot be changed by javascript code in this read-only version of the dompoint object.
... syntax const xpos = somedompointreadonly.x; value a double-precision floating-point value indicating the x coordinate's value for the point.
DOMPointReadOnly.y - Web APIs
the dompointreadonly interface's y property holds the vertical coordinate, y, for a read-only point in space.
... if your script needs to be able to change the value of this property, you should instead use the dompoint object.
... syntax const ypos = somedompointreadonly.y; value a double-precision floating-point value indicating the y coordinate's value for the point.
DOMPointReadOnly.z - Web APIs
the dompointreadonly interface's z property holds the depth coordinate, z, for a read-only point in space.
... if your script needs to be able to change the value of this property, you should instead use the dompoint object.
... syntax const zpos = somedompointreadonly.z; value a double-precision floating-point value indicating the z coordinate's value for the point.
DOMRectReadOnly.fromRect() - Web APIs
the fromrect() property of the domrectreadonly interface creates a new domrectreadonly object with a given location and dimensions.
... syntax var domrect = domrectreadonly.fromrect(rectangle) parameters rectangle optional an object specifying the location and dimensions of a rectangle.
... return value an instance of domrect.
DOMTokenList.forEach() - Web APIs
the foreach() method of the domtokenlist interface calls the callback given in parameter once for each value pair in the list, in insertion order.
... example in the following example we retrieve the list of classes set on a <span> element as a domtokenlist using element.classlist.
... html <span class="a b c"></span> javascript let span = document.queryselector("span"); let classes = span.classlist; 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.domtokenlist && !domtokenlist.prototype.foreach) { domtokenlist.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 specificatio...
DOMTokenList.keys() - Web APIs
WebAPIDOMTokenListkeys
the keys() method of the domtokenlist interface returns an iterator allowing to go through all keys contained in this object.
... examples in the following example we retrieve the list of classes set on a <span> element as a domtokenlist using element.classlist.
... first, the html: <span class="a b c"></span> now the javascript: var span = document.queryselector("span"); var classes = span.classlist; 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.
DOMTokenList.length - Web APIs
the length read-only property of the domtokenlist interface is an integer representing the number of objects stored in the object.
... examples in the following example we retrieve the list of classes set on a <span> element as a domtokenlist using element.classlist, then write the length of the list to 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.classlist; let length = classes.length; span.textcontent = `classlist length = ${length}`; the output looks like this: specifications specification status comment domthe definition of 'length' in that specification.
DOMTokenList.value - Web APIs
the value property of the domtokenlist interface is a stringifier that returns the value of the list as a domstring, or clears and sets the list to the given value.
... syntax tokenlist.value; value a domstring examples in the following example we retrieve the list of classes set on a <span> element as a domtokenlist using element.classlist, then write the value of the list to 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.classlist; span.textcontent = classes.value; the output looks like this: specifications specification status comment domthe definition of 'value' in that specification.
Document.domConfig - Web APIs
note: this has never been implemented in mozilla, and has been removed from the dom specification.
... this should return the domconfiguration for the document.
... specification http://www.w3.org/tr/dom-level-3-cor...ent3-domconfig ...
Locating DOM elements using selectors - Web APIs
the selectors api provides methods that make it quick and easy to retrieve element nodes from the dom by matching against a set of selectors.
... note: the nodelist returned by queryselectorall() is not live, which means that changes in the dom are not reflected in the collection.
... this is different from other dom querying methods that return live node lists.
Element: DOMActivate event - Web APIs
the domactivate event is fired at an element when it becomes active, such as when it is clicked on using the mouse or a keypress is used to navigate to it.
... bubbles yes cancelable yes interface mouseevent examples <svg xmlns="http://www.w3.org/2000/svg" version="1.2" baseprofile="tiny" xmlns:ev="http://www.w3.org/2001/xml-events" width="6cm" height="5cm" viewbox="0 0 600 500"> <desc>example: invoke an ecmascript function from a domactivate event</desc> <!-- ecmascript to change the radius --> <script type="application/ecmascript"><![cdata[ function change(evt) { var circle = evt.target; var currentradius = circle.getfloattrait("r"); if (currentradius == 100) circle.setfloattrait("r", currentradius * 2); else circle.setfloattrait("r", currentradius * 0.5); } ]]></script> <!-- act on each domactivate event --> <circle cx="300" cy="...
...225" r="100" fill="red"> <handler type="application/ecmascript" ev:event="domactivate"> change(evt); </handler> </circle> <text x="300" y="480" font-family="verdana" font-size="35" text-anchor="middle"> activate the circle to change its size </text> </svg> specifications specification status ui eventsthe definition of 'domactivate' in that specification.
Microdata DOM API - Web APIs
each item is represented in the dom by the element on which the relevant itemscope attribute is found.
...t.createtextnode(items[item].properties.names[name])); inner.appendchild(propli); } itemli.appendchild(inner); outer.appendchild(itemli); } document.body.appendchild(outer); if faced with the following from an earlier example: <section itemscope itemtype="http://example.org/animals#cat"> <h1 itemprop="name http://example.com/fn">hedral</h1> <p itemprop="desc">hedral is a male american domestic shorthair, with a fluffy <span itemprop="http://example.com/color">black</span> fur with <span itemprop="http://example.com/color">white</span> paws and belly.</p> <img itemprop="img" src="hedral.jpeg" alt="" title="hedral, age 18 months"> </section> ...it would result in the following output: name http://example.com/fn desc http://example.com/color img (the duplicate occurrence of "http:/...
...nameditem(domstring name); // shadows inherited nameditem() readonly attribute domstring[] names; }; typedef sequence<any> propertyvaluearray; interface propertynodelist : nodelist { propertyvaluearray getvalues(); }; collection .
XDomainRequest.onerror - Web APIs
an event handler which is called when an xdomainrequest encounters an error.
... note: there is no way to determine the cause of the error from the xdomainrequest interface.
... example var xdr = new xdomainrequest(); xdr.open("post", "http://example.com/api/method"); xdr.onerror = function(){ //handle error } xdr.onload = function(){ //handle response with xdr.responsetext } xdr.send("param1=value1&param2=value2"); specification not part of any specification.
XDomainRequest.onload - Web APIs
an event handler for when an xdomainrequest has finished receiving the response from the server.
... you can find the entire server response in the xdomainrequest.responsetext property.
... syntax xdr.onload = funcref; example var xdr = new xdomainrequest(); xdr.open("post", "http://example.com/api/method"); xdr.onload = function(){ //handle response with xdr.responsetext } xdr.send("param1=value1&param2=value2"); specification not part of any specification.
browser.dom.window.dump.file
browser.dom.window.dump.file redirects the ouput of window.dump() calls to a file whose address is specified in this preference if browser.dom.window.dump.enabled is set to true.
... related browser.dom.window.dump.enabled ...
Random Number Generator
this chapter describes the nspr random number generator.
... random number generator function pr_getrandomnoise - produces a random value for use as a seed value for another random number generator.
nsIDOMClientRect
dom/interfaces/base/nsidomclientrect.idlscriptable represents a rectangular box.
... see also cssom view module : the clientrect interfacewd this object was renamed a few times: initial name was textrectangle, then clientrect, then domrect.
nsIDOMFileError
the nsidomfileerror interface describes errors that occur while using the dom file api.
... it implements the dom fileerror object; for details, please read that article.
nsIDOMFileList
the nsidomfilelist interface contains a list of nsidomfile objects describing the files selected by the user for a "file" input field on a web form.
... this interface implements the dom filelist object.
nsIDOMGeoPositionCoords
the nsidomgeopositioncoords interface describes a geographical location.
... dom/interfaces/geolocation/nsidomgeopositioncoords.idlscriptable please add a summary to this article.
nsIDOMGeoPositionOptions
the nsidomgeopositionoptions interface is used to specify options for geolocation operations.
... dom/interfaces/geolocation/nsidomgeopositionoptions.idlscriptable please add a summary to this article.
nsIDOMGlobalPropertyInitializer
dom/interfaces/base/nsidomglobalpropertyinitializer.idlscriptable an initializer for global properties that lets them know about the window they're being attached to.
...method overview jsval init(in nsidomwindow window); methods init() jsval init( in nsidomwindow window ); parameters window the window to which the global property is being attached.
nsIDOMHTMLMediaElement
dom/interfaces/html/nsidomhtmlmediaelement.idlscriptable the basis for the nsidomhtmlaudioelement and nsidomhtmlvideoelement interfaces, which in turn implement the <audio> and <video> html5 elements.
... 1.0 67 introduced gecko 1.9.1 inherits from: nsidomhtmlelement last changed in gecko 1.1 the nsidomhtmlmediaelement interface implements the dom htmlmediaelement interface.
nsIDOMXPathException
dom/interfaces/xpath/nsidomxpathexception.idlscriptable describes an exception resulting from xpath operations.
... see also introduction to using xpath in javascript document object model (dom) level 3 xpath specification nsidomxpathevaluator document.evaluate nsidomxpathresult ...
nsIDOMXULControlElement
dom/interfaces/xul/nsidomxulcontrolelement.idlscriptable provides additional attributes specific to control elements.
... 66 introduced gecko 1.0 inherits from: nsidomxulelement last changed in gecko 1.0 attributes attribute type description disabled boolean indicates whether the element is disabled or not.
DOM allocation example - Firefox Developer Tools
you can try out the site at https://mdn.github.io/performance-scenarios/dom-allocs/alloc.html.
... it just contains a script that creates a large number of dom nodes: var toolbarbuttoncount = 20; var toolbarcount = 200; function getrandomint(min, max) { return math.floor(math.random() * (max - min + 1)) + min; } function createtoolbarbutton() { var toolbarbutton = document.createelement("span"); toolbarbutton.classlist.add("toolbarbutton"); // stop spidermonkey from sharing instances toolbarbutton[getrandomint(0,5000)] = "foo"; return toolbarbutton; } function createtoolbar() { var toolbar = document.createelement("div"); // stop spidermonkey from sharing instances toolbar[getrandomint(0,5000)] = "foo"; for (var i = 0; i < toolbarbuttoncount; i++) { var toolbarbutton = createtoolbarbutton(); toolbar.appendchild(toolbarbutton); } return toolbar; } fu...
DOMConfiguration - Web APIs
note: this interface has never been supported in gecko, and has been removed from the dom specification.
... pre-defined parameters: "canonical-form", "cdata-sections", "check-character-normalization", "comments", "datatype-normalization", "element-content-whitespace", "entities", "error-handler", "infoset", "namespaces", "namespace-declarations", "normalize-characters","schema-location", "schema-type", "split-cdata-sections", "validate", "validate-if-schema", "well-formed" properties domconfiguration.parameternames read only is a domstringlist methods domconfiguration.cansetparameter() returns a boolean domconfiguration.getparameter() returns a domuserdata domconfiguration.setparameter() sets a parameter specification http://www.w3.org/tr/dom-level-3-cor...mconfiguration ...
DOMException.message - Web APIs
the message read-only property of the domexception interface returns a domstring representing a message or description associated with the given error name.
... syntax var domexceptionmessage = domexceptioninstance.message; value a domstring.
DOMException.name - Web APIs
WebAPIDOMExceptionname
the name read-only property of the domexception interface returns a domstring that contains one of the strings associated with an error name.
... syntax var domexceptionname = domexceptioninstance.name; value a domstring.
DOMObject - Web APIs
WebAPIDOMObject
the obsolete domobject interface was used in earlier versions of the dom specification as the base class for any object data type.
... specifications specification status comment document object model (dom) level 3 core specificationthe definition of 'domobject' in that specification.
DOMPoint.w - Web APIs
WebAPIDOMPointw
the dompoint interface's w property holds the point's perspective value, w, for a point in space.
... syntax var perspective = dompoint.w; value a double-precision floating-point value indicating the w perspective value for the point.
DOMPoint.x - Web APIs
WebAPIDOMPointx
the dompoint interface's x property holds the horizontal coordinate, x, for a point in space.
... syntax var xpos = dompoint.x; value a double-precision floating-point value indicating the x coordinate's value for the point.
DOMPoint.y - Web APIs
WebAPIDOMPointy
the dompoint interface's y property holds the vertical coordinate, y, for a point in space.
... syntax var ypos = dompoint.y; value a double-precision floating-point value indicating the y coordinate's value for the point.
DOMPoint.z - Web APIs
WebAPIDOMPointz
the dompoint interface's z property specifies the depth coordinate of a point in space.
... syntax var zpos = dompoint.z; value a double-precision floating-point value indicating the z coordinate's value for the point.
DOMRectReadOnly.bottom - Web APIs
the bottom read-only property of the domrectreadonly interface returns the bottom coordinate value of the domrect.
... (has the same value as y + height, or y if height is negative.) syntax var recbottom = domrect.bottom; value a double.
DOMRectReadOnly.height - Web APIs
the height read-only property of the domrectreadonly interface represents the height of the domrect.
... syntax var recheight = domrect.height; value a double.
DOMRectReadOnly.left - Web APIs
the left read-only property of the domrectreadonly interface returns the left coordinate value of the domrect.
... (has the same value as x, or x + width if width is negative.) syntax var recleft = domrect.left; value a double.
DOMRectReadOnly.right - Web APIs
the right read-only property of the domrectreadonly interface returns the right coordinate value of the domrect.
... (has the same value as x + width, or x if width is negative.) syntax var recright = domrect.right; value a double.
DOMRectReadOnly.top - Web APIs
the top read-only property of the domrectreadonly interface returns the top coordinate value of the domrect.
... (has the same value as y, or y + height if height is negative.) syntax var rectop = domrect.top; value a double.
DOMRectReadOnly.width - Web APIs
the width read-only property of the domrectreadonly interface represents the width of the domrect.
... syntax var recwidth = domrect.width; value a double.
DOMRectReadOnly.x - Web APIs
WebAPIDOMRectReadOnlyx
the x read-only property of the domrectreadonly interface represents the x coordinate of the domrect's origin.
... syntax var recx = domrect.x; value a double.
DOMRectReadOnly.y - Web APIs
WebAPIDOMRectReadOnlyy
the y read-only property of the domrectreadonly interface represents the y coordinate of the domrect's origin.
... syntax var recy = domrect.y; value a double.
DOMStringMap - Web APIs
the domstringmap interface is used for the htmlelement.dataset attribute, to represent data for custom attributes added to elements.
... specifications specification status comment html living standardthe definition of 'domstringmap' in that specification.
DOMTimeStamp - Web APIs
the domtimestamp type represents an absolute or relative number of milliseconds, depending on the specification in which it appears.
... specifications specification status comment web idlthe definition of 'domtimestamp' in that specification.
DOMTokenList.supports() - Web APIs
the supports() method of the domtokenlist interface returns true if a given token is in the associated attribute's supported tokens.
... syntax let trueorfalse = element.supports(token) parameters token a domstring containing the token to query for.
PerformanceTiming.domComplete - Web APIs
the legacy performancetiming.domcomplete read-only property returns an unsigned long long representing the moment, in miliseconds since the unix epoch, when the parser finished its work on the main document, that is when its document.readystate changes to 'complete' and the corresponding readystatechange event is thrown.
... syntax time = performancetiming.domcomplete; specifications specification status comment navigation timingthe definition of 'performancetiming.domcomplete' in that specification.
PerformanceTiming.domContentLoadedEventEnd - Web APIs
the legacy performancetiming.domcontentloadedeventend read-only property returns an unsigned long long representing the moment, in milliseconds since the unix epoch, right after all the scripts that need to be executed as soon as possible, in order or not, has been executed.
... syntax time = performancetiming.domcontentloadedeventend; specifications specification status comment navigation timingthe definition of 'performancetiming.domcontentloadedeventend' in that specification.
PerformanceTiming.domContentLoadedEventStart - Web APIs
the legacy performancetiming.domcontentloadedeventstart read-only property returns an unsigned long long representing the moment, in miliseconds since the unix epoch, right before the parser sent the domcontentloaded event, that is right after all the scripts that need to be executed right after parsing has been executed.
... syntax time = performancetiming.domcontentloadedeventstart; specifications specification status comment navigation timingthe definition of 'performancetiming.domcontentloadedeventstart' in that specification.
PerformanceTiming.domInteractive - Web APIs
the legacy performancetiming.dominteractive read-only property returns an unsigned long long representing the moment, in miliseconds since the unix epoch, when the parser finished its work on the main document, that is when its document.readystate changes to 'interactive' and the corresponding readystatechange event is thrown.
... syntax time = performancetiming.dominteractive; specifications specification status comment navigation timingthe definition of 'performancetiming.dominteractive' in that specification.
PerformanceTiming.domLoading - Web APIs
the legacy performancetiming.domloading read-only property returns an unsigned long long representing the moment, in miliseconds since the unix epoch, when the parser started its work, that is when its document.readystate changes to 'loading' and the corresponding readystatechange event is thrown.
... syntax time = performancetiming.domloading; specifications specification status comment navigation timingthe definition of 'performancetiming.domloading' in that specification.
PerformanceTiming.domainLookupEnd - Web APIs
the legacy performancetiming.domainlookupend read-only property returns an unsigned long long representing the moment, in miliseconds since the unix epoch, where the domain lookup is finished.
... syntax time = performancetiming.domainlookupend; specifications specification status comment navigation timingthe definition of 'performancetiming.domainlookupend' in that specification.
PerformanceTiming.domainLookupStart - Web APIs
the legacy performancetiming.domainlookupstart read-only property returns an unsigned long long representing the moment, in miliseconds since the unix epoch, where the domain lookup starts.
... syntax time = performancetiming.domainlookupstart; specifications specification status comment navigation timingthe definition of 'performancetiming.domainlookupstart' in that specification.
XDomainRequest.abort() - Web APIs
aborts an xdomainrequest.
... syntax xdr.abort(); example var xdr = new xdomainrequest(); xdr.open("get", "http://example.com/api/method"); xdr.send(); xdr.abort(); specification not part of any specification.
XDomainRequest.ontimeout - Web APIs
an event handler which is called when a pending xdomainrequest times out.
... example var xdr = new xdomainrequest(); xdr.open("post", "http://example.com/api/method"); xdr.ontimeout = function(){ //handle timeout } xdr.onload = function(){ //handle response with xdr.responsetext } xdr.send("param1=value1&param2=value2"); specification not part of any specification.
XDomainRequest.open() - Web APIs
opens an xdomainrequest which is configured to use a given method (get/post) and url.
... example var xdr = new xdomainrequest(); xdr.open("get", "http://example.com/api/method"); specification not part of any specification.
XDomainRequest.responseText - Web APIs
returns the response body of an xdomainrequest as a string.
... note: this property is valid during the xdomainrequest.onprogress and xdomainrequest.onload events.
XDomainRequest.send() - Web APIs
sends an xdomainrequest which has previously been opened calling xdomainrequest.open().
... example var xdr = new xdomainrequest(); xdr.open("post", "http://example.com/api/method"); xdr.onload = function(){ //handle response with xdr.responsetext } xdr.send("param1=value1&param2=value2"); specification not part of any specification.
Using the DOM File API in chrome code - Extensions
if you want to use the dom file api in chrome code, you can do so without restriction.
Node (DOM) - MDN Web Docs Glossary: Definitions of Web-related terms
GlossaryNodeDOM
in the context of the dom, a node is a single point in the node tree.
browser.dom.window.dump.enabled
related browser.dom.window.dump.file window.dump ...
dom.event.clipboardevents.enabled
dom.event.clipboardevents.enabled lets websites get notifications if the user copies, pastes, or cuts something from a web page, and it lets them know which part of the page had been selected.
nsIDOMCanvasRenderingContext2D
the nsidomcanvasrenderingcontext2d interface implements the dom canvasrenderingcontext2d interface.
nsIDOMDesktopNotification
the nsidomdesktopnotification interface implements the dom notification interface.
nsIDOMDesktopNotificationCenter
the nsidomdesktopnotificationcenter interface implements the dom navigator.moznotification interface.
nsIDOMEventListener
the nsidomeventlistener interface implements the dom eventlistener interface.
nsIDOMEventTarget
dom/interfaces/events/nsidomeventtarget.idlscriptable this interface is the interface implemented by all event targets in the document object model.
nsIDOMHTMLFormElement
the nsidomhtmlformelement interface implements the dom htmlformelement interface.
nsIDOMMozNetworkStatsData
dom/network/interfaces/nsidomnetworkstats.idlscriptable represents a single record in the network statistics database, as reported using the nsidommoznetworkstatsmanager interface.
Element: DOMMouseScroll event - Web APIs
the dom dommousescroll event is fired asynchronously when mouse wheel or similar device is operated and the accumulated scroll amount is over 1 line or 1 page since last event.
XDomainRequest.timeout - Web APIs
gets or sets the amount of time in milliseconds until an xdomainrequest times out.
Index - Web APIs
WebAPIIndex
found 5328 pages: # page tags and summary 1 web apis api, dom, landing, reference, web when writing code for the web, there are a large number of web apis available.
... 6 abortcontroller api, abortcontroller, experimental, interface, reference the abortcontroller interface represents a controller object that allows you to abort one or more dom requests as and when desired.
... 8 abortcontroller.abort() api, abortcontroller, experimental, fetch, method, reference, abort() the abort() method of the abortcontroller interface aborts a dom request (e.g.
...And 1687 more matches
Index
MozillaTechXPCOMIndex
14 introduction to xpcom for the dom developing mozilla warning: this document has not yet been reviewed by the dom gurus, it might contain some errors.
... 16 components object dom, gecko, xpcom:language bindings, xpconnect the components object is the object through which xpconnect functionality is reflected into javascript.
...the result is structured cloned back to the original context, unless it is native (for example, if it returns a dom node, this is not structured cloned, because the original context will see that through an xraywrapper already), so it's guaranteed to behave predictably.
...And 116 more matches
WebIDL bindings
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.
...And 81 more matches
Event reference
dom events are sent to notify code of interesting things that have taken place.
... (see non-standard events) storage update events checking downloading error noupdate obsolete updateready value change events broadcast checkboxstatechange hashchange input radiostatechange readystatechange valuechange uncategorized events invalid message message open show less common and non-standard events abortable fetch events event name fired when abort a dom request is aborted, i.e.
... svg events svgabort svgerror svgload svgresize svgscroll svgunload svgzoom database events abort blocked complete error success upgradeneeded versionchange script events afterscriptexecute beforescriptexecute menu events dommenuitemactive dommenuiteminactive window events close popup events popuphidden popuphiding popupshowing popupshown tab events visibilitychange battery events chargingchange chargingtimechange dischargingtimechange levelchange call events alerting busy callschanged cfstatechange connecting dialing disconnected disconnecting error held, holding incoming resuming statechange voicechange sensor events compassneedscalibration devicemotion deviceorientation orientationchange smartcard events icccardlockerror iccinfo...
...And 61 more matches
Mozilla accessibility architecture
readers of this document should be familiar with interfaces, the w3c dom, xul and the concept of a layout object tree.
...accessible nodes and interfaces every node in the dom tree could be important to 3rd party assistive technology.
...accessible tree contains only a subset of nodes from the dom tree not all dom nodes are exposed through accessibility api toolkits -- only those objects deemed important by the developers of the toolkit.
...And 47 more matches
Index - Archive of obsolete content
17 cross-domain content scripts add-on sdk, add-ons, extensions no summary!
... 50 page-worker add-on sdk create a permanent, invisible page and access its dom.
... 189 html to dom code snippets, dom, guide, html, intermediate, needsupdate although you can now natively parse html using domparser and xmlhttprequest, this is a new feature that is not yet supported by all browsers in use in the wild.
...And 45 more matches
Advanced Svelte: Reactivity, lifecycle, accessibility - Learn web development
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.
...And 43 more matches
Gecko info for Windows accessibility vendors
the base of our support for these products is msaa (microsoft active accessibility), external readonly dom support, and the keyboard api/user interface.
...it supports html, xhtml, cascading style sheets (css) and the document object model (dom).
... dom: document object model this is the w3c's specification for how web content is exposed to javascript and other languages.
...And 42 more matches
CustomizableUI.jsm
note that these are also abstract cross-window objects; customizableui will manage the actual dom manipulation involved with adding/moving/removing widgets in all windows for you.
... there are three main types of widgets: 'legacy' xul widgets, which are the way customizableui represents widgets whose dom representation is present (or overlaid) into a window; api-style widgets, which are the new widgets customizableui can create and manage for you.
... customizableui provides apis to add, move and remove all these different widgets, and mostly abstracts the dom away from you.
...And 42 more matches
Index - MDN Web Docs Glossary: Definitions of Web-related terms
7 arpa glossary, infrastructure .arpa (address and routing parameter area) is a top-level domain used for internet infrastructure purposes, especially reverse dns lookup (i.e., find the domain name for a given ip address).
... 12 accessibility tree (aom) aom, accessibility, dom, glossary, reference the accessibility tree, or accessibility object model (aom), contains accessibility-related information for most html elements.
...specifically, blink began as a fork of the webcore library in webkit, which handles layout, rendering, and dom, but now stands on its own as a separate rendering engine.
...And 39 more matches
Performance best practices for Firefox front-end engineers
as of bug 1353206, you can also schedule idle events in non-dom contexts by using services.tm.idledispatchtomainthread.
...this allows you to put all of your dom writes (most importantly, anything that could change the size or position of things in the dom) just before the style and layout steps of the pipeline, combining all the style and layout calculations into a single batch so it all happens once, in a single frame tick, instead of across multiple frames.
...this happens the first time the page loads and the css is initially applied, but can happen again if javascript modifies the dom.
...And 39 more matches
Migrate apps from Internet Explorer to Mozilla - Archive of obsolete content
they include: html 4.01, xhtml 1.0 and xhtml 1.1 cascade style sheets (css): css level 1, css level 2.1 and parts of css level 3 document object model (dom): dom level 1, dom level 2 and parts of dom level 3 mathematical markup language: mathml version 2.0 extensible markup language (xml): xml 1.0, namespaces in xml, associating style sheets with xml documents 1.0, fragment identifier for xml xsl transformations: xslt 1.0 xml path language: xpath 1.0 resource description framework: rdf simple object access protocol: soap 1.1 ecma-262, revisio...
... dom differences the document object model (dom) is the tree structure that contains the document elements.
... accessing elements to retrieve an element reference using the cross-browser approach, you use document.getelementbyid(aid), which works in internet explorer 5.0+, mozilla-based browsers, other w3c-compliant browsers and is part of the dom level 1 specification.
...And 35 more matches
nsIContentPrefService2
dom/interfaces/base/nsicontentprefservice2.idlscriptable asynchronous api for content preferences 1.0 66 introduced gecko 20.0 inherits from: nsisupports last changed in gecko 20.0 (firefox 20.0 / thunderbird 20.0 / seamonkey 2.17) description content preferences allow the application to associate arbitrary data, or "preferences", with specific domains, or web "content".
... specifically, a content preference is a structure with three values: a domain with which the preference is associated, a name that identifies the preference within its domain, and a value.
... (see nsicontentpref below.) for example, if you want to remember the user's preference for a certain zoom level on www.mozilla.org pages, you might store a preference whose domain is "www.mozilla.org", whose name is "zoomlevel", and whose value is the numeric zoom level.
...And 35 more matches
Adding a new event
a simple dom event which can be implemented with webidl and widgetevent or something.
... a dom event which represents a native event like a user action such as keyboard or mouse input.
... it's not a dom event.
...And 30 more matches
IME handling guide
this represents a dom compositionstart event.
... the mdata value is a selected string at dispatching the dom event and it's automatically set by textcomposition.
...this represents a dom compositionupdate event.
...And 30 more matches
nsIAccessibleRetrieval
accessible/public/nsiaccessibleretrieval.idlscriptable an interface for in-process accessibility clients wishing to get an nsiaccessible or nsiaccessnode for a given dom node.
... inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview nsiaccessible getaccessiblefor(in nsidomnode anode); nsiaccessible getaccessibleinshell(in nsidomnode anode, in nsipresshell apresshell); nsiaccessible getaccessibleinweakshell(in nsidomnode anode, in nsiweakreference apresshell); obsolete since gecko 2.0 nsiaccessible getaccessibleinwindow(in nsidomnode anode, in nsidomwindow adomwin); obsolete since gecko 2.0 nsiaccessible getapplicationaccessible(); nsiaccessible getattachedaccessiblefor(in nsidomnode anode); nsiaccessible getcachedaccessible(in nsidomnode anode, in nsiweakreference ashell); obsolete since gecko 2.0 nsiaccessnode getcachedaccessnode...
...(in nsidomnode anode, in nsiweakreference ashell); obsolete since gecko 2.0 nsidomnode getrelevantcontentnodefor(in nsidomnode anode); astring getstringeventtype(in unsigned long aeventtype); astring getstringrelationtype(in unsigned long arelationtype); astring getstringrole(in unsigned long arole); nsidomdomstringlist getstringstates(in unsigned long astates, in unsigned long aextrastates); methods getaccessiblefor() return an nsiaccessible for a dom node in pres shell 0.
...And 28 more matches
Extending a Protocol
the tutorial is designed for browser engineers who are implementing dom/web apis that need to, for example, send a message to the os or spin up something off the main thread - so it's biased towards supporting w3c/whatwg dom apis.
...the method will take one argument, a domstring, which we will pass to the parent process.
... the webidl for this will be: partial interface navigator { promise<domstring> echo(domstring somestring); }; learning goals are: extending an existing ipdl protocol.
...And 27 more matches
sslfnc.html
therefore, an application cannot use nss to perform any cryptographic operations until after it enables appropriate cipher suites by calling one of the ssl export policy functions: nss_setdomesticpolicy, nss_setexportpolicy, and nss_setfrancepolicy configure the cipher suites for domestic, international, and french versions of software products with encryption features.
...the functions nss_setdomesticpolicy, nss_setexportpolicy, and nss_setfrancepolicy permit the use of approved cipher suites for domestic, international, and french versions, respectively, of software products with encryption features.
... applications must call one of the export policy functions before attempting to perform any cryptographic operations: nss_setdomesticpolicy nss_setexportpolicy nss_setfrancepolicy ssl_cipherpolicyset the following function is also described in this section: ssl_cipherpolicyget nss_setdomesticpolicy configures cipher suites to conform with current u.s.
...And 27 more matches
nsISessionStore
method overview void deletetabvalue(in nsidomnode atab, in astring akey); void deletewindowvalue(in nsidomwindow awindow, in astring akey); nsidomnode duplicatetab(in nsidomwindow awindow, in nsidomnode atab); nsidomnode forgetclosedtab(in nsidomwindow awindow, in unsigned long aindex); nsidomnode forgetclosedwindow(in unsigned long aindex); astring getbrowserstate(); unsigned long get...
...closedtabcount(in nsidomwindow awindow); astring getclosedtabdata(in nsidomwindow awindow); unsigned long getclosedwindowcount(); astring getclosedwindowdata(); astring gettabstate(in nsidomnode atab); astring gettabvalue(in nsidomnode atab, in astring akey); astring getwindowstate(in nsidomwindow awindow); astring getwindowvalue(in nsidomwindow awindow, in astring akey); void init(in nsidomwindow awindow); void persisttabattribute(in astring aname); void restorelastsession(); void setbrowserstate(in astring astate); void settabstate(in nsidomnode atab, in astring astate); void settabvalue(in nsidomnode atab, in astring akey, in astring astringvalue); void setwind...
...owstate(in nsidomwindow awindow, in astring astate, in boolean aoverwrite); void setwindowvalue(in nsidomwindow awindow, in astring akey, in astring astringvalue); nsidomnode undoclosetab(in nsidomwindow awindow, in unsigned long aindex); nsidomwindow undoclosewindow(in unsigned long aindex); attributes attribute type description canrestorelastsession boolean is it possible to restore the previous session.
...And 27 more matches
nsITextInputProcessor
dom/interfaces/base/nsitextinputprocessor.idlscriptable this interface is a text input events synthesizer and manages its composition and modifier state 1.0 66 introduced gecko 38 inherits from: nsisupports last changed in gecko 38.0 (firefox 38.0 / thunderbird 38.0 / seamonkey 2.35) the motivation of this interface is to provide better api than nsidomwindowutils to dispatch key events and create, modify, and commit composition in higher level.
... nsidomwindowutils has provided the methods which dispatched keyboard events and composition events almost directly.
... for example, the implementation of this interface manages modifier state and composition state, initializes dom events from minimum information, and doesn't dispatch some events if they are not necessary.
...And 25 more matches
Creating Custom Events That Can Pass Data
this page describes how to implement custom dom events that can be used to pass data.
...note that starting with version 6, firefox supports dom level 3 customevent, which lets you dispatch custom events with arbitrary data from javascript.
...as of gecko 1.8, if your event names do not start with "nsdom" and their interfaces do not start with "nsidom" then you can forget about passing data.
...And 24 more matches
Element - Web APIs
WebAPIElement
element.classlist read only returns a domtokenlist containing the list of class attributes.
... element.classname is a domstring representing the class of the element.
... element.computedname read only returns a domstring containing the label exposed to accessibility.
...And 23 more matches
nsIHTMLEditor
inherits from: nsisupports last changed in gecko 5.0 (firefox 5.0 / thunderbird 5.0 / seamonkey 2.2) method overview void adddefaultproperty(in nsiatom aproperty, in astring aattribute, in astring avalue); void addinsertionlistener(in nsicontentfilter infilter); void align(in astring aalign); boolean breakisvisible(in nsidomnode anode); boolean candrag(in nsidomevent aevent); void checkselectionstateforanonymousbuttons(in nsiselection aselection); nsidomelement createanonymouselement(in astring atag, in nsidomnode aparentnode, in astring aanonclass, in boolean aiscreatedhidden); nsidomelement createelementwithdefaults(in astring atagname); void decreasefontsize(); ...
... void dodrag(in nsidomevent aevent); void getalignment(out boolean amixed, out short aalign); astring getbackgroundcolorstate(out boolean amixed); nsidomelement getelementorparentbytagname(in astring atagname, in nsidomnode anode); astring getfontcolorstate(out boolean amixed); astring getfontfacestate(out boolean amixed); astring getheadcontentsashtml(); astring gethighlightcolorstate(out boolean amixed); void getindentstate(out boolean acanindent, out boolean 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 a...
...string avalue, out boolean afirst, out boolean aany, out boolean aall); nsisupportsarray getlinkedobjects(); void getlistitemstate(out boolean amixed, out boolean ali, out boolean adt, out boolean add); void getliststate(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 aignorespuriousdragevent); void increasefontsize(); void indent(in astring aindent); void insertelementatselection(in nsidomelement aelement, in boolean adeleteselection); void insertfromdrop(in nsidomevent aevent); void ...
...And 20 more matches
Web Components
shadow dom: a set of javascript apis for attaching an encapsulated "shadow" dom tree to an element — which is rendered separately from the main document dom — and controlling associated functionality.
... 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.
...And 20 more matches
Focus management with Vue refs - Learn web development
we'll look at using vue refs to handle this — an advanced feature that allows you to have direct access to the underlying dom nodes below the virtual dom, or direct access from one component to the internal dom structure of a child component.
... 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.
...specifically, when a user activates the "edit" button, we remove the "edit" button from the dom, but we don't move the user's focus anywhere, so in effect it just disappears.
...And 19 more matches
Error codes returned by Mozilla APIs
ns_error_dom_index_size_err (0x80530001) an attempt was made to adjust the value of a text node using an index that was out of range.
... ns_error_dom_domstring_size_err (0x80530002) an attempt was made to create a string larger than is supported.
... ns_error_dom_hierarchy_request_err (0x80530003) a node was inserted into a location where it cannot go.
...And 19 more matches
Element.classList - Web APIs
WebAPIElementclassList
the element.classlist is a read-only property that returns a live domtokenlist collection of the class attributes of the element.
... syntax const elementclasses = elementnodereference.classlist; returns a domtokenlist representing the contents of the element's class attribute.
... if the class attribute is not set or empty, it returns an empty domtokenlist, i.e.
...And 19 more matches
HTMLAnchorElement - Web APIs
element.accesskey is a domstring representing a single character that switches input focus to the hyperlink.
... htmlanchorelement.download is a domstring indicating that the linked resource is intended to be downloaded rather than displayed in the browser.
... htmlanchorelement.hreflang is a domstring that reflects the hreflang html attribute, indicating the language of the linked resource.
...And 19 more matches
Proxy Auto-Configuration (PAC) file - HTTP
(of course, the javascripts must be edited to reflect your site's domain name and/or subnets.) predefined functions and environment these functions can be used in building the pac file: hostname based conditions isplainhostname() dnsdomainis() localhostordomainis() isresolvable() isinnet() related utility functions dnsresolve() convert_addr() myipaddress() dnsdomainlevels() url/hostname based conditions shex...
... description true if and only if there is no domain name in the hostname (no dots).
... examples isplainhostname("www.mozilla.org") // false isplainhostname("www") // true dnsdomainis() syntax dnsdomainis(host, domain) parameters host is the hostname from the url.
...And 19 more matches
window/utils - Archive of obsolete content
globals functions getmostrecentbrowserwindow() get the topmost browser window, as an nsidomwindow instance.
... returns nsidomwindow: the topmost browser window.
...this function wraps nsidomwindowutils.currentinnerwindowid.
...And 18 more matches
Manipulating documents - Learn web development
this is usually done by using the document object model (dom), a set of apis for controlling html and styling information that makes heavy use of the document object.
... in this article we'll look at how to use the dom in detail, along with some other interesting apis that can alter your environment in interesting ways.
... objective: to gain familiarity with the core dom apis, and the other apis commonly associated with dom and document manipulation the important parts of a web browser web browsers are very complicated pieces of software with a lot of moving parts, many of which can't be controlled or manipulated by a web developer using javascript.
...And 18 more matches
nsIEffectiveTLDService
netwerk/dns/nsieffectivetldservice.idlscriptable this is an interface that examines a hostname and determines the longest portion that should be treated as though it were a top-level domain (tld).
... it can also determine the base domain of a uri.
...cookie setting and domain highlighting, but you should check whether it's the right answer for your application.
...And 18 more matches
Implementing a Microsoft Active Accessibility (MSAA) Server - Accessibility
on microsoft windows, these kinds of assistive technology acquire this necessary information via a combination of hacks, msaa and proprietary doms.
...for example, gecko support isimpledomnode to provide information about the dom node for an accessible object.
...this information may be in the form of extensions to msaa, like mozilla has done with isimpledomnode (you can qi to it from iaccessible).
...And 18 more matches
nsIFocusManager
dom/interfaces/base/nsifocusmanager.idlscriptable please add a summary to this article.
....0 66 introduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 5.0 (firefox 5.0 / thunderbird 5.0 / seamonkey 2.2) implemented by: @mozilla.org/focus-manager;1 as a service: var focusmanager = components.classes["@mozilla.org/focus-manager;1"] .getservice(components.interfaces.nsifocusmanager); method overview void clearfocus(in nsidomwindow awindow); void contentremoved(in nsidocument adocument, in nsicontent aelement); native code only!
... nsidomelement getfocusedelementforwindow(in nsidomwindow awindow, in prbool adeep, out nsidomwindow afocusedwindow); pruint32 getlastfocusmethod(in nsidomwindow window); void movecarettofocus(in nsidomwindow awindow); void elementisfocusable(in nsidomelement aelement, in unsigned long aflags); nsidomelement movefocus(in nsidomwindow awindow, in nsidomelement astartelement, in unsigned long atype, in unsigned long aflags); void setfocus(in nsidomelement aelement, in unsigned long aflags); void windowhidden(in nsidomwindow awindow); native code only!
...And 17 more matches
Framework main features - Learn web development
previous overview: client-side javascript frameworks next each major javascript framework has a different approach to updating the dom, handling browser events, and providing an enjoyable developer experience.
... domain-specific languages all of the frameworks discussed in this module are powered by javascript, and all allow you to use domain-specific languages (dsls) in order to build your applications.
...typescript is not concerned with the writing of user interfaces, but it is a domain-specific language, and has significant differences to vanilla javascript.
...And 16 more matches
Mozilla’s UAAG evaluation report
ref("capability.policy.popupsites.windowinternal.open", "noaccess"); or turn it off everywhere: user_pref("capability.policy.default.windowinternal.open", "noaccess"); override popping up new windows on target=anything: user_pref("browser.target_new_blocked", true); override popup windows at beginning of new page load (blocks most popup advertisements): user_pref("dom.disable_open_during_load", true); 5.4 selection and focus in viewport.
... checkpoint title status notes/plans 6.1 dom read access.
... (p1) vg the dom is available in-process, but not via an out-of-process (com) interface.
...And 16 more matches
nsISelection
as a service: var selection = components.classes["@mozilla.org/????????????????????????????"] .createinstance(components.interfaces.nsiselection); method overview void addrange(in nsidomrange range); void collapse(in nsidomnode parentnode, in long offset); [noscript,notxpcom,nostdcall] boolean collapsed(); void collapsenative(in nsidomnode parentnode, in long offset); native code only!
... void collapsetoend(); void collapsetostart(); boolean containsnode(in nsidomnode node, in boolean partlycontained); void deletefromdocument(); void extend(in nsidomnode parentnode, in long offset); void extendnative(in nsidomnode parentnode, in long offset); native code only!
... nsidomrange getrangeat(in long index); void modify(in domstring alter, in domstring direction, in domstring granularity); void removeallranges(); void removerange(in nsidomrange range); void selectallchildren(in nsidomnode parentnode); void selectionlanguagechange(in boolean langrtl); domstring tostring(); attributes attribute type description anchornode nsidomnode returns the node in which the selection begins.
...And 16 more matches
Window - Web APIs
WebAPIWindow
the window interface represents a window containing a dom document; the document property points to the dom document loaded in that window.
...many of these are documented in the javascript reference and the dom reference.
.../web/api/window" target="_top"><rect x="1" y="1" width="75" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">window</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constructors see also the dom interfaces.
...And 16 more matches
Critical rendering path - Web Performance
optimizing the critical render path improves render performance.the critical rendering path includes the document object model (dom), css object model (cssom), render tree and layout.
...the html may request javascript, which may, in turn, alter the dom.
...the browser then begins parsing the html, converting the received bytes to the dom tree.
...And 16 more matches
Dynamically modifying XUL-based user interface - Archive of obsolete content
this article discusses manipulating xul interfaces, using dom and other apis.
... it explains the concept of dom documents, demonstrates a few simple examples of using dom calls to perform basic manipulations on a document, and then demonstrates working with anonymous xbl content using mozilla-specific methods.
...you may also want to read some introductory documents about dom, like the about the document object model article or the introduction page of the gecko dom reference.
...And 15 more matches
nsIWindowMediator
nsisimpleenumerator getenumerator(in wstring awindowtype); nsidomwindow getmostrecentwindow(in wstring awindowtype); nsidomwindow getouterwindowwithid(in unsigned long long aouterwindowid); nsisimpleenumerator getxulwindowenumerator(in wstring awindowtype); pruint32 getzlevel(in nsixulwindow awindow); native code only!
... nsisimpleenumerator getzorderdomwindowenumerator(in wstring awindowtype, in boolean afronttoback); nsisimpleenumerator getzorderxulwindowenumerator(in wstring awindowtype, in boolean afronttoback); void registerwindow(in nsixulwindow awindow); native code only!
... var {cc: classes, ci: interfaces} = components; var windowlistener = { onopenwindow: function (awindow) { // wait for the window to finish loading let domwindow = awindow.queryinterface(ci.nsiinterfacerequestor).getinterface(ci.nsidomwindowinternal || ci.nsidomwindow); domwindow.addeventlistener("load", function () { domwindow.removeeventlistener("load", arguments.callee, false); //this removes this load function from the window //window has now loaded now do stuff to it //as example this will add a funct...
...And 15 more matches
nsIWindowWatcher
embedding/components/windowwatcher/public/nsiwindowwatcher.idlscriptable this interface is the keeper of gecko/dom windows.
... method overview nsiwebbrowserchrome getchromeforwindow(in nsidomwindow awindow); nsiauthprompt getnewauthprompter(in nsidomwindow aparent); nsiprompt getnewprompter(in nsidomwindow aparent); nsidomwindow getwindowbyname(in wstring atargetname, in nsidomwindow acurrentwindow); nsisimpleenumerator getwindowenumerator(); nsidomwindow openwindow(in nsidomwindow aparent, in string aurl, in string aname, in string afeatur...
...es, in nsisupports aarguments); void registernotification(in nsiobserver aobserver); void setwindowcreator(in nsiwindowcreator creator); void unregisternotification(in nsiobserver aobserver); attributes attribute type description activewindow nsidomwindow the watcher serves as a global storage facility for the current active (front most non-floating-palette-type) window, storing and returning it on demand.
...And 15 more matches
HTMLAreaElement - Web APIs
element.accesskey is a domstring containing a single character that switches input focus to the control.
... htmlareaelement.alt is a domstring that reflects the alt html attribute, containing alternative text for the element.
... htmlareaelement.coords is a domstring that reflects the coords html attribute, containing coordinates to define the hot-spot region.
...And 15 more matches
Node - Web APIs
WebAPINode
the dom node interface is an abstract base class upon which many other dom api objects are based, thus letting those object types to be used similarly and often interchangeably.
... in addition, every kind of dom node is represented by an interface based on node.
... node.baseuriread only returns a domstring representing the base url of the document containing the node.
...And 15 more matches
Navigation and resource timings - Web Performance
as displayed in the image below, the navigation process goes from navigationstart, unloadeventstart, unloadeventend, redirectstart, redirectend, fetchstart, domainlookupstart, domainlookupend, connectstart , connectend, secureconnectionstart, requeststart, responsestart, responseend, domloading, dominteractive, domcontentloadedeventstart, domcontentloadedeventend, domcomplete, loadeventstart, and loadeventend.
... domainlookupend when the domain lookup is finished.
... domainlookupstart when the domain lookup starts.
...And 15 more matches
Getting started with Ember - Learn web development
the glimmer vm enables extremely fast dom change tracking without the need to manage and diff a cached virtual representation (which is a common approach to mitigating the slow i/o of dom changes).
... getting started the rest of the ember material you'll find here consists of a multi-part tutorial, in which we'll make a version of the classic todomvc sample app, teaching you how to use the essentials of the ember framework along the way.
... todomvc is a basic to-do tracking app implemented in many different technologies.
...And 14 more matches
Index - Firefox Developer Tools
6 dom inspector dom, dom:tools, dom_inspector, extensions, extensions:tools, themes, themes:tools, tools, web development, web development:tools, xul, xul:tools the dom inspector (also known as domi) is a developer tool used to inspect, browse, and edit the document object model of documents - usually web pages or xul windows.
... the dom hierarchy can be navigated using a two-paned window that allows a variety of different views on the document and all nodes within.
... 7 dom inspector faq dom_inspector the file menu contains approaches which will allow you to inspect a document.
...And 14 more matches
HTMLImageElement - Web APIs
4" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlimageelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constructor image() the image() constructor creates and returns a new htmlimageelement object representing an html <img> element which is not attached to any dom tree.
... htmlimageelement.alt a domstring that reflects the alt html attribute, thus indicating the alternate fallback content to be displayed if the image has not been loaded.
... htmlimageelement.crossorigin a domstring specifying the cors setting for this image element.
...And 14 more matches
SVGStringList - Web APIs
svg string list interface the svgstringlist defines a list of domstring objects.
... 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 normative document svg 1.1 (2nd edition) properties name ...
... 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 14 more matches
Using HTTP cookies - HTTP
WebHTTPCookies
additional restrictions to a specific domain and path can be set, limiting where the cookie is sent.
... here is an example: set-cookie: id=a3fwa; expires=wed, 21 oct 2021 07:28:00 gmt; secure; httponly define where cookies are sent the domain and path attributes define the scope of the cookie: what urls the cookies should be sent to.
... domain attribute the domain attribute specifies which hosts are allowed to receive the cookie.
...And 14 more matches
nsIAccessNode
accessible/public/nsiaccessnode.idlscriptable an interface used by in-process accessibility clients to get style, window, markup and other information about a dom node.
... when accessibility is active in gecko, every dom node can have one nsiaccessnode.
...the nsiaccessnode tree for a given dom window has a one to one relationship to the dom tree.
...And 13 more matches
Background Tasks API - Web APIs
certainly most if not all code that is capable of making changes to the dom is running in the main thread, since it's common for user interface changes to only be available to the main thread.
... avoid making changes to the dom within your idle callback.
...if your callback needs to change the dom, it should use window.requestanimationframe() to schedule that.
...And 13 more matches
HTMLObjectElement - Web APIs
htmlobjectelement.align is a domstring representing an enumerated property indicating alignment of the element's contents with respect to the surrounding context.
... htmlobjectelement.archive is a domstring that reflects the archive html attribute, containing a list of archives for resources for this object.
... htmlobjectelement.border is a domstring that reflects the border html attribute, specifying the width of a border around the object.
...And 13 more matches
HTMLTableElement - Web APIs
when set, if the object doesn't represent a <caption>, a domexception with the hierarchyrequesterror name is thrown.
...when set, if the object doesn't represent a <thead>, a domexception with the hierarchyrequesterror name is thrown.
...when set, if the object doesn't represent a <tfoot>, a domexception with the hierarchyrequesterror name is thrown.
...And 13 more matches
Populating the page: how browsers work - Web Performance
parsing is the step the browser takes to turn the data it receives over the network into the dom and cssom, which is used by the renderer to paint a page to the screen.
... the dom is the internal representation of the markup for the browser.
... the dom is also exposed, and can be manipulated through various apis in javascript.
...And 13 more matches
Browser Feature Detection - Archive of obsolete content
among the methods of browser detection, many people recommend using the existence of specific properties or methods in a browser's dom to detect the browser type and whether it supports a given operation.
... 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 sufficient dom css 1 and dom level 1 & 2 document property and method support to enable cross browser web development.
...And 12 more matches
Introduction to events - Learn web development
in the following example, we have a single <button>, which when pressed, makes the background change to a random color: <button>change color</button> button { margin: 10px }; the javascript looks like so: const btn = document.queryselector('button'); function random(number) { return math.floor(math.random() * (number+1)); } btn.onclick = function() { const rndcol = 'rgb(' + random(255) + ',' + random(255) + ',' + random(255) + ')'; document.body.style.backgroundcolor = rndcol; } in this code,...
...we also define a function that returns a random number.
...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.
...And 12 more matches
Storage access policy: Block cookies from trackers
firefox nightly may also contain experimental features that we don't yet plan to ship to release users; experimental features will not be included in this documentation, but may nevertheless impact the functionality of domains classified as trackers.
... 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.
...domains are matched against the list in accordance with the safebrowsing v4 specification.
...And 12 more matches
Autoconfiguration in Thunderbird
configuration server at isp isps have the option to provide their configuration information themselves directly to users, by setting up a web server at autoconfig.<domain>, which simply returns a static xml file with the configuration, as described below.
... guessing if all other mechanisms failed, thunderbird tries to guess the configuration, by trying common server names like imap.<domain>, smtp.<domain>, mail.<domain> etc., and, when a mail server answers, checking whether it supports ssl, starttls and encrypted passwords (cram-md5).
... all the lookup mechanisms use the email address domain as base for the lookup.
...And 12 more matches
Document - Web APIs
WebAPIDocument
the document interface represents any web page loaded in the browser and serves as an entry point into the web page's content, which is the dom tree.
... the dom tree includes elements such as <body> and <table>, among many others.
... document.implementationread only returns the dom implementation associated with the current document.
...And 12 more matches
HTMLIFrameElement - Web APIs
htmliframeelement.align is a domstring that specifies the alignment of the frame with respect to the surrounding context.
... htmliframeelement.frameborder is a domstring that indicates whether to create borders between frames.
... htmliframeelement.height is a domstring that reflects the height html attribute, indicating the height of the frame.
...And 12 more matches
HTMLLinkElement - Web APIs
htmllinkelement.as is a domstring representing the type of content being loaded by the html link.
... htmllinkelement.crossorigin is a domstring that corresponds to the cors setting for this link element.
... htmllinkelement.href is a domstring representing the uri for the target resource.
...And 12 more matches
KeyboardEvent - Web APIs
they are accessed as keyboardevent.dom_key_location_standard and so forth.
... keyboard location identifiers constant value description dom_key_location_standard 0x00 the key described by the event is not identified as being located in a particular area of the keyboard; it is not located on the numeric keypad (unless it's the numlock key), and for keys that are duplicated on the left and right sides of the keyboard, the key is, for whatever reason, not to be associated with that location.
... dom_key_location_left 0x01 the key is one which may exist in multiple locations on the keyboard and, in this instance, is on the left side of the keyboard.
...And 12 more matches
Choosing between www and non-www URLs - HTTP
what are domain names?
... in an http url, the first substring that follows the initial http:// or https:// is called the domain name.
... this domain name is hosted on a server where the document resides.
...And 12 more matches
Same-origin policy - Web security
exceptions in internet explorer internet explorer has two major exceptions to the same-origin policy: trust zones if both domains are in the highly trusted zone (e.g.
... corporate intranet domains), then the same-origin limitations are not applied.
...a script can set the value of document.domain to its current domain or a superdomain of its current domain.
...And 12 more matches
Content Scripts - Archive of obsolete content
you can attach content scripts to the page, to access and manipulate the page's dom.
...it takes one of: "start": load the scripts immediately after the document element for the page is inserted into the dom.
... at this point the dom content hasn't been loaded yet, so the script won't be able to interact with it.
...And 11 more matches
Inner-browsing extending the browser navigation paradigm - Archive of obsolete content
an implementation can also use other transport technologies such as soap-based remote procedure calls, xmlhttprequest interfaces, or dom 3 load.
...but the real showcase for new browser features and web standards like html 4.0 and dom level 2, and xml are models like inner-browsing, where these technologies can begin to be used in the way that they were envisioned.
... many of the new web technologies in the html 4.0 specification, xml 1.0, dom level 3 were explicitly created with application-like behavior and more sophisticated navigational models in mind.
...And 11 more matches
Browser Detection and Cross Browser Support - Archive of obsolete content
gecko was designed from the ground up to be compliant with the w3c html, w3c css, w3c xml, w3c dom, and ecmascript (javascript) standards.
...if (document.all) { // ie4 height = document.body.offsetheight; } else if (document.layers) { // nn4 height = window.innerheight; } else { // other height = 0; } with the introduction of the w3c dom, the standard method document.getelementbyid became available in internet explorer 5 and later in netscape 6 (gecko).
...this is not true today and will become even less true as more browsers which support the w3c dom standards are introduced in the future.
...And 11 more matches
A first splash into JavaScript - Learn web development
me</title> <style> html { font-family: sans-serif; } body { width: 50%; max-width: 800px; min-width: 480px; margin: 0 auto; } .lastresult { color: white; padding: 3px; } </style> </head> <body> <h1>number guessing game</h1> <p>we have selected a random number between 1 and 100.
...oo low.</p> <div class="form"> <label for="guessfield">enter a guess: </label><input type="text" id="guessfield" class="guessfield"> <input type="submit" value="submit guess" class="guesssubmit"> </div> <div class="resultparas"> <p class="guesses"></p> <p class="lastresult"></p> <p class="loworhi"></p> </div> <script> // your javascript goes here let randomnumber = math.floor(math.random() * 100) + 1; const guesses = document.queryselector('.guesses'); const lastresult = document.queryselector('.lastresult'); const loworhi = document.queryselector('.loworhi'); const guesssubmit = document.queryselector('.guesssubmit'); const guessfield = document.queryselector('.guessfield'); let guesscount = 1; let resetbutton; func...
...tion checkguess() { let userguess = number(guessfield.value); if (guesscount === 1) { guesses.textcontent = 'previous guesses: '; } guesses.textcontent += userguess + ' '; if (userguess === randomnumber) { lastresult.textcontent = 'congratulations!
...And 11 more matches
Introduction to client-side frameworks - Learn web development
mdn web docs, which you are currently reading this on, uses the react/reactdom framework to power its front end.
...react is used in combination with other libraries to make applications — react and react native enable developers to make mobile applications; react and reactdom enable them to make web applications, etc.
... because react and reactdom are so often used together, react is colloquially understood as a javascript framework.
...And 11 more matches
AbstractRange - Web APIs
the abstractrange abstract interface is the base class upon which all dom range types are defined.
... endcontainer read only the dom node in which the end of the range, as specified by the endoffset property, is located.
... startcontainer read only the dom node in which the beginning of the range, as specified by the startoffset property, is located.
...And 11 more matches
Attr - Web APIs
WebAPIAttr
the attr interface represents one of a dom element's attributes as an object.
... in most dom methods, you will directly retrieve the attribute as a string (e.g., element.getattribute()), but certain functions (e.g., element.getattributenode()) or means of iterating return attr types.
... namespaceuri read only a domstring representing the namespace uri of the attribute, or null if there is no namespace.
...And 11 more matches
BasicCardResponse - Web APIs
sung internetbasiccardresponsechrome no support noedge no support ≤18 — 79firefox full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true) and the dom.payments.request.supportedregions preference (needs to be set to a comma-delineated list of one or more 2-character iso country codes indicating the countries in which to support payments (for example, us,ca.).
...android no support nochrome android full support 57firefox android full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true) and the dom.payments.request.supportedregions preference (needs to be set to a comma-delineated list of one or more 2-character iso country codes indicating the countries in which to support payments (for example, us,ca.).
... 7.0billingaddresschrome no support noedge no support ≤18 — 79firefox full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
...And 11 more matches
EventTarget.addEventListener() - Web APIs
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.
... usecapture optional a boolean indicating whether events of this type will be dispatched to the registered listener before being dispatched to any eventtarget beneath it in the dom tree.
...see dom level 3 events and javascript event order for a detailed explanation.
...And 11 more matches
HTMLTableCellElement - Web APIs
htmltablecellelement.abbr a domstring which can be used on <th> elements (not on <td>), specifying an alternative label for the header cell..
... htmltablecellelement.headers read only is a domsettabletokenlist describing a list of id of <th> elements that represents headers associated with the cell.
... htmltablecellelement.scope a domstring indicating the scope of a <th> cell.
...And 11 more matches
Content type - SVG: Scalable Vector Graphics
in the svg dom, <angle> values are represented using svgangle or svganimatedangle objects.
... 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.
...And 11 more matches
Document Object Model - Archive of obsolete content
« previousnext » the document object model (dom) can be used with xul elements to get information about them or modify them.
... dom introduction the document object model (dom) is used to store the tree of xul nodes.
...the dom structure may be examined and modified using various methods provided for this purpose.
...And 10 more matches
The Implementation of the Application Object Model - Archive of obsolete content
this is referred to as the dom (document object model).
... how are xml dom/aom trees represented in nglayout?
...examples of these interfaces include nsidomelement, nsidomnode, nsixmlcontent, and nsicontent.
...And 10 more matches
nsIContentPolicy - Archive of obsolete content
dom/base/nsicontentpolicy.idlscriptable interface used to implement a content policy mechanism.
... type_document 6 indicates a dom document at the top-level (that is, directly within a browser tab).
... reject_server -3 returned from shouldload() or shouldprocess() if the load/process is rejected based on the server it is hosted on or requested from (acontentlocation or arequestorigin), e.g., if you block an image because it is served from goatse.cx (even if you don't necessarily block other types from that server/domain).
...And 10 more matches
How CSS works - Learn web development
it converts the html into a dom (document object model).
... the dom represents the document in the computer's memory.
... the dom is explained in a bit more detail in the next section.
...And 10 more matches
Index - Learn web development
28 what is a domain name?
... beginner, domain names, infrastructure, intro, needsactivelearning, web domain names are a key part of the internet infrastructure.
... 56 client-side web apis api, articles, beginner, codingscripting, dom, graphics, javascript, landing, learn, media, module, webapi, data when writing client-side javascript for web sites or applications, you will quickly encounter application programming interfaces (apis).
...And 10 more matches
Index
for example, while nss supports random calculation (creation) of a new public/private key pair, it's difficult to work with such a raw key pair.
...instead of simply verifying that the requester of a certificate is in control of an administrative email address at the desired web site's domain, it's required that the ca performs a verification of real world identity documents (such as a company registration document with the country's authority), and it's also required that a browser software performs a revocation check with the ca, prior to granting validity to the certificate.
... modutil supports several mechanisms: rsa, dsa, rc2, rc4, rc5, aes, des, dh, sha1, sha256, sha512, ssl, tls, md5, md2, random (for random number generation), and friendly (meaning certificates are publicly readable).
...And 10 more matches
nsIPromptService
its methods should be used in privileged code instead of dom window.alert, window.confirm, and other similar functions.
...to get an instance, use: var promptservice = components.classes["@mozilla.org/embedcomp/prompt-service;1"] .getservice(components.interfaces.nsipromptservice); method overview void alert(in nsidomwindow aparent, in wstring adialogtitle, in wstring atext); void alertcheck(in nsidomwindow aparent, in wstring adialogtitle, in wstring atext, in wstring acheckmsg, inout boolean acheckstate); boolean confirm(in nsidomwindow aparent, in wstring adialogtitle, in wstring atext); boolean confirmcheck(in nsidomwindow aparent, in wstring adialogtitle, in wstring atext, in ws...
...tring acheckmsg, inout boolean acheckstate); print32 confirmex(in nsidomwindow aparent,in wstring adialogtitle,in wstring atext, in unsigned long abuttonflags,in wstring abutton0title, in wstring abutton1title,in wstring abutton2title,in wstring acheckmsg, inout boolean acheckstate); boolean prompt(in nsidomwindow aparent, in wstring adialogtitle, in wstring atext, inout wstring avalue, in wstring acheckmsg, inout boolean acheckstate); boolean promptusernameandpassword(in nsidomwindow aparent, in wstring adialogtitle, in wstring atext, inout wstring ausername, inout wstring apassword, in wstring acheckmsg, inout boolean acheckstate); boolean promptpassword(in nsidomwindow aparent, in wstring adialogtitle, in wstring atext, inout wstring apassword, in wstrin...
...And 10 more matches
Document.cookie - Web APIs
WebAPIDocumentcookie
;domain=domain (e.g., 'example.com' or 'subdomain.example.com').
...contrary to earlier specifications, leading dots in domain names are ignored, but browsers may decline to set the cookie containing such dots.
... if a domain is specified, subdomains are always included.
...And 10 more matches
HTMLButtonElement - Web APIs
htmlbuttonelement.accesskey is a domstring indicating the single-character keyboard key to give access to the button.
... htmlbuttonelement.formaction is a domstring reflecting the uri of a resource that processes information submitted by the button.
... htmlbuttonelement.formenctype is a domstring reflecting the type of content that is used to submit the form to the server.
...And 10 more matches
KeyboardEvent.location - Web APIs
possible values are: constant value description dom_key_location_standard 0 the key has only one version, or can't be distinguished between the left and right versions of the key, and was not pressed on the numeric keypad or a key that is considered to be part of the keypad.
... dom_key_location_left 1 the key was the left-hand version of the key; for example, the left-hand control key was pressed on a standard 101 key us keyboard.
... dom_key_location_right 2 the key was the right-hand version of the key; for example, the right-hand control key is pressed on a standard 101 key us keyboard.
...And 10 more matches
PerformanceResourceTiming - Web APIs
performanceresourcetiming.workerstartread only returns a domhighrestimestamp immediately before dispatching the fetchevent if a service worker thread is already running, or immediately before starting the service worker thread if it is not already running.
... performanceresourcetiming.redirectstartread only a domhighrestimestamp that represents the start time of the fetch which initiates the redirect.
... performanceresourcetiming.redirectendread only a domhighrestimestamp immediately after receiving the last byte of the response of the last redirect.
...And 10 more matches
Communicating With Other Scripts - Archive of obsolete content
content scripts that have been loaded into the same document by different methods, or the same method called more than once, can pass messages directly to each other using the dom postmessage() api or a customevent.
...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.
...this is true as long as both context scripts have direct access to the same dom objects.
...And 9 more matches
Introduction to SSL - Archive of obsolete content
that way, when a domestic client or server is dealing with another domestic server or client, respectively, it will negotiate the use of the strongest ciphers available.
... and when an domestic client or server is dealing with an international server or client, it will negotiate the use of those ciphers that are permitted under u.s.
...however, the steps involved can be summarized as follows (assuming the use of the cipher suites listed in "cipher suites with rsa key exchange"): the client sends the server the client's ssl version number, cipher settings, randomly generated data, and other information the server needs to communicate with the client using ssl.
...And 9 more matches
Experimental features in Firefox
html element: <dialog> the html <dialog> element and its associated dom apis provide support for html-based modal dialog boxes.
... nightly 53 yes developer edition 53 no beta 53 no release 53 no preference name dom.dialog_element.enabled global attribute: inputmode our implementation of the inputmode global attribute has been updated as per the whatwg spec (bug 1509527), but we still need to make other changes too, like making it available on contenteditable content.
... nightly 75 yes developer edition 75 no beta 75 no release 75 no preference name dom.forms.inputmode <link rel="preload"> the <link> element's rel attribute is intended to help provide performance gains by letting you download resources earlier in the page lifecycle, ensuring that they're available earlier and are less likely to block page rendering.
...And 9 more matches
Observer Notifications
browser:purge-domain-data sent after domain-specific history and other information have been purged.
... the data value is a string form of the domain.
... documents these topics indicate notifications you can monitor related to dom documents.
...And 9 more matches
nsIDocShell
method overview void addsessionstorage(in nsiprincipal principal, in nsidomstorage storage); void addstate(in nsivariant adata, in domstring atitle, in domstring aurl, in boolean areplace); void beginrestore(in nsicontentviewer viewer, in boolean top); void createaboutblankcontentviewer(in nsiprincipal aprincipal); void createloadinfo(out nsidocshellloadinfo loadinfo); void detacheditorfromwindow(); violates the xpcom inte...
...obsolete since gecko 1.8 nsisimpleenumerator getdocshellenumerator(in long aitemtype, in long adirection); nsidomstorage getsessionstorageforprincipal(in nsiprincipal principal, in domstring documenturi, in boolean create); nsidomstorage getsessionstorageforuri(in nsiuri uri, in domstring documenturi); void historypurged(in long numentries); 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 unsign...
...setting this attribute overrides the encoding; however, to update the dom or display of the content, you need have the data reparsed.
...And 9 more matches
Xray vision
scripts running in web pages can add extra properties to dom objects (also known as expando properties) and even redefine standard dom objects to do something unexpected.
... for example: window.confirm() is a dom api that's supposed to ask the user to confirm an action, and return a boolean depending on whether they clicked "ok" or "cancel".
...however, there are some operations for which they are too restrictive: for example, if you need to see expandos on dom objects.
...And 9 more matches
AddressErrors - Web APIs
properties addressline a domstring which, if present, indicates that the addressline property of the paymentaddress could not be validated.
... city a domstring which, if present, indicates that the city property of the paymentaddress could not be validated.
... country a domstring which, if present, indicates that the country property of the paymentaddress could not be validated.
...And 9 more matches
CharacterData - Web APIs
characterdata.data is a domstring representing the textual data contained in this object.
... characterdata.appenddata() appends the given domstring to the characterdata.data string; when this method returns, data contains the concatenated domstring.
... characterdata.deletedata() removes the specified amount of characters, starting at the specified offset, from the characterdata.data string; when this method returns, data contains the shortened domstring.
...And 9 more matches
HTMLElement - Web APIs
htmlelement.accesskey is a domstring representing the access key assigned to the element.
... htmlelement.accesskeylabel read only returns a domstring containing the element's assigned access key.
... htmlelement.contenteditable is a domstring, where a value of true means the element is editable and a value of false means it isn't.
...And 9 more matches
Timing element visibility with the Intersection Observer API - Web APIs
let's start with the global variables: let contentbox; let nextarticleid = 1; let visibleads = new set(); let previouslyvisibleads = null; let adobserver; let refreshintervalid = 0; these are used as follows: contentbox a reference to the <main> element's htmlelement object in the dom.
... these are accessed through each ad's htmlelement.dataset attribute, which provides a domstringmap mapping each custom attribute's name to its value.
...aliquam sed magna aliquam, vestibulum nisi at," + " cursus nunc.</p>"; function buildcontents() { for (let i=0; i<5; i++) { contentbox.appendchild(createarticle(loremipsum)); if (!(i % 2)) { loadrandomad(); } } } the variable loremipsum contains the text we'll use for the body of all of our articles.
...And 9 more matches
PaymentAddress - Web APIs
properties paymentaddress.addressline read only an array of domstring objects providing each line of the address not included among the other properties.
... paymentaddress.country read only a domstring specifying the country in which the address is located, using the iso-3166-1 alpha-2 standard.
... paymentaddress.city read only a domstring which contains the city or town portion of the address.
...And 9 more matches
PerformanceNavigationTiming - Web APIs
performanceentry.starttime read only returns a domhighrestimestamp with a value of "0".
... the interface also supports the following properties: performancenavigationtiming.domcomplete read only a domhighrestimestamp representing a time value equal to the time immediately before the browser sets the current document readiness of the current document to complete.
... performancenavigationtiming.domcontentloadedeventend read only a domhighrestimestamp representing the time value equal to the time immediately after the current document's domcontentloaded event completes.
...And 9 more matches
Index - Developer guides
WebGuideIndex
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.
... 17 event developer guide dom, event, guide, needsupdate, events events refers both to a design pattern used for the asynchronous handling of various incidents which occur in the lifetime of a web page and to the naming, characterization, and use of a large number of incidents of different types.
... 18 creating and triggering events advanced, dom, guide, javascript, needscontent, events this article demonstrates how to create and dispatch dom events.
...And 9 more matches
Set-Cookie - HTTP
header type response header forbidden header name no forbidden response-header name yes syntax set-cookie: <cookie-name>=<cookie-value> set-cookie: <cookie-name>=<cookie-value>; expires=<date> set-cookie: <cookie-name>=<cookie-value>; max-age=<non-zero-digit> set-cookie: <cookie-name>=<cookie-value>; domain=<domain-value> set-cookie: <cookie-name>=<cookie-value>; path=<path-value> set-cookie: <cookie-name>=<cookie-value>; secure set-cookie: <cookie-name>=<cookie-value>; httponly set-cookie: <cookie-name>=<cookie-value>; samesite=strict set-cookie: <cookie-name>=<cookie-value>; samesite=lax set-cookie: <cookie-name>=<cookie-value>; samesite=none // multiple attributes are also possible, for exam...
...ple: set-cookie: <cookie-name>=<cookie-value>; domain=<domain-value>; secure; httponly attributes <cookie-name>=<cookie-value> a cookie begins with a name-value pair: a <cookie-name> can be any us-ascii characters, except control characters, spaces, or tabs.
... __host- prefix: cookies with names starting with __host- must be set with the secure flag, must be from a secure page (https), must not have a domain specified (and therefore aren't sent to subdomains) and the path must be /.
...And 9 more matches
JavaScript technologies overview - JavaScript
one of them is the core language (ecmascript), another is the collection of the web apis, including the dom (document object model).
... dom apis webidl the webidl specification provides the glue between the dom technologies and ecmascript.
... the core of the dom the document object model (dom) is a cross-platform, language-independent convention for representing and interacting with objects in html, xhtml and xml documents.
...And 9 more matches
StringView - Archive of obsolete content
ript arraybuffer interface to create a highly extensible library that anyone can extend by adding methods to the object stringview.prototype to create a collection of methods for such string-like objects (since now: stringviews) which work strictly on arrays of numbers rather than on creating new immutable javascript strings to work with unicode encodings other than javascript's default utf-16 domstrings introduction as web applications become more and more powerful, adding features such as audio and video manipulation, access to raw data using websockets, and so forth, it has become clear that there are times when it would be helpful for javascript code to be able to quickly and easily manipulate raw binary data.
...*/ for (var ninptidx = nstartidx, noutptidx = 0; noutptidx < noutptlen; ninptidx += fgetinptchrsize(nchrcode)) { nchrcode = fgetinptchrcode(vsource, ninptidx); noutptidx = fputoutptcode(awhole, nchrcode, noutptidx); } break conversionswitch; case 4: /* domstring to ascii or binarystring or other unknown encodings */ awhole = new ftaview(noutptlen); /* transcription...
... */ for (var nidx = 0; nidx < noutptlen; nidx++) { awhole[nidx] = vsource.charcodeat(nidx) & 0xff; } break conversionswitch; case 5: /* domstring to utf-8 or to utf-16 */ /* mapping...
...And 8 more matches
No Proxy For configuration - Archive of obsolete content
this feature was originally designed as a "blacklist" of sites or domains that was within the intranet, and should not be accessed via the proxy server.
... 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.
... note for former-ie users: "*" is supported only at the beginning of domain filters (*.mozilla.org).
...And 8 more matches
jspage - Archive of obsolete content
ft({});return $mixin.apply(null,a);}function $mixin(e){for(var d=1,a=arguments.length;d<a;d++){var b=arguments[d];if($type(b)!="object"){continue; }for(var c in b){var g=b[c],f=e[c];e[c]=(f&&$type(g)=="object"&&$type(f)=="object")?$mixin(f,g):$unlink(g);}}return e;}function $pick(){for(var b=0,a=arguments.length; b<a;b++){if(arguments[b]!=undefined){return arguments[b];}}return null;}function $random(b,a){return math.floor(math.random()*(a-b+1)+b);}function $splat(b){var a=$type(b); return(a)?((a!="array"&&a!="arguments")?[b]:b):[];}var $time=date.now||function(){return +new date;};function $try(){for(var b=0,a=arguments.length;b<a; b++){try{return arguments[b]();}catch(c){}}return null;}function $type(a){if(a==undefined){return false;}if(a.$family){return(a.$family.name=="number"&&!isfinite(...
...id=(browser.engine.trident)?function(a){return(a.uid||(a.uid=[native.uid++]))[0];}:function(a){return a.uid||(a.uid=native.uid++);};var window=new native({name:"window",legacy:(browser.engine.trident)?null:window.window,initialize:function(a){$uid(a); if(!a.element){a.element=$empty;if(browser.engine.webkit){a.document.createelement("iframe");}a.element.prototype=(browser.engine.webkit)?window["[[domelement.prototype]]"]:{}; }a.document.window=a;return $extend(a,window.prototype);},afterimplement:function(b,a){window[b]=window.prototype[b]=a;}});window.prototype={$family:{name:"window"}}; new window(window);var document=new native({name:"document",legacy:(browser.engine.trident)?null:window.document,initialize:function(a){$uid(a);a.head=a.getelementsbytagname("head")[0]; a.html=a.getelementsb...
...;for(var a=0;a<b;a++){d[c[a]]=this[a];}return d;},link:function(c){var a={}; for(var e=0,b=this.length;e<b;e++){for(var d in c){if(c[d](this[e])){a[d]=this[e];delete c[d];break;}}}return a;},contains:function(a,b){return this.indexof(a,b)!=-1; },extend:function(c){for(var b=0,a=c.length;b<a;b++){this.push(c[b]);}return this;},getlast:function(){return(this.length)?this[this.length-1]:null;},getrandom:function(){return(this.length)?this[$random(0,this.length-1)]:null; },include:function(a){if(!this.contains(a)){this.push(a);}return this;},combine:function(c){for(var b=0,a=c.length;b<a;b++){this.include(c[b]);}return this; },erase:function(b){for(var a=this.length;a--;a){if(this[a]===b){this.splice(a,1);}}return this;},empty:function(){this.length=0;return this;},flatten:function(){var d=[]; fo...
...And 8 more matches
New Security Model for Web Services - Archive of obsolete content
when an attempt is made to access a resource at a previously-unknown uri, the sandbox reads a file at that domain with declarations to determine whether access is permitted to the script.
... same source restriction by restricting sandboxed scripts to access only resources in the domain from which they were loaded, any script loaded from one domain into another is prevented from accessing resources in the domain into which it has been loaded.
... if the sandbox is unable to distinguish the common uri substring of the domain to be trusted from similar uris of untrusted domains, then it could allow a script loaded from an indistinguishable domain to exploit firewall-protected resources.
...And 8 more matches
Elements - Archive of obsolete content
css: div { -moz-binding: url(mybinding.xml#default); } dom: elementreference.style.mozbinding = "url(mybinding.xml#default)"; in both cases above we are using binding with id="default" contained in file mybinding.xml starting with firefox 3, you can also use a data: url to embed the binding inline: div { -moz-binding: url(data:text/xml;charset=utf-8,%3c%3fxml%20version%3d%221.0%22%3f%3e%0a%3cbindings%20id%3d%22xbltestbindings%22%20xmlns%3d%22http...
... note: the normal same-origin policy is used for web sites; they can only link to xbl files on the same domain, or within the chrome.
...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.
...And 8 more matches
TLD - MDN Web Docs Glossary: Definitions of Web-related terms
a tld (top-level domain) is the most generic domain in the internet's hierarchical dns (domain name system).
... a tld is the final component of a domain name, for example, "org" in developer.mozilla.org.
... consider an example internet address: https://developer.mozilla.org here org is the tld; mozilla.org is the second-level domain name; and developer is a subdomain name.
...And 8 more matches
mozbrowsercontextmenu
general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
... contextmenu a menu object (see the menu object, below) representing a custom menu defined via <menu> / <menuitem> elements and pointed to via a contextmenu attribute on the dom element clicked on, which contains the menu's id.
...its properties are as follows: documenturi a domstring representing the url of the document the menu is associated with.
...And 8 more matches
Overview of Mozilla embedding APIs
conceptually, for each document being rendered, gecko creates a container called a domwindow.
... each webbrowser exposes a tree of domwindows - representing the frame hierarchy for the current document.
... as such, access to individual document frames is done via the domwindow interfaces.
...And 8 more matches
nsIWebContentHandlerRegistrar
: 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 protocol,in domstring uri, in domstring title, in nsidomwindow contentwindow) methods registercontenthandler summary of registercontenthandler void registercontenthandler( in doms...
...tring mimetype, in domstring uri, in domstring title, in nsidomwindow contentwindow ); parameters mimetype the desired mime type as a string uri the uri to the handler as a string.
... contentwindow the dom content window from which the method has been called.
...And 8 more matches
nsIXULTemplateBuilder
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.
...a template builder is attached to a single dom node; this node is called the root node and is expected to contain a xul template element as a direct child.
...if a result passes a rule's conditions, this is considered a match, and the content within the rule's <action> body is inserted as a sibling of the <template>, assuming the template builder creates real dom content.
...And 8 more matches
Network request list - Firefox Developer Tools
domain: domain of the path requested.
... if the request used ssl/tls and the connection had security weaknesses such as weak ciphers, you'll see a warning triangle next to the domain.
... y hover over the domain to see the ip address.
...And 8 more matches
CSSCounterStyleRule - Web APIs
csscounterstylerule.name is a domstring object that contains the serialization of the <counter-style-name> defined for the associated rule.
... csscounterstylerule.system is a domstring object that contains the serialization of the system descriptor defined for the associated rule.
... csscounterstylerule.symbols is a domstring object that contains the serialization of the symbols descriptor defined for the associated rule.
...And 8 more matches
Event - Web APIs
WebAPIEvent
the event interface represents an event which takes place in the dom.
... many dom elements can be set up to accept (or "listen" for) these events, and execute code in response to process (or "handle") them.
... animationevent audioprocessingevent beforeinputevent beforeunloadevent blobevent clipboardevent closeevent compositionevent cssfontfaceloadevent customevent devicelightevent devicemotionevent deviceorientationevent deviceproximityevent domtransactionevent dragevent editingbeforeinputevent errorevent fetchevent focusevent gamepadevent hashchangeevent idbversionchangeevent inputevent keyboardevent mediastreamevent messageevent mouseevent mutationevent offlineaudiocompletionevent overconstrainederror pagetransitionevent paymentrequestupdateevent pointerevent popstateevent progressevent relatedevent rtcdatachanne...
...And 8 more matches
SVGTransformList - Web APIs
note: starting in gecko 9.0,the svgtransformlist dom interface is now indexable and can be accessed like arrays interface overview also implement none methods void clear() svgtransform initialize(in svgtransform newitem) svgtransform getitem(in unsigned long index) svgtransform insertitembefore(in svgtransform newitem, in unsigned long index) svgtransform replaceitem(in svgtransform newitem, in unsigned long index) svgtransform removeitem(in unsigned long index) svgtransform appenditem(i...
... 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.
... 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 8 more matches
Parsing and serializing XML - Developer guides
at times, you may need to parse xml content and convert it into a dom tree, or, conversely, serialize an existing dom tree into xml.
... xmlserializer serializes dom trees, converting them into strings containing xml.
... domparser constructs a dom tree by parsing a string containing xml, returning a xmldocument or document as appropriate based on the input data.
...And 8 more matches
JavaScript modules - JavaScript
15disabled disabled from version 15: this feature is behind the experimental javascript features preference.firefox full support 60 full support 60 no support 54 — 60disabled disabled from version 54 until version 60 (exclusive): this feature is behind the dom.modulescripts.enabled preference.
... full support 61chrome android full support 61firefox android full support 60 full support 60 no support 54 — 60disabled disabled from version 54 until version 60 (exclusive): this feature is behind the dom.modulescripts.enabled preference.
... 15disabled disabled from version 15: this feature is behind the experimental javascript features preference.firefox full support 60 full support 60 no support 54 — 60disabled disabled from version 54 until version 60 (exclusive): this feature is behind the dom.modulescripts.enabled preference.
...And 8 more matches
Using templates and slots - Web Components
this article explains how you can use the <template> and <slot> elements to create a flexible template that can then be used to populate the shadow dom of a web component.
...this element and its contents are not rendered in the dom, but it can still be referenced using javascript.
... let's look at a trivial quick example: <template id="my-paragraph"> <p>my paragraph</p> </template> this won't appear in your page until you grab a reference to it with javascript and then append it to the dom, using something like the following: let template = document.getelementbyid('my-paragraph'); let templatecontent = template.content; document.body.appendchild(templatecontent); although trivial, you can already start to see how this could be useful.
...And 8 more matches
Interacting with page scripts - Archive of obsolete content
with unsafewindow you can see javascript objects that have been defined by page scripts, and if a page script has modified the behavior of native dom functions, you'll get the modified version of them as well.
... communicating with page scripts there are two different ways a content script can communicate with a page script: 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 addeventlistener() and instead must use document.defaultview.
... 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.
...And 7 more matches
Tabbed browser - Archive of obsolete content
eryinterface(components.interfaces.nsiinterfacerequestor) .getinterface(components.interfaces.nsiwebnavigation) .queryinterface(components.interfaces.nsidocshelltreeitem) .roottreeitem .queryinterface(components.interfaces.nsiinterfacerequestor) .getinterface(components.interfaces.nsidomwindow); mainwindow.gbrowser.addtab(...); from a dialog if your code is running in a dialog opened directly by a browser window, you can use: window.opener.gbrowser.addtab(...); if window.opener doesn't work, you can get the most recent browser window using this code: var wm = components.classes["@mozilla.org/appshell/window-mediator;1"] .getservice(components.interfaces...
... gbrowser.tabcontainer.advanceselectedtab(-1, true); detecting page load see also code snippets:on page load function examplepageload(event) { if (event.originaltarget instanceof components.interfaces.nsidomhtmldocument) { var win = event.originaltarget.defaultview; if (win.frameelement) { // frame within a tab was loaded.
...for example: var num = gbrowser.browsers.length; for (var i = 0; i < num; i++) { var b = gbrowser.getbrowseratindex(i); try { dump(b.currenturi.spec); // dump urls of all open tabs to console } catch(e) { components.utils.reporterror(e); } } to learn what methods are available for <browser/> and <tabbrowser/> elements, use dom inspector or look in browser.xml for corresponding xbl bindings (or just look at the current reference pages on browser and tabbrowser.
...And 7 more matches
JavaScript crypto - Archive of obsolete content
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.
...="load" value="submit"></p> </form> <script> /* the following values could be filled in by the server cgi */ var nickname= "mycertnickname"; var cert = "mkjflakdjfiwjflaksufklasf ..."; var forcebackup = false; function loadcertificate() { window.crypto.importusercertificates(nickname, cert, forcebackup); return false; } document.forms[0].onsubmit = loadcertificate; </script> signing text domstring signtext(domstring stringtosign, domstring caoption /* ...
...And 7 more matches
XML in Mozilla - Archive of obsolete content
supported core xml w3c recommendations the core xml support includes parsing xml without validation (we use the expat parser), displaying xml with css, manipulating xml documents with scripts via dom, associating stylesheets with xml documents, and namespaces in xml.
...other notes a lot of the document object model (dom, w3c recommendations and drafts) applies to xml.
...for example, dom related questions should probably be discussed in the mozilla.dev.tech.dom newsgroup, while style issues should be discussed on mozilla.dev.tech.css and so on.
...And 7 more matches
A XUL Bestiary - Archive of obsolete content
object models: dom and aom the document object model is the representation of a document as a series of scriptable objects.
... when a scripting language like javascript accesses various parts of an html document, it does so by means of the dom.
...the w3c has standardized on a particular dom and already has a candidate recommendation for an updated version.
...And 7 more matches
XUL Events - Archive of obsolete content
this event would be used to update the disabled status of its commands.dommenuitemactivethe dommenuitemactive event is executed when a <menu> or a <menuitem> has been hovered or highlighted.dommenuiteminactivethe dommenuiteminactive event is executed when a <menu> or a <menuitem> in no longer hovered or highlighted.popuphiddenthe popuphidden event is executed when a <menupopup>, <panel> or <tooltip> has become hidden.popuphidingthe popuphiding event is executed when a <...
... inherited dom events event description blur the opposite of the focus event, the blur event is passed after an element loses the focus.
... attribute: ondblclick dommousescroll this event is sent when the mouse wheel is moved, whether it results in content being scrolled or not.
...And 7 more matches
Index - Archive of obsolete content
ArchiveMozillaXULIndex
312 reserved dom, deprecated, events no summary!
... 422 deprecated and defunct markup reference, xul {many elements on this page are wrongly marked as deprecated, this page needs review} 423 dynamically modifying xul-based user interface add-ons, dom, extensions, xul this article discusses manipulating xul interfaces, using dom and other apis.
... it explains the concept of dom documents, demonstrates a few simple examples of using dom calls to perform basic manipulations on a document, and then demonstrates working with anonymous xbl content using mozilla-specific methods.
...And 7 more matches
Writing JavaScript for XHTML - Archive of obsolete content
solution: use dom methods many people avoided dom methods because of the typing to create one simple element, when document.write() worked.
...use dom methods to create all of your elements, attributes and other nodes.
...for example: var string = '<div xmlns="http://www.w3.org/999/xhtml"><h1>hello world!</h1></div>'; var parser = new domparser(); var documentfragment = parser.parsefromstring(string, "text/xml"); body.appendchild(documentfragment); // assuming 'body' is the body element but be aware that if your string is not well-formed xml (e.g., you have an & where it should not be), then this method will crash, leaving you with a parser error.
...And 7 more matches
Cooperative asynchronous JavaScript: Timeouts and intervals - Learn web development
note: if you want to perform some kind of simple constant dom animation, css animations are probably faster.
... if, however, you are doing something more complex and involving objects that are not directly accessible inside the dom (such as 2d canvas api or webgl objects), requestanimationframe() is the better option in most cases.
... when the start button is pressed, a spinner like the one we saw earlier is displayed for a random amount of time between 5 and 10 seconds.
...And 7 more matches
Silly story generator - Learn web development
previous overview: first steps in this assessment you'll be tasked with taking some of the knowledge you've picked up in this module's articles and applying it to creating a fun app that generates random silly stories.
... project brief you have been provided with some raw html/css and a few text strings and javascript functions; you need to write the necessary javascript to turn this into a working program, which does the following: generates a silly story when the "generate random story" button is pressed.
... will generate another random silly story if you press the button again (and again...) the following screenshot shows an example of what the finished program should output: to give you more of an idea, have a look at the finished example (no peeking at the source code!) steps to complete the following sections describe what you need to do.
...And 7 more matches
What is JavaScript? - Learn web development
for example: the dom (document object model) api allows you to manipulate html and css, creating, removing and changing html, dynamically applying new styles to your page, etc.
... every time you see a popup window appear on a page, or some new content displayed (as we saw above in our simple demo) for example, that's the dom in action.
... next, go to your text editor and add the following in your head — just before your closing </head> tag: <script> // javascript goes here </script> now we'll add some javascript inside our <script> element to make the page do something more interesting — add the following code just below the "// javascript goes here" line: document.addeventlistener("domcontentloaded", function() { function createparagraph() { let para = document.createelement('p'); para.textcontent = 'you clicked the button!'; document.body.appendchild(para); } const buttons = document.queryselectorall('button'); for(let i = 0; i < buttons.length ; i++) { buttons[i].addeventlistener('click', createparagraph); } }); save your file and refresh the br...
...And 7 more matches
Getting started with React - Learn web development
familiarity with both html and javascript will help you to learn jsx, and better identify whether bugs in your application are related to javascript or to the more specific domain of react.
... to build for the web, developers use react in tandem with reactdom.
... react and reactdom are often discussed in the same spaces as — and utilized to solve the same problems as — other true web development frameworks.
...And 7 more matches
nsICookieManager2
void add( in autf8string ahost, in autf8string apath, in acstring aname, in acstring avalue, in boolean aissecure, in boolean aishttponly, in boolean aissession, in print64 aexpiry ); parameters ahost the host or domain for which the cookie is set.
... presence of a leading dot indicates a domain cookie; otherwise, the cookie is treated as a non-domain cookie.
...to be a domain cookie, the host must have at least two subdomain parts (e.g.
...And 7 more matches
nsISelectionPrivate
dom/base/nsiselectionprivate.idlscriptable internal support for content selection handling.
... void getrangesforinterval(in nsidomnode beginnode, in print32 beginoffset, in nsidomnode endnode, in print32 endoffset, in prbool allowadjacent, out pruint32 resultcount, [retval, array, size_is(resultcount)] out nsidomrange results); void getrangesforintervalarray(in nsinode beginnode, in print32 beginoffset, in nsinode endnode, in print32 endoffset, in boolean allowadjacent, in rangearray results); native code only!
... void getrangesforintervalcomarray(in nsidomnode beginnode, in print32 beginoffset, in nsidomnode endnode, in print32 endoffset, in prbool allowadjacent, in rangearray results); native code only!
...And 7 more matches
nsISmsService
dom/sms/interfaces/nsismsservice.idlscriptable used to send sms text messages for the websms api 1.0 66 introduced gecko 13.0 inherits from: nsisupports last changed in gecko 15.0 (firefox 15.0 / thunderbird 15.0 / seamonkey 2.12) implemented by: @mozilla.org/sms/smsservice;1.
... to create an instance, use: var smsservice = components.classes["@mozilla.org/sms/smsservice;1"] .createinstance(components.interfaces.nsismsservice); method overview [implicit_jscontext] nsidommozsmsmessage createsmsmessage(in long id, in domstring delivery, in domstring sender, in domstring receiver, in domstring body, in jsval timestamp, in bool read ); unsigned short getnumberofmessagesfortext(in domstring text); boolean hassupport(); void send(in domstring number, in domstring message, in long requestid, [optional] in unsigned long long processid); methods createsmsmessage() [implicit_jscontext] nsidommozsmsmessage createsmsmessage( in long id, in domstring delivery, in domstring sender, in domstring receiver, i...
...n domstring body, in jsval timestamp, in bool read ); parameters id a number representing the id of the message.
...And 7 more matches
Streams - Plugins
random-access mode: the plug-in calls the npn_requestread method to "pull" stream data.
... receiving a stream sending a stream receiving a stream when the browser sends a data stream to the plug-in, it has several tasks to perform: telling the plug-in when a stream is created telling the plug-in when a stream is deleted finding out how much data the plug-in can accept writing the stream to the plug-in sending the stream in random-access mode sending the stream in file mode telling the plug-in when a stream is created to tell the plug-in instance when a new stream is created, the browser calls the npp_newstream method.
...seekable streams support random access (for example, local files or http servers that support byte-range requests).
...And 7 more matches
HTMLScriptElement - Web APIs
htmlscriptelement.type is a domstring representing the mime type of the script.
... htmlscriptelement.src is a domstring representing the url of an external script.
... htmlscriptelement.event is a domstring; an obsolete way of registering event handlers on elements in an html document.
...And 7 more matches
IDBDatabaseSync - Web APIs
method overview idbobjectstoresync createobjectstore (in domstring name, in domstring keypath, in optional boolean autoincrement) raises (idbdatabaseexception); idbobjectstoresync openobjectstore (in domstring name, in optional unsigned short mode) raises (idbdatabaseexception); void removeobjectstore (in domstring storename) raises (idbdatabaseexception); void setversion (in domstring version); idbtransactionsync trans...
...action (in optional domstringlist storenames, in optional unsigned int timeout) raises (idbdatabaseexception); attributes attribute type description description readonly domstring the human-readable description of the connected database.
... name readonly domstring the name of the connected database.
...And 7 more matches
Node.isSupported() - Web APIs
WebAPINodeisSupported
the node.issupported()returns a boolean flag containing the result of a test whether the dom implementation implements a specific feature and this feature is supported by the specific node.
... syntax boolvalue = element.issupported(feature, version) parameters feature is a domstring containing the name of the feature to test.
... this is the same name which can be passed to the method hasfeature on domimplementation.
...And 7 more matches
SVGLengthList - Web APIs
note: starting in gecko 5.0,the svglengthlist dom interface is now indexable and can be accessed like arrays interface overview also implement none methods void clear() svglength initialize(in svglength newitem) svglength getitem(in unsigned long index) svglength insertitembefore(in svglength newitem, in unsigned long index) svglength replaceitem(in svglength newitem, in unsigned long index) svglength removeitem(in unsigned long index) svglength appenditem(in svglength newitem) properties ...
... 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.
... 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 7 more matches
SVGNumberList - Web APIs
note: starting in gecko 5.0,the svgnumberlist dom interface is now indexable and can be accessed like arrays.
... 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.
... 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 7 more matches
URLUtilsReadOnly - Web APIs
urlutilsreadonly.href read only is a domstring containing the whole url.
... urlutilsreadonly.protocol read only is a domstring containing the protocol scheme of the url, including the final ':'.
... urlutilsreadonly.host read only is a domstring containing the host, that is the hostname, a ':', and the port of the url.
...And 7 more matches
Window.open() - Web APIs
WebAPIWindowopen
syntax var window = window.open(url, windowname, [windowfeatures]); parameters url a domstring indicating the url of the resource to be loaded.
... windowname optional a domstring specifying the name of the browsing context (window, <iframe> or tab) into which to load the specified resource; if the name doesn't indicate an existing context, a new window is created and is given the name specified by windowname.
... windowfeatures optional a domstring containing a comma-separated list of window features given with their corresponding values in the form "name=value".
...And 7 more matches
WorkerLocation - Web APIs
urlutilsreadonly.href read only is a stringifier that returns a domstring containing the whole url of the script executed in the worker.
... urlutilsreadonly.protocol read only is a domstring containing the protocol scheme of the url of the script executed in the worker, including the final ':'.
... urlutilsreadonly.host read only is a domstring containing the host, that is the hostname, a ':', and the port of the url of the script executed in the worker.
...And 7 more matches
ARIA: row role - Accessibility
aria-colindex attribute the aria-colindex attribute is only needed if columns are hidden from the dom.
...for example, in a table with 15 columns, and columns 4, 5, and 6 are in the dom, aria-colindex="4" could be set on every row.
... if the set of columns which is present in the dom is not contiguous, or if there are cells spanning more than one row or column, put the aria-colindex on all of the children of each row instead of on the row itself.
...And 7 more matches
HTTP Index - HTTP
WebHTTPIndex
8 identifying resources on the web domain, http, path, scheme, syntax, uri, url, url syntax, web, fragment, port, query, resources the target of an http request is called a "resource", whose nature isn't defined further; it can be a document, a photo, or anything else.
... 102 csp: style-src-attr csp, content, content-security-policy, directive, http, reference, security, style, source, style-src, style-src-attr the http content-security-policy (csp) style-src-attr directive specifies valid sources for inline styles applied to individual dom elements.
... 104 csp: trusted-types the http content-security-policy (csp) trusted-types directive instructs user agents to restrict usage of known dom xss sinks to a predefined set of functions that only accept non-spoofable, typed values in place of strings.
...And 7 more matches
HTTP Public Key Pinning (HPKP) - HTTP
web clients such as browsers trust a lot of these cas, which can all create certificates for arbitrary domain names.
... enabling hpkp to enable this feature for your site, you need to return the public-key-pins http header when your site is accessed over https: public-key-pins: pin-sha256="base64=="; max-age=expiretime [; includesubdomains][; report-uri="reporturi"] pin-sha256 the quoted string is the base64 encoded subject public key information (spki) fingerprint.
... includesubdomains optional if this optional parameter is specified, this rule applies to all of the site's subdomains as well.
...And 7 more matches
requiredFeatures - SVG: Scalable Vector Graphics
to detect availability of an svg feature from script, there is the (also deprecated) domimplementation.hasfeature() method.
...these same feature strings apply to the hasfeature method call that is part of the svg dom's support for the domimplementation interface.
... 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.w3.org/tr/svg11/feature#svg-dynamic http://www.w3.org/tr/svg11/feature#svgdom http://www.w3.org/tr/svg11/feature#svgdom at least one of the following feature is supported: http://www.w3.org/tr/svg11/feature#svgdom-static http://www.w3.org/tr/svg11/feature#svgdom-animation http://www.w3.org/tr/svg11/feature#svgdom-dynamic http://www.w3.org/tr/svg11/feature#svg-static the browser supports all the following features: http://www.w3.org/tr/svg11/fe...
...And 7 more matches
tabs - Archive of obsolete content
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.
... ready this event is emitted when the dom for a tab's content is ready.
... it is equivalent to the domcontentloaded event for the given content page.
...And 6 more matches
Chapter 2: Technologies used in developing extensions - Archive of obsolete content
listing 3: an example of a class definition in javascript function myclass() { } myclass.prototype = { property1 : true, property2 : 'string', method : function() { alert('hello, world!'); } }; var obj = new myclass(); obj.method(); dom: an api for manipulating xml documents the document object model (dom) is a technical standard promulgated by the w3c, and is an api for manipulating the contents of xml documents as objects.
... in earlier dynamic html approaches, the typical method was to use the innerhtml property of the html element node to dynamically change the contents of the html document by manipulating strings, but using the dom makes it possible to manipulate xml documents in a way that better matches javascript's object-oriented nature.
... in addition, xul lacks any equivalent for the innerhtml property, so if it weren’t for the dom, dynamic processing would be impossible.
...And 6 more matches
Parsing microformats in JavaScript - Archive of obsolete content
normalizeddate = microformats.parser.datetimegetter(propnode, parentnode); parameters propnode the dom node to check.
... propertyvalue = microformats.parser.defaultgetter(propnode, parentnode, datatype); parameters propnode the dom node to check.
...email = microformats.parser.emailgetter(propnode, parentnode); parameters propnode the dom node to check.
...And 6 more matches
How to build custom form controls - Learn web development
note: we'll focus on building the control, not on how to make the code generic and reusable; that would involve some non-trival javascript code and dom manipulation in an unknown context, and that is out of the scope of this article.
... function () { document.body.classlist.remove("no-widget"); document.body.classlist.add("widget"); }); without js with js check out the source code note: if you really want to make your code generic and reusable, instead of doing a class switch it's far better to just add the widget class to hide the <select> elements, and to dynamically add the dom tree representing the custom control after every <select> element in the page.
... making the job easier in the code we are about to build, we will use the standard javascript and dom apis to do all the work we need.
...And 6 more matches
What went wrong? Troubleshooting JavaScript - Learn web development
a logic error at this point, the game should play through fine, however after playing through a few times you'll undoubtedly notice that the "random" number you've got to guess is always 1.
... search for the randomnumber variable, and the lines where the random number is first set.
... the instance that stores the random number that we want to guess at the start of the game should be around line number 44: let randomnumber = math.floor(math.random()) + 1; and the one that generates the random number before each subsequent game is around line 113: randomnumber = math.floor(math.random()) + 1; to check whether these lines are indeed the problem, let's turn to our friend console.log() again — insert the following line directly below each of the above two lines: console.log(randomnumber); save and refresh, then play a few games — you'll see that randomnumber is equal to 1 at each point where it is logged to the console.
...And 6 more matches
sslerr.html
peer does not support high-grade encryption." the local system was configured to support the cipher suites permitted for domestic use.
...peer requires high-grade encryption which is not supported." the remote system was configured to support the cipher suites permitted for domestic use.
... -12278 (unused) ssl_error_wrong_certificate -12277 "client authentication failed: private key in key database does not correspond to public key in certificate database." ssl_error_bad_cert_domain -12276 "unable to communicate securely with peer: requested domain name does not match the server's certificate." this error code should be returned by the certificate authentication callback function when it detects that the common name in the remote server's certificate does not match the hostname sought by the local client, according to the matching rules specified for cert...
...And 6 more matches
nsIEventListenerService
method overview void geteventtargetchainfor(in nsidomeventtarget aeventtarget, [optional] out unsigned long acount, [retval, array, size_is(acount)] out nsidomeventtarget aoutarray); void getlistenerinfofor(in nsidomeventtarget aeventtarget, [optional] out unsigned long acount, [retval, array, size_is(acount)] out nsieventlistenerinfo aoutarray); boolean haslistenersfor(in nsidomeventtarget aeventtarget, in domstring ...
...atype); void addsystemeventlistener(in nsidomeventtarget target, in domstring type, in nsidomeventlistener listener, in boolean usecapture); void removesystemeventlistener(in nsidomeventtarget target, in domstring type, in nsidomeventlistener listener, in boolean usecapture); attributes attribute type description systemeventgroup nsidomeventgroup returns system event group.
...void geteventtargetchainfor( in nsidomeventtarget aeventtarget, [optional] out unsigned long acount, [retval, array, size_is(acount)] out nsidomeventtarget aoutarray ); parameters aeventtarget the nsidomeventtarget for which to return the event target chain.
...And 6 more matches
nsIRadioInterfaceLayer
dom/system/gonk/nsiradiointerfacelayer.idlscriptable used to implement the interface between the telephony api and the radio hardware in a telephone.
...to create an instance, use: var radiointerfacelayer = components.classes["@mozilla.org/telephony/system-worker-manager;1"] .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 getdatacalllist(); unsigned short getnumberofmessagesfortext(in domstring text); void hangup(in unsigned long callindex); void registercallback(in nsiriltelephonycallback callback); void registerdatacallcallback(in nsirildatacallback callback); void rejec...
...tcall(in unsigned long callindex); void sendsms(in domstring number, in domstring message, in long requestid, in unsigned long long processid); void setupdatacall(in long radiotech, in domstring apn, in domstring user, in domstring passwd, in long chappap, in domstring pdptype); void starttone(in domstring dtmfchar); void stoptone(); void unregistercallback(in nsiriltelephonycallback callback); void unregisterdatacallcallback(in nsirildatacallback callback); attributes attribute type description currentstate jsval read only.
...And 6 more matches
nsISmsRequestManager
nsismsrequestmanager dom/sms/interfaces/nsismsrequestmanager.idlscriptable used to manage sms related requests and notifications for the websms api 1.0 66 introduced gecko 13.0 inherits from: nsisupports last changed in gecko 15.0 (firefox 15.0 / thunderbird 15.0 / seamonkey 2.12) implemented by: @mozilla.org/sms/smsrequestmanager;1.
... to create an instance, use: var smsrequestmanager = components.classes["@mozilla.org/sms/smsrequestmanager;1"] .createinstance(components.interfaces.nsismsrequestmanager); method overview long addrequest(in nsidommozsmsrequest arequest); long createrequest(in nsidommozsmsmanager amanager, out nsidommozsmsrequest arequest); void notifycreatemessagelist(in long arequestid, in long alistid, in 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 l...
...ong aerror); void notifynomessageinlist(in long arequestid); void notifyreadmessagelistfailed(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 that could apply to smsrequest objects.
...And 6 more matches
nsIXULTemplateQueryProcessor
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.
...currently, the datasource supplied to the methods will always be an nsirdfdatasource or a dom node, and will always be the same one in between calls to initializeforbuilding() and done().
... method overview void addbinding(in nsidomnode arulenode, in nsiatom avar, in nsiatom aref, in astring aexpr); print32 compareresults(in nsixultemplateresult aleft, in nsixultemplateresult aright, in nsiatom avar, in unsigned long asorthints); nsisupports compilequery(in nsixultemplatebuilder abuilder, in nsidomnode aquery, in nsiatom arefvariable, in nsiatom amembervariable); void done(); nsisimpleenumerator generateresults(in nsisupports adatasource, in nsixultemplateresult aref, in nsisupports aquery); nsisupports getdatasource(in nsiarray adatasources, in nsidomnode arootnode, in boolean aistrusted, in nsixultemplatebuilder abuilder, out boolean ashoulddelaybuilding); void initializeforbuilding(in nsisupports adatasource, in nsixultemplatebuilder abuilder, in nsidomnode aro...
...And 6 more matches
Reference Manual
nsidomnode* p = ...; while ( p ) { // ...
... nsidomnode* p = ...; while ( p ) { // ...
... nscomptr<nsidomnode> p = ...; while ( p ) { // ...
...And 6 more matches
CSSStyleDeclaration.setProperty() - Web APIs
syntax style.setproperty(propertyname, value, priority); parameters propertyname is a domstring representing the css property name (hyphen case) to be modified.
... value optional is a domstring containing the new property value.
... priority optional is a domstring allowing the "important" css priority to be set.
...And 6 more matches
Document.getElementById() - Web APIs
return value an element object describing the dom element object matching the specified id, or null if no matching element was found in the document.
... unlike some other element-lookup methods such as document.queryselector() and document.queryselectorall(), getelementbyid() is only available as a method of the global document object, and not available as a method on all element objects in the dom.
... example <!doctype html> <html> <head> <meta charset="utf-8"> <title>document</title> </head> <body> <div id="parent-id"> <p>hello word1</p> <p id="test1">hello word2</p> <p>hello word3</p> <p>hello word4</p> </div> <script> var parentdom = document.getelementbyid('parent-id'); var test1 = parentdom.getelementbyid('test1'); //throw error //uncaught typeerror: parentdom.getelementbyid is not a function </script> </body> </html> if there is no element with the given id, this function returns null.
...And 6 more matches
DocumentType - Web APIs
documenttype.internalsubset read only a domstring of the internal subset, or null if there is none.
... documenttype.name read only a domstring, eg "html" for <!doctype html>.
... documenttype.publicid read only a domstring, eg "-//w3c//dtd html 4.01//en", empty string for html5.
...And 6 more matches
HTMLBodyElement - Web APIs
htmlbodyelement.alink is a domstring that represents the color of active hyperlinks.
... htmlbodyelement.background is a domstring that represents the description of the location of the background image resource.
... htmlbodyelement.bgcolor is a domstring that represents the background color for the document.
...And 6 more matches
HTMLTableRowElement - Web APIs
htmltablerowelement.align is a domstring containing an enumerated value reflecting the align attribute.
... htmltablerowelement.bgcolor is a domstring containing the background color of the cells.
... htmltablerowelement.ch is a domstring containing one single character.
...And 6 more matches
Using IndexedDB - Web APIs
wait for the operation to complete by listening to the right kind of dom event.
...if everything succeeds, a success event (that is, a dom event whose type property is set to "success") is fired with request as its target.
...otherwise, if there was any problem, an error event (that is, a dom event whose type property is set to "error") is fired at request.
...And 6 more matches
MutationEvent - Web APIs
the mutationevent interface provides event properties that are specific to modifications to the document object model (dom) hierarchy and nodes.
... note: mutation events (w3c dom level 3 events) have been deprecated in favor of mutation observers (w3c dom4).
... preface the mutation events have been marked as deprecated in the dom events specification, as the api's design is flawed (see details in the "dom mutation events replacement: the story so far / existing points of consensus" post to public-webapps).
...And 6 more matches
RTCIceCandidate - Web APIs
properties candidate read only a domstring representing the transport address for the candidate that can be used for connectivity checks.
... component read only a domstring which indicates whether the candidate is an rtp or an rtcp candidate; its value is either "rtp" or "rtcp", and is derived from the "component-id" field in the candidate a-line string.
... foundation read only returns a domstring containing a unique identifier that is the same for any candidates of the same type, share the same base (the address from which the ice agent sent the candidate), and come from the same stun server.
...And 6 more matches
SVGPathSegList - Web APIs
exceptions: a domexception with code no_modification_allowed_err is raised when the list cannot be modified.
... exceptions: a domexception with code no_modification_allowed_err is raised when the list cannot be modified.
... exceptions: a domexception with code no_modification_allowed_err is raised when the list cannot be modified.
...And 6 more matches
SVGPointList - Web APIs
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.
... 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.
... 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 6 more matches
Slottable - Web APIs
WebAPISlottable
specifications specification status comment domthe definition of 'slottable' in that specification.
...lchrome full support 53edge full support 79firefox full support 63 full support 63 no support 59 — 63disabled disabled from version 59 until version 63 (exclusive): this feature is behind the dom.webcomponents.shadowdom.enabled preference (needs to be set to true).
...— 59disabled disabled until version 59 (exclusive): this feature is behind the dom.webcomponents.enabled preference (needs to be set to true) and the dom.webcomponents.shadowdom.enabled preference (needs to be set to true).
...And 6 more matches
Fundamentals of WebXR - Web APIs
degrees of freedom the term degrees of freedom is an indication of how much freedom of movement the user has within the virtual world.
... diagram showing the movements possible with 3 degree of freedom hardware: yaw, roll, and pitch.
... freedom of rotational movement the first three degrees of freedom are rotational.
...And 6 more matches
Mutation events - Developer guides
mutation events provide a mechanism for a web page or an extension to get notified about changes made to the dom.
... preface the mutation events have been marked as deprecated in the dom events specification, as the api's design is flawed (see details in the "dom mutation events replacement: the story so far / existing points of consensus" post to public-webapps).
... mutation observers are the proposed replacement for mutation events in dom4.
...And 6 more matches
HTML documentation index - HTML: Hypertext Markup Language
WebHTMLIndex
classes allow css and javascript to select and access specific elements via the class selectors or functions like the dom method document.getelementsbyclassname.
... 13 data-* global attributes, html, reference the data-* global attributes form a class of attributes called custom data attributes, that allow proprietary information to be exchanged between the html and its dom representation by scripts.
... 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 value matches that slot attribute's value.
...And 6 more matches
Introduction to using XPath in JavaScript - XPath
mozilla implements a fair amount of the dom 3 xpath, which means that xpath expressions can be run against both html and xml documents.
...note that, if the xpathexpression contains a namespace prefix, this will result in a domexception being thrown with the code namespace_err.
... notes adapts any dom node to resolve namespaces so that an xpath expression can be easily evaluated relative to the context of the node where it appeared within the document.
...And 6 more matches
JavaScript/XSLT Bindings - XSLT: Extensible Stylesheet Language Transformations
to process part of a page's dom, it is necessary to first create an xml document in memory.
... assuming that the dom to be processed is contained by an element with the id example, that dom can be "cloned" using the in-memory xml document's document.importnode() method.
... document.importnode() allows transferring a dom fragment between documents, in this case from an html document to an xml document.
...And 6 more matches
Miscellaneous - Archive of obsolete content
example for firefox: services.startup.quit(services.startup.eforcequit|services.startup.erestart); mouse and keyboard detecting mouse wheel events when scrolling the mouse wheel on an element, the dommousescroll event fires.
...</div> <script type="text/javascript"> var elm = document.getelementbyid("scrollarea"); elm.addeventlistener("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.
...if set, you will receive dommousescroll events.
...And 5 more matches
Anonymous Content - Archive of obsolete content
scoping and access using the dom when a binding is attached and certain conditions are met, the children of the binding's content element are cloned.
... dom methods that can be invoked on elements (e.g., getelementsbytagname) will only see nodes that are in the same scope.
... handling dom changes insertion points continuing to be used as elements are inserted or removed from the dom.
...And 5 more matches
Binding Attachment and Detachment - Archive of obsolete content
note: some older papers mentioned dom methods document.addbinding and document.removebinding; these were subsequently discarded as redundant and not implemented.
... when a binding is attached using the dom, it inherits from the current most derived binding that may already be attached to the element.
...binding document loads suppress the firing of the dom load event for the bound document.
...And 5 more matches
tree - Archive of obsolete content
ArchiveMozillaXULtree
tree type view interfaces has dom nodes?
...dom treeitems are not created.
... even though the template uses treeitem elements to define the content, dom nodes for these elements are not created.
...And 5 more matches
Publishing your website - Learn web development
getting hosting and a domain name to have more control over content and website appearance, most people choose to buy web hosting and a domain name: web hosting is rented file space on a hosting company's web server.
... a domain name is the unique address where people find your website, such as http://www.mozilla.org or http://www.bbc.co.uk.
... you can rent your domain name for as many years as you want from a domain registrar.
...And 5 more matches
Functions — reusable blocks of code - Learn web development
the source string, // with the target string, and returns the newly formed string or every time we manipulated an array: let myarray = ['i', 'love', 'chocolate', 'frogs']; let madeastring = myarray.join(' '); console.log(madeastring); // the join() function takes an array, joins // all the array items together into a single // string, and returns this new string or every time we generated a random number: let mynumber = math.random(); // the random() function generates a random number between // 0 and up to but not including 1, and returns that number ...we were using a function!
...in our random-canvas-circles.html example (see also the full source code) from our loops article, we included a custom draw() function that looked like this: 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(); } } this funct...
...ion draws 100 random circles inside a <canvas> element.
...And 5 more matches
Routing in Ember - Learn web development
go to the todomvc/app/templates/application.hbs file and replace <todolist /> 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 todolist component invocation.
...for todomvc, the capabilities of model aren't that important to us; you can find more information in the ember model guide if you want to dig deeper.
... the index route model first of all, update todomvc/app/routes/index.js so it looks as follows: import route from '@ember/routing/route'; import { inject as service } from '@ember/service'; export default class indexroute extends route { @service('todo-data') todos; model() { let todos = this.todos; return { get alltodos() { return todos.all; } } } } we can now update the todomvc/app/templates/index.hbs file so that when it includes the <todolist /> component, it does so explicitly with the available model, calling its alltodos() getter to make sure all of the todos are shown.
...And 5 more matches
Working with Svelte stores - Learn web development
previous overview: client-side javascript frameworks next in the last article we completed the development of our app, finished organizing it into components, and discussed some advanced techniques for dealing with reactivity, working with dom nodes, and exposing component functionality.
...remember that we can access top-level variables from the markup, and whenever they are modified the dom will update accordingly.
...in the callback function we just assign the value we receive to the local variable, which will trigger the update of the component's dom.
...And 5 more matches
Understanding client-side JavaScript frameworks - Learn web development
we are not aiming to exhaustively teach you everything you need to know about react/reactdom, or vue, or some other specific framework; the framework teams' own docs (and other resources) do that job already.
...framework main features each major javascript framework has a different approach to updating the dom, handling browser events, and providing an enjoyable developer experience.
... react tutorials note: react tutorials last tested in may 2020, with react/reactdom 16.13.1 and create-react-app 3.4.1.
...And 5 more matches
Limitations of chrome scripts
however, these shims are not a substitute for migrating extensions: they are only a temporary measure, and will be removed eventually they can have a bad effect on responsiveness there are likely to be edge cases in which they don't work properly you can see all the places where your add-on uses compatibility shims by setting the dom.ipc.shims.enabledwarnings preference and watching the browser console as you use the add-on.
...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).
...And 5 more matches
Rhino overview
second, the value of the property security.requiresecuritydomain should be changed to true in the resource bundle org.mozilla.javascript.resources.security.
... the value of this property can be determined at runtime by calling the issecuritydomainrequired method of context.
... setting this property to true requires that any calls that compile or evaluate javascript must supply a security domain object of any object type that will be used to identify javascript code.
...And 5 more matches
nsIDragService
the only exception is getcurrentsession(), since there's currently no way to check for a drag in progress using standard dom methods or properties.
... nsidragsession getcurrentsession( ) ; void invokedragsession( in nsidomnode adomnode, in nsisupportsarray atransferables, in nsiscriptableregion aregion, in unsigned long aactiontype ); void invokedragsessionwithimage(in nsidomnode adomnode, in nsisupportsarray atransferablearray, in nsiscriptableregion aregion, in unsigned long aactiontype, in nsidomnode aimage, in long aimagex, in long aimagey, in nsidomdragevent adragevent, in nsidomdatatransfer adatatran...
...sfer); void invokedragsessionwithselection(in nsiselection aselection, in nsisupportsarray atransferablearray, in unsigned long aactiontype, in nsidomdragevent adragevent, in nsidomdatatransfer adatatransfer); void startdragsession( ) ; void suppress(); void unsuppress(); constants constant value description dragdrop_action_none 0 no action.
...And 5 more matches
nsIXMLHttpRequestEventTarget
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 nsidomeventlistener a javascript function object that gets invoked if the operation is canceled by the user.
... onerror nsidomeventlistener a javascript function object that gets invoked if the operation fails to complete due to an error.
... onload nsidomeventlistener a javascript function object that gets invoked when the operation is successfully completed.
...And 5 more matches
nsIXSLTProcessor
to create an instance, use: var xsltprocessor = components.classes["@mozilla.org/document-transformer;1?type=xslt"] .createinstance(components.interfaces.nsixsltprocessor); method overview void clearparameters(); nsivariant getparameter(in domstring namespaceuri, in domstring localname); void importstylesheet(in nsidomnode style); void removeparameter(in domstring namespaceuri, in domstring localname); void reset(); void setparameter(in domstring namespaceuri, in domstring localname, in nsivariant value); nsidomdocument transformtodocument(in nsidomnode source); nsidomdocumentfragment transformtofragment(in nsidomnode sourc...
...e, in nsidomdocument output); methods clearparameters() removes all set parameters from this nsixsltprocessor.
...nsivariant getparameter( in domstring namespaceuri, in domstring localname ); parameters namespaceuri the namespaceuri of the xslt parameter.
...And 5 more matches
Working with windows in chrome code
opening windows from a <script> in a window or an overlay to open a new window, we usually use a window.open or window.opendialog dom call, like this: var win = window.open("chrome://myextension/content/about.xul", "aboutmyextension", "chrome,centerscreen"); the first parameter to window.open is the uri of the xul file that describes the window and its contents.
... technically speaking, it implements a number of interfaces, including nsidomjswindow and nsidomwindow, but it also contains the user-defined properties for global variables and functions of the window.
... so, for example, to access the dom document corresponding to the window, you can use win.document.
...And 5 more matches
Debugger.Source - Firefox Developer Tools
element the debugger.object instance referring to the dom element to which this source code belongs, if any, or undefined if it belongs to no dom element.
... source belongs to a dom element in the following cases: source belongs to a <script> element if it is the element’s text content (that is, it is written out as the body of the <script> element in the markup text), or is the source document referenced by its src attribute.
... source belongs to a dom element if it is an event handler content attribute (that is, if it is written out in the markup text as an attribute value).
...And 5 more matches
Examine and edit HTML - Firefox Developer Tools
shadow roots any shadow roots present in the dom are exposed in the html page in the same manner as the regular dom.
... the shadow root is signified by a node named #shadow-root — you can click its expansion arrow to see the full contents of the shadow dom, and then manipulate the contained nodes in a similar way to other part of the page's dom (although with a limited featureset — you can't, for example, drag and drop or delete shadow dom nodes).
... if a shadow dom contains a "slotted" element (an element with a slot attribute after it has been inserted inside a <slot> element — see adding flexibility with slots for an explanation of how these are used), the "slotted" element will be shown inside its corresponding <slot> element, with a "reveal" link alongside it.
...And 5 more matches
CSSPrimitiveValue - Web APIs
if this css value doesn't contain a counter value, a domexception is raised.
...if this css value doesn't contain a float value or can't be converted into the specified unit, a domexception is raised.
...if this css value doesn't contain a rgb color value, a domexception is raised.
...And 5 more matches
CustomEvent - Web APIs
this interface inherits properties from its parent, event: event.bubbles read only a boolean indicating whether or not the event bubbles up through the dom.
... event.composed read only a boolean indicating whether or not the event can bubble across the boundary between the shadow dom and the regular dom.
... event.deeppath an array of dom nodes through which the event has bubbled.
...And 5 more matches
Document.createDocumentFragment() - Web APIs
creates a new empty documentfragment into which dom nodes can be added to build an offscreen dom tree.
... usage notes documentfragments are dom node objects which are never part of the main dom tree.
... the usual use case is to create the document fragment, append elements to the document fragment and then append the document fragment to the dom tree.
...And 5 more matches
Element.getAttributeNS() - Web APIs
note: earlier versions of the dom specification had this method described as returning an empty string for non-existent attributes, but it was not typically implemented this way since null makes more sense.
... the dom4 specification now says this method should return null for non-existent attributes.
... prior to the dom4 specification, this method was specified to return an empty string rather than null for non-existent attributes.
...And 5 more matches
HTMLFormElement - Web APIs
the htmlformelement interface represents a <form> element in the dom.
... htmlformelement.name a domstring reflecting the value of the form's name html attribute, containing the name of the form.
... htmlformelement.method a domstring reflecting the value of the form's method html attribute, indicating the http method used to submit the form.
...And 5 more matches
HTMLMediaElement - Web APIs
htmlmediaelement.controlslist read only returns a domtokenlist 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 domtokenlist takes one or more of three possible values: nodownload, nofullscreen, and noremoteplayback.
... htmlmediaelement.crossorigin a domstring indicating the cors setting for this media element.
...And 5 more matches
HTMLTableSectionElement - Web APIs
htmltablesectionelement.align is a domstring containing an enumerated value reflecting the align attribute.
... htmltablesectionelement.ch is a domstring containing one single chararcter.
... htmltablesectionelement.choff is a domstring containing a integer indicating how many characters must be left at the right (for left-to-right scripts; or at the left for right-to-left scripts) of the character defined by htmltablerowelement.ch.
...And 5 more matches
Basic concepts - Web APIs
so while you can access stored data within a domain, you cannot access data across different domains.
...you get notified by a dom event when the operation finishes, and the type of event you get lets you know if the operation succeeded or failed.
...requests are objects that receive the success or failure dom events that were mentioned previously.
...And 5 more matches
MouseEvent - Web APIs
mouseevent.clientx read only the x coordinate of the mouse pointer in local (dom content) coordinates.
... mouseevent.clienty read only the y coordinate of the mouse pointer in local (dom content) coordinates.
... example this example demonstrates simulating a click (that is programmatically generating a click event) on a checkbox using dom methods.
...And 5 more matches
MutationObserver.MutationObserver() - Web APIs
the dom mutationobserver() constructor — part of the mutationobserver interface — creates and returns a new observer which invokes a specified callback when dom events occur.
... dom observation does not begin immediately; the observe() method must be called first to establish which portion of the dom to watch and what kinds of changes to watch for.
... syntax const observer = new mutationobserver(callback) parameters callback a function which will be called on each dom change that qualifies given the observed node or subtree and options.
...And 5 more matches
MutationObserver.observe() - Web APIs
the mutationobserver method observe() configures the mutationobserver callback to begin receiving notifications of changes to the dom that match the given options.
... depending on the configuration, the observer may watch a single node in the dom tree, or that node and some or all of its descendant nodes.
... syntax mutationobserver.observe(target, options) parameters target a dom node (which may be an element) within the dom tree to watch for changes, or to be the root of a subtree of nodes to be watched.
...And 5 more matches
Node.nodeType - Web APIs
WebAPINodenodeType
attributes no longer implement the node interface as of dom4.
...removed in dom4.
...removed in dom4.
...And 5 more matches
PerformanceTiming - Web APIs
some correspond to dom events; others describe the time at which internal browser operations of interest took place.
... performancetiming.domainlookupstart read only when the domain lookup starts.
... performancetiming.domainlookupend read only when the domain lookup is finished.
...And 5 more matches
RTCIceCandidate.usernameFragment - Web APIs
note that 24 bits of the username fragment are required to be randomized by the browser.
... see randomization below for details.
... syntax var ufrag = rtcicecandidate.usernamefragment; value a domstring containing the username fragment (usually referred to in shorthand as "ufrag" or "ice-ufrag") that, along with the ice password ("ice-pwd"), uniquely identifies a single ongoing ice interaction, including for any communication with the stun server.
...And 5 more matches
SVGLength - Web APIs
WebAPISVGLength
interface overview also implement none methods void newvaluespecifiedunits(in unsigned short unittype, in float valueinspecifiedunits) void converttospecifiedunits(in unsigned short unittype) properties readonly unsigned short unittype float value float valueinspecifiedunits domstring valueasstring constants svg_lengthtype_unknown = 0 svg_lengthtype_number = 1 svg_lengthtype_percentage = 2 svg_lengthtype_ems = 3 svg_lengthtype_exs = 4 svg_lengthtype_px = 5 svg_lengthtype_cm = 6 svg_lengthtype_mm = 7 svg_lengthtype_in = 8 svg_lengthtype_pt = 9 svg_lengthtype_pc = 10 normati...
... exceptions on setting: a domexception with code no_modification_allowed_err is raised when the length corresponds to a read only attribute or when the object itself is read only.
... exceptions on setting: a domexception with code no_modification_allowed_err is raised when the length corresponds to a read only attribute or when the object itself is read only.
...And 5 more matches
SubtleCrypto.wrapKey() - Web APIs
*/ function getkeymaterial() { const password = window.prompt("enter your password"); const enc = new textencoder(); return window.crypto.subtle.importkey( "raw", enc.encode(password), {name: "pbkdf2"}, false, ["derivebits", "derivekey"] ); } /* given some key material and some random salt derive an aes-kw key using pbkdf2.
...*/ async function wrapcryptokey(keytowrap) { // get the key encryption key const keymaterial = await getkeymaterial(); salt = window.crypto.getrandomvalues(new uint8array(16)); const wrappingkey = await getkey(keymaterial, salt); return window.crypto.subtle.wrapkey( "raw", keytowrap, wrappingkey, "aes-kw" ); } /* generate an encrypt/decrypt secret key, then wrap it.
...*/ function getkeymaterial() { const password = window.prompt("enter your password"); const enc = new textencoder(); return window.crypto.subtle.importkey( "raw", enc.encode(password), {name: "pbkdf2"}, false, ["derivebits", "derivekey"] ); } /* given some key material and some random salt derive an aes-gcm key using pbkdf2.
...And 5 more matches
Text.splitText() - Web APIs
WebAPITextsplitText
exceptions thrown a domexception with a value of index_size_err is thrown if the specified offset is negative or is greater than the number of 16-bit units in the node's text; a domexception with a value of no_modification_allowed_err is thrown if the node is read-only.
...r', // and save 'bar' as a const const bar = foobar.splittext(3); // create a <u> element containing ' new content ' const u = document.createelement('u'); u.appendchild(document.createtextnode(' new content ')); // add <u> before 'bar' p.insertbefore(u, bar); // the result is: <p>foo<u> new content </u>bar</p> result specifications specification status comment domthe definition of 'text.splittext' in that specification.
... living standard no change from document object model (dom) level 3 core specification.
...And 5 more matches
Getting Started - Developer guides
as a security feature, you cannot call urls on 3rd-party domains by default.
... be sure to use the exact domain name on all of your pages or you will get a "permission denied" error when you call open().
... a common pitfall is accessing your site by domain.tld, but attempting to call pages with www.domain.tld.
...And 5 more matches
Cross-Origin Resource Sharing (CORS) - HTTP
WebHTTPCORS
a web application executes a cross-origin http request when it requests a resource that has a different origin (domain, protocol, or port) from its own.
... an example of a cross-origin request: the front-end javascript code served from https://domain-a.com uses xmlhttprequest to make a request for https://domain-b.com/data.json.
... web fonts (for cross-domain font usage in @font-face within css), so that servers can deploy truetype fonts that can only be cross-site loaded and used by web sites that are permitted to do so.
...And 5 more matches
Connection management in HTTP/1.x - HTTP
domain sharding unless you have a very specific immediate need, don't use this deprecated technique; switch to http/2 instead.
... in http/2, domain sharding is no longer useful: the http/2 connection is able to handle parallel unprioritized requests very well.
... domain sharding is even detrimental to performance.
...And 5 more matches
Feature-Policy - HTTP
when this policy is disabled and there were no user gestures, the promise returned by htmlmediaelement.play() will reject with a domexception.
...when this policy is disabled, the promise returned by navigator.getbattery() will reject with a notallowederror domexception.
...when this policy is disabled, the promise returned by getusermedia() will reject with a notallowederror domexception.
...And 5 more matches
Strict-Transport-Security - HTTP
header type response header forbidden header name no syntax strict-transport-security: max-age=<expire-time> strict-transport-security: max-age=<expire-time>; includesubdomains strict-transport-security: max-age=<expire-time>; preload directives max-age=<expire-time> the time, in seconds, that the browser should remember that a site is only to be accessed using https.
... includesubdomains optional if this optional parameter is specified, this rule applies to all of the site's subdomains as well.
...by following the guidelines and successfully submitting your domain, browsers will never connect to your domain using an insecure connection.
...And 5 more matches
Types of attacks - Web security
xss attacks can be put into three categories: stored (also called persistent), reflected (also called non-persistent), or dom-based.
... dom-based xss attacks the payload is executed as a result of modifying the dom environment (in the victim’s browser) used by the original client-side script.
... that is, the page itself does not change, but the client side code contained in the page runs in an unexpected manner because of the malicious modifications to the dom environment.
...And 5 more matches
Using custom elements - Web Components
this takes as its arguments: a domstring representing the name you are giving to the element.
...in this case we attach a shadow root to the custom element, use some dom manipulation to create the element's internal shadow dom structure — which is then attached to the shadow root — and finally attach some css to the shadow root to style it.
...this.getattribute('img') : 'img/default.png'; const info = wrapper.appendchild(document.createelement('span')); info.setattribute('class','info'); // take attribute content and put it inside the info span info.textcontent = this.getattribute('data-text'); // create some css to apply to the shadow dom const style = document.createelement('style'); style.textcontent = '.wrapper {' + // css truncated for brevity // attach the created elements to the shadow dom this.shadowroot.append(style,wrapper); finally, we register our custom element on the customelementregistry using the define() method we mentioned earlier — in the parameters we specify the element name, and then the class name that ...
...And 5 more matches
content/mod - Archive of obsolete content
window : nsidomwindow the window to be modified.
...detachfrom(style, window); parameters modification : object the modification we want to remove from the target window : nsidomwindow the window to be modified.
... gettargetwindow(target) function takes target, value representing content (page) and returns nsidomwindow for that content.
...And 4 more matches
How to convert an overlay extension to restartless - Archive of obsolete content
you could look into dynamically loading and unloading your overlay, however dynamically manipulating the dom of your xul window is usually the more straightforward route.
...docs: document.getelementbyid(), document.createelement(), element reference, node reference (dom elements are also nodes).
... that way you build elements hierarchy with not much interaction with dom, plus you can see tag properties and it children in a nice, structured way, just like in overlay.xul.
...And 4 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.
...t("myextensiondataelement"); element.setattribute("attribute1", "foobar"); element.setattribute("attribute2", "hello world"); document.documentelement.appendchild(element); var evt = document.createevent("events"); evt.initevent("myextensionevent", true, false); element.dispatchevent(evt); this code creates an arbitrary element -- <myextensiondataelement/> -- and inserts it into the web page's dom.
...And 4 more matches
Connecting to Remote Content - Archive of obsolete content
if the response is an xml document, the responsexml property will hold an xmldocument object that can be manipulated using dom methods.
...let's assume that the xml returned from remote server is this: <?xml version="1.0"?> <data> <shops> <shop> <name>apple</name> <code>a001</code> </shop> <shop> <name>orange</name> </shop> </shops> <total>2</total> </data> when a valid xml response comes back from the remote server, the xml document object can be manipulated using different dom methods, to display the data in the ui or store it into a local datasource.
...otelement && "parseerror" != rootelement.tagname) { let shopelements = rootelement.getelementsbytagname("shop"); let totalelement = rootelement.getelementsbytagname("total")[0]; window.alert(shopelements[1].getelementsbytagname("name")[0].firstchild.nodevalue); // => orange window.alert(totalelement.firstchild.nodevalue); // => 2 } }; using dom functions is good for simple xml documents, but dom manipulation code can become too complicated if the documents are more complex.
...And 4 more matches
Custom XUL Elements with XBL - Archive of obsolete content
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.
...this code gets the dom object that corresponds to the xshelloperson tag, allowing you access to its methods and properties.
...these nodes are part of the xul dom just like any other, and having an id attribute is bound to cause problems, given that you could have more than instance of your element in the same document and then multiple inner items with the same id.
...And 4 more matches
JXON - Archive of obsolete content
mber> <discount_until>dec 25, 1995</discount_until> <price>42.50</price> <size description="medium"> <color_swatch image="black_cardigan.jpg">black</color_swatch> </size> </catalog_item> </product> <script type="text/javascript"><![cdata[function matchwo(a,b) { if (a < b && a < 0) { return 1; } else { return 0; } }]]></script> </catalog> first, create a dom tree like the previous example as described in the how to create a dom tree article.
... if you have already have a dom tree from using xmlhttprequest, skip to the next paragraph.
... now let's serialize doc — the dom tree — to a javascript object tree (you can read more about working with objects and how javascript is object-oriented).
...And 4 more matches
Working with BFCache - Archive of obsolete content
q: when a user clicks a link that replaces the view in the current tab with a new page, what is the fate of the nsidomwindow supporting the view they click on?
...a: the outer nsidomwindow (the |window| object in content js, aka the <browser>'s contentwindow object in the parent document) stays right where it is.
...the inner nsidomwindow (the global scope object in content js) is either thrown away when gc happens, or frozen and placed in the bfcache.
...And 4 more matches
In-Depth - Archive of obsolete content
well there is an easy way to find out - using the dom inspector.
...then open the dom inspector (tools->web development->dom inspector).
...what this will do is find the code for the back button and display it in the dom inspector.
...And 4 more matches
Introduction to XUL - Archive of obsolete content
xml documents support the basic dom level 1 core apis.
... xul documents support an extended set, much as html documents support dom level 1 html apis.
... dom extensions since xul is not the same thing as html, while xul documents will support the dom level 1 core api, they will not support the dom level 1 html api.
...And 4 more matches
Building a Theme - Archive of obsolete content
it's especially important to install the dom inspector, which we'll be using in later steps.
... when writing a theme, the easiest way to determine what css selectors you need to write is to use the dom inspector which you should have installed in the setup step.
... updating the toolbar's styling note in firefox 4.0 and up, the highlight feature of dom inspector is broken.
...And 4 more matches
Common causes of memory leaks in extensions - Extensions
storing references to window objects and dom nodes the most common problem is extensions holding onto references to content windows for too long.
... a similar problem is holding onto window objects or dom nodes (such as window.document) for too long by storing them in a javascript module.
... to avoid these issues, references to dom nodes in foreign document should 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.
...And 4 more matches
How much does it cost to do something on the Web? - Learn web development
prerequisites: you should already understand what software you need, the difference between a webpage, a website, etc., and what a domain name is.
... domain names your domain name has to be purchased through a domain name provider (a registrar).
...the domain name usually costs $5-15 per year.
...And 4 more matches
Listening to events on all tabs
void onlocationchange( nsidomxulelement abrowser, nsiwebprogress awebprogress, nsirequest arequest, nsiuri alocation [optional] in unsigned long aflags ); parameters abrowser the browser representing the tab whose location changed.
...void onprogresschange( nsidomxulelement abrowser, nsiwebprogress awebprogress, nsirequest arequest, print32 acurselfprogress, print32 amaxselfprogress, print32 acurtotalprogress, print32 amaxtotalprogress ); parameters abrowser the browser representing the tab for which updated progress information is being provided.
...void onsecuritychange( nsidomxulelement abrowser, nsiwebprogress awebprogress, nsirequest arequest, unsigned long astate ); parameters abrowser the browser that fired the notification.
...And 4 more matches
Mozilla Web Developer FAQ
some proprietary document objects such as document.all and document.layers are not part of the w3c dom and are not supported in mozilla.
...the point of having a common api (the w3c dom) is interoperability, and checking for a particular browser defeats that purpose.
... when working with the dom, it is better to check for the existence of the methods and objects you are planning on using.
...And 4 more matches
JS::CompileOptions
methods of js::owningcompileoptions method description jsobject *element() const returns the dom element to which this source code belongs, if any, or null if it belongs to no dom element.
... source belongs to a dom element in the following cases: source belongs to a <script> element if it is the element's text content (that is, it is written out as the body of the <script> element in the markup text), or is the source document referenced by its src attribute.
... source belongs to a dom element if it is an event handler content attribute (that is, if it is written out in the markup text as an attribute value).
...And 4 more matches
Avoiding leaks in JavaScript XPCOM components
however, it's not quite that simple, because of the convention that dom nodes can have arbitrary javascript properties added to them by the programmer.
... these properties have to be preserved across garbage collections, even if the wrapper is not reachable from any garbage collection root, since the javascript programmer could access the dom node again the same way he did the first time, and would then expect the added properties to still be there.
... we currently implement this by making the wrapper a root in the javascript garbage collector once somebody sets a javascript property on a dom node.
...And 4 more matches
Components.utils.Sandbox
system principal to specify the system principal, you can create it using code like: cc["@mozilla.org/systemprincipal;1"].createinstance(ci.nsiprincipal); content principal you can specify a content principal for a particular origin in one of three ways: as an nsiprincipal, for example by using the nodeprincipal property of a dom node as an nsidomwindow, such as that returned by the dom window property as a string uri like "http://www.example.com/" (discouraged) when possible, specify a window or an nsiprincipal object instead of using a string uri.
... window objects and nsiprincipal carry additional information such as origin attributes and same-origin privilege changes caused by setting document.domain.
...each item in the array should be an nsiprincipal, a dom window, or a uri.
...And 4 more matches
mozIThirdPartyUtil
1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview boolean isthirdpartychannel(in nsichannel achannel, [optional] in nsiuri auri); boolean isthirdpartyuri(in nsiuri afirsturi, in nsiuri aseconduri); boolean isthirdpartywindow(in nsidomwindow awindow, [optional] in nsiuri auri); methods isthirdpartychannel() determine whether the given channel and its content window hierarchy is third party.
...obtain the bottommost nsidomwindow, and its same-type parent if it exists, from the channel's notification callbacks.
...this is determined by computing the base domain for both uris.
...And 4 more matches
nsIAccessibleDocument
you can also get one from nsiaccessnode.getaccessibledocument() or nsiaccessibleevent.getaccessibledocument() method overview nsiaccessible getaccessibleinparentchain(in nsidomnode adomnode, in boolean acancreate); obsolete since gecko 2.0 nsiaccessnode getcachedaccessnode(in voidptr auniqueid); native code only!
... domdocument nsidomdocument the nsidomdocument interface associated with this document.
... window nsidomwindow the nsidomwindow that the document resides in.
...And 4 more matches
nsICompositionStringSynthesizer
dom/interfaces/base/nsicompositionstringsynthesizer.idlscriptable this interface is a composition string synthesizer interface that synthesizes composition string with arbitrary clauses and a caret 1.0 66 introduced gecko 26 obsolete gecko 38 inherits from: nsisupports last changed in gecko 38.0 (firefox 38.0 / thunderbird 38.0 / seamonkey 2.35) this interface is obsoleted in gecko 38.
... every instance is associated with a dom window at created by nsidomwindowutils.createcompositionstringsynthesizer().
... to create an instance for this: var domwindowutils = window.windowutils; var compositionstringsynthesizer = domwindowutils.createcompositionstringsynthesizer(); for example, when you create a composition whose composing string is "foo-bar-buzz" and "bar" is selected to convert, then, first, you need to start composition: domwindowutils.sendcompositionevent("compositionstart", "", ""); next, dispatch composition string with crause information and caret information (optional): // set new composition string with .setstring().
...And 4 more matches
nsIDeviceMotion
method overview void addlistener(in nsidevicemotionlistener alistener); void addwindowlistener(in nsidomwindow awindow); native code only!
... void removelistener(in nsidevicemotionlistener alistener); void removewindowlistener(in nsidomwindow awindow); native code only!
... native code only!addwindowlistener sets the nsiaccelerometer as the source for mozorientation events on the specified dom window.
...And 4 more matches
nsIEditor
66 introduced gecko 1.0 inherits from: nsisupports last changed in gecko 18.0 (firefox 18.0 / thunderbird 18.0 / seamonkey 2.15) method overview [noscript] void init(in nsidomdocument doc, in nsicontent aroot, in nsiselectioncontroller aselcon, in unsigned long aflags); void setattributeorequivalent(in nsidomelement element, in astring sourceattrname, in astring sourceattrvalue, in boolean asuppresstransaction); void removeattributeorequivalent(in nsidomelement element, in domstring sourceattrname, in boolean asuppresstransaction); void postcreate(); void predestroy(in boolean adestroyingframes)...
... clipboard methods void cut(); boolean cancut(); void copy(); boolean cancopy(); void paste(in long aselectiontype); boolean canpaste(in long aselectiontype); selection methods void selectall(); void beginningofdocument(); void endofdocument(); drag/drop methods boolean candrag(in nsidomevent aevent); void dodrag(in nsidomevent aevent); void insertfromdrop(in nsidomevent aevent); node manipulation methods void setattribute(in nsidomelement aelement, in astring attributestr,in astring attvalue); boolean getattributevalue(in nsidomelement aelement, in astring attributestr, out astring resultvalue); void removeattribute(in nsidom...
...element aelement, in astring aattribute); void cloneattribute(in astring aattribute, in nsidomnode asourcenode); void cloneattributes(in nsidomnode destnode, in nsidomnode sourcenode); nsidomnode createnode(in astring tag, in nsidomnode parent, in long position); void insertnode(in nsidomnode node, in nsidomnode parent, in long aposition); void splitnode(in nsidomnode existingrightnode, in long offset, out nsidomnode newleftnode); void joinnodes(in nsidomnode leftnode, in nsidomnode rightnode, in nsidomnode parent); void deletenode(in nsidomnode child); void marknodedirty(in nsidomnode node); direction controller void switchtextdirection(); output methods astring outputtostring(in ...
...And 4 more matches
nsIPrincipal
domain nsiuri the domain uri to which this principal pertains.
... this is congruent with htmldocument.domain, and may be null.
... securitypolicy voidptr the domain security policy of the principal.
...And 4 more matches
nsISmsDatabaseService
nsismsdatabaseservice dom/sms/interfaces/nsismsdatabaseservice.idlscriptable used to store and manage sms text messages for the websms api 1.0 66 introduced gecko 13.0 inherits from: nsisupports last changed in gecko 15.0 (firefox 15.0 / thunderbird 15.0 / seamonkey 2.12) implemented by: @mozilla.org/sms/smsdatabaseservice;1.
... to create an instance, use: var smsservice = components.classes["@mozilla.org/sms/smsdatabaseservice;1"] .createinstance(components.interfaces.nsismsdatabaseservice); method overview long savereceivedmessage(in domstring asender, in domstring abody, in unsigned long long adate); long savesentmessage(in domstring areceiver, in domstring abody, in unsigned long long adate); void getmessage(in long messageid, in long requestid, [optional] in unsigned long long processid); void deletemessage(in long messageid, in long requestid, [optional] in unsigned long long processid); void createmessagelist(in nsidommozsmsfilter filter, in boolean reverse, in long requestid, [optional] in unsigned long long processid); void getnextmessageinlist(in long listid, in long requesti...
...d, [optional] in unsigned long long processid); void clearmessagelist(in long listid); void markmessageread(in long messageid, in boolean value, in long requestid, [optional] in unsigned long long processid) methods savereceivedmessage() void savereceivedmessage( in domstring asender, in domstring abody, in unsigned long long adate ); parameters asender a domstring with the sender of the text message.
...And 4 more matches
nsIXPConnect
me, in print32 alinenumber, in nsistackframe acaller); void debugdump(in short depth); void debugdumpevalinjsstackframe(in pruint32 aframenumber, in string asourcetext); void debugdumpjsstack(in prbool showargs, in prbool showlocals, in prbool showthisprops); void debugdumpobject(in nsisupports acomobj, in short depth); [noscript,notxpcom] prbool definedomquickstubs(in jscontextptr cx, in jsobjectptr proto, in pruint32 flags, in pruint32 interfacecount, [array, size_is(interfacecount)] in nsiidptr interfacearray); jsval evalinsandboxobject(in astring source, in jscontextptr cx, in nsixpconnectjsobjectholder sandbox, in prbool returnstringonly); native code only!
...ers showargs missing description showlocals missing description showthisprops missing description exceptions thrown missing exception missing description debugdumpobject() void debugdumpobject( in nsisupports acomobj, in short depth ); parameters acomobj missing description depth missing description exceptions thrown missing exception missing description definedomquickstubs() define quick stubs on the given object, @a proto.
... [noscript,notxpcom] prbool definedomquickstubs( in jscontextptr cx, in jsobjectptr proto, in pruint32 flags, in pruint32 interfacecount, [array, size_is(interfacecount)] in nsiidptr interfacearray ); parameters cx a context.
...And 4 more matches
Migrating from Firebug - Firefox Developer Tools
inspect object properties by clicking on an object logged within the console you can inspect the object's properties and methods within the dom panel.
... 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, which caused the change.
...xhr, dom, cookie and error breakpoints are not supported yet (see bug 821610, bug 1004678, bug 895893 and bug 1165010).
...And 4 more matches
Waterfall - Firefox Developer Tools
the following operations are recorded: name and description color detailed information dom event javascript code that's executed in response to a dom event.
... domcontentloaded the document's domcontentloaded event.
... rendering waterfall one pattern that you'll often see in the waterfall view is something like this: this is a visualization of the basic algorithm the browser uses to update the page in response to some event: javascript function call: some event - for example, a dom event - causes some javascript in the page to run.
...And 4 more matches
ChildNode - Web APIs
WebAPIChildNode
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.
...And 4 more matches
Document.implementation - Web APIs
the document.implementation property returns a domimplementation object associated with the current document.
... syntax domimpobj = document.implementation; example var modname = "html"; var modver = "2.0"; var conformtest = document.implementation.hasfeature( modname, modver ); alert( "dom " + modname + " " + modver + " supported?: " + conformtest ); // alerts with: "dom html 2.0 supported?: true" if dom level 2 html module is supported.
... a list of module names (e.g., core, html, xml, etc.) is available in the dom level 2 conformance section.
...And 4 more matches
Using files from web applications - Web APIs
using the file api, which was added to the dom in html5, it's now possible for web content to ask the user to select local files and then read the contents of those files.
... 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.
...And 4 more matches
FileSystemEntrySync - Web APIs
method overview metadata getmetadata () raises (fileexception); filesystementrysync moveto (in directoryentrysync parent, optional domstring newname) raises (fileexception); filesystementrysync copyto(in directoryentrysync parent, optional domstring newname) raises (fileexception); domstring tourl(); void remove() raises (fileexception); directoryentrysync getparent(); attributes attribute type description filesystem readonly filesystemsync the file sy...
... fullpath readonly domstring the full absolute path from the root to the entry.
... name readonly domstring the name of the entry, excluding the path leading to it.
...And 4 more matches
HTMLHRElement - Web APIs
htmlhrelement.align is a domstring, an enumerated attribute indicating alignment of the rule with respect to the surrounding context.
... htmlhrelement.color is a domstring representing the name of the color of the rule.
... htmlhrelement.size is a domstring representing the height of the rule.
...And 4 more matches
HTMLMetaElement - Web APIs
name type description content domstring gets or sets the value of meta-data property.
... httpequiv domstring gets or sets the name of an http response header to define for a document.
... name domstring gets or sets the name of a meta-data property to define for a document.
...And 4 more matches
HTMLParamElement - Web APIs
htmlparamelement.name is a domstring representing the name of the parameter.
... htmlparamelement.value is a domstring representing the value associated to the parameter.
... htmlparamelement.type is a domstring containing the type of the parameter when valuetype has the "ref" value.
...And 4 more matches
HTMLTableColElement - Web APIs
htmltablecolelement.align is a domstring that indicates the horizontal alignment of the cell data in the column.
... htmltablecolelement.ch is a domstring representing the alignment character for cell data.
... htmltablecolelement.choff is a domstring representing the offset for the alignment character.
...And 4 more matches
IDBObjectStoreSync - Web APIs
method overview any add (in any value, in optional any key) raises (idbdatabaseexception); idbindexsync createindex (in domstring name, in domstring storename, in domstring keypath, in optional boolean unique); any get (in any key) raises (idbdatabaseexception); idbcursorsync opencursor (in optional idbkeyrange range, in optional unsigned short direction) raises (idbdatabaseexception); idbindexsync openindex (in domstring name) raises (idbdatabaseexception); any put (in any value,...
... in optional any key) raises (idbdatabaseexception); void remove (in any key) raises (idbdatabaseexception); void removeindex (in domstring indexname) raises (idbdatabaseexception); attributes attribute type description indexnames readonly domstringlist a list of the names of the indexes on this object store.
... keypath readonly domstring the key path of this object store.
...And 4 more matches
MediaTrackConstraints - Web APIs
properties of all media tracks deviceid a constraindomstring object specifying a device id or an array of device ids which are acceptable and/or required.
... groupid a constraindomstring object specifying a group id or an array of group ids which are acceptable and/or required.
... facingmode a constraindomstring object specifying a facing or an array of facings which are acceptable and/or required.
...And 4 more matches
MediaTrackSettings - Web APIs
properties of all media tracks deviceid a domstring indicating the current value of the deviceid property.
... groupid a domstring indicating the current value of the groupid property.
... facingmode a domstring indicating the current value of the facingmode property, specifying the direction the camera is facing.
...And 4 more matches
Node.appendChild() - Web APIs
WebAPINodeappendChild
example // create a new paragraph element, and append it to the end of the document body let p = document.createelement("p"); document.body.appendchild(p); specifications specification status comment domthe definition of 'node.appendchild()' in that specification.
... living standard no change from document object model (dom) level 3 core specification.
... document object model (dom) level 3 core specificationthe definition of 'node.appendchild()' in that specification.
...And 4 more matches
Node.namespaceURI - Web APIs
WebAPINodenamespaceURI
in dom4 this api was moved from node to the element and attr interfaces.
... you can create an element with the specified namespaceuri using the dom level 2 method document.createelementns and attributes with the method element.setattributens.
... the dom does not handle or enforce namespace validation per se.
...And 4 more matches
NodeList - Web APIs
WebAPINodeList
live nodelists in some cases, the nodelist 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 nodelists in other cases, the nodelist is static, where any changes in the dom does not affect the content of the collection.
...this is mostly useful for non-javascript dom implementations.
...And 4 more matches
RTCIceCandidatePairStats - Web APIs
consentexpiredtimestamp optional a domhighrestimestamp value indicating the time at which the most recent stun binding response expired.
... firstrequesttimestamp optional a domhighrestimestamp value which specifies the time at which the first stun request was sent from the local peer to the remote peer for this candidate pair.
... lastpacketreceivedtimestamp optional a domhighrestimestamp value indicating the time at which the last packet was received by the local peer from the remote peer for this candidate pair.
...And 4 more matches
SVGAngle - Web APIs
WebAPISVGAngle
exceptions on setting: a domexception with code no_modification_allowed_err is raised when the length corresponds to a read-only attribute, or when the object itself is read-only.
... exceptions on setting: a domexception with code no_modification_allowed_err is raised when the length corresponds to a read-only attribute, or when the object itself is read-only.
... valueasstring the value as a domstring value, in the units expressed by unittype.
...And 4 more matches
StaticRange - Web APIs
the dom staticrange interface extends abstractrange to provide a method to specify a range of content in the dom whose contents don't update to reflect changes which occur within the dom tree.
... staticrange.endcontainer read only returns the dom node which contains the ending point of the range.
... staticrange.startcontainer read only returns the dom node which contains the starting point of the range (which is in turn identified by startoffset.
...And 4 more matches
Clearing by clicking - Web APIs
« previousnext » this example demonstrates how to combine user interaction with webgl graphics operations by clearing the rendering context with a random color when the user clicks.
... clearing the rendering context with random colors this example provides a simple illustration of how to combine webgl and user interaction.
... every time the user clicks the canvas or the button, the canvas is cleared with a new randomly chosen color.
...And 4 more matches
Using textures in WebGL - Web APIs
note: it's important to note that the loading of textures follows cross-domain rules; that is, you can only load textures from sites for which your content has cors approval.
... see cross-domain textures below for details.
... view the complete code | open this demo on a new page cross-domain textures loading of webgl textures is subject to cross-domain access controls.
...And 4 more matches
Overview of events and handlers - Developer guides
douglas crockford explains this change effectively in several lectures, notably his talk, an inconvenient api: the theory of the dom, which shows the change in flow from the original browser flow to the event driven browser.
..."eventprototype" : "objectprototype"; alert("we got a click event at " + ev.timestamp + " with an argument object derived from: " + objkind ); }; and second register our function with the the button object, either on the scripting side using the dom (document object model) representation of the html page: var buttondomelement = document.queryselector('#buttonone'); buttondomelement.addeventlistener('click', example_click_handler); or within the html page by adding the function as the value of the 'onclick' attribute, although this second approach is usually only used in very simple web pages.
...the code has no visible effect until a user interacts with the button either by placing the mouse pointer over the html button and clicking on the left mouse button or by placing a finger or stylus of some kind on the screen above the html button; when that happens, the buttondomelement javascript object would call the example_click_handler function with an event object as an argument.
...And 4 more matches
<input type="url"> - HTML: Hypertext Markup Language
WebHTMLElementinputurl
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.
...but we want the url to only successfully validate if the entered url is in a myco domain.
...And 4 more matches
Index - HTTP
WebHTTPHeadersIndex
when this policy is enabled and there were no user gestures, the promise returned by htmlmediaelement.play() will reject with a domexception.
...when this policy is enabled, the promise returned by navigator.requestmediakeysystemaccess() will reject with a domexception.
...when this policy is enabled, the promise returned by navigator.requestmidiaccess() will reject with a domexception.
...And 4 more matches
X-DNS-Prefetch-Control - HTTP
the x-dns-prefetch-control http response header controls dns prefetching, a feature by which browsers proactively perform domain name resolution on both links that the user may choose to follow as well as urls for items referenced by the document, including images, css, javascript, and so forth.
...this is useful if you don't control the link on the pages, or know that you don't want to leak information to these domains.
... the implementation of this prefetching in some browsers allows domain name resolution to occur in parallel with (instead of in serial with) the fetching of actual page content.
...And 4 more matches
HTTP headers - HTTP
WebHTTPHeaders
host specifies the domain name of the server (for virtual hosting), and (optionally) the tcp port number on which the server is listening.
... cross-origin-opener-policy (coop) prevents other domains from opening/controlling a window.
... cross-origin-resource-policy (corp) prevents other domains from reading the response of the resources to which this header is applied.
...And 4 more matches
Autoplay guide for media and Web Audio APIs - Web media technologies
the http feature-policy header's autoplay directive is used to control which domains, if any, can be used to autoplay media.
... by default, the autoplay feature policy is set to 'self' (including the single quote characters), indicating that autoplay is permitted as they're hosted on the same domain as the document.
... you can also specify 'none' to disable autoplay entirely, '*' to allow autoplay from all domains, or one or more specific origins from which media can be automatically played.
...And 4 more matches
Using dns-prefetch - Web Performance
dns-prefetch is an attempt to resolve domain names before resources get requested.
... when a browser requests a resource from a (third party) server, that cross-origin’s domain name must be resolved to an ip address before the browser can issue the request.
...the cross-origin domain is then specified in the href attribute: syntax <link rel="dns-prefetch" href="https://fonts.gstatic.com/" > examples <html> <head> <link rel="dns-prefetch" href="https://fonts.gstatic.com/"> <!-- and all other head elements --> </head> <body> <!-- your page content --> </body> </html> you should place dns-prefetch hints in the <head> element any time your site refere...
...And 4 more matches
Using the Mozilla JavaScript interface to XSL Transformations - XSLT: Extensible Stylesheet Language Transformations
it has a single parameter, which is the dom node of the xslt stylesheet to import.
... note: the import is live, meaning that if you alter the stylesheet dom after importing it, this will be reflected in the processing.
... rather than modifying the dom it is recommended to use stylesheet parameters which are usually easier and can give better performance.
...And 4 more matches
remote/child - Archive of obsolete content
each frame then has a content property that's the top-level dom window for the frame, and addeventlistener/removeeventlistener functions that enable you to listen to dom events dispatched by the frame.
... getframeforwindow finds the frame for a top level dom window.
... addeventlistener adds an event listener for dom events dispatched to any existing and future frames.
...And 3 more matches
Chapter 5: Let's build a Firefox extension - Archive of obsolete content
true browser.dom.window.dump.enabled (not present in firefox 3.5+) enables use of the dump method for debugging.
... 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.
...there are a number of ways to go about this; here, we’ll use the dom inspector (figure 5).
...And 3 more matches
Setting Up a Development Environment - Archive of obsolete content
dom inspector the dom inspector used to be part of firefox as an installer option, but since firefox 3 it has been separated as another add-on you can add and remove.
... it's a very useful inspection tool that lets you look into the dom of html and xul documents, as well as applied css rules and associated javascript objects.
... introduction to dom inspector is a good guide on how to get started using it.
...And 3 more matches
Setting up an extension development environment - Archive of obsolete content
browser.dom.window.dump.enabled = true.
... you might also want to set dom.report_all_js_exceptions = true.
... dom inspector, used to inspect and edit the live dom of any web document or xul application (firefox and thunderbird) venkman, a javascript debugger (firefox version, thunderbird version) thunderbird developer tools, enables debugging thunderbird remotely using using firefox developer tools extension developer's extension a suite of tools for extension development (firefox) extension test an add-...
...And 3 more matches
MCD, Mission Control Desktop, AKA AutoConfig - Archive of obsolete content
instead of configuring end user individual preferences files (~/.mozilla/default/randomdir/prefs.js) we now use a centralized default set of preferences.
... ldap fail-over creating an array of possible running ldap servers permits an ldap fail-over, then a shuffle function allows us to randomly pick up a running ldap server.
...m mickweb script * factory at: * http://www.mickweb.com/javascript/arrays/pureshuffle.html */ here's how the ldap fail-over works: // 2) setup multiple ldap servers for fail-over var ldap_values; var ldap_servers = new array('ldap2.int-evry.fr', 'ldap1.int-evry.fr', 'openldap.int-evry.fr' ); // shuffle function to randomize the server array // setup the shuffle method for an array array.prototype.shuffle = function(times) { var i,j,t,l=this.length; while(times--) { with(math) { i = floor(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 t...
...And 3 more matches
Finding the code to modify - Archive of obsolete content
dom inspector now that we've found the file to edit, we need to find the specific code within that file.
... again, the dom inspector makes this easy.
... the "document - dom nodes" pane on the left-hand side of the inspector window displays a tree representation of the browser window's xul file.
...And 3 more matches
Finding the file to modify - Archive of obsolete content
the best way to find a xul file for a window is to use the dom inspector.
... the dom inspector is a tool bundled with mozilla that allows you to examine the dom of web pages and xul windows.
... to access it, go to the "tools" menu, select the "web development" submenu, then select the "dom inspector" item.
...And 3 more matches
Mozilla Crypto FAQ - Archive of obsolete content
i've updated this version of the mozilla crypto faq to discuss the situation now that the rsa public key algorithm is in the public domain and a full open source crypto implementation is being added to the mozilla code base.
...now that the rsa patent is in the public domain, mozilla crypto development can proceed with minimal restrictions.
... on september 6, 2000, rsa security released the rsa patent into the public domain, two weeks before the patent was scheduled to expire (on september 20, 2000).
...And 3 more matches
Manipulating Lists - Archive of obsolete content
although listboxes may be manipulated using the standard dom functions as well, it is recommended that the specialized listbox functions be used instead when possible.
...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.
...in fact, these methods are part of the nsidomxulselectcontrolelement interface so any xul elements which implement this interface have these methods.
...And 3 more matches
XUL Questions and Answers - Archive of obsolete content
as an extension author, you have at least two options: use dom methods to dynamically create or rearrange elements file an enhancement request in bugzilla to have extra ids added.
... while the attributes are always strings per the dom specification, the properties will eventually be fixed to return the value with the correct type.
...json string) from the server, parsing it on client, and building the menupopup using dom methods (such as document.createelementns).
...And 3 more matches
Gecko FAQ - Gecko Redirect 1
gecko is the open source browser engine designed to support open internet standards such as html 5, css 3, the w3c dom, xml, javascript, and others.
... except for: the application of styles to html column elements the ability to turn off author styles the names of certain mozilla extension pseudo-classes lack the moz- prefix css 2 - partial support is expected and has already been built into gecko, including support for css2 positioning, but no commitment has been made to achieve a specific level of support dom level 0 level 1 core: full support making entityreferences available through dom1; per a provision of the dom1 spec for xml implementations, entities will be automatically expanded inline and therefore not available through dom1; our implementation extrapolates this provision to apply to entityreferences as well for more information, see the dom in mozilla leve...
...l 1 html dom 2 - most of it has already been implemented in gecko, including support for dom 2 events, the dom 2 style, and the dom2 core.
...And 3 more matches
SLD - MDN Web Docs Glossary: Definitions of Web-related terms
an sld (second level domain) is the domain name that is located right before a tld.
... for example, in mozilla.org, mozilla is the second-level domain of the .org tld.
... a domain name is not limited to a tld and an sld.
...And 3 more matches
WAI-ARIA basics - Learn web development
wai-aria doesn't affect webpage structure, the dom, etc., although the attributes can be useful for selecting elements by css.
...via xmlhttprequest, or dom apis.
... dynamic content updates content loaded into the dom can be easily accessed using a screenreader, from textual content to alternative text attached to images.
...And 3 more matches
What is a URL? - Learn web development
www.example.com is the domain name.
... you might think of a url like a regular postal mail address: the protocol represents the postal service you want to use, the domain name is the city or town, and the port is like the zip code; the path represents the building where your mail should be delivered; the parameters represent extra information such as the number of the apartment in the building; and, finally, the anchor represents the actual person to whom you've addressed your mail.
... implicit domain name /docs/learn this is the most common use case for an absolute url within an html document.
...And 3 more matches
Sending forms through JavaScript - Learn web development
the xmlhttprequest (xhr) dom object can build http requests, send them, and retrieve their results.
...the "magic" is in the javascript: // because we want to access dom nodes, // we initialize our script at page load.
... window.addeventlistener( 'load', function () { // these variables are used to store the form data const text = document.getelementbyid( "thetext" ); const file = { dom : document.getelementbyid( "thefile" ), binary : null }; // use the filereader api to access file content const reader = new filereader(); // because filereader is asynchronous, store its // result when it finishes to read the file reader.addeventlistener( "load", function () { file.binary = reader.result; } ); // at page load, if a file is already selected, read it.
...And 3 more matches
Function return values - Learn web development
we saw this in action recently in our random-canvas-circles.html example.
... our draw() function draws 100 random circles somewhere on an html <canvas>: 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(); } } inside each loop iteration, three calls are made to the random() function, to generate a random value for the current circle's x-coordinate, y-coordinate, and radius, respectively.
... the random() function takes one parameter — a whole number — and it returns a whole random number between 0 and that number.
...And 3 more matches
Object building practice - Learn web development
the last bit of the initial script looks as follows: function random(min, max) { const num = math.floor(math.random() * (max - min + 1)) + min; return num; } this function takes two numbers as arguments, and returns a random number in the range between the two.
...the following will do this job — add it to the bottom of your code now: let balls = []; while (balls.length < 25) { let size = random(10,20); let ball = new ball( // ball position always drawn at least one ball width // away from the edge of the canvas, to avoid drawing errors random(0 + size,width - size), random(0 + size,height - size), random(-7,7), random(-7,7), 'rgb(' + random(0,255) + ',' + random(0,255) + ',' + random(0,255) +')', size ); balls.push(ball); } the while loop creat...
...es a new instance of our ball() using random values generated with our random() function, then push()es it onto the end of our balls array, but only while the number of balls in the array is less than 25.
...And 3 more matches
A bird's-eye view of the Mozilla framework
content (dom) the mozilla document object model (dom) specifies a logical tree structure for storing ui and document content, and provides an api (application programming interface) for accessing and manipulating the content.
... an application such as the browser may have one or more open documents accessible via dom apis.
... when an html, xml, svg or other type of document is loaded, the nglayout engine (also known as gecko) parses the contents into a dom tree, and handles the layout and rendering of the document pages.
...And 3 more matches
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.
... in particular, note that a frame script accesses the dom window using content, not window: // frame script var links = content.document.getelementsbytagname("a"); all the frame scripts running in a tab share this global.
... 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.
...And 3 more matches
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.
... in particular, note that a frame script accesses the dom window using content, not window: // frame script var links = content.document.getelementsbytagname("a"); all of the frame scripts running in a tab share this global.
... 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.
...And 3 more matches
source-editor.jsm
void init( element aelement, object aconfig function acallback ); parameters aelement the dom element in which to place the editor.
...this value comes from the dom contextmenu's event.screenx property.
...this value comes from the dom contextmenu's event.screeny property.
...And 3 more matches
JSS Provider Notes
dsakpg.initialize(1024); keypair dsapair = dsakpg.generatekeypair(); supported classes cipher dsaprivatekey dsapublickey keyfactory keygenerator keypairgenerator mac messagedigest rsaprivatekey rsapublickey secretkeyfactory secretkey securerandom signature what's not supported the following classes don't work very well: keystore: there are many serious problems mapping the jca keystore interface onto nss's model of pkcs #11 modules.
... cbc nopadding pkcs5 padding rc4 none none rc2 cbc nopadding pkcs5padding the securerandom argument passed to initsign() and initverify() is ignored, because nss does not support specifying an external source of randomness.
... keygenerator supported algorithms notes aes des desede (des3 ) rc4 the securerandom argument passed to init() is ignored, because nss does not support specifying an external source of randomness.
...And 3 more matches
Mozilla-JSS JCA Provider notes
dsakpg.initialize(1024); keypair dsapair = dsakpg.generatekeypair(); supported classes cipher dsaprivatekey dsapublickey keyfactory keygenerator keypairgenerator mac messagedigest rsaprivatekey rsapublickey secretkeyfactory secretkey securerandom signature cipher supported algorithms notes aes des desede (des3) rc2 rc4 rsa the following modes and padding schemes are supported: algorithm mode padding des ecb nopadding cbc nopadding pkcs5 padding desede des3 ecb ...
...nopadding cbc nopadding pkcs5 padding aes ecb nopadding cbc nopadding pkcs5 padding rc4 none none rc2 cbc nopadding pkcs5padding the securerandom argument passed to initsign() and initverify() is ignored, because nss does not support specifying an external source of randomness.
... keygenerator supported algorithms notes aes des desede (des3) rc4 the securerandom argument passed to init() is ignored, because nss does not support specifying an external source of randomness.
...And 3 more matches
nsIAccessibleEvent
accessible/public/nsiaccessibleevent.idlscriptable an interface for accessibility events listened to by in-process accessibility clients, which can be used to find out how to get accessibility and dom interfaces for the event and its target.
...this can be used to get the dom window, the dom document and the window handler, among other things.
... domnode nsidomnode the nsidomnode associated with the event.
...And 3 more matches
nsIAppShellService
doprofilestartup(in nsicmdlineservice acmdlineservice, in boolean caninteract); obsolete since gecko 1.8 void ensure1window(in nsicmdlineservice acmdlineservice); obsolete since gecko 1.8 void enterlastwindowclosingsurvivalarea(); obsolete since gecko 1.8 void exitlastwindowclosingsurvivalarea(); obsolete since gecko 1.8 void gethiddenwindowandjscontext(out nsidomwindow ahiddendomwindow, out jscontext ajscontext); native code only!
... void quit(in pruint32 aferocity); obsolete since gecko 1.8 void registertoplevelwindow(in nsixulwindow awindow); void run(); obsolete since gecko 1.8 void toplevelwindowismodal(in nsixulwindow awindow, in boolean amodal); obsolete since gecko 1.9.1 void unregistertoplevelwindow(in nsixulwindow awindow); note: prior to gecko 8.0, all references to nsidomwindow used in this interface were nsidomwindowinternal.
... hiddendomwindow nsidomwindow return the (singleton) application hidden window, automatically created and maintained by this appshellservice.
...And 3 more matches
nsIAuthInformation
domain astring the initial value should be used to prefill the dialog or be shown in some other way to the user.
... on return, this parameter should contain the domain entered by the user.
... this attribute is only used if flags include #need_domain.
...And 3 more matches
nsIBoxObject
pertyname); obsolete since gecko 1.9 wstring getproperty(in wstring propertyname); nsisupports getpropertyassupports(in wstring propertyname); void removeproperty(in wstring propertyname); void setproperty(in wstring propertyname, in wstring propertyvalue); void setpropertyassupports(in wstring propertyname, in nsisupports value); attributes attribute type description element nsidomelement read only.
... firstchild nsidomelement the first child of the box, in box-ordinal-group order.
... lastchild nsidomelement the last child of the box, in box-ordinal-group order.
...And 3 more matches
nsIBrowserHistory
nsiuri auri); obsolete since gecko 9.0 void removeallpages(); void removepage(in nsiuri auri); void removepages([array, size_is(alength)] in nsiuri auris, in unsigned long alength, in boolean adobatchnotify); void removepagesbytimeframe(in long long abegintime, in long long aendtime); void removepagesfromhost(in autf8string ahost, in boolean aentiredomain); void removevisitsbytimeframe(in long long abegintime, in long long aendtime); void unregisteropenpage(in nsiuri auri); obsolete since gecko 9.0 note: the markpageasfollowedlink and markpageastyped methods were moved to nsinavhistoryservice in gecko 22.0 so that all markpageas* methods can be found in one interface.
...it is called from the ui when the user deletes a group associated with a host or domain.
... this method lets you delete pages from a specific host, or pages from all hosts in a given domain.
...And 3 more matches
nsIContentViewer
[noscript,notxpcom,nostdcall] void setnavigationtiming(in nsdomnavigationtimingptr atiming); void setpagemode(in boolean apagemode, in nsiprintsettings aprintsettings); void show(); void stop(); void unload(); obsolete since gecko 1.8 attributes attribute type description container nsisupports domdocument nsidomdocument enablerendering boolean obsolete ...
...native code only!getbounds void getbounds( in nsintrectref abounds ); parameters abounds missing description getdocument() returns the dom document object (as an nsidocument without addrefing.
...return value the dom document object.
...And 3 more matches
nsIDroppedLinkHandler
dom/base/nsidroppedlinkhandler.idlscriptable please add a summary to this article.
... 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview boolean candroplink(in nsidomdragevent aevent, in prbool aallowsamedocument); astring droplink(in nsidomdragevent aevent, out astring aname, [optional] in boolean adisallowinherit); void droplinks(in nsidomdragevent aevent, [optional] in boolean adisallowinherit, [optional] out unsigned long acount, [retval, array, size_is(acount)] out nsidroppedlinkitem alinks); methods candroplink() determines if a link being dragged can be dropped.
... boolean candroplink( in nsidomdragevent aevent, in prbool aallowsamedocument ); parameters aevent a dragenter or dragover event.
...And 3 more matches
nsIEditorMailSupport
inherits from: nsisupports last changed in gecko 1.7 method overview nsisupportsarray getembeddedobjects(); nsidomnode insertascitedquotation(in astring aquotedtext, in astring acitation, in boolean ainserthtml); nsidomnode insertasquotation(in astring aquotedtext); void inserttextwithquotations(in domstring astringtoinsert); void pasteascitedquotation(in astring acitation, in long aselectiontype); void pasteasquotation(in long aselectiontype); void rewrap(in boolean arespectnewlines); void stripcites(); methods getembeddedobjects() get a list of img and object tags in the current document.
...nsidomnode insertascitedquotation( in astring aquotedtext, in astring acitation, in boolean ainserthtml ); parameters aquotedtext the actual text to be quoted.
...(vs plaintext) return value the nsidomnode which was inserted.
...And 3 more matches
nsINavHistoryQuery
domain autf8string this is the host or domain name (controlled by domainishost).
... when domainishost, domain only does exact matching on host names.
... otherwise, it will return anything whose host name ends in domain.
...And 3 more matches
nsISyncJPAKE
agvb schnorr signature value g^vb (vb is a random value), in hex representation.
...agv1 schnorr signature value g^v1 (v1 is a random value), in hex representation.
...agv2 schnorr signature value g^v2 (v2 is a random value), in hex representation.
...And 3 more matches
nsIWebProgressListener
the document corresponding to a document request is available via the domwindow attribute of onstatechange()'s awebprogress parameter.
... example the nsiwebprogresslistener for each tab: gbrowser.mtabprogresslistener can be used in the parent to listen for most nsiwebprogresslistener events, but in browser code, will not have access to the nsiwebprogress's domwindow property.
... see the example below on how to use an nsiwebprogresslistener in a frame script to get access to the dom window.
...And 3 more matches
Address Book examples
use the setproperty/getproperty functions on nsiabcard to set your property in the same way as you would do with normal properties: card.setproperty("random1", "xyz"); card.setproperty("random2", "foo"); ...
... 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.
... there are 3 address book autocomplete widgets: "mydomain" - use to autocomplete a domain for an email identity, e.g.
...And 3 more matches
Accessibility Inspector - Firefox Developer Tools
semantic dom elements have roles assigned to them by default that hint at what their purpose is.
...this is a bit like the dom tree, except that it contains a more limited set of elements and slightly different information about them.
... domnode — the type of dom node that the item in the accessibility tree represents.
...And 3 more matches
Cookies - Firefox Developer Tools
domain — the domain of the cookie.
...same-site cookies allow servers to mitigate the risk of csrf and information leakage attacks by asserting that a particular cookie should only be sent with requests initiated from the same registrable domain.
... hostonly — is this cookie a domain cookie?
...And 3 more matches
AnalyserNode - Web APIs
the analysernode interface represents a node able to provide real-time frequency and time-domain analysis information.
... analysernode.fftsize is an unsigned long value representing the size of the fft (fast fourier transform) to be used to determine the frequency domain.
... analysernode.getfloattimedomaindata() copies the current waveform, or time-domain, data into a float32array array passed into it.
...And 3 more matches
ByteLengthQueuingStrategy - Web APIs
dsafari on iossamsung internetbytelengthqueuingstrategy experimentalchrome full support 59edge full support 16firefox full support 57disabled full support 57disabled disabled from version 57: this feature is behind the dom.streams.enabled preference (needs to be set to true) and the javascript.options.streams preference (needs to be set to true).
... webview android full support 59chrome android full support 59firefox android full support 57disabled full support 57disabled disabled from version 57: this feature is behind the dom.streams.enabled preference (needs to be set to true) and the javascript.options.streams preference (needs to be set to true).
... 7.0bytelengthqueuingstrategy() constructor experimentalchrome full support 59edge full support 16firefox full support 57disabled full support 57disabled disabled from version 57: this feature is behind the dom.streams.enabled preference (needs to be set to true) and the javascript.options.streams preference (needs to be set to true).
...And 3 more matches
CDATASection - Web APIs
specifications specification status comment domthe definition of 'cdatasection' in that specification.
... living standard re-added in issue #295 due to web breakage dom4the definition of 'cdatasection' in that specification.
... obsolete removed in favour of the more generic text interface document object model (dom) level 3 core specificationthe definition of 'cdatasection' in that specification.
...And 3 more matches
Using dynamic styling information - Web APIs
the css object model (cssom), part of the dom, exposes specific interfaces allowing manipulation of a wide amount of information regarding css.
... initially defined in the dom level 2 style recommendation, these interfaces forms now a specification, css object model (cssom) which aims at superseding it.
...note also that, as with individual element's dom styles, when speaking of manipulating the stylesheets, this is not actually manipulating the physical document(s), but merely the internal representation of the document.
...And 3 more matches
ChildNode.after() - Web APIs
WebAPIChildNodeafter
the childnode.after() method 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.
... syntax [throws, unscopable] void childnode.after((node or domstring)...
...And 3 more matches
ChildNode.before() - Web APIs
WebAPIChildNodebefore
the childnode.before() method 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.
... syntax [throws, unscopable] void childnode.before((node or domstring)...
...And 3 more matches
CountQueuingStrategy - Web APIs
ndroidsafari on iossamsung internetcountqueuingstrategy experimentalchrome full support 59edge full support 16firefox full support 57disabled full support 57disabled disabled from version 57: this feature is behind the dom.streams.enabled preference (needs to be set to true) and the javascript.options.streams preference (needs to be set to true).
... webview android full support 59chrome android full support 59firefox android full support 57disabled full support 57disabled disabled from version 57: this feature is behind the dom.streams.enabled preference (needs to be set to true) and the javascript.options.streams preference (needs to be set to true).
... 7.0countqueuingstrategy() constructor experimentalchrome full support 59edge full support 16firefox full support 57disabled full support 57disabled disabled from version 57: this feature is behind the dom.streams.enabled preference (needs to be set to true) and the javascript.options.streams preference (needs to be set to true).
...And 3 more matches
Document.createProcessingInstruction() - Web APIs
exceptions dom_invalid_character throws if either of the following are true: the processing instruction target is invalid — it should be a valid xml name that doesn't contain "xml", "xml", or any case combination of the two, other than standardized ones such as <?xml-stylesheet ?>.
... example var doc = new domparser().parsefromstring('<foo />', 'application/xml'); var pi = doc.createprocessinginstruction('xml-stylesheet', 'href="mycss.css" type="text/css"'); doc.insertbefore(pi, doc.firstchild); console.log(new xmlserializer().serializetostring(doc)); // displays: <?xml-stylesheet href="mycss.css" type="text/css"?><foo/> specifications specification status comment domthe definition of 'createprocessinginstruction()' in that specification.
... living standard no change dom4the definition of 'createprocessinginstruction()' in that specification.
...And 3 more matches
DocumentFragment - Web APIs
usage notes a common use for documentfragment is to create one, assemble a dom subtree within it, then append or insert the fragment into the dom using node interface methods such as appendchild() or insertbefore().
... doing this moves the fragment's nodes into the dom, leaving behind an empty documentfragment.
...ist"></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.
...And 3 more matches
Element.getBoundingClientRect() - Web APIs
syntax domrect = element.getboundingclientrect(); value the returned value is a domrect object which is the union of the rectangles returned by getclientrects() for the element, i.e., the css border-boxes associated with the element.
...t : document.body).scrolltop examples this simple example retrieves the domrect object representing the bounding client rect of a simple <div> element, and prints out its properties below it.
... working draft initial definition notes the returned domrect object can be modified in modern browsers.
...And 3 more matches
Element.getElementsByTagName() - Web APIs
the returned list is live, which means it updates itself with the dom tree automatically.
... therefore, there is no need to call element.getelementsbytagname() with the same element and arguments repeatedly if the dom changes in between calls.
... example // check the status of each data cell in a table const table = document.getelementbyid('forecast-table'); const cells = table.getelementsbytagname('td'); for (let cell of cells) { let status = cell.getattribute('data-status'); if (status === 'open') { // grab the data } } specifications specification status comment domthe definition of 'element.getelementsbytagname()' in that specification.
...And 3 more matches
Element.localName - Web APIs
WebAPIElementlocalName
in previous dom specifications this api was defined within the node interface.
... syntax name = element.localname return value a domstring representing the local part of the element's qualified name.
...artners is the local name and ecomm is the prefix: <ecomm:business id="soda_shop" type="brick_n_mortar" xmlns:ecomm="http://example.com/ecomm"> <ecomm:partners> <ecomm:partner id="1001">tony's syrup warehouse </ecomm:partner> </ecomm:partner> </ecomm:business> note: in gecko 1.9.2 and earlier, the property returns the upper-cased version of the local name for html elements in html doms (as opposed to xhtml elements in xml doms).
...And 3 more matches
Event.composed - Web APIs
WebAPIEventcomposed
the read-only composed property of the event interface returns a boolean which indicates whether or not the event will propagate across the shadow dom boundary into the standard dom.
... syntax const iscomposed = event.composed; value a boolean which is true if the event will cross from the shadow dom into the standard dom after reaching the shadow root.
... (that is, the first node in the shadow dom in which the event began to propagate.) all ua-dispatched ui events are composed (click/touch/mouseover/copy/paste, etc.).
...And 3 more matches
HTMLBaseElement - Web APIs
htmlbaseelement.href is a domstring that reflects the href html attribute, containing a base url for relative urls in the document.
... htmlbaseelement.target is a domstring that reflects the target html attribute, containing a default target browsing context or frame for elements that do not have a target reference specified.
... recommendation no change from document object model (dom) level 2 html specification.
...And 3 more matches
HTMLEmbedElement - Web APIs
htmlembedelement.align is a domstring representing an enumerated property indicating alignment of the element's contents with respect to the surrounding context.
... htmlembedelement.height is a domstring reflecting the height html attribute, containing the displayed height of the resource.
... htmlembedelement.name is a domstring representing the name of the embedded object.
...And 3 more matches
HTMLImageElement.decode() - Web APIs
the decode() method of the htmlimageelement interface returns a promise that resolves when the image is decoded and it is safe to append the image to the dom.
... this can be used to initiate loading of the image prior to attaching it to an element in the dom (or adding it to the dom as a new element), so that the image can be rendered immediately upon being added to the dom.
... this, in turn, prevents the rendering of the next frame after adding the image to the dom from causing a delay while the image loads.
...And 3 more matches
HTMLKeygenElement - Web APIs
challenge is a domstring that reflects the challenge html attribute, containing a challenge string that is packaged with the submitted key.
... keytype is a domstring that reflects the keytype html attribute, containing the type of key used.
... name is a domstring that reflects the name html attribute, containing the name for the control that is submitted with form data.
...And 3 more matches
HTMLModElement - Web APIs
htmlmodelement.cite is a domstring reflecting the cite html attribute, containing a uri of a resource explaining the change.
... htmlmodelement.datetime is a domstring reflecting the datetime html attribute, containing a date-and-time string representing a timestamp for the change.
... recommendation no change from document object model (dom) level 2 html specification.
...And 3 more matches
HTMLOutputElement - Web APIs
htmloutputelement.defaultvalue a domstring representing the default value of the element, initially the empty string.
... htmloutputelement.htmlforread only a domtokenlist reflecting the for html attribute, containing a list of ids of other elements in the same document that contribute to (or otherwise affect) the calculated value.
... htmloutputelement.name a domstring reflecting the name html attribute, containing the name for the control that is submitted with form data.
...And 3 more matches
HTMLSelectElement - Web APIs
htmlselectelement.name a domstring reflecting the name html attribute, containing the name of this control used by servers and dom search functions.
... htmlselectelement.typeread only a domstring represeting the form control's type.
... htmlselectelement.validationmessageread only a domstring representing a localized message that describes the validation constraints that the control does not satisfy (if any).
...And 3 more matches
Node.localName - Web APIs
WebAPINodelocalName
in dom4 this api was moved from node to the element and attr interfaces.
...rtners is the local name and ecomm is the prefix: <ecomm:business id="soda_shop" type="brick_n_mortar" xmlns:ecomm="http://example.com/ecomm"> <ecomm:partners> <ecomm:partner id="1001">tony's syrup warehouse </ecomm:partner> </ecomm:partners> </ecomm:business> note: in gecko 1.9.2 and earlier, the property returns the upper-cased version of the local name for html elements in html doms (as opposed to xhtml elements in xml doms).
... in later versions, in compliance with html5, the property returns in the case of the internal dom storage, which is lower case for both html elements in html doms and xhtml elements in xml doms.
...And 3 more matches
Node.nextSibling - Web APIs
WebAPINodenextSibling
see whitespace in the dom and w3c dom 3 faq: why are some text nodes empty?
...script **************************************************/ in the above example, #text nodes are inserted in the dom where whitespace occurs between tags (i.e.
... the possible inclusion of text nodes must be allowed for when traversing the dom using nextsibling.
...And 3 more matches
Node.removeChild() - Web APIs
WebAPINoderemoveChild
the node.removechild() method removes a child node from the dom and returns the removed node.
... syntax var oldchild = node.removechild(child); or node.removechild(child); child is the child node to be removed from the dom.
... the removed child node still exists in memory, but is no longer part of the dom.
...And 3 more matches
ParentNode.append() - Web APIs
WebAPIParentNodeappend
the parentnode.append() method inserts a set of node objects or domstring objects after the last child of the parentnode.
... domstring objects are inserted as equivalent text nodes.
... differences from node.appendchild(): parentnode.append() allows you to also append domstring objects, whereas node.appendchild() only accepts node objects.
...And 3 more matches
ParentNode - Web APIs
see locating dom elements using selectors to learn how to use css selectors to find nodes or elements of interest.
... methods parentnode.append() inserts a set of node objects or domstring objects after the last child of the parentnode.
... domstring objects are inserted as equivalent text nodes.
...And 3 more matches
Performance API - Web APIs
as such, the performance api defines a domhighrestimestamp type rather than using the date.now() interface.
... domhighrestimestamp the domhighrestimestamp type, as its name implies, represents a high resolution point in time.
... the unit of domhighrestimestamp is milliseconds and should be accurate to 5 µs (microseconds).
...And 3 more matches
RTCIceCandidateInit.usernameFragment - Web APIs
value a domstring containing the username fragment (usually referred to in shorthand as "ufrag" or "ice-ufrag") that, along with the ice password ("ice-pwd"), uniquely identifies a single ongoing ice interaction, including for any communication with the stun server.
... randomization at least 24 bits of the text in the ufrag are required to be randomly selected by the ice layer at the beginning of the ice session.
... the specifics for which bits are random and what the remainder of the ufrag text are are left up to the browser implementation to decide.
...And 3 more matches
Range - Web APIs
WebAPIRange
range.getboundingclientrect() returns a domrect object which bounds the entire contents of the range; this would be the union of all the rectangles returned by range.getclientrects().
... range.getclientrects() returns a list of domrect objects that aggregates the results of element.getclientrects() for all the elements in the range.
... specifications specification status comment domthe definition of 'range' in that specification.
...And 3 more matches
SVGSVGElement - Web APIs
svgsvgelement.screenpixeltomillimeterx user interface (ui) events in dom level 2 indicate the screen positions at which the given ui event occurred.
...the meaning depends on the situation: if the initial view was a "standard" view, then: the values for viewbox, preserveaspectratio and zoomandpan within currentview will match the values for the corresponding dom attributes that are on svgsvgelement directly the values for transform and viewtarget within currentview will be null if the initial view was a link into a <view> element, then: the values for viewbox, preserveaspectratio and zoomandpan within currentview will correspond to the corresponding attributes for the given <view> element the values for transform and viewtarget within current...
...view will be null if the initial view was a link into another element (i.e., other than a <view>), then: the values for viewbox, preserveaspectratio and zoomandpan within currentview will match the values for the corresponding dom attributes that are on svgsvgelement directly for the closest ancestor <svg> element the values for transform within currentview will be null the viewtarget within currentview will represent the target of the link if the initial view was a link into the svg document fragment using an svg view specification fragment identifier (i.e., #svgview(…)), then: the values for viewbox, preserveaspectratio, zoomandpan, transform and viewtarget within currentview will correspond to the values from the svg view specification fragment identifier svgsvge...
...And 3 more matches
SVGStyleElement - Web APIs
svgstyleelement.type a domstring corresponding to the type attribute of the given element.
... svg 1.1 defined that a domexception is raised with code no_modification_allowed_err on an attempt to change the value of a read-only attribute.
... svgstyleelement.media a domstring corresponding to the media attribute of the given element.
...And 3 more matches
SVGTransform - Web APIs
exceptions: a domexception with code no_modification_allowed_err is raised when attempting to modify a read only attribute or when the object itself is read only.
... exceptions: a domexception with code no_modification_allowed_err is raised when attempting to modify a read only attribute or when the object itself is read only.
... exceptions: a domexception with code no_modification_allowed_err is raised when attempting to modify a read only attribute or when the object itself is read only.
...And 3 more matches
ShadowRoot - Web APIs
the shadowroot interface of the shadow dom api is the root node of a dom subtree that is rendered separately from a document's main dom tree.
... shadowroot.host read only returns a reference to the dom element the shadowroot is attached to.
... shadowroot.innerhtml sets or returns a reference to the dom tree inside the shadowroot.
...And 3 more matches
Text - Web APIs
WebAPIText
text.wholetext read only returns a domstring containing the text of all text nodes logically adjacent to this node, concatenated in document order.
... specifications specification status comment domthe definition of 'text' in that specification.
... document object model (dom) level 3 core specificationthe definition of 'text' in that specification.
...And 3 more matches
TextTrack - Web APIs
WebAPITextTrack
texttrack.id read only a domstring which identifies the track, if it has one.
... texttrack.inbandmetadatatrackdispatchtype read only returns a domstring which indicates the track's in-band metadata track dispatch type.
... needs details texttrack.kind read only returns a domstring indicating what kind of text track the texttrack describes.
...And 3 more matches
URL - Web APIs
WebAPIURL
host a usvstring containing the domain (that is the hostname) followed by (if a port was specified) a ':' and the port of the url.
... hostname a usvstring containing the domain of the url.
... origin read only returns a usvstring containing the origin of the url, that is its scheme, its domain and its port.
...And 3 more matches
Visualizations with Web Audio API - Web APIs
the analyser node will then capture audio data using a fast fourier transform (fft) in a certain frequency domain, depending on what you specify as the analysernode.fftsize property value (if no value is specified, the default is 2048.) note: you can also specify a minimum and maximum power value for the fft data scaling range, using analysernode.mindecibels and analysernode.maxdecibels, and different data averaging constants using analysernode.smoothingtimeconstant.
... to capture data, you need to use the methods analysernode.getfloatfrequencydata() and analysernode.getbytefrequencydata() to capture frequency data, and analysernode.getbytetimedomaindata() and analysernode.getfloattimedomaindata() to capture waveform data.
...for example: analyser.getbytetimedomaindata(dataarray); we now have the audio data for that moment in time captured in our array, and can proceed to visualize it however we like, for example by plotting it onto an html5 <canvas>.
...And 3 more matches
Using XMLHttpRequest - Web APIs
analyzing and manipulating the responsexml property if you use xmlhttprequest to get the content of a remote xml document, the responsexml property will be a dom object containing a parsed xml document.
... using xmlserializer to serialize dom trees to strings or to files.
... inject the content into the body of a document fragment via fragment.body.innerhtml and traverse the dom of the fragment.
...And 3 more matches
XMLSerializer - Web APIs
the xmlserializer interface provides the serializetostring() method to construct an xml string representing a dom tree.
... inserting nodes into a dom based on xml this example uses the element.insertadjacenthtml() method to insert a new dom node into the body of the document, based on xml created by serializing an element object.
... note: in the real world, you should usually instead call importnode() method to import the new node into the dom, then call one of the following methods to add the node to the dom tree: the document and element methods append() and prepend() the node.replacewith() method (to replace an existing node with the new one) the document.insertadjacentelement() and element.insertadjacentelement() methods.
...And 3 more matches
ARIA: cell role - Accessibility
aria-colindex attribute the aria-colindex attribute is only needed if columns are hidden from the dom.
...if all the columns are in the dom, this attribute is not necessary.
... aria-rowindex attribute the aria-rowindex attribute is only needed if rows are hidden from the dom, to indicate which row, in the list of total rows, the current cell is in.
...And 3 more matches
<tr>: The Table Row element - HTML: Hypertext Markup Language
WebHTMLElementtr
alignobsolete since html5 a domstring which specifies how the cell's context should be aligned horizontally within the cells in the row; this is shorthand for using align on every cell in the row individually.
... bgcolorobsolete since html5 a domstring specifying a color to apply to the backgrounds of each of the row's cells.
... charobsolete since html5 a domstring which sets the character to align the cells in each of the row's columns on (each row's centering that uses the same character gets aligned with others using the same character .
...And 3 more matches
HTML elements reference - HTML: Hypertext Markup Language
WebHTMLElement
<main> the html <main> element represents the dominant content of the <body> of a document.
... <main> the html <main> element represents the dominant content of the <body> of a document.
... element description <slot> the html <slot> element—part of the web components technology suite—is a placeholder inside a web component that you can fill with your own markup, which lets you create separate dom trees and present them together.
...And 3 more matches
XPath snippets - XPath
this article provides some xpath code snippets—simple examples of how to a few simple utility functions based on standard interfaces from the dom level 3 xpath specification that expose xpath functionality to javascript code.
...the first argument is a dom node or document object, while the second is a string defining an xpath expression.
... example: defining a custom node-specific evaluatexpath() utility function // evaluate an xpath expression aexpression against a given dom node // or document object (anode), returning the results as an array // thanks wanderingstan at morethanwarm dot mail dot com for the // initial work.
...And 3 more matches
Loading Content Scripts - Archive of obsolete content
it takes one of three possible values: "start" loads the scripts immediately after the document element for the page is inserted into the dom.
... at this point the dom content hasn't been loaded yet, so the script won't be able to interact with it.
... "ready" loads the scripts after the dom for the page has been loaded: that is, at the point the domcontentloaded event fires.
...And 2 more matches
page-mod - Archive of obsolete content
for example, we might want to run a script in the context of the currently active tab when the user clicks a button: to block certain content, to change the font style, or to display the document's dom structure.
... you can specify a url exactly: var pagemod = require("sdk/page-mod"); pagemod.pagemod({ include: "http://www.iana.org/domains/example/", contentscript: 'window.alert("page matches ruleset");' }); you can specify a number of wildcard forms, for example: var pagemod = require("sdk/page-mod"); pagemod.pagemod({ include: "*.mozilla.org", contentscript: 'window.alert("matched!");' }); you can specify a set of urls using a regular expression.
... name: contentscriptwhen type: string by default, content scripts are attached after all the content (dom, js, css, images) for the document has been loaded, at the time the window.onload event fires.
...And 2 more matches
page-worker - Archive of obsolete content
create a permanent, invisible page and access its dom.
... "console.log(paras[0].textcontent);" + "self.port.emit('loaded');" pageworker = require("sdk/page-worker").page({ contentscript: getfirstparagraph, contenturl: "http://en.wikipedia.org/wiki/chalk" }); pageworker.port.on("loaded", function() { pageworker.contenturl = "http://en.wikipedia.org/wiki/cheese" }); scripting page content to access the page's dom you need to attach a script to it.
... while content scripts can access dom content, they can't access any of the sdk apis, so in many cases you'll need to exchange messages between the content script and your main add-on code for a complete solution.
...And 2 more matches
JavaScript Daemons Management - Archive of obsolete content
|*| |*| https://developer.mozilla.org/docs/dom/window.setinterval |*| |*| syntax: |*| var timeoutid = window.settimeout(func, delay, [param1, param2, ...]); |*| var timeoutid = window.settimeout(code, delay); |*| var intervalid = window.setinterval(func, delay[, param1, param2, ...]); |*| var intervalid = window.setinterval(code, delay); |*| \*/ /* if (document.all && !window.settimeout.ispolyfill) { var __nativest__ = window.settime...
...build letters list // http://tyleregeto.com/text-animation-in-javascript this.textcontent = ""; aletters.length = 0; for (var ospan, oletter, nletter = 0, nlen = stext.length; nletter < nlen; nletter++) { ospan = document.createelement("span"); ospan.textcontent = stext[nletter]; oletter = { "elem": ospan, "parent": this }; aletters.push(oletter); oletter.pos = math.random() * 50; oletter.elem.style.position = "relative"; this.appendchild(ospan); } } var nmaxdist = 25, aletters = [], stext = "do you feel lucky, punk?", orecompose = new daemon(document.createelement("p"), perform, 33, 30, prepare); onload = function () { orecompose.owner.id = "perform-me"; document.body.appendchild(orecompose.owner); orecompose.play(); }; </script> <style typ...
... oletter.val : this.pool[parseint(math.random() * this.pool.length)]; } } }, 33, 30); onload = function () { ounhide.owner.target.id = "animate-me"; document.body.appendchild(ounhide.owner.target); ounhide.play(); }; </script> <style type="text/css"> body { font-family: monospace, sans-serif; background: #dddddd; overflow: hidden; } #animate-me { margin: 50px; font-size: 20px; line-height: 20px; } </style> </head>...
...And 2 more matches
Listening to events in Firefox extensions - Archive of obsolete content
simple dom events registering for a dom event is done using with code such as the following: function callback(evt) { // do your processing here.
... some of the more interesting dom events you may wish to monitor are listed here: event description domlinkadded dispatched when a new html <link> element is detected in the document.
... domtitlechanged dispatched when the title of the page changes.
...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.
...in a nutshell, events propagate from the root of the dom tree all the way down to the target element and then all the way up back to the root, in the capture and bubble phases, respectively.
...the dom createevent function allows you to create custom events that you can dispatch and capture.
...And 2 more matches
Appendix D: Loading Scripts - Archive of obsolete content
problems can ensue if the script immediately attempts to access dom nodes.
... disadvantages namespacing: as modules always execute with their own namespace, they have no direct access to the dom or window properties of windows or documents, and therefore must often pass around references to these objects and any document-specific state data that they require.
... const { services } = module("resource://gre/modules/services.jsm"); const { bar, foo } = module("my-module"); dom workers: worker and chromeworker dom workers can be used to load scripts into their own global contexts which run in their own threads.
...And 2 more matches
Intercepting Page Loads - Archive of obsolete content
in most cases you'll need to compare the page url with some string or regular expression: if (some_regular_expression.test(doc.defaultview.location.href)) you can access and modify the dom of the loaded page, just like you normally would for xul and html documents.
... you won't be able to make dom modifications like with the load events, since these notifications are triggered before the response arrives and is parsed into dom tree, so this is not the best approach for the typical greasemonkey-style extensions.
...awebprogress.domwindow gives you access to the window where the content was going to be loaded.
...And 2 more matches
Index of archived content - Archive of obsolete content
add-ons add-on sdk builder guides content scripts communicating with other scripts communicating using "port" communicating using "postmessage" cross-domain content scripts interacting with page scripts loading content scripts reddit example port self contributor's guide classes and inheritance content processes getting started mo...
...kies customizing the download progress bar delayed execution dialogs and prompts downloading files drag & drop embedding svg examples and demos from articles file i/o finding window handles forms related code snippets html in xul for rich tooltips html to dom isdefaultnamespace js xpcom javascript debugger service javascript timers javascript daemons management label and description lookupnamespaceuri lookupprefix miscellaneous modules on page load page ...
...and commands adding toolbars and toolbar buttons adding menus and submenus adding sidebars adding windows and dialogs appendix a: add-on performance appendix b: install and uninstall scripts appendix c: avoiding using eval in add-ons appendix d: loading scripts appendix e: dom building and insertion (html & xul) appendix f: monitoring dom changes connecting to remote content custom xul elements with xbl getting started with firefox extensions handling preferences intercepting page loads introduction javascript object management local storage ...
...And 2 more matches
Mozilla Application Framework in Detail - Archive of obsolete content
gecko consists roughly of an html parser and xml parser, a dom implementation, a css parser and style system, and the code for css-based and html-based layout and rendering.
...gecko features full support for open internet standards such as css1, html 4.0, dom1, rdf, xml and javascript.
...in addition, independent software developers and corporate information technology departments now have complete access to the modular source code and freedom to freely license the source, make changes and build customized versions to accommodate their individual needs.
...And 2 more matches
Box Objects - Archive of obsolete content
the dom is generally used only to get and modify information pertaining to the content or structure of the document.
...first, you can retrieve the position and size of the xul element as displayed, and second, you can determine the order of the elements in the box as displayed, instead of their order as they are stored in the dom.
...recall that dom properties such as childnodes, firstchild, and nextsibling may be used to navigate the document tree.
...And 2 more matches
promptBox - Archive of obsolete content
method overview nsidomelement appendprompt(args, onclosecallback); void removeprompt(nsidomelement aprompt); nodelist listprompts(nsidomelement aprompt); methods appendprompt() creates a new prompt, adding it to the tab.
... nsidomelement appendprompt( args, onclosecallback ); parameters args arguments for the prompt.
... return value an nsidomelement object representing the new prompt.
...And 2 more matches
XULRunner tips - Archive of obsolete content
when using xulrunner 1.9 or greater, you can create your own alias in your chrome manifest add a "skin" line: skin communicator classic/1.0 skin/communicator/ add a skin folder named "communicator" and add a single css file named "communicator.css" with this content: @import url("chrome://global/skin"); dom inspector to add dom inspector 2.0.* to your xulrunner 1.9.0.* application follow these steps: download the dom inspector (instead of clicking the "add to..." button, right-click and select "save link as...").
... save the dom_inspector-*.xpi package to a temporary directory unzip the package copy the following files: chrome/inspector.jar to the chrome directory of your xulrunner application components/inspector-cmdline.js to your components directory defaults/preferences/inspector.js to your preferences directory open your chrome.manifest file and add these lines: content inspector jar:inspector.jar!/content/inspector/ xpcnativewrappers=no locale inspector en-us jar:inspector.jar!/locale/inspector/ skin inspector modern/1.0 jar:inspector.jar!/skin/modern/inspector/ skin inspector classic/1.0 jar:inspector.jar!/skin/classic/inspector/ overlay chrome://inspector/content/popupoverlay.xul chrome://inspector/content/view...
...ers/dom/popupoverlay.xul overlay chrome://inspector/content/commandoverlay.xul chrome://inspector/content/viewers/stylerules/commandoverlay.xul overlay chrome://inspector/content/keysetoverlay.xul chrome://inspector/content/viewers/dom/keysetoverlay.xul overlay chrome://inspector/content/popupoverlay.xul chrome://inspector/content/viewers/stylerules/popupoverlay.xul overlay chrome://inspector/content/commandoverlay.xul chrome://inspector/content/viewers/dom/commandoverlay.xul to launch dom inspector in your application, you need to open its main window, with a command like this: window.open("chrome://inspector/content/inspector.xul", "", "chrome"); alternatively, the dom inspector may also be added as an extension: (if you already have inspector installed for another applicatio...
...And 2 more matches
Extentsions FAQ - Archive of obsolete content
these two links should give you a starting point: http://www..xulplanet.com/tutorials/...u/advmenu.html http://www.xulplanet.com/tutorials/x...dommodify.html request for a thunderbird extension that can automatically detect the default domain when composing e-mails via autodetect.
... <https://bugzilla.mozilla.org/show_bug.cgi?id=312818> "thunderbird requires domain in addresses and doesn't always add default" there is an extension that allows what you want attached to one of the comments in this bug.
...use the dom api (http://www.w3schools.com/dom/default.asp has a good tutorial).
...And 2 more matches
NPP_NewStream - Archive of obsolete content
stream supports random access through calls to npn_requestread (for example, local files or http servers that support byte-range requests).
...the browser must copy data in the stream to the local cache to satisfy random access requests made through npn_requestread.
... np_seek: stream data randomly accessible by the plug-in as needed, through calls to npn_requestread.
...And 2 more matches
Introduction to Public-Key Cryptography - Archive of obsolete content
the client digitally signs a randomly generated piece of data and sends both the certificate and the signed data across the network.
...instead it concatenates the password with a random per-user value (so called "salt") and stores the hash value of the result along with the salt.
...to authenticate a user to a server, a client digitally signs a randomly generated piece of data and sends both the certificate and the signed data across the network.
...And 2 more matches
Back to the Server: Server-Side JavaScript On The Rise - Archive of obsolete content
in addition, the jaxer “ajax server” (a project i work on at aptana) is an example of ssjs that uses not only spidermonkey, but also embeds the entire firefox browser engine in the application server such that you can do server-side dom manipulation and other ajaxy things server-side that rhino was not built to do.
...rhino’s support of this important standard eliminates the pain of using dom or sax based parsers in java.
... as stated earlier, aptana jaxer is built using the mozilla browser engine engine that powers mozilla firefox, which includes spidermonkey as its javascript interpreter, but lots more features beyond ssjs alone such as dom, db, file io, css, server sessions, e4x, etc...] this is a great advantage to the developer as it presents a consistent server-side and client-side development environment for both browser and server contexts that is centered on open source and web standards.
...And 2 more matches
XForms Custom Controls - Archive of obsolete content
interface nsixformsuiwidget : nsidomelement { /** * is called when control should be updated to reflect the value of the bound node.
... */ domstring getvalue(); /** * set value of instance node.
... */ void setvalue(in domstring value); /** * return true if the instance node is readonly as determined by the mdg.
...And 2 more matches
RDF in Mozilla FAQ - Archive of obsolete content
one alternative to using rdf and xul templates is to use the w3c dom apis to build up and manipulate a xul (or html) content model.
...rather than writing three pieces of js (or c++) code to construct the dom trees each for <menubutton>, <menu>, and <tree> content models, you write three compact sets of rules for each content model.
...*/; // get the dom element for 'my-tree' var tree = document.getelementbyid('my-tree'); // add our datasource to it tree.database.adddatasource(ds); // force the tree to rebuild *now*.
...And 2 more matches
Anatomy of a video game - Game development
it is known as a domhighrestimestamp but, for all intents and purposes, consider it a floating point number.
...because this is common, window.requestanimationframe() always provides a domhighrestimestamp to callbacks as an argument when they are executed.
...*/ ;(function () { function main( tframe ) { mygame.stopmain = window.requestanimationframe( main ); // your main loop contents // tframe, from "function main ( tframe )", is now a domhighrestimestamp provided by raf.
...And 2 more matches
DNS - MDN Web Docs Glossary: Definitions of Web-related terms
dns (domain name system) is a hierarchical and decentralized naming system for internet connected resources.
... dns maintains a list of domain names along with the resources, such as ip addresses, that are associated with them.
... the most prominent function of dns is the translation of human-friendly domain names (such as mozilla.org) to a numeric ip address (such as 151.106.5.172); this process of mapping a domain name to the appropriate ip address is known as a dns lookup.
...And 2 more matches
How does the Internet work? - Learn web development
to make things easier, we can alias an ip address with a human readable name called a domain name.
... for example (at the time of writing; ip addresses can change) google.com is the domain name used on top of the ip address 173.194.121.32.
... so using the domain name is the easiest way for us to reach a computer over the internet.
...And 2 more matches
What are browser developer tools? - Learn web development
(an added bonus: this method straight-away highlights the code of the element you right-clicked.) the inspector: dom explorer and css editor the developer tools usually open by default to the inspector, which looks something like the following screenshot.
... in internet explorer, tap/click dom explorer, or press ctrl + 1.
... exploring the dom inspector for a start, right-click (ctrl-click) an html element in the dom inspector and look at the context menu.
...And 2 more matches
Looping code - Learn web development
let's say we wanted to draw 100 random circles on a <canvas> element (press the update button to run the example again and again to see different random sets): hidden code <!doctype html> <html> <head> <meta charset="utf-8"> <title>random canvas circles</title> <style> html { width: 100%; height: inherit; background: #ddd; } canvas { display: block; } bod...
... <body> <button>update</button> <canvas></canvas> <script> const btn = document.queryselector('button'); const canvas = document.queryselector('canvas'); const ctx = canvas.getcontext('2d'); let width = document.documentelement.clientwidth; let height = document.documentelement.clientheight; canvas.width = width; canvas.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.addeventlistener('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 code, returns a whole number between 0 and x-1.
...And 2 more matches
Test your skills: Functions - Learn web development
dom manipulation: considered useful some of the questions below require you to write some dom manipulation code to complete them — such as creating new html elements, setting their text contents to equal specific string values, and nesting them inside existing elements on the page — all via javascript.
... we haven't explicitly taught this yet in the course, but you'll have seen some examples that make use of it, and we'd like you to do some research into what dom apis you need to successfully answer the questions.
... functions 1 for the first task, you have to create a simple function — choosename() — that prints a random name from the provided array (names) to the provided paragraph (para), and then run it once.
...And 2 more matches
Client-side storage - Learn web development
separate storage for each domain there is a separate data store for each domain (each separate web address loaded in the browser).
...}) — if so, we create a dom fragment, populate it with the data from the record, and insert it into the page (inside the <ul> element).
... when the database transaction is complete, we delete the note's <li> from the dom, and again do the check to see if the <ul> is now empty, inserting a note as appropriate.
...And 2 more matches
Drawing graphics - Learn web development
note: you should generally set the size of the image using html attributes or dom properties, as explained above.
... now add the following code to the bottom of the javascript: function degtorad(degrees) { return degrees * math.pi / 180; }; function rand(min, max) { return math.floor(math.random() * (max-min+1)) + (min); } let length = 250; let moveoffset = 20; for(var i = 0; i < length; i++) { } here we are implementing the same degtorad() function we saw in the triangle example above, a rand() function that returns a random number between given lower and upper bounds, length and moveoffset variables (which we'll find out more about later), and an empty for loop.
... introduce some random numbers using that rand() function we included above but didn't use.
...And 2 more matches
Ember app structure and componentization - Learn web development
previous overview: client-side javascript frameworks next in this article we'll get right on with planning out the structure of our todomvc ember app, adding in the html for it, and then breaking that html structure into components.
... planning out the layout of the todomvc app in the last article we set up a new ember project, then added and configured our css styles.
... at this point we add some html, planning out the structure and semantics of our todomvc app.
...And 2 more matches
Componentizing our Svelte app - Learn web development
note: custom events in svelte share the same api as regular dom events.
...take into account that it won't just show or hide the markup based on the condition — it will dynamically add and remove the elements from the dom, depending on the condition.
... when editing is true, for example, svelte will show the update form; when it's false, it will remove it from the dom and add in the checkbox.
...And 2 more matches
Getting started with Svelte - Learn web development
highly interactive pages or complex visualizations: if you are building data-visualizations that need to display a large number of dom elements, the performance gains that come from a framework with no runtime overhead will ensure that user interactions are snappy and responsive.
... a first look at svelte reactivity in the context of a ui framework, reactivity means that the framework can automatically update the dom when the state of any component is changed.
...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.
...And 2 more matches
Dynamic behavior in Svelte: working with variables and props - Learn web development
svelte has the on:eventname directive for listening to dom events.
...in our app, the todos array value is updated directly every time a todo is toggled or deleted, and so svelte will update the dom automatically.
...update the newtodo form's opening tag like so: <form on:submit|preventdefault={addtodo}> the on:eventname directive supports adding modifiers to the dom event with the | character.
...And 2 more matches
Handling common HTML and CSS problems - Learn web development
in the worst cases, javascript is used to generate the entire web page content and style, which makes your pages inaccessible, and less performant (generating dom elements is expensive).
...se case we mentioned earlier (making modern semantic elements styleable in old versions of ie) can be achieved easily using conditional comments, for example you could put something like this in your ie stylesheet: aside, main, article, section, nav, figure, figcaption { display: block; } it isn't that simple, however — you also need to create a copy of each element you want to style in the dom via javascript, for them to be styleable; this is a strange quirk, and we won't bore you with the details here.
...we find that it is helpful to inspect the element you are trying to style using your browser's dev tools, then look at the dom tree breadcrumb trail that dom inspectors tend to provide to see if your selector makes sense compared to it.
...And 2 more matches
mozbrowsermetachange
general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
... details the details property returns an anonymous javascript object with the following properties: name a domstring representing the <meta> name attribute value.
... content a domstring representing the <meta> content attribute value, i.e.
...And 2 more matches
mozbrowsershowmodalprompt
general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
... details the details property is an anonymous javascript object with the following properties: prompttype a domstring defining the type of the prompt.
... title a domstring representing the title of the prompt.
...And 2 more matches
Script security
when objects share an origin but not a global - for example two web pages from the same protocol, port, and domain - they belong to two different compartments, and the caller gets a transparent wrapper to the target object.
...for example, privileged code using an xray to a dom object sees only the original version of the dom object.
... any expando properties are not visible, and if any native dom properties have been redefined, they are not visible in the xray.
...And 2 more matches
PBackground
for most purposes this is great, because the dom is already bound to the main thread.
...this allows the dom code to generally not worry about what thread (main vs.
...instead, it simply turns all of its operations into ipdl calls on a set of pbackground-based actors and the processing, file i/o, etc, can be controlled from the pbackground thread regardless of where the dom calls are being made.
...And 2 more matches
API-provided widgets
should return the dom node that has been constructed.
... nb: the dom node you construct should have the same id as the id property described above, so that customizableui can find the node again later.
... onbeforecreated(adoc) attached to all non-custom widgets; a function that will be invoked before the widget gets a dom node constructed, passing the document in which that will happen.
...And 2 more matches
Mozilla Web Services Security Model
please do not depend on anything in it being correct for security.) to prevent the browser from being used as a tool for web sites to obtain priveleges that belong to the browser's user (such as being behind a firewall or getting the benefits of the user's cookies), web browsers restrict what web pages can do when accessing things in other domains.
... however, web services can be designed to be accessed from other domains, or even from any domain.
...they do this by creating a file called web-scripts-access.xml in the root of the server that grants permission for other domains to access web services.
...And 2 more matches
about:memory
don't click "measure..." repeatedly, because that will cause the memory usage of about:memory itself to rise, due to it discarding and regenerating large numbers of dom nodes.
...��──10.57 mb (05.51%) -- window(http://edition.cnn.com/) │ │ │ │ ├───4.55 mb (02.37%) ++ js-compartment(http://edition.cnn.com/) │ │ │ │ ├───2.60 mb (01.36%) ++ layout │ │ │ │ ├───1.94 mb (01.01%) ── style-sheets │ │ │ │ └───1.48 mb (00.77%) -- (2 tiny) │ │ │ │ ├──1.43 mb (00.75%) ++ dom │ │ │ │ └──0.05 mb (00.02%) ── property-tables │ │ │ └───9.61 mb (05.01%) ++ (18 tiny) │ │ └───4.39 mb (02.29%) -- js-zone(0x7f69425b5800) │ ├──15.75 mb (08.21%) ++ top(http://techcrunch.com/, id=20) │ ├──12.85 mb (06.69%) ++ top(http://arstechnica.com/, id=14) │ ├───6.40 mb (03.33%) ++ top(chrome://browse...
... within each window's measurements are sub-trees for javascript ("js-compartment(...)" and "js-zone(...)"), layout, style-sheets, the dom, and other things.
...And 2 more matches
Building NSS
run the standard suite by: host=localhost domsuf=localdomain use_64=1 nss/tests/all.sh unit test configuration nss tests are configured using environment variables.
... the scripts will attempt to infer values for host and domsuf, but can fail.
... replace localhost and localdomain with the hostname and domain suffix for your host.
...And 2 more matches
Utilities for nss samples
generate random numbers.
...rd whereas in the multi- * password variant they could be of the form * * token_1_name:its_password * token_2_name:its_password * */ extern char * filepasswd(pk11slotinfo * slot, prbool retry, void *arg); /* * getmodulepassword */ extern char * getmodulepassword(pk11slotinfo *slot, int retry, void *pwdata); /* * generaterandom */ extern secstatus generaterandom(unsigned char *rbuf, int rsize); /* * filetoitem */ extern secstatus filetoitem(secitem *dst, prfiledesc *src); /* * seedfromnoisefile */ extern secstatus seedfromnoisefile(const char *noisefilename); /* * filesize */ extern long filesize(const char* filename); /* * readderfromfile */ extern secstatus readderfr...
...mpt, checkpassword); case pw_fromfile: pw = filepasswd(slot, retry, pwdata->data); pwdata->source = pw_plaintext; pwdata->data = pl_strdup(pw); return pw; case pw_plaintext: return pl_strdup(pwdata->data); default: break; } pr_fprintf(pr_stderr, "password check failed: no password found.\n"); return null; } /* * generaterandom */ secstatus generaterandom(unsigned char *rbuf, int rsize) { char meter[] = { "\r| |" }; int fd, count; int c; secstatus rv = secsuccess; cc_t orig_cc_min; cc_t orig_cc_time; tcflag_t orig_lflag; struct termios tio; fprintf(stderr, "to gen...
...And 2 more matches
NSS functions
function name/documentation source code nss versions nss_getclientauthdata mxr 3.2 and later nss_setdomesticpolicy mxr 3.2 and later nss_setexportpolicy mxr 3.2 and later nss_setfrancepolicy mxr 3.2 and later nssssl_versioncheck mxr 3.2.1 and later ssl_authcertificate mxr 3.2 and later ssl_authcertificatehook mxr 3.2 and later ssl_badcerthook mxr 3.2 and later ssl_certdbhandleset mxr 3.2 a...
... function name/documentation source code nss versions cert_addcerttolisttail mxr 3.2 and later cert_addextension mxr 3.5 and 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_certlistfromcert mxr 3.2 and later cert_certtimesvalid mxr 3.2 and later ...
...nd later cert_getclassicocspenabledhardfailurepolicy mxr 3.12 and later cert_getclassicocspenabledsoftfailurepolicy mxr 3.12 and later cert_getcommonname mxr 3.2 and later cert_getcountryname mxr 3.2 and later cert_getdbcontentversion mxr 3.2 and later cert_getdefaultcertdb mxr 3.2 and later cert_getdomaincomponentname mxr 3.2 and later cert_getfirstemailaddress mxr 3.7 and later cert_getlocalityname mxr 3.2 and later cert_getnextemailaddress mxr 3.7 and later cert_getnextgeneralname mxr 3.10 and later cert_getnextnameconstraint mxr 3.10 and later cert_getocspresponsestatus mxr 3.6 and later ...
...And 2 more matches
Starting WebLock
in general, the weblock service interface needs to include the following functionality: lock - enable web locking so that any browser in the gecko application is restricted to the white list of website domains.
...for example, addsite is supposed to add the current url to the white list, but is the url an input parameter to the method, is it the topmost web page in the gecko application, or is it something more random-a url picked from global history or that's been given context in some other way?
... the next set of functionality manages the white list where acceptable domains are stored: void addsite(in string url); void removesite(in string url); attribute nsisimpleenumerator sites; operations in this set - add, remove, and enumerate - will be called from a user interface that manages the white list and adds the current website to the white list.
...And 2 more matches
Detailed XPCOM hashtable guide
in their implementation, hashtables take the key and apply a mathematical hash function to randomize the key and then use the hash to find the location in the 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.
...And 2 more matches
Mozilla internal string guide
js and dom prefer utf-16.
... most gecko code uses utf-16 for compatibility with js strings and dom string which are potentially-invalid utf-16.
... however, both dom text nodes and js strings store strings that only contain code points below u+0100 as latin1 (byte value is the unicode scalar value).
...And 2 more matches
Components.utils.importGlobalProperties
system scopes such as jsms and frame scripts don't have certain objects, such as indexeddb and xmlhttprequest, that are available to dom window globals.
...the following strings are supported: string/object xpcom component atob blob btoa crypto css fetch file nsidomfile indexeddb nodefilter firefox 60 nsidomnodefilter obsolete since gecko 60 rtcidentityprovider textdecoder textencoder url urlsearchparams xmlhttprequest nsixmlhttprequest obsolete since gecko 60 for string/object in table without a minimum firefox version, it is not exactly kno...
...knowing that, we can just get a valid blob by importing a known module that has the objects, such as services.jsm const {blob, file, services} = cu.import("resource://gre/modules/services.jsm", {}); reference: stackoverflow :: use blob on firefox add-on hiddendomwindow the hidden domwindow has all of these objects automatically imported.
...And 2 more matches
amIWebInstallListener
1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) method overview boolean onwebinstallblocked(in nsidomwindow awindow, in nsiuri auri, [array, size_is(acount)] in nsivariant ainstalls, [optional] in pruint32 acount); void onwebinstalldisabled(in nsidomwindow awindow, in nsiuri auri, [array, size_is(acount)] in nsivariant ainstalls, [optional] in pruint32 acount); boolean onwebinstallrequested(in nsidomwindow awindow, in nsiuri auri, [array, size_is(acount)] in nsivariant ainstalls...
..., [optional] in pruint32 acount); note: prior to gecko 8.0, all references to nsidomwindow used in this interface were nsidomwindowinternal.
...boolean onwebinstallblocked( in nsidomwindow awindow, in nsiuri auri, [array, size_is(acount)] in nsivariant ainstalls, in pruint32 acount optional ); parameters awindow the window that triggered the installs.
...And 2 more matches
nsIClipboardDragDropHooks
method overview boolean allowdrop(in nsidomevent event, in nsidragsession session); boolean allowstartdrag(in nsidomevent event); boolean oncopyordrag(in nsidomevent aevent, in nsitransferable trans); boolean onpasteordrop(in nsidomevent event, in nsitransferable trans); methods allowdrop() tells gecko whether a drop is allowed on this content area.
... boolean allowdrop( in nsidomevent event, in nsidragsession session ); parameters event the dom event (drag gesture).
...boolean allowstartdrag( in nsidomevent event ); parameters event the dom event (drag gesture).
...And 2 more matches
nsIIOService
g extractscheme(in autf8string urlstring); unsigned long getprotocolflags(in string ascheme); nsiprotocolhandler getprotocolhandler(in string ascheme); nsichannel newchannel(in autf8string aspec, in string aorigincharset, in nsiuri abaseuri); obsolete since gecko 48 nsichannel newchannel2(in autf8string aspec, in string aorigincharset, in nsiuri abaseuri, in nsidomnode aloadingnode, in nsiprincipal aloadingprincipal, in nsiprincipal atriggeringprincipal, in uint32_t asecurityflags, in uint32_t acontentpolicytype); nsichannel newchannelfromuri(in nsiuri auri); obsolete since gecko 48 nsichannel newchannelfromuri2(in nsiuri auri, in nsidomnode aloadingnode, in nsiprincipal aloadingprincipal, in nsiprincipal atriggeringprincipal, in unsigned...
... long asecurityflags, in unsigned long acontentpolicytype); nsichannel newchannelfromuriwithloadinfo(in nsiuri auri, in nsiloadinfo aloadinfo); nsichannel newchannelfromuriwithproxyflags2(in nsiuri auri, in nsiuri aproxyuri, in uint32_t aproxyflags,in nsidomnode aloadingnode, in nsiprincipal aloadingprincipal, in nsiprincipal atriggeringprincipal, in uint32_t asecurityflags, in uint32_t acontentpolicytype); nsiuri newfileuri(in nsifile afile); nsiuri newuri(in autf8string aspec, in string aorigincharset, in nsiuri abaseuri); attributes attribute type description offline boolean returns true if networking is in "offline" mode.
... nsichannel newchannel2( in autf8string aspec, in string aorigincharset, in nsiuri abaseuri, in nsidomnode aloadingnode, in nsiprincipal aloadingprincipal, in nsiprincipal atriggeringprincipal, in uint32_t asecurityflags, in uint32_t acontentpolicytype, ); parameters aspec the spec for the desired uri.
...And 2 more matches
nsIPushService
dom/interfaces/push/nsipushservice.idlscriptable a service for components to subscribe and receive push messages from remote servers.
... implemented by @mozilla.org/push/service;1 as a service: const pushservice = components.classes["@mozilla.org/push/service;1"] .getservice(components.interfaces.nsipushservice); method overview void subscribe(in domstring scope, in nsiprincipal principal, in nsipushsubscriptioncallback callback); void getsubscription(in domstring scope, in nsiprincipal principal, in nsipushsubscriptioncallback callback); void unsubscribe(in domstring scope, in nsiprincipal principal, in nsiunsubscriberesultcallback callback); methods subscribe() creates a push subscription.
... void subscribe( in domstring scope, in nsiprincipal principal, in nsipushsubscriptioncallback callback ); parameters scope the serviceworkerregistration.scope for a service worker subscription, or a unique url (for example, chrome://my-module/push) for a system subscription.
...And 2 more matches
nsIScriptableUnescapeHTML
implemented by: @mozilla.org/feed-unescapehtml;1 as a service: var scriptableunescapehtml = components.classes["@mozilla.org/feed-unescapehtml;1"] .getservice(components.interfaces.nsiscriptableunescapehtml); method overview nsidomdocumentfragment parsefragment(in astring fragment, in prbool isxml, in nsiuri baseuri, in nsidomelement element); astring unescape(in astring src); methods parsefragment() parses a string of html or xml source into a sanitized documentfragment.
... nsidomdocumentfragment parsefragment( in astring fragment, in prbool isxml, in nsiuri baseuri, in nsidomelement element ); parameters fragment a string of html or xml source to parse as a fragment.
... element the nsidomelement to be used as the context node for the purposes of the fragment parsing algorithm.
...And 2 more matches
nsITreeContentView
the nsitreecontentview interface is implemented by tree views that are backed by dom content.
... last changed in gecko 1.8.0 inherits from: nsisupports method overview long getindexofitem(in nsidomelement item); nsidomelement getitematindex(in long index); attributes attribute type description root nsidomelement the element in the dom which this view uses as root content.
...long getindexofitem( in nsidomelement item ); parameters item a tree row for which to find the row index.
...And 2 more matches
nsIWebBrowserPersist
embedding/components/webbrowserpersist/nsiwebbrowserpersist.idlscriptable interface for persisting dom documents and uris to local or remote storage.
...to create an instance, use: var webbrowserpersist = components.classes["@mozilla.org/embedding/browser/nswebbrowserpersist;1"] .createinstance(components.interfaces.nsiwebbrowserpersist); method overview void cancelsave(); void savechannel(in nsichannel achannel, in nsisupports afile); void savedocument(in nsidomdocument adocument, in nsisupports afile, in nsisupports adatapath, in string aoutputcontenttype, in unsigned long aencodingflags, in unsigned long awrapcolumn); void saveuri(in nsiuri auri, in nsisupports acachekey, in nsiuri areferrer, in long areferrerpolicy, in nsiinputstream apostdata, in string aextraheaders, in nsisupports afile, in nsiloadcontext aprivacycontext); void sa...
... persist_flags_fixup_original_dom 128 make changes to original dom rather than cloning nodes.
...And 2 more matches
nsIWebProgress
the nsiwebprogress interface is used to add or remove nsiwebprogresslistener 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.
...And 2 more matches
XPCOM Interface Reference
letextiaccessiblehyperlinkiaccessiblehypertextiaccessibleimageiaccessiblerelationiaccessibletableiaccessibletable2iaccessibletablecelliaccessibletextiaccessiblevalueidispatchijsdebuggeramiinstallcallbackamiinstalltriggeramiwebinstallinfoamiwebinstalllisteneramiwebinstallpromptamiwebinstallerimgicacheimgicontainerimgicontainerobserverimgidecoderimgidecoderobserverimgiencoderimgiloaderimgirequestinidomutilsjsdistackframemoziasyncfaviconsmoziasynchistorymozicoloranalyzermozijssubscriptloadermozipersonaldictionarymoziplaceinfomoziplacesautocompletemoziregistrymozirepresentativecolorcallbackmozispellcheckingenginemozistorageaggregatefunctionmozistorageasyncstatementmozistoragebindingparamsmozistoragebindingparamsarraymozistoragecompletioncallbackmozistorageconnectionmozistorageerrormozistoragefunc...
...ontrollersnsiconverterinputstreamnsiconverteroutputstreamnsicookiensicookie2nsicookieacceptdialognsicookieconsentnsicookiemanagernsicookiemanager2nsicookiepermissionnsicookiepromptservicensicookieservicensicookiestoragensicrashreporternsicryptohmacnsicryptohashnsicurrentcharsetlistenernsicyclecollectorlistenernsidbchangelistenernsidbfolderinfonsidnslistenernsidnsrecordnsidnsrequestnsidnsservicensidomcanvasrenderingcontext2dnsidomchromewindownsidomclientrectnsidomdesktopnotificationnsidomdesktopnotificationcenternsidomelementnsidomeventnsidomeventgroupnsidomeventlistenernsidomeventtargetnsidomfilensidomfileerrornsidomfileexceptionnsidomfilelistnsidomfilereadernsidomfontfacensidomfontfacelistnsidomgeogeolocationnsidomgeopositionnsidomgeopositionaddressnsidomgeopositioncallbacknsidomgeopositionc...
...oordsnsidomgeopositionerrornsidomgeopositionerrorcallbacknsidomgeopositionoptionsnsidomglobalpropertyinitializernsidomhtmlaudioelementnsidomhtmlformelementnsidomhtmlmediaelementnsidomhtmlsourceelementnsidomhtmltimerangesnsidomjswindownsidommousescrolleventnsidommoznetworkstatsnsidommoznetworkstatsdatansidommoznetworkstatsmanagernsidommoztoucheventnsidomnshtmldocumentnsidomnavigatordesktopnotificationnsidomnodensidomofflineresourcelistnsidomorientationeventnsidomparsernsidomprogresseventnsidomserializernsidomsimplegestureeventnsidomstoragensidomstorage2nsidomstorageeventobsoletensidomstorageitemnsidomstoragelistnsidomstoragemanagernsidomstoragewindownsidomuserdatahandlernsidomwindownsidomwindow2nsidomwindowinternalnsidomwindowutilsnsidomxpathevaluatornsidomxpathexceptionnsidomxpathexpressionns...
...And 2 more matches
Aggregate view - Firefox Developer Tools
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".
...for this we'll use the dom allocation example.
... this page simply runs a script that creates a large number of dom nodes (200 htmldivelement objects and 4000 htmlspanelement objects).
...And 2 more matches
Memory - Firefox Developer Tools
the basics opening the memory tool taking a heap snapshot comparing two snapshots deleting snapshots saving and loading snapshots recording call stacks analyzing snapshots the tree map view is new in firefox 48, and the dominators view is new in firefox 46.
... the dominators view shows the "retained size" of objects: that is, the size of objects plus the size of other objects that they keep alive through references.
... if you've opted to record allocation stacks for the snapshot, the aggregate and dominators views can show you exactly where in your code allocations are happening.
...And 2 more matches
AbortController - Web APIs
communicating with a dom request is done using an abortsignal object.
... properties abortcontroller.signal read only returns a abortsignal object instance, which can be used to communicate with/abort a dom request.
... methods abortcontroller.abort() aborts a dom request before it has completed.
...And 2 more matches
AnalyserNode.fftSize - Web APIs
the fftsize property of the analysernode interface is an unsigned long value and represents the window size in samples that is used when performing a fast fourier transform (fft) to get frequency domain data.
...a higher value will result in more details in the frequency domain but fewer details in the time domain.
... note: if its value is not a power of 2, or it is outside the specified range, a domexception with the name indexsizeerror is thrown.
...And 2 more matches
Attr.localName - Web APIs
WebAPIAttrlocalName
in previous dom specifications this api was defined within the node interface.
... syntax name = attribute.localname return value a domstring representing the local part of the attribute's qualified name.
... note: in gecko 1.9.2 and earlier, the property returns the upper-cased version of the local name for html attributes in html doms (as opposed to xhtml attributes in xml doms).
...And 2 more matches
Attr.namespaceURI - Web APIs
WebAPIAttrnamespaceURI
before dom4 this api was defined within the node interface.
... you can create an attribute with the specified namespaceuri using the dom level 2 method element.setattributens.
... the dom does not handle or enforce namespace validation per se.
...And 2 more matches
CSSStyleSheet.insertRule() - Web APIs
syntax stylesheet.insertrule(rule [, index]) parameters rule a domstring containing the rule to be inserted.
...violating them will likely raise a domexception.
... 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, so style information can be kept in * genuine stylesheets and avoid adding extra elements to the dom).
...And 2 more matches
ChildNode.replaceWith() - Web APIs
the childnode.replacewith() method replaces this childnode in the children list of its parent with a set of node or domstring objects.
... domstring objects are inserted as equivalent text nodes.
... syntax [throws, unscopable] void childnode.replacewith((node or domstring)...
...And 2 more matches
Crypto - Web APIs
WebAPICrypto
it allows access to a cryptographically strong random number generator and to cryptographic primitives.
... properties this interface implements properties defined on randomsource.
... methods this interface implements methods defined on randomsource.
...And 2 more matches
Document.createAttribute() - Web APIs
the dom does not enforce what sort of attributes can be added to a particular element in this manner.
... example var node = document.getelementbyid("div1"); var a = document.createattribute("my_attrib"); a.value = "newval"; node.setattributenode(a); console.log(node.getattribute("my_attrib")); // "newval" specifications specification status comment domthe definition of 'document.createattribute()' in that specification.
... living standard precised behavior with uppercase characters document object model (dom) level 3 core specificationthe definition of 'document.createattribute()' in that specification.
...And 2 more matches
Document.importNode() - Web APIs
deep optional a boolean which controls whether to include the entire dom subtree of the externalnode in the import.
... note: in the dom4 specification, deep was an optional argument with a default value of true.
... for more on the node.ownerdocument issues, see the w3c dom faq.
...And 2 more matches
Document.querySelectorAll() - Web APIs
syntax elementlist = parentnode.queryselectorall(selectors); parameters selectors a domstring containing one or more selectors to match against.
...see locating dom elements using selectors for more information about using selectors to identify elements.
...you can use any common looping statement, such as: var highlighteditems = userlist.queryselectorall(".highlighted"); highlighteditems.foreach(function(useritem) { deleteuser(useritem); }); user notes queryselectorall() behaves differently than most common javascript dom libraries, which might lead to unexpected results.
...And 2 more matches
DocumentOrShadowRoot - Web APIs
the documentorshadowroot mixin of the shadow dom api provides apis that are shared between documents and shadow roots.
... methods documentorshadowroot.caretpositionfrompoint() returns a caretposition object containing the dom node containing the caret, and caret's character offset within that node.
... specifications specification status comment shadow domthe definition of 'documentorshadowroot' in that specification.
...And 2 more matches
Element.attachShadow() - Web APIs
the element.attachshadow() method attaches a shadow dom tree to the specified element and returns a reference to its shadowroot.
...there are some that can't have a shadow dom for security reasons (for example <a>), and more besides.
...with a valid name <article> <aside> <blockquote> <body> <div> <footer> <h1> <h2> <h3> <h4> <h5> <h6> <header> <main> <nav> <p> <section> <span> syntax var shadowroot = element.attachshadow(shadowrootinit); parameters shadowrootinit a shadowrootinit dictionary, which can contain the following fields: mode a string specifying the encapsulation mode for the shadow dom tree.
...And 2 more matches
Element.className - Web APIs
WebAPIElementclassName
example let el = document.getelementbyid('item'); if (el.classname === 'active'){ el.classname = 'inactive'; } else { el.classname = 'active'; } notes the name classname is used for this property instead of class because of conflicts with the "class" keyword in many languages which are used to manipulate the dom.
... elm.setattribute('class', elm.getattribute('class')) the class is an html attribute, while the classname is a dom property.
... specifications specification status comment domthe definition of 'element.classname' in that specification.
...And 2 more matches
Element.getAttribute() - Web APIs
examples const div1 = document.getelementbyid('div1'); const align = div1.getattribute('align'); alert(align); // shows the value of align for the element with id="div1" description lower casing when called on an html element in a dom flagged as an html document, getattribute() lower-cases its argument before proceeding.
... non-existing attributes essentially all web browsers (firefox, internet explorer, recent versions of opera, safari, konqueror, and icab, as a non-exhaustive list) return null when the specified attribute does not exist on the specified element; this is what the current dom specification draft specifies.
... the old dom 3 core specification, on the other hand, says that the correct return value in this case is actually the empty string, and some dom implementations implement this behavior.
...And 2 more matches
Element.id - Web APIs
WebAPIElementid
specifications specification status comment domthe definition of 'id' in that specification.
... living standard no change from document object model (dom) level 2 html specification.
... document object model (dom) level 2 html specificationthe definition of 'id' in that specification.
...And 2 more matches
Element.namespaceURI - Web APIs
before dom4 this api was defined within the node interface.
... you can create an element with the specified namespaceuri using the dom level 2 method document.createelementns.
... the dom does not handle or enforce namespace validation per se.
...And 2 more matches
Element.querySelectorAll() - Web APIs
syntax elementlist = parentnode.queryselectorall(selectors); parameters selectors a domstring containing one or more selectors to match against.
...see locating dom elements using selectors for more information about using selectors to identify elements.
... user notes queryselectorall() behaves differently than most common javascript dom libraries, which might lead to unexpected results.
...And 2 more matches
Event.currentTarget - Web APIs
the currenttarget read-only property of the event interface identifies the current target for the event, as the event traverses the dom.
... specifications specification status comment domthe definition of 'event.currenttarget' in that specification.
... living standard dom4the definition of 'event.currenttarget' in that specification.
...And 2 more matches
EventTarget - Web APIs
eventtarget is a dom interface implemented by objects that can receive events and may have listeners for them.
... void seteventhandler(domstring type, eventhandler handler) eventhandler geteventhandler(domstring type) example simple implementation of eventtarget var eventtarget = function() { this.listeners = {}; }; eventtarget.prototype.listeners = null; eventtarget.prototype.addeventlistener = function(type, callback) { if (!(type in this.listeners)) { this.listeners[type] = []; } this.listeners[type].push(ca...
... 1); return; } } }; eventtarget.prototype.dispatchevent = function(event) { if (!(event.type in this.listeners)) { return true; } var stack = this.listeners[event.type].slice(); for (var i = 0, l = stack.length; i < l; i++) { stack[i].call(this, event); } return !event.defaultprevented; }; specifications specification status comment domthe definition of 'eventtarget' in that specification.
...And 2 more matches
FileSystemDirectoryEntry - Web APIs
ull support yesgetdirectory experimentalchrome full support 8edge full support 79firefox full support 50notes full support 50notes notes in firefox, the errorcallback's input parameter is a domexception rather than a fileerror object.ie no support noopera no support nosafari full support 11.1webview android full support ≤37chrome android full support 18firefox and...
...roid full support 50notes full support 50notes notes in firefox, the errorcallback's input parameter is a domexception rather than a fileerror object.opera android no support nosafari ios full support 11.3samsung internet android full support yesgetfile experimentalchrome full support 8edge full support 79firefox full support 50notes full support 50notes notes in firefox, the errorcallback's i...
...nput parameter is a domexception rather than a fileerror object.ie no support noopera no support nosafari full support 11.1webview android full support ≤37chrome android full support 18firefox android full support 50notes full support 50notes notes in firefox, the errorcallback's input parameter is a domexception rather than a fileerror object.opera android no support nosafari ios full support ...
...And 2 more matches
HTMLBaseFontElement - Web APIs
htmlbasefontelement.color is a domstring representing the text color using either a named color or a color specified in the hexadecimal #rrggbb format.
... htmlbasefontelement.face is a domstring representing a list of one or more font names.
... htmlbasefontelement.size is a domstring representing the font size as either a numeric or relative value.
...And 2 more matches
HTMLCollection - Web APIs
note: this interface is called htmlcollection for historical reasons (before the modern dom, collections implementing this interface could only have html elements as their items).
... an htmlcollection in the html dom is live; it is automatically updated when the underlying document is changed.
...this is mostly useful for non-javascript dom implementations.
...And 2 more matches
HTMLDivElement - Web APIs
htmldivelement.align is a domstring representing an enumerated property indicating alignment of the element's contents with respect to the surrounding context.
... recommendation no change from document object model (dom) level 2 html specification.
... document object model (dom) level 2 html specificationthe definition of 'htmldivelement' in that specification.
...And 2 more matches
HTMLFieldSetElement - Web APIs
htmlfieldsetelement.name a domstring reflecting the name html attribute, containing the name of the field set.
... htmlfieldsetelement.typeread only the domstring "fieldset".
... htmlfieldsetelement.validationmessage a domstring representing a localized message that describes the validation constraints that the element does not satisfy (if any).
...And 2 more matches
HTMLFrameSetElement - Web APIs
htmlframesetelement.cols is a domstring structured as a comma-seperated list specifing the width of each column inside a frameset.
... htmlframesetelement.rows is a domstring structured as a comma-seperated list specifing the height of each column inside a frameset.
... document object model (dom) level 2 html specificationthe definition of 'htmlbodyelement' in that specification.
...And 2 more matches
HTMLLegendElement - Web APIs
htmllegendelement.accesskey is a domstring representing a single-character access key to give access to the element.
... htmllegendelement.align is a domstring representing the alignment relative to the form set methods no specific method; inherits methods from its parent, htmlelement.
... document object model (dom) level 2 html specificationthe definition of 'htmllegendelement' in that specification.
...And 2 more matches
HTMLOptGroupElement - Web APIs
htmloptgroupelement.label is a domstring representing the label for the group.
... recommendation no change from document object model (dom) level 2 html specification.
... document object model (dom) level 2 html specificationthe definition of 'htmloptgroupelement' in that specification.
...And 2 more matches
HTMLOptionElement - Web APIs
htmloptionelement.label read only is a domstring that reflects the value of the label html attribute, which provides a label for the option.
... htmloptionelement.text is a domstring that contains the text content of the element.
... htmloptionelement.value is a domstring that reflects the value of the value html attribute, if it exists; otherwise reflects value of the node.textcontent property.
...And 2 more matches
HTMLOrForeignElement.dataset - Web APIs
this access is available both in html and within the dom.
... it is a map of domstrings (domstringmap) with one entry for each custom data attribute.
...note also that an html data-attribute and its corresponding dom dataset.property do not share the same name, but they are always similar: in html, the name of a custom data attribute begins with data-.
...And 2 more matches
HTMLQuoteElement - Web APIs
htmlquoteelement.cite is a domstring reflecting the cite html attribute, containing a url for the source of the quotation.
... recommendation no change from document object model (dom) level 2 html specification.
... document object model (dom) level 2 html specificationthe definition of 'htmlquoteelement' in that specification.
...And 2 more matches
HTMLSlotElement.name - Web APIs
syntax var name = htmlslotelement.name htmlslotelement.name = name value a domstring.
...lchrome full support 53edge full support 79firefox full support 63 full support 63 no support 59 — 63disabled disabled from version 59 until version 63 (exclusive): this feature is behind the dom.webcomponents.shadowdom.enabled preference (needs to be set to true).
...— 59disabled disabled until version 59 (exclusive): this feature is behind the dom.webcomponents.enabled preference (needs to be set to true) and the dom.webcomponents.shadowdom.enabled preference (needs to be set to true).
...And 2 more matches
HTMLStyleElement - Web APIs
to manipulate css, see using dynamic styling information for an overview of the objects used to manipulate specified css properties using the dom.
... htmlstyleelement.media is a domstring representing the intended destination medium for style information.
... htmlstyleelement.type is a domstring representing the type of style being applied by this statement.
...And 2 more matches
HTMLTableCaptionElement - Web APIs
htmltablecaptionelement.align is a domstring which represents an enumerated attribute indicating alignment of the caption with respect to the table.
... recommendation no change from document object model (dom) level 2 html specification, though align was formerly obsoleted.
... document object model (dom) level 2 html specificationthe definition of 'htmltablecaptionelement' in that specification.
...And 2 more matches
HTMLTextAreaElement - Web APIs
the two properties tabindex and accesskey are inherited from htmlelement from html5 on, but were defined on htmltextareaelement in dom level 2 html and earlier specifications.
... setcustomvalidity(domstring) sets a custom validity message for the element.
... the two methods blur() and focus() are inherited from htmlelement from html5 on, but were defined on htmltextareaelement in dom level 2 html and earlier specifications.
...And 2 more matches
HTMLTitleElement - Web APIs
htmltitleelement.text is a domstring representing the text of the document's title.
... recommendation no change from document object model (dom) level 2 html specification.
... document object model (dom) level 2 html specificationthe definition of 'htmltitleelement' in that specification.
...And 2 more matches
HTMLTrackElement - Web APIs
the htmltrackelement interface represents an html <track> element within the dom.
... htmltrackelement.kind is a domstring that reflects the kind html attribute, indicating how the text track is meant to be used.
... htmltrackelement.src is a domstring that reflects the src html attribute, indicating the address of the text track data.
...And 2 more matches
MutationObserver - Web APIs
the mutationobserver interface provides the ability to watch for changes being made to the dom tree.
... it is designed as a replacement for the older mutation events feature, which was part of the dom3 events specification.
... constructor mutationobserver() creates and returns a new mutationobserver which will invoke a specified callback function when dom changes occur.
...And 2 more matches
Navigator - Web APIs
WebAPINavigator
navigatorid.appname read only returns a domstring with the official name of the browser.
... navigatorid.appversion read only returns the version of the browser as a domstring.
... navigatorlanguage.language read only returns a domstring representing the preferred language of the user, usually the language of the browser ui.
...And 2 more matches
Node.insertBefore() - Web APIs
WebAPINodeinsertBefore
specifications specification status comment domthe definition of 'node.insertbefore' in that specification.
... living standard fixes errors in the insertion algorithm dom4the definition of 'node.insertbefore' in that specification.
... obsolete describes the algorithm in more detail document object model (dom) level 3 core specificationthe definition of 'node.insertbefore' in that specification.
...And 2 more matches
Node.previousSibling - Web APIs
see whitespace in the dom and w3c dom 3 faq: why are some text nodes empty?
... 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.
...And 2 more matches
Notation - Web APIs
WebAPINotation
properties notation.publicid read only is a domstring.
... notation.systemid read only is a domstring.
... specifications specification status comment document object model (dom) level 3 core specificationthe definition of 'notation' in that specification.
...And 2 more matches
ParentNode.querySelectorAll() - Web APIs
note: this method is implemented as element.queryselectorall(), document.queryselectorall(), and documentfragment.queryselectorall() syntax elementlist = parentnode.queryselectorall(selectors); parameters selectors a domstring containing one or more selectors to match against.
...see locating dom elements using selectors for more information about using selectors to identify elements.
...selectorall("iframe[data-src]"); here, an attribute selector is used to return a list of the list items contained within a list whose id is userlist which have a data-active attribute whose value is 1: var container = document.queryselector("#userlist"); var matches = container.queryselectorall("li[data-active=1]"); user notes queryselectorall() behaves differently than most common javascript dom libraries, which might lead to unexpected results.
...And 2 more matches
PerformanceEntry.entryType - Web APIs
the entrytype property returns a domstring representing the type of performance metric such as, for example, "mark".
... mark performancemark domstring the name used when the mark was created by calling performance.mark().
... measure performancemeasure domstring name used when the measure was created by calling performance.measure().
...And 2 more matches
RTCIceCandidateStats.address - Web APIs
while it's preferred that the address be specified as an ipv4 or ipv6 numeric address, a fully-qualified domain name can be used as well.
... when a domain name is specified, the first ip address selected for that address is used, even if the domain name maps to multiple ip addresses.
... syntax candidateaddress = rtcicecandidatestats.address; value either an ipv4 or ipv6 address or a fully-qualified domain name, which corresponds to the candidate.
...And 2 more matches
Resource Timing API - Web APIs
these timestamps have a domhighrestimestamp type and as its name implies, they represent a high-resolution point in time.
... the unit of domhighrestimestamp is milliseconds and should be accurate to 5 µs (microseconds).
... the properties which are returned as 0 by default when loading a resource from a domain other than the one of the web page itself: redirectstart, redirectend, domainlookupstart, domainlookupend, connectstart, connectend, secureconnectionstart, requeststart, and responsestart.
...And 2 more matches
SharedWorker() - Web APIs
syntax var myworker = new sharedworker(aurl, name); var myworker = new sharedworker(aurl, options); parameters aurl a domstring representing the url of the script the worker will execute.
... name optional a domstring specifying an identifying name for the sharedworkerglobalscope representing the scope of the worker, which is mainly useful for debugging purposes.
...available properties are as follows: type: a domstring specifying the type of worker to create.
...And 2 more matches
Slottable: assignedSlot - Web APIs
let slottedspan = document.queryselector('my-paragraph span') console.log(slottedspan.assignedslot); // logs '<slot name="my-text">' specifications specification status comment domthe definition of 'assignedslot' in that specification.
...lchrome full support 53edge full support 79firefox full support 63 full support 63 no support 59 — 63disabled disabled from version 59 until version 63 (exclusive): this feature is behind the dom.webcomponents.shadowdom.enabled preference (needs to be set to true).
...— 59disabled disabled until version 59 (exclusive): this feature is behind the dom.webcomponents.enabled preference (needs to be set to true) and the dom.webcomponents.shadowdom.enabled preference (needs to be set to true).
...And 2 more matches
StorageEvent - Web APIs
top"><rect x="116" y="1" width="120" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="176" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">storageevent</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} method overview void initstorageevent( in domstring type, in boolean canbubble, in boolean cancelable, in domstring key, in domstring oldvalue, in domstring newvalue, in usvstring url, in storage storagearea ); attributes attribute type description key domstring represents the key changed.
... newvalue domstring the new value of the key.
... oldvalue domstring the original value of the key.
...And 2 more matches
Using readable streams - Web APIs
finding some examples we will look at various examples in this article, taken from our dom-examples/streams repo.
...as an example, have a look at our simple random stream demo (see it live also), which creates a custom stream, enqueues some random strings into it, and then reads the data out of the stream again once the stop string generation button is pressed.
... the custom stream constructor has a start() method that uses a windowtimers.setinterval() call to generate a random string every second.
...And 2 more matches
StyleSheet - Web APIs
stylesheet.href read only returns a domstring representing the location of the stylesheet.
... stylesheet.title read only returns a domstring representing the advisory title of the current style sheet.
... stylesheet.typeread only returns a domstring representing the style sheet language for this style sheet.
...And 2 more matches
TrackDefault.TrackDefault() - Web APIs
syntax var trackdefault = new trackdefault(type, language, label, kinds, bytestreamtrackid); parameters type a domstring specifying a media segment data type for the sourcebuffer to contain.
... language a domstring specifying a default language for the sourcebuffer to use when an initialization segment does not contain language information for a new track.
... label a domstring specifying a default label for the sourcebuffer to use when an initialization segment does not contain label information for a new track.
...And 2 more matches
Simple color animation - Web APIs
« previousnext » a very basic color animation created using webgl, performed by clearing the drawing buffer with a different random color every second.
...elementbyid("canvas-view"); gl = canvas.getcontext("webgl") ||canvas.getcontext("experimental-webgl"); if (!gl) { clearinterval(timer); alert("failed to get webgl context.\n" + "your browser or device may not support webgl."); return; } gl.viewport(0, 0, gl.drawingbufferwidth, gl.drawingbufferheight); } // get a random color value using a helper function.
... var color = getrandomcolor(); // set the webglrenderingcontext clear color to the // random color.
...And 2 more matches
Advanced techniques: Creating and sequencing audio - Web APIs
the techniques we are using are: name of voice technique associated web audio api feature "sweep" oscillator, periodic wave oscillatornode, periodicwave "pulse" multiple oscillators oscillatornode "noise" random noise buffer, biquad filter audiobuffer, audiobuffersourcenode, 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.
... amp = audioctx.creategain(); amp.gain.setvalueattime(1, audioctx.currenttime); let lfo = audioctx.createoscillator(); lfo.type = 'square'; lfo.frequency.setvalueattime(lfohz, audioctx.currenttime); lfo.connect(amp.gain); osc.connect(amp).connect(audioctx.destination); lfo.start(); osc.start(); osc.stop(audioctx.currenttime + pulsetime); } the "noise" — random noise buffer with biquad filter now we need to make some noise!
...noise is just random numbers when it comes to audio data, so is, therefore, a relatively straightforward thing to create with code.
...And 2 more matches
Web Authentication API - Web APIs
in their most basic forms, both create() and get() receive a very large random number called a challenge from the server and they return the challenge signed by the private key back to the server.
...note that it is absolutely critical that the challenge be a buffer of random information (at least 16 bytes) and it must be generated on the server in order to ensure the security of the registration process.
...note that it is absolutely critical that the challenge be a buffer of random information (at least 16 bytes) and it must be generated on the server in order to ensure the security of the authentication process.
...And 2 more matches
Using the Web Storage API - Web APIs
here is a function that detects whether localstorage is both supported and available: function storageavailable(type) { var storage; try { storage = window[type]; var x = '__storage_test__'; storage.setitem(x, x); storage.removeitem(x); return true; } catch(e) { return e instanceof domexception && ( // everything except firefox e.code === 22 || // firefox e.code === 1014 || // test name field too, because code might not be present // everything except firefox e.name === 'quotaexceedederror' || // firefox e.name === 'ns_error_dom_quota_reached') && // acknowled...
...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.
...And 2 more matches
WheelEvent() - Web APIs
syntax var wheelevent = new wheelevent(typearg, wheeleventinit); properties typearg is a domstring representing the name of the event.
...permitted values are: constant value description dom_delta_pixel 0x00 the delta values are specified in pixels.
... dom_delta_line 0x01 the delta values are specified in lines.
...And 2 more matches
WindowOrWorkerGlobalScope.setTimeout() - Web APIs
|*| |*| https://developer.mozilla.org/docs/dom/window.setinterval |*| |*| syntax: |*| var timeoutid = window.settimeout(func, delay[, arg1, arg2, ...]); |*| var timeoutid = window.settimeout(code, delay); |*| var intervalid = window.setinterval(func, delay[, arg1, arg2, ...]); |*| var intervalid = window.setinterval(code, delay); |*| \*/ (function() { settimeout(function(arg1) { if (arg1 === 'test') { // feature test is pass...
... note: the minimum delay, dom_min_timeout_value, is 4 ms (stored in a preference in firefox: dom.min_timeout_value), with a dom_clamp_timeout_nesting_level of 5.
... firefox implements this behavior since version 5 (see bug 633421, the 1000ms constant can be tweaked through the dom.min_background_timeout_value preference).
...And 2 more matches
XPathEvaluator.evaluate() - Web APIs
syntax xpathresult xpathevaluator.evaluate(expression, contextnode, resolver, type, result); parameters expression a domstring representing the xpath expression to be parsed and evaluated.
... namespace_err if the expression contains namespace prefixes which cannot be resolved by the specified xpathnsresolver, a domexception of type namespace_error is raised.
... wrong_document_err if the provided context node is from a document that is not supported by the xpathevaluator, a domexception of type wrong_document_err is raised.
...And 2 more matches
ARIA: feed role - Accessibility
the feed pattern enables reliable assistive technology reading mode interaction by establishing the following interoperability agreement between the web page and assistive technologies: in the context of a feed, the web page code is responsible for: appropriate visual scrolling of the content based on which article contains dom focus.
... loading or removing feed articles based on which article contains dom focus.
... in the context of a feed, assistive technologies with a reading mode are responsible for: indicating which article contains the reading cursor by ensuring the article element or one of its descendants has dom focus.
...And 2 more matches
Web applications and ARIA FAQ - Accessibility
along with placing them directly in the markup, aria attributes can be added to the element and updated dynamically using javascript code like this: // find the progress bar <div> in the dom.
... no, aria is only made available to assistive technology apis, and doesn't affect native browser functionality with respect to the dom or styling.
...assitive technologies often access a page's dom as well through this api in order to understand the semantics and attributes of the page.
...And 2 more matches
Web Accessibility: Understanding Colors and Luminance - Accessibility
currently, the rgb color space predominates as the space web developers work in.
...because of the current domination of the rgb color space in measuring color output, most calculations in this document are presumed to be in the rgb color space, and very specifically, in the srgb color space.
... this is evolving, and new methods for measuring color involve measurements using other color spaces, but color measurements in the rgb color space still predominates, and this includes video production.
...And 2 more matches
<script>: The Script element - HTML: Hypertext Markup Language
WebHTMLElementscript
implicit aria role no corresponding role permitted aria roles no role permitted dom interface htmlscriptelement attributes this element includes the global attributes.
...to allow error logging for sites which use a separate domain for static media, use this attribute.
... defer this boolean attribute is set to indicate to a browser that the script is meant to be executed after the document has been parsed, but before firing domcontentloaded.
...And 2 more matches
Content Security Policy (CSP) - HTTP
WebHTTPCSP
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 allowlisted domains, ignoring all other script (including inline scripts and event-handling html attributes).
... mitigating packet sniffing attacks in addition to restricting the domains from which content can be loaded, the server can specify which protocols are allowed to be used; for example (and ideally, from a security standpoint), a server can specify that all content must be loaded using https.
...And 2 more matches
Redirections in HTTP - HTTP
there are two others: html redirections with the <meta> element javascript redirections via the dom html redirections http redirects are the best way to create redirections, but sometimes you don't have control over the server.
... domain aliasing ideally, there is one location, and therefore one url, for each resource.
...you might also redirect from common synonyms or frequent typos of your domains.
...And 2 more matches
Memory Management - JavaScript
var d = new date(); // allocates a date object var e = document.createelement('div'); // allocates a dom element some methods allocate new values or objects: var s = 'azerty'; var s2 = s.substr(0, 3); // s2 is a new string // since strings are immutable values, // javascript may decide to not allocate memory, // but just store the [0, 3] range.
... function f() { var x = {}; var y = {}; x.a = y; // x references y y.a = x; // y references x return 'azerty'; } f(); real-life example internet explorer 6 and 7 are known to have reference-counting garbage collectors for dom objects.
... cycles are a common mistake that can generate memory leaks: var div; window.onload = function() { div = document.getelementbyid('mydivelement'); div.circularreference = div; div.lotsofdata = new array(10000).join('*'); }; in the above example, the dom element "mydivelement" has a circular reference to itself in the "circularreference" property.
...And 2 more matches
baseline-shift - SVG: Scalable Vector Graphics
the baseline-shift attribute allows repositioning of the dominant-baseline relative to the dominant-baseline of the parent text content element.
... as a presentation attribute, it can be applied to any element but it has effect only on the following four elements: <altglyph>, <textpath>, <tref>, and <tspan> usage notes value <length-percentage> | sub | super default value 0 animatable yes sub the dominant-baseline is shifted to the default position for subscripts.
... super the dominant-baseline is shifted to the default position for superscripts.
...And 2 more matches
SVG documentation index - SVG: Scalable Vector Graphics
WebSVGIndex
7 example svg, xml in this example, we use xhtml, svg, javascript, and the dom to animate a swarm of "motes".
... 32 baseline-shift needsexample, svg, svg attribute the baseline-shift attribute allows repositioning of the dominant-baseline relative to the dominant-baseline of the parent text content element.
...they let svg markup and its resulting dom share information that standard attributes can't, usually for scripting purposes.
...And 2 more matches
Example - SVG: Scalable Vector Graphics
in this example, we use xhtml, svg, javascript, and the dom to animate a swarm of "motes".
...urn [mouse_x, mouse_y]; } // determine average (x,y) of the swarm function averagemoteposition() { if( !motes ) return [0,0]; if( motes.length == 0 ) return [0,0]; var i; var sum_x=0, sum_y=0; for(i=0; i<motes.length; i++) { sum_x += motes[i].x; sum_y += motes[i].y; } return [sum_x/motes.length, sum_y/motes.length]; } // a nicer, integer random function rand(modulo) { return math.round( math.random() * (modulo-1)); } // class mote function mote() { // dimensions of drawing area.
... var dims = dimensions(); var width = dims[0], height = dims[1]; // choose a random coordinate to start at.
...And 2 more matches
Namespaces crash course - SVG: Scalable Vector Graphics
the dom level 1 recommendation was created before the original namespaces in xml recommendation was released; therefore, dom1 isn't namespace aware.
...to resolve these problems, dom level 2 core added namespace aware equivalents of all the applicable dom level 1 methods.
...the table below lists the dom1 methods that shouldn't be used in svg, along with their equivalent dom2 counterparts that should be used instead.
...And 2 more matches
SVG 1.1 Support in Firefox - SVG: Scalable Vector Graphics
currentscale and currenttranslate dom attributes are implemented, but there is no pan and zoom user interface.
... only stored in the dom, no user interface.
... only stored in the dom, no user interface.
...And 2 more matches
indexed-db - Archive of obsolete content
for example: window.indexeddb = window.indexeddb || window.webkitindexeddb || window.mozindexeddb || window.msindexeddb; var request = window.indexeddb.open("mydatabase"); request.onerror = function(event) { console.log("failure"); }; request.onsuccess = function(event) { console.log("success"); }; because your main add-on code can't access the dom, you can't do this.
... the api exposed by indexed-db is almost identical to the dom indexeddb api, so we haven't repeated its documentation here, but refer you to the indexeddb api documentation for all the details.
... domexception provides more detailed information about an exception.
... see the domexception documentation.
ui/sidebar - Archive of obsolete content
using attach the attach event is triggered whenever the dom for a new sidebar instance is loaded and its scripts are attached.
...you should see console output like: console.log: add-on: add-on script got the message console.log: add-on: sidebar script got the reply using ready the ready event is emitted when the dom for the sidebar's content is ready.
... it is equivalent to the domcontentloaded event.
... ready this event is emitted after the dom content for a sidebar has been loaded, as a result of any of: calling the sidebar's show() method, when the sidebar is not shown in the currently active window changing the sidebar's url property the user switching the sidebar on using the "sidebar" submenu in firefox, when the sidebar is not shown in the currently active window the user opening a new window from a window that has the sideb...
On page load - Archive of obsolete content
ppcontent element (browsers) or messagepane (mail): window.addeventlistener("load", function load(event){ window.removeeventlistener("load", load, false); //remove listener, no longer needed myextension.init(); },false); var myextension = { init: function() { var appcontent = document.getelementbyid("appcontent"); // browser if(appcontent){ appcontent.addeventlistener("domcontentloaded", myextension.onpageload, true); } var messagepane = document.getelementbyid("messagepane"); // mail if(messagepane){ messagepane.addeventlistener("load", function(event) { myextension.onpageload(event); }, true); } }, onpageload: function(aevent) { var doc = aevent.originaltarget; // doc is document that triggered "onload" event // do something wit...
... basic onpageload for a browser window var myextension = { init: function() { // the event can be domcontentloaded, pageshow, pagehide, load or unload.
... if(gbrowser) gbrowser.addeventlistener("domcontentloaded", this.onpageload, false); }, onpageload: function(aevent) { var doc = aevent.originaltarget; // doc is document that triggered the event var win = doc.defaultview; // win is the window for the doc // test desired conditions and do something // if (doc.nodename != "#document") return; // only documents // if (win != win.top) return; //only top window.
... see also domcontentloaded event in listening to events: simple dom events ...
Progress Listeners - Archive of obsolete content
stener.state_start; const state_stop = ci.nsiwebprogresslistener.state_stop; var mylistener = { queryinterface: xpcomutils.generateqi(["nsiwebprogresslistener", "nsisupportsweakreference"]), onstatechange: function(awebprogress, arequest, aflag, astatus) { // if you use mylistener for more than one tab/window, use // awebprogress.domwindow to obtain the tab/window which triggers the state change if (aflag & state_start) { // this fires when the load event is initiated } if (aflag & state_stop) { // this fires when the load finishes } }, onlocationchange: function(aprogress, arequest, auri) { // this fires when the location bar changes; that is load event...
...if you use mylistener for more than one tab/window, // use aprogress.domwindow to obtain the tab/window which triggered the change.
...(auri); }, onstatechange: function() {}, onprogresschange: function() {}, onstatuschange: function() {}, onsecuritychange: function() {} }; window.addeventlistener("load", function() { myextension.init() }, false); window.addeventlistener("unload", function() { myextension.uninit() }, false); note: if you use the same listener for more than one tab/window, use awebprogress.domwindow in the callback methods to obtain the tab/window which triggers the state change or event.
... var domwin = aprogress.domwindow; var domdoc = domwin.document; } } }; you can learn about this here: nsiwebprogresslistener - location change flags ...
Windows - Archive of obsolete content
.getservice(components.interfaces.nsiwindowwatcher) .getwindowenumerator(); var index = 1; var windowname = "yourwindowname"; while (wenum.hasmoreelements()) { var win = wenum.getnext(); if (win.name == windowname) { win.focus(); return; } index++ } window.open("chrome://to/your/window.xul", windowname, "features"); uniquely identifying dom windows requires gecko 2.0(firefox 4 / thunderbird 3.3 / seamonkey 2.1) in gecko, each dom window has a unique 64-bit id number.
... you can get a dom window's id using the nsidomwindowutils attribute outerwindowid.
...this can be used in cases in which you need to uniquely identify a dom window during the duration of the application's lifespan: var util = win.queryinterface(components.interfaces.nsiinterfacerequestor).getinterface(components.interfaces.nsidomwindowutils); var windowid = util.outerwindowid; after running that code, windowid contains the outer window's unique id.
... similarly, you can get the current inner window id using the nsidomwindowutils attribute currentinnerwindowid: var util = win.queryinterface(components.interfaces.nsiinterfacerequestor).getinterface(components.interfaces.nsidomwindowutils); var windowid = util.currentinnerwindowid; programatically modifying html when attempting to modify html elements, it is important to specify the namespace.
The Box Model - Archive of obsolete content
once you grasp this simple idea, you'll be able to use the dom inspector and css to mold xul elements and layouts with great precision and flexibility.
...a box is a generic version that you can orient as you please, but its default is horizontal orientation, so it's pretty much equivalent to an hbox and it is seldom used.
...you can easily parse xml using the domparser object.
... exercise use the dom inspector extension to look into the firefox chrome.
Getting the page URL in NPAPI plugin - Archive of obsolete content
sometimes, you want to restrict an npapi plugin to be loadable only from a certain url or domain or scheme.
...there are at least 3 solutions (quoting newsgroup posts): via window location from robert platt: // get the dom window object.
... via dom from benjamin smedberg: the npapi gives you the ability to get access to the nsidomwindow object which contains the current plugin via the npnvdomelement enum passed to npn_getvalue.
... this returns an addrefed nsidomelement interface pointer from which you can call .ownerdocument (on nsidomnode), queryinterface that object to nsidom3document, and call .documenturi.
Editor Embedding Guide - Archive of obsolete content
in the beginning there is makeeditable given an nsiwebbrowser instance, get an nsidomwindow from the getcontentdomwindow call.
...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.
...nscomptr<nsieditingsession> editingsession; nsiwebbrowser->do_getinterface(getter_addrefs(editingsession)); if (editingsession) editingsession->makewindoweditable(domwindow, "html", pr_true); the valid editor types are: "text" (similar to notepad or a textarea; does not allow for html) "textmail" (similar to "text" but html can be inserted; intended for plaintext mail usage and handling of citations) "html" (this is the default type if no type is specified; it allows for all html tags to be inserted) "htmlmail" (this is much like "html" except there are a few editing rules/behaviors that differ such as splitting of mail quot...
Using microformats - Archive of obsolete content
the dom element at which to begin the search.
...the dom element at which to begin the search.
... ismicroformat() determines whether or not the specified dom node is a microformat.
... var flag = microformats.ismicroformat(node); parameters node the dom node to check to see if it's a microformat.
Menu - Archive of obsolete content
ArchiveMozillaJetpackUIMenu
parameters node the menu is attached to this node, which may be either a raw dom node or a dom node wrapped by jquery.
...parameters node the menu is attached to this node, which may be either a raw dom node or a dom node wrapped by jquery.
...parameters anchornode the menu will pop up on this node, which may be either a raw dom node or a dom node wrapped by jquery.
...they have the following properties: property description node the dom node on which the menu is shown.
Anonymous Content - Archive of obsolete content
this inner content is created anonymously and cannot be seen using the dom.
...note that to dom functions, the content will appear as it was in the xul file, so the menupopup will be a child of the menu.
...results in a display that is equivalent to the following: <binding id="zoombox"> <content> <xul:box flex="1"> <xul:button label="zoom in"/> <xul:box flex="1" style="border: 1px solid black"> <xul:image src="images/happy.jpg"/> <xul:image src="images/angry.jpg"/> </xul:box> <xul:button label="zoom out"/> </xul:box> </content> </binding> from the dom's perspective, the child elements are still in their original location.
...this is an important distinction when using the dom with xbl.
Using the Editor from XUL - Archive of obsolete content
for text widgets and composer): nstexteditorkeylistener (as a nsidomkeylistener) nstexteditormouselistener (as a nsidommouselistener) nstexteditorfocuslistener (as a nsidomfocuslistener) nstexteditortextlistener (as a nsidomtextlistener) nstexteditorcompositionlistener (as a nsidomcompositionlistener) nstexteditordraglistener (as a nsidomdraglistener) in nseditorshell::preparedocumentforediting(), we install a mouse listener.
...not for text widgets): nseditorshellmouselistener (as a nsidommouselistener) note: starting in gecko 12, the editor refuses any events sent by unprivileged content.
... nstexteditortextlistener the nsidomtextlistener interface that this implements is used by the ime code.
... nstexteditorcompositionlistener nstexteditorcompositionlistener implements another ime-related interface, nsidomcompositionlistener.
prefpane - Archive of obsolete content
preferenceelements type: dom nodelist holds a list of the ui elements in the pane that are attached to preferences.
... preferences type: dom nodelist holds a list of the preference elements in the pane.
... methods domelement getpreferenceelement(in domelement startelement) preferenceforelement( uielement ) return type: preference element 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.
calICalendarView - Archive of obsolete content
summary an object implementing calicalendarview is generally intended to serve as a way of manipulating a set of dom nodes corresonding to a visual representation of calievent and calitodo objects.
...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 link allows the calicalendarview to have a way of creating, modifying, and deleting events based on user interaction with the dom nodes it controls, often without requiring any other user interaction.
Archived Mozilla and build documentation - Archive of obsolete content
building transformiix standalone calicalendarview an object implementing calicalendarview is generally intended to serve as a way of manipulating a set of dom nodes corresonding to a visual representation of calievent and calitodo objects.
...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.
...be sure to install the dom inspector extension as well.
...most of these services are available via the dom window object as window.crypto.
Sunbird Theme Tutorial - Archive of obsolete content
creating a unique identifier create an identifier that is likely to be unique, in the form: <tt>something@domain-name</tt> it must contain an at-sign (<tt>@</tt>), making it look something like an e-mail address, but it does not need to be a real e-mail address.
...if you do not own a domain name, you can make up something else.
... if you want to make it clear that your made-up name is not a real domain, add <tt>.invalid</tt> to the end.
...to discover details of the interface, you can also use the dom inspector tool in firefox.
Processing XML with E4X - Archive of obsolete content
use domparser/domserializer or a non-native jxon algorithm instead.
.../browser> <language>javascript</language> <language>python</language> </likes> </person>; alert(person.name); // bob smith alert(person['name']); // bob smith alert(person.likes.browser); // firefox alert(person['likes'].browser); // firefox if you access something with more than one matching element, you get back an xmllist: alert(person.likes.language.length()); // 2 as with the dom, * can be used to access all child nodes: alert(person.likes.*.length()); // 4 while the .
... it is possible to create an xmllist using xml literal syntax without needing to create a well-formed xml document, using the following syntax: var xmllist = <> <lang>javascript</lang> <lang>python</lang> </>; the += operator can be used to append new elements to an xmllist within a document: languages.lang += <lang>ruby</lang>; note that unlike node lists returned by regular dom methods, xmllists are static and are not automatically updated to reflect changes in the dom.
... in a manner akin to dom tree walkers, we can define our own walkers for e4x.
RFE to the XForms API - Archive of obsolete content
ArchiveWebXFormsRFEXForms API
these are xforms dom and xforms interfaces that are exposed by xforms dom.
... xforms dom is a list of interfaces that are available from xforms elements directly.
... this means those interfaces available to be queried from the xforms element that resides in the dom.
... xforms dom put here your requirements how to improve xforms dom api.
Visual typescript game engine - Game development
* - dragging is script for dragging dom elements.
... */ private aspectratio: number = 1.333; /** * domain is simple url address, * recommendent to use for local propose lan ip * like : 192.168.0.xxx if you wanna run ant test app with server.
... */ private domain: string = "maximumroulette.com"; /** * networkdeeplogs control of dev logs for webrtc context only.
... this.networkdeeplogs = false; this.rtcserverport = 12034; this.rtc3serverport = 12034; this.connectorport = 1234; this.domain = "192.168.0.14"; this.masterserverkey = "multi-platformer-sever1.maximum"; this.protocol = "http"; this.issecure = false; this.appuseaccountssystem = true; this.appusevideochat = true; this.databasename = "masterdatabase"; this.databaseroot = "mongodb://localhost:27017"; - the running server is easy : npm run rtc with this cmd: npm run rtc we run server.js and...
Plug-in Development Overview - Gecko Plugin API Reference
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 called during initialization to retrieve the plug-in's name and description, which will appear in the navigator.plugins dom object which is used to populate about:plugins.
... random-access mode: the browser allows the plug-in to request specific ranges of bytes from anywhere in the stream.
... making plug-ins scriptable scriptable plug-ins are plug-ins that have been extended to provide methods that can be called from javascript and the dom when accessed through the object or embed element.
Shadow tree - MDN Web Docs Glossary: Definitions of Web-related terms
a shadow tree is a tree of dom nodes whose topmost node is a shadow root; that is, the topmost node within a shadow dom.
... a shadow tree is a hidden set of standard dom nodes which is attached to a standard dom node that serves as a host.
... the hidden nodes are not directly visible using regular dom functionality, but require the use of a special shadow dom api to access.
... learn more general knowledge using shadow dom technical information element.shadowroot and element.attachshadow() shadowroot <slot> ...
MDN Web Docs Glossary: Definitions of Web-related terms
eprocessor d data structure decryption delta denial of service descriptor (css) deserialization developer tools dhtml digest digital certificate distributed denial of service dmz dns doctype document directive document environment dom (document object model) domain domain name domain sharding dominator dos attack dtls (datagram transport layer security) dtmf (dual-tone multi-frequency signaling) dynamic programming language dynamic typing e ecma ecmascript effective connection type element ...
...ype minification mitm mixin mobile first modem modern web apps modularity mozilla firefox mutable mvc n namespace nan nat native navigation directive netscape navigator network throttling nntp node node (dom) node (networking) node.js non-normative normative null nullish value number o object object reference oop opengl openssl opera browser operand operator origin ota owasp p p2p pac ...
... property property (css) property (javascript) protocol prototype prototype-based programming proxy server pseudo-class pseudo-element pseudocode public-key cryptography python q quality values quaternion quic r rail random number generator raster image rdf real user monitoring (rum) recursion reference reflow regular expression rendering engine repo reporting directive request header resource timing response header responsive web design rest rgb ril robots...
...ht to left) rtp (real-time transport protocol) and srtp (secure rtp) rtsp: real-time streaming protocol ruby s safe same-origin policy scm scope screen reader script-supporting element scroll container scrollport sctp sdp search engine second-level domain secure sockets layer (ssl) selector (css) self-executing anonymous function semantics seo serialization server server timing session hijacking sgml shadow tree shim signature signature (functions) signature (security) simd simple header ...
Debugging CSS - Learn web development
the dom versus view source something that can trip up newcomers to devtools is the difference between what you see when you view the source of a webpage, or look at the html file you put on the server, and what you can see in the html pane of the devtools.
... in the rendered dom the browser may have corrected some badly-written html for you.
... if you incorrectly closed an element, for instance opening an <h2> but closing with an </h3>, the browser will figure out what you were meaning to do and the html in the dom will correctly close the open <h2> with an </h2>.
... the browser will also normalize all of the html, and the dom will also show any changes made by javascript.
Client-side form validation - Learn web development
the constraint validation api most browsers support the constraint validation api, which consists of a set of methods and properties available on the following form element dom interfaces: htmlbuttonelement (represents a <button> element) htmlfieldsetelement (represents a <fieldset> element) htmlinputelement (represents an <input> element) htmloutputelement (represents an <output> element) htmlselectelement (represents a <select> element) htmltextareaelement (represents a <textarea> element) the constraint validation api makes the following properties availabl...
... note: a key point here is that setting the novalidate attribute on the form is what stops the form from showing its own error message bubbles, and allows us to instead display the custom error messages in the dom in some manner of our own choosing.
... // there are many ways to pick a dom node; here we get the form itself and the email // input box, as well as the span element into which we will place the error message.
... // there are fewer ways to pick a dom node with legacy browsers const form = document.getelementsbytagname('form')[0]; const email = document.getelementbyid('mail'); // the following is a trick to reach the next sibling element node in the dom // this is dangerous because you can easily build an infinite loop.
UI pseudo-classes - Learn web development
the chunk of content is not added to the dom, so is invisible to screenreaders; it is part of the document's styles.
... because it is a pseudo element, it can be targetted with styles in the same way that any actual dom node can.
...3px) scale(0); transform-origin: center; transition: all 0.3s ease-in; } input[type="radio"]:checked::before { transform: translate(3px, 3px) scale(1); transition: all 0.3s cubic-bezier(0.25, 0.25, 0.56, 2); } this is really useful — screenreaders already let their users know when a radio button or checkbox they encounter is checked/selected, so you don't want them to read out another dom element that indicates selection — that could be confusing.
... now finally, we've used some javascript to toggle the disabling of the billing address fields: // wait for the page to finish loading document.addeventlistener('domcontentloaded', function () { // attach `change` event listener to checkbox document.getelementbyid('billing-checkbox').addeventlistener('change', togglebilling); }, false); function togglebilling() { // select the billing text fields let billingitems = document.queryselectorall('#billing input[type="text"]'); // select the billing text labels let billinglabels = document.queryselect...
Build your own function - Learn web development
the first line uses a dom api function called document.queryselector() to select the <html> element and store a reference to it in a constant called html, so we can do things to it later on: const html = document.queryselector('html'); the next section uses another dom api function called document.createelement() to create a <div> element and store a reference to it in a constant called panel.
... we then use yet another dom api function called element.setattribute() to set a class attribute on our panel with a value of msgbox.
... finally, we call a dom function called node.appendchild() on the html constant we stored earlier, which nests one element inside the other as a child of it.
...the line inside the function uses the node.removechild() dom api function to specify that we want to remove a specific child element of the html element — in this case the panel <div>.
Introduction to web APIs - Learn web development
the most obvious example is the dom (document object model) api, which allows you to manipulate html and css — creating, removing and changing html, dynamically applying new styles to your page, etc.
... every time you see a popup window appear on a page or some new content displayed, for example, that's the dom in action.
... the document object model (dom) api also has a simple entry point — its features tend to be found hanging off the document object, or an instance of an html element that you want to affect in some way, for example: const em = document.createelement('em'); // create a new em element const para = document.queryselector('p'); // reference an existing p element em.textcontent = 'hello there!'; // give em some text content para.
...next up, we'll look at manipulating documents with the document object model (dom).
What is web performance? - Learn web development
there are a lot of best practices to consider in making apps feel smooth, for example using css animations rather than javascript for animation, and minimizing the number of repaints the ui requires due to changes in the dom.
... to summarize, many features impact performance including latency, application size, the number of dom nodes, the number of resource requests made, javascript performance, cpu load, and more.
...the document object model, or dom, is a tree structure that represents the content and elements of your html as a tree of nodes.
...extensive dom manipulation after the pages has loaded (e.g., adding, deleting, or moving of nodes) can affect performance, so it is worth understanding how to dom works, and how such issues can be mitigated.
Creating JavaScript callbacks in components
remember (or discover) that addeventlistener is a method of the nsidomeventtarget interface and is defined as such: void addeventlistener(in domstring type, in nsidomeventlistener listener, in boolean usecapture); however, it is extremely common to see developers pass a normal javascript function for the listener instead of an nsidomeventlistener implementation: function doload(event) { // do something here } window.ad...
...is nsidomeventlistener magical?
...the nsidomeventlistener interface is "marked" with the function attribute.
...note, that since the javascript function is a single method, this magic only works for callback interfaces with a single method, like nsidomeventlistener.
Eclipse CDT
for example, in content/svg/content/src/nssvgellipseelement.cpp eclipse shows a parse error due to ns_dom_interface_map_entry_classinfo not being defined.
... this define is in nsdomclassinfoid.h, which is included via the following include chain: content/svg/content/src/nssvgellipseelement.cpp content/svg/content/src/nssvgpathgeometryelement.h content/svg/content/src/nssvggraphicelement.h content/svg/content/src/nssvgstylableelement.h content/svg/content/src/nssvgelement.h content/base/src/nsgenericelement.h obj-debug/dist/include/nsdomclassinfoid.h in nsdomclassinfoid.h the ns_dom_interface_map_entry_classinfo define is behind an |ifdef _impl_ns_layout|.
... the properties for nssvgellipseelement.cpp show that this define was picked up by the build option discovery and set on nssvgellipseelement.cpp, but somehow it's not set for nsdomclassinfoid.h.
... however, if you right click on nsdomclassinfoid.h in the project explorer and select "index > create parser log file", the log shows "context" is set to "accessible/src/base/accevent.cpp", not "content/svg/content/src/nssvgellipseelement.cpp", and if you check the properties for accevent.cpp, indeed it is not built with the _impl_ns_layout define.
Security best practices for Firefox front-end engineers
existing security controls sanitizing all strings that enter the dom through apis such as innerhtml when running system-privileged chrome code, we sanitize all html fragments that are created for chrome-privileged documents.
... this policy includes all dom apis that take a string and parse it into a dom tree.
... linter rules against unsanitized dom interaction the security assurance team maintains an eslint rule that disallows unsafe uses of innerhtml and similar dom apis.
... appendix list of disallowed dom apis innerhtml outerhtml insertadjacenthtml() createcontextualfragment() document.write() document.writeln() please take a look at the repository for an updated list ...
mozbrowsericonchange
general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
... details the details property returns an anonymous javascript object with the following properties: href a domstring representing the path to the new icon.
... sizes a domstring listing the sizes the new icon is available in, e.g.
...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.
mozbrowseropenwindow
general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
... 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.
mozbrowsersecuritychange
general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
... details the details property returns an anonymous javascript object with the following properties: state a domstring representing the current state of ssl security.
... trackingstate a domstring representing the current loading state of tracking content.
... mixedstate a domstring representing the current loading state of mixed active content.
Embedding Tips
how do i get the dom document from the web browser object?
... nscomptr<nsidomdocument> doc; nscomptr<nsidomwindow> window; webbrowser->getcontentdomwindow(getter_addrefs(window)); if (window) { window->getdocument(getter_addrefs(doc)); } what is the docshell?
...the nsicontextmenulistener::onshowcontextmenu() method will be called with the dom node that the context applies, the dom event plus some flag combinations that assist in determining what menu to display (document, link, image, selected text etc.) how do i implement tool tips?
... nscomptr<nsicommandmanager> commandmanager = do_getinterface(iwebbrowser); if (commandmanager) { nscomptr<nsidomwindow> thedomwindow = do_getinterface(iwebbrowser); nscomptr<nsicommandparams> cmdparamsobj = do_createinstance(ns_command_params_contractid,&rv); cmdparamsobj->setisupportsvalue("addhook", reinterpret_cast<nsisupports*>(ichromeimplementation)); commandmanager->docommand("cmd_clipboarddragdrophook", cmdparamsobj, thedomwindow); } ...
DMD
t { #01: replace_malloc (/home/njn/moz/mi5/go64dmd/memory/replace/dmd/../../../../memory/replace/dmd/dmd.cpp:1286) #02: malloc (/home/njn/moz/mi5/go64dmd/memory/build/../../../memory/build/replace_malloc.c:153) #03: moz_xmalloc (/home/njn/moz/mi5/memory/mozalloc/mozalloc.cpp:84) #04: nscyclecollectingautorefcnt::incr(void*, nscyclecollectionparticipant*) (/home/njn/moz/mi5/go64dmd/dom/xul/../../dist/include/nsisupportsimpl.h:250) #05: nsxulelement::create(nsxulprototypeelement*, nsidocument*, bool, bool,mozilla::dom::element**) (/home/njn/moz/mi5/dom/xul/nsxulelement.cpp:287) #06: nsxblcontentsink::createelement(char16_t const**, unsigned int, mozilla::dom::nodeinfo*, unsigned int, nsicontent**, bool*, mozilla::dom::fromparser) (/home/njn/moz/mi5/dom/xbl/nsxblcontentsi...
...nk.cpp:874) #07: nscomptr<nsicontent>::startassignment() (/home/njn/moz/mi5/go64dmd/dom/xml/../../dist/include/nscomptr.h:753) #08: nsxmlcontentsink::handlestartelement(char16_t const*, char16_t const**, unsigned int, unsigned int, bool) (/home/njn/moz/mi5/dom/xml/nsxmlcontentsink.cpp:1007) } } it tells you that there were 150 heap blocks that were allocated from the program point 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).
...; 64 x 48,648 1.35% of the heap (48.65% cumulative) 1.64% of once-reported (59.18% cumulative) allocated at { #01: (no stack trace recorded due to --stacks=partial) } reported at { #01: mozilla::dmd::dmdfuncs::report(void const*) (/home/njn/moz/mi5/go64dmd/memory/replace/dmd/../../../../memory/replace/dmd/dmd.cpp:1646) #02: windowsmallocsizeof(void const*) (/home/njn/moz/mi5/dom/base/nswindowmemoryreporter.cpp:189) #03: nsattrandchildarray::sizeofexcludingthis(unsigned long (*)(void const*)) const (/home/njn/moz/mi5/dom/base/nsattrandchildarray.cpp:880) #04: mozilla::dom::fragmentorelement::sizeofexcludingthis(unsigned long (*)(void const*)) const (/home/njn/moz/mi5/dom/base/fragmentorelement.cpp:2337) #05: nsinode::sizeofincludingthis(unsigned long (*)(void ...
...const*)) const (/home/njn/moz/mi5/go64dmd/parser/html/../../../dom/base/nsinode.h:307) #06: mozilla::dom::nodeinfo::nodetype() const (/home/njn/moz/mi5/go64dmd/dom/base/../../dist/include/mozilla/dom/nodeinfo.h:127) #07: nshtmldocument::docaddsizeofexcludingthis(nswindowsizes*) const (/home/njn/moz/mi5/dom/html/nshtmldocument.cpp:3710) #08: nsidocument::docaddsizeofincludingthis(nswindowsizes*) const (/home/njn/moz/mi5/dom/base/nsdocument.cpp:12820) } } the choice of whether to record an allocation stack trace for all blocks is controlled by an option (see below).
NSS Key Log Format
secrets follow the format <label> <space> <clientrandom> <space> <secret> where: <label> describes the following secret.
... <clientrandom> is 32 bytes random value from the client hello message, encoded as 64 hexadecimal characters.
... the following labels are defined, followed by a description of the secret: rsa: 48 bytes for the premaster secret, encoded as 96 hexadecimal characters (removed in nss 3.34) client_random: 48 bytes for the master secret, encoded as 96 hexadecimal characters (for ssl 3.0, tls 1.0, 1.1 and 1.2) client_early_traffic_secret: the hex-encoded early traffic secret for the client side (for tls 1.3) client_handshake_traffic_secret: the hex-encoded handshake traffic secret for the client side (for tls 1.3) server_handshake_traffic_secret: the hex-encoded handshake traffic secret for the server side (for tls 1.3) client_traffic_secret_0: the first hex-encoded application traffic secret for the client side (for tls 1.3) server_traffic_secret_0: the ...
...it has been superseded by client_random which also works with other key-agreement algorithms (such as those based on diffie-hellman) and is supported since wireshark 1.8.0.
NSS 3.37 release notes
starting with nss version 3.31, an alternative implementation for rng seeding on the linux/unix platform was available (bug 1346735), which performed seeding exclusively based on /dev/urandom.
... this alternative implementation is selected at build time by defining the seed_only_dev_urandom symbol.
... (the classic implementation for rng seeding on the linux/unix platform, which may use additional sources for the default seeding, is still available and will be used if seed_only_dev_urandom is undefined.) 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.
NSS Tools sslstrength
synopsis 1) sslstrength ciphers 2) sslstrength hostname[:port] [ciphers=xyz] [debug] [verbose] [policy=export|domestic] description the first form simple lists out the possible ciphers.
...firstly, you can set policy to be either domestic or export.
... policy=export or policy=domestic will set your policies appropriately.
... policy will default to domestic if not specified.
PKCS11 FAQ
MozillaProjectsNSSPKCS11FAQ
will nss use the random number generation features of pkcs #11?
... only if you 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.
NSS tools : modutil
modutil supports several mechanisms: rsa, dsa, rc2, rc4, rc5, aes, des, dh, sha1, sha256, sha512, ssl, tls, md5, md2, random (for random number generation), and friendly (meaning certificates are publicly readable).
...for the most basic case, simply upload the library: modutil -add modulename -libfile library-file [-ciphers cipher-enable-list] [-mechanisms mechanism-list] for example: modutil -dbdir sql:/home/my/sharednssdb -add "example pkcs #11 module" -libfile "/tmp/crypto.so" -mechanisms rsa:dsa:rc2:random using database directory ...
...certprefix= keyprefix= secmod=secmod.db flags=readonly " nss="trustorder=75 cipherorder=100 slotparams={0x00000001=[slotflags=rsa,rc4,rc2,des,dh,sha1,md5,md2,ssl,tls,aes,random askpw=any timeout=30 ] } flags=internal,critical" setting a default provider for security mechanisms multiple security modules may provide support for the same security mechanisms.
... rsa: 0x00000001 dsa: 0x00000002 rc2: 0x00000004 rc4: 0x00000008 des: 0x00000010 dh: 0x00000020 fortezza: 0x00000040 rc5: 0x00000080 sha1: 0x00000100 md5: 0x00000200 md2: 0x00000400 random: 0x08000000 friendly: 0x10000000 own_pw_defaults: 0x20000000 disable: 0x40000000 cipherenableflags specifies ciphers that this module provides that nss does not provide (so that the module enables those ciphers for nss).
NSS Tools sslstrength
synopsis 1) sslstrength ciphers 2) sslstrength hostname[:port] [ciphers=xyz] [debug] [verbose] [policy=export|domestic] description the first form simple lists out the possible ciphers.
...firstly, you can set policy to be either domestic or export.
... policy=export or policy=domestic will set your policies appropriately.
... policy will default to domestic if not specified.
NSS tools : modutil
MozillaProjectsNSStoolsmodutil
modutil supports several mechanisms: rsa, dsa, rc2, rc4, rc5, aes, des, dh, sha1, sha256, sha512, ssl, tls, md5, md2, random (for random number generation), and friendly (meaning certificates are publicly readable).
...for the most basic case, simply upload the library: modutil -add modulename -libfile library-file [-ciphers cipher-enable-list] [-mechanisms mechanism-list] for example: modutil -dbdir sql:/home/my/sharednssdb -add "example pkcs #11 module" -libfile "/tmp/crypto.so" -mechanisms rsa:dsa:rc2:random using database directory ...
...certprefix= keyprefix= secmod=secmod.db flags=readonly " nss="trustorder=75 cipherorder=100 slotparams={0x00000001=[slotflags=rsa,rc4,rc2,des,dh,sha1,md5,md2,ssl,tls,aes,random askpw=any timeout=30 ] } flags=internal,critical" setting a default provider for security mechanisms multiple security modules may provide support for the same security mechanisms.
... rsa: 0x00000001 dsa: 0x00000002 rc2: 0x00000004 rc4: 0x00000008 des: 0x00000010 dh: 0x00000020 fortezza: 0x00000040 rc5: 0x00000080 sha1: 0x00000100 md5: 0x00000200 md2: 0x00000400 random: 0x08000000 friendly: 0x10000000 own_pw_defaults: 0x20000000 disable: 0x40000000 cipherenableflags specifies ciphers that this module provides that nss does not provide (so that the module enables those ciphers for nss).
Shell global objects
for error messages and debug info global global in which to execute the code newcontext if true, create and use a new cx (default: false) catchtermination if true, catch termination (failure without an exception value, as for slow scripts or out-of-memory) and return 'terminated' element if present with value v, convert v to an object o and mark the source as being attached to the dom element o.
... if the property is omitted or v is null, don't attribute the source to any dom element.
...ould be compiled: noscriptrval use the no-script-rval compiler option (default: false) filename filename for error messages and debug info linenumber starting line number for error messages and debug info columnnumber starting column number for error messages and debug info element if present with value v, convert v to an object o and mark the source as being attached to the dom element o.
... if the property is omitted or v is null, don't attribute the source to any dom element.
A Web PKI x509 certificate primer
if your certificates will only be used to verify one domain (e.g.
... generate your ca root update *.example.com and *.example.net below to match your domains.
... assumptions: you are the domain owner of *.example.com and *.example.net.
...verauth authorityinfoaccess = ocsp;uri:http://ocsp.example.com:8888/ sign the intermediate csr with the root key and the intermediate extensions "openssl x509 -req -sha256 -days 2922 -in int.csr -cakey rootkey.pem -ca root.pem -set_serial $some_large_integer -out int.pem -extfile openssl.int.cnf" generate the end entity certificate update www.example.com below to match your domain.
AT APIs Support
gecko can render a variety of content, not just html and supports key web standards such as cascading style sheets, javascript and the w3c dom.
...also we expose ms com interfaces isimpledom* to provide an access to dom tree.
... iaccessible2 is a set of interfaces that overlay the msaa (iaccessible) and dom (isimpledom*) interface support.
... 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 explorer for the gnome desktop gecko dom inspector has an ability to test gecko accessibility layer, supports base features.
Places utilities for JavaScript
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 setannotationsforuri(int aitemid, object aannos); getviewfornode(nsidomnode anode); void markpageastyped(string aurl); void markpageasfollowedbookmark(string aurl); boolean checkurlsecurity(nsinavhistoryresultnode aurinode); string getquerystringforfolder(int afolderid); string getdescriptionfromdocument(nsidomdocument doc); string setpostdataforbookmark(int aboomarkid, string apostdata); string getpostda...
...dpostdataforkeyword(string akeyword); string getitemdescription(int aitemid); nsinavhistoryresultnode getmostrecentbookmarkforuri(nsiuri auri); nsinavhistoryresultnode getmostrecentfolderforfeeduri(nsiuri auri); nsinavhistoryresultnode geturlsforcontainernode(nsinavhistoryresultnode anode); void opencontainernodeintabs(nsinavhistoryresultnode anode, nsidomevent aevent); void openurinodesintabs(array nsinavhistoryresultnode anodes, nsidomevent aevent); void createmenuitemfornode(nsinavhistoryresultnode anode, acontainersmap); constants mimetypes type_x_moz_place_container type_x_moz_place_separator: "text/x-moz-place-separator", type_x_moz_place: "text/x-moz-place", type_x_moz_url: "text/x-moz-url", type_html: "text/...
... getviewfornode() returns the closet ancestor places view for the given dom node getviewfornode(anode) parameters anode a dom node return type return the closet ancestor places view if exists, null otherwsie.
... getdescriptionfromdocument(doc) parameters doc a dom document to get a description for return type returns a description string if a meta element was discovered with a "description" or "httpequiv" attribute, empty string otherwise.
Querying Places
bute boolean hasbegintime readonly attribute prtime absolutebegintime attribute prtime endtime attribute unsigned long endtimereference readonly attribute boolean hasendtime readonly attribute prtime absoluteendtime attribute astring searchterms readonly attribute boolean hassearchterms attribute long minvisits attribute long maxvisits attribute boolean onlybookmarked attribute boolean domainishost attribute autf8string domain readonly attribute boolean hasdomain attribute boolean uriisprefix attribute nsiuri uri readonly attribute boolean hasuri attribute boolean annotationisnot attribute autf8string annotation readonly attribute boolean hasannotation readonly attribute unsigned long foldercount basic query configuration options const unsigned short group_by_day = 0 ...
... const unsigned short group_by_host = 1 const unsigned short group_by_domain = 2 const unsigned short group_by_folder = 3 const unsigned short sort_by_none = 0 const unsigned short sort_by_title_ascending = 1 const unsigned short sort_by_title_descending = 2 const unsigned short sort_by_date_ascending = 3 const unsigned short sort_by_date_descending = 4 const unsigned short sort_by_uri_ascending = 5 const unsigned short sort_by_uri_descending = 6 const unsigned short sort_by_visitcount_ascending = 7 const unsigned short sort_by_visitcount_descending = 8 const unsigned short sort_by_keyword_ascending = 9 const unsigned short sort_by_keyword_descending = 10 const unsigned short sort_by_dateadded_ascending = 11 const unsigned short sort_by_dateadded_descending = 12 const unsigned...
...story.getnewquery(); query1.searchterms = "firefox"; // second query object searches for visited in past 24 hours and from mozilla.org var query2 = placesutils.history.getnewquery(); query2.begintimereference = query2.time_relative_now; query2.begintime = -24 * 60 * 60 * 1000000; // 24 hours ago in microseconds query2.endtimereference = query2.time_relative_now; query2.endtime = 0; // now query2.domain = "mozilla.org"; var result = placesutils.history.executequeries([query1, query2], 2, options); note: keyword searching doesn't work correctly across or queries.
...domain name matching, text terms matching, time range...) // see : https://developer.mozilla.org/en/nsinavhistoryquery var query = placesutils.history.getnewquery(); // options parameters (e.g.
XML Extras
feature status feature status xmlserializer available xmlhttprequest available domparser (string and stream input source) available web services with soap and wsdl no longer available from gecko 1.9/firefox 3.
...the "workaround" is to use domparser object's parsefromstring() method to create a document from string, and pass the temporary document into send().
... 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.
... nsidomserializer (currently, the javascript constructor is xmlserializer()) nsidomparser (currently, the javascript constructor is domparser()) nsixmlhttprequest please see the xml linking and pointing section in xml in mozilla document for fixptr and xpointer documentation.
XPCOM hashtable guide
in their implementation, hashtables take the key and apply a mathematical hash function to randomize the key and then use the hash to find the location in the 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.
... a few examples: a hashtable that maps utf-8 origin names to a dom window - nsinterfacehashtable<nscstringhashkey, nsidomwindow> a hashtable that maps 32 bit integers to floats - nsdatahashtable<nsuint32hashkey, float> a hashtable that maps nsisupports pointers to reference counted cacheentrys - nsrefptrhashtable<nsisupportshashkey, cacheentry> a hashtable that maps jscontext pointers to a contextinfo struct - nsclasshashtable<nsptrhashkey<jscontext>, context...
nsIAccessibilityService
last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) inherits from: nsiaccessibleretrieval method overview nsiaccessible createouterdocaccessible(in nsidomnode anode); nsiaccessible createrootaccessible(in nsipresshell ashell, in nsidocument adocument); nsiaccessible createhtml4buttonaccessible(in nsisupports aframe); nsiaccessible createhypertextaccessible(in nsisupports aframe); nsiaccessible createhtmlbraccessible(in nsisupports aframe); nsiaccessible createhtmlbuttonaccessible(in nsisupports aframe); nsiaccessible createhtmlaccessiblebymarkup(in nsiframe aframe, in nsiweakreference aweakshell, in nsidomnode adomnode); nsiaccessible ...
...createhtmlliaccessible(in nsisupports aframe, in nsisupports abulletframe, in astring abullettext); nsiaccessible createhtmlcheckboxaccessible(in nsisupports aframe); nsiaccessible createhtmlcomboboxaccessible(in nsidomnode anode, in nsiweakreference apresshell); nsiaccessible createhtmlgenericaccessible(in nsisupports aframe); nsiaccessible createhtmlgenericaccessible(in nsisupports aframe); nsiaccessible createhtmlhraccessible(in nsisupports aframe); nsiaccessible createhtmlimageaccessible(in nsisupports aframe); nsiaccessible createhtmllabelaccessible(in nsisupports aframe); nsiaccessible createhtmllabelaccessible(in nsidomnode anode, in nsiweakreference apresshell); nsiaccessible createhtmlobjectframeaccessible(in nsobjectframe aframe); nsiaccessible createht...
...mlradiobuttonaccessible(in nsisupports aframe); nsiaccessible createhtmlselectoptionaccessible(in nsidomnode anode, in nsiaccessible aaccparent, in nsiweakreference apresshell); nsiaccessible createhtmltableaccessible(in nsisupports aframe); nsiaccessible createhtmltablecellaccessible(in nsisupports aframe); nsiaccessible createhtmltableheadaccessible(in nsidomnode adomnode); nsiaccessible createhtmltextaccessible(in nsisupports aframe); nsiaccessible createhtmltextfieldaccessible(in nsisupports aframe); nsiaccessible createhtmlcaptionaccessible(in nsisupports aframe); nsiaccessible getaccessible(in nsidomnode anode, in nsipresshell apresshell, in nsiweakreference aweakshell, inout nsiframe framehint, out boolean aishidden); nsiaccessible addnativerootaccessible(in ...
... <tt>achangedcontent</tt> the affected dom content.
nsIContentFrameMessageManager
idl file: mozilla-central/source/dom/base/nsimessagemanager.idl inherits from: nsisyncmessagesender this interface provides the environment for scripts that are loaded into content frames using the nsiframescriptloader interface.
... methods void dump(in domstring astr); domstring atob(in domstring aasciistring); domstring btoa(in domstring abase64data); dump() prints the specified string to standard output.
... attributes content nsidomwindow: the current top level window in the frame or null.
... examples once you obtain the conten frame messge manager, you can send messages to listeners who registered with services.mm.addmessagelistener get content message manager from browser this could would run in a nsidomwindow scope.
nsIDragDropHandler
use this to register where the listeners should attach (something that implements nspidomeventtarget which is what we end up using under the hood).
... last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) inherits from: nsisupports method overview void detach(); void hookupto(in nsidomeventtarget attachpoint, in nsiwebnavigation navigator); methods detach() unregisters all handlers related to drag and drop.
...void hookupto( in nsidomeventtarget attachpoint, in nsiwebnavigation navigator ); parameters attachpoint the receiver to which to attach drag handlers.
...if this is null, the client must handle the drop itself, either through the method provided via overridedrop() or by letting the event bubble up through the dom.
nsIDroppedLinkItem
dom/base/nsidroppedlinkhandler.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) attributes attribute type description url domstring url of the dropped link.
... name domstring name of the dropped link.
... type domstring mime-type of the dropped link.
nsIFeedTextConstruct
method overview nsidomdocumentfragment createdocumentfragment(in nsidomelement element); astring plaintext(); attributes attribute type description base nsiuri if the text construct contains html or xhtml, relative references in the content should be resolved against this base uri.
... methods createdocumentfragment() creates a new document fragment on a given dom element, containing the text and (if the text construct contains html or xhtml) its markup.
... nsidomdocumentfragment createdocumentfragment( in nsidomelement element ); parameters element the element in which to create the new document fragment.
... see also nsidomelement nsidocumentfragment interwiki link ...
nsIMessenger
method overview void setdisplaycharset(in acstring acharset); void setwindow(in nsidomwindow ptr, in nsimsgwindow msgwindow); void openurl(in acstring aurl); void loadurl(in nsidomwindow ptr, in acstring aurl); void launchexternalurl(in acstring aurl); boolean canundo(); boolean canredo(); unsigned long getundotransactiontype(); unsigned long getredotransactiontype(); void undo(in nsimsgwindow msgwindow); ...
...e messageservicefromuri(in acstring auri); nsimsgdbhdr msghdrfromuri(in acstring auri); acstring getmsguriatnavigatepos(in long apos); acstring getfolderuriatnavigatepos(in long apos); void getnavigatehistory(out unsigned long acurpos, out unsigned long acount, [array, size_is(acount)] out string ahistory); note: prior to gecko 8.0, all references to nsidomwindow used in this interface were nsidomwindow.
... void setwindow(in nsidomwindow awin, in nsimsgwindow amsgwindow); parameters awin the window to set as the window for the messaging session.
... void loadurl(in nsidomwindow awin, in acstring aurl); parameters awin a window.
Component; nsIPrefBranch
method overview void addobserver(in string adomain, in nsiobserver aobserver, in boolean aholdweak); void clearuserpref(in string aprefname); 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 utf8trin...
...idref 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 lockpref(in string aprefname); boolean prefhasuservalue(in string aprefname); boolean prefislocked(in string aprefname); void removeobserver(in string adomain, in nsiobserver aobserver); void resetbranch(in string astartingat); void setboolpref(in string aprefname, in long avalue); void setcharpref(in string aprefname, in string avalue); requires gecko 58 void setstringpref(in string aprefname, in utf8string avalue); void setcomplexvalue(in string aprefname, in nsiidref atype, in nsisupports avalue); ...
... void addobserver( in string adomain, in nsiobserver aobserver, in boolean aholdweak ); parameters adomain the preference on which to listen for changes.
... void removeobserver( in string adomain, in nsiobserver aobserver ); parameters adomain the preference which is being observed for changes.
nsISelection2
method overview void getrangesforinterval(in nsidomnode beginnode, in print32 beginoffset, in nsidomnode endnode, in print32 endoffset, in prbool allowadjacent, out pruint32 resultcount, [retval, array, size_is(resultcount)] out nsidomrange results); void getrangesforintervalcomarray(in nsidomnode beginnode, in print32 beginoffset, in nsidomnode endnode, in print32 endoffset, in prbool allowadjacent, in rangearray results); native code on...
... methods getrangesforinterval() return array of ranges intersecting with the given dom interval.
... void getrangesforinterval( in nsidomnode beginnode, in print32 beginoffset, in nsidomnode endnode, in print32 endoffset, in prbool allowadjacent, out pruint32 resultcount, [retval, array, size_is(resultcount)] out nsidomrange results ); parameters beginnode beginoffset endnode endoffset these four parameters represent the range to compare against the selection.
... native code only!getrangesforintervalcomarray void getrangesforintervalcomarray( in nsidomnode beginnode, in print32 beginoffset, in nsidomnode endnode, in print32 endoffset, in prbool allowadjacent, in rangearray results ); parameters beginnode beginoffset endnode endoffset these four parameters represent the range to compare against the selection.
nsISelectionController
void charactermove(in boolean forward, in boolean extend); boolean checkvisibility(in nsidomnode node, in short startoffset, in short endoffset); void completemove(in boolean forward, in boolean extend); void completescroll(in boolean forward); boolean getcaretenabled(); short getdisplayselection(); nsiselection getselection(in short type); void intralinemove(in boolean forward, in boolean ext...
...boolean checkvisibility( in nsidomnode node, in short startoffset, in short endoffset ); parameters node nsidomnode to test.
... startoffset offset in dom to first char of textnode to test.
... endoffset offset in dom to last char of textnode to test.
nsITreeView
inherits from: nsisupports last changed in gecko 22 (firefox 22 / thunderbird 22 / seamonkey 2.19) implementing a nsitreeview in lieu of dom methods for tree creation can improve performance dramatically, and removes the need to make changes to the tree manually when changes to the database occur.
... method overview boolean candrop(in long index, in long orientation, in nsidomdatatransfer datatransfer); boolean candropbeforeafter(in long index, in boolean before); obsolete since gecko 1.8 boolean candropon(in long index); obsolete since gecko 1.8 void cyclecell(in long row, in nsitreecolumn col); void cycleheader(in nsitreecolumn col); void drop(in long row, in long orientation, in nsidomdatatransfer datatransfer); astring getcellproperties(in long row, in nsitreecolumn col, in nsisupportsarray properties obsolete since gecko 22); astring getcelltext(in long row, in nsitreecolumn col); astring getcellvalue(in long row, in nsitreec...
... boolean candrop( in long index, in long orientation, in nsidomdatatransfer datatransfer ); parameters index the index of the row.
... void drop( in long row, in long orientation, in nsidomdatatransfer datatransfer ); parameters row the index of the row.
nsIURI
inherits from: nsisupports last changed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) see the following rfcs for details: rfc3490: internationalizing domain names in applications (idna) rfc3986: uniform resource identifier (uri): generic syntax rfc3987: internationalized resource identifiers subclasses of nsiuri, such as nsiurl, impose further structure on the uri.
...follows the idna draft specification for converting internationalized domain names (utf-8) to ascii for compatibility with existing internet infrastructure.
... host autf8string the host is the internet domain name to which this uri refers.
...if supported, it could be a non-ascii internationalized domain name.
nsIUpdate
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 nsiupdatepatch getpatchat(in unsigned long index); nsidomelement serialize(in nsidomdocument updates); attributes attribute type description appversion astring the application version of this update.
...serialize() serializes the update object into a dom element.
... nsidomelement serialize( in nsidomdocument updates ); parameters updates the dom document into which to serialize the update.
... return value the patch object serialized into an nsidomelement.
nsIUpdatePatch
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 nsidomelement serialize(in nsidomdocument updates); attributes attribute type description finalurl astring the final url this patch was being downloaded from.
... methods serialize() serializes the patch object into a dom element.
... nsidomelement serialize( in nsidomdocument updates ); parameters updates the dom document into which to serialize the patch.
... return value the patch object serialized into an nsidomelement.
nsIUserInfo
attributes attribute type description linux mac osx os/2 windows domain string read only.
... the computer's domain, or the domain of its hostname.
... the domain portion of the email address, if available.
... the concatenation of the user's login name and the computer's domain.
nsIWebBrowser
the interface may also be used at runtime to obtain the content dom window and from that the rest of the dom.
... contentdomwindow nsidomwindow the top-level dom window.
... the embedder may walk the entire dom starting from this value.
... see also nsibasewindow nsicontextmenulistener nsidomwindow nsiembeddingsitewindow nsiinterfacerequestor nsishistorylistener nsitooltiplistener nsiuricontentlistener nsiweakreference nsiwebbrowserchrome nsiwebbrowserchromefocus nsiwebprogresslistener ...
nsIWorker
dom/interfaces/threads/nsidomworkers.idlscriptable this interface represents a dom worker thread.
... 1.0 66 introduced gecko 1.9.1 inherits from: nsiabstractworker last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) for usage details, see worker and the article using dom workers.
... method overview void postmessage(in domstring amessage, [optional] in nsiworkermessageport amessageport); attributes attribute type description onmessage nsidomeventlistener an object to receive notifications when messages are received on the worker's message port.
...void postmessage( in domstring amessage, in nsiworkermessageport amessageport optional ); parameters amessage the message the worker wishes to post back to its creator.
nsIWorkerMessageEvent
dom/interfaces/threads/nsidomworkers.idlscriptable this interface represents an event in a web worker thread's event queue.
... 1.0 66 introduced gecko 1.9.1 inherits from: nsidomevent last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) method overview void initmessageevent(in domstring atypearg, in boolean acanbubblearg, in boolean acancelablearg, in domstring adataarg, in domstring aoriginarg, in nsisupports asourcearg); attributes attribute type description data domstring the event's data.
... origin domstring the event's origin.
... void initmessageevent( in domstring atypearg, in boolean acanbubblearg, in boolean acancelablearg, in domstring adataarg, in domstring aoriginarg, in nsisupports asourcearg ); parameters atypearg the event type.
nsIWorkerScope
dom/interfaces/threads/nsidomworkers.idlscriptable this interface represents the global scope in which a worker's script runs.
... 1.0 66 introduced gecko 1.9.1 inherits from: nsiworkerglobalscope last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) method overview void postmessage(in domstring amessage, [optional] in nsiworkermessageport amessageport); void close(); attributes attribute type description onclose nsidomeventlistener a listener object to be called when the worker stops running.
... onmessage nsidomeventlistener a listener object to be called when a message is posted on the port.
...void postmessage( in domstring amessage, in nsiworkermessageport amessageport optional ); parameters amessage the message to post.
nsIXFormsModelElement
1.0 66 introduced gecko 1.8 obsolete gecko 1.9.1 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview nsidomdocument getinstancedocument(in domstring instanceid); void rebuild(); void recalculate(); void refresh(); void revalidate(); methods getinstancedocument() nsidomdocument getinstancedocument( in domstring instanceid ); parameters instanceid the id of the instance element to be returned.
... return value an nsidomdocument.
... exceptions thrown domexception if there is no matching instance data.
...though the script is assumed to have modified instance data prior to invoking recalculate, the dom mutations are not cached.
nsIXMLHttpRequest
nsixmlhttprequest along with nsijsxmlhttprequest and nsixmlhttprequesteventtarget are mozilla's implementation details of the dom xmlhttprequest object.
... the interface definition: //github.com/realityripple/uxp/blob/master/dom/xhr/nsixmlhttprequest.idl elevated privileges as mentioned in the "non-standard properties" the property of channel was read-only.
...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->addeventlistener(ns_literal_string("load"), mylistener, pr_false) where mylistener is your event listener object that implements the interface nsidomeventlistener.
nsIXULBrowserWindow
method overview astring onbeforelinktraversal(in astring originaltarget, in nsiuri linkuri, in nsidomnode linknode, in prbool isapptab); void setjsdefaultstatus(in astring status); void setjsstatus(in astring status); void setoverlink(in astring link, in nsidomelement element); methods onbeforelinktraversal() called before traversing a link to determine the appropriate target into which to load the link.
...astring onbeforelinktraversal( in astring originaltarget, in nsiuri linkuri, in nsidomnode linknode, in prbool isapptab ); parameters originaltarget the specified target for the link.
...linknode the nsidomnode representing the dom node in which the link is located.
...void setoverlink( in astring link, in nsidomelement element ); parameters link the link string.
XPCOM Interface Reference by grouping
browser autocomplete nsiautocompletecontroller nsiautocompleteinput nsiautocompletesearch console nsiconsolelistener nsiconsolemessage nsiconsoleservice document nsidocshell dom device nsidomgeogeolocation nsidomgeoposition nsidomgeopositionaddress nsidomgeopositioncallback nsidomgeopositioncoords nsidomgeopositionerror nsidomgeopositionerrorcallback nsidomgeopositionoptions nsidomglobalpropertyinitializer element nsidomchromewindow nsidomclientrect nsidomelement nsidomhtmlaudioelement nsidomhtmlformele...
...ment nsidomhtmlmediaelement nsidomhtmlsourceelement nsidomhtmltimeranges nsidomjswindow nsidomnode nsidomnshtmldocument nsidomstorageitem nsidomstoragemanager nsidomwindow nsidomwindow2 nsidomwindowinternal nsidomwindowutils nsidynamiccontainer nsieditor event nsidomevent nsidomeventgroup nsidomeventlistener nsidomeventtarget nsidommousescrollevent nsidommoztouchevent nsidomorientationevent nsidomprogressevent nsidomsimplegestureevent nsidragdrophandler nsidragservice nsidragsession html nsiaccessibilityservice nsiaccessiblecoordinatetype nsiaccessibledocument nsiaccessibleeditabletext nsiaccessibleevent nsiaccessiblehyperlink nsiaccessiblehyperte...
...iaccessibleselectable nsiaccessiblestates nsiaccessibletable nsiaccessibletext nsiaccessibletreecache nsiaccessiblevalue nsiaccessnode nsisyncmessagesender script nsiscriptableunescapehtml nsiscriptableunicodeconverter nsiscripterror nsiscripterror2 stylesheet nsistylesheetservice url nsiuri nsiurl util nsidomserializer nsidomxpathevaluator nsidomxpathexception nsidomxpathexpression nsidomxpathresult xslt nsixsltexception nsixsltprocessor download nsidownload nsidownloadmanager nsidownloadprogresslistener element internal nsiworker nsiworkerglobalscope nsiworkermessageevent nsiworkermessageport nsiworkerscope tree ...
... nsixulruntime nsixultemplatebuilder nsixultemplatequeryprocessor nsixultemplateresult bookmark livemark nsilivemarkservice nsinavbookmarkobserver nsinavbookmarksservice nsinavhistoryservice browser dom nsiwebbrowser nsiwebbrowserpersist cache nsicache nsicachedeviceinfo nsicacheentrydescriptor nsicacheentryinfo nsicachelistener nsicachemetadatavisitor nsicacheservice nsicachesession nsicachevisitor nsicachingchannel nsiselectionimages...
Mozilla
changes to a document originate in the content tree (from dom modification by scripting, insertion of elements from the parser, etc.) and are propogated to the layout tree through magic that primarily resides in //github.com/realityripple/uxp/blob/master/layout/base/nscssframeconstructor.cpp getting started with chat note that on 2nd march 2020, mozilla moved away from irc ...
... internationalized domain names (idn) support in mozilla browsers netscape 7.1 is the first commercial browser that has built-in support for internationalized domain name under the new ietf rfc's established in 2003.
... javascript tips javascript-dom prototypes in mozilla when a dom node is accessed from javascript in mozilla, the native c++ dom node is wrapped using xpconnect and the wrapper is exposed to javascript as the javascript representation of the dom node.
... mozilla dom hacking guide mozilla gives you the opportunity not only to use very powerful and complete dom support, but also to work on a world-class implementation of one of the greatest internet technologies ever created.
Plug-in Development Overview - Plugins
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 called during initialization to retrieve the plug-in's name and description, which will appear in the navigator.plugins dom object which is used to populate about:plugins.
... random-access mode: the browser allows the plug-in to request specific ranges of bytes from anywhere in the stream.
... making plug-ins scriptable scriptable plug-ins are plug-ins that have been extended to provide methods that can be called from javascript and the dom when accessed through the object or embed element.
Intensive JavaScript - Firefox Developer Tools
here's the code, together with its immediate caller: const iterations = 50; const multiplier = 1000000000; function calculateprimes(iterations, multiplier) { var primes = []; for (var i = 0; i < iterations; i++) { var candidate = i * (multiplier * math.random()); var isprime = true; for (var c = 2; c <= math.sqrt(candidate); ++c) { if (candidate % c === 0) { // not prime isprime = false; break; } } if (isprime) { primes.push(candidate); } } return primes; } function dopointlesscomputationswithblocking() { var primes = calculateprimes(iterations, multiplier); pointlesscomputa...
... will just calculate primality for each number in a separate function: function dopointlesscomputationswithrequestanimationframe() { function testcandidate(index) { // finishing condition if (index == iterations) { console.log(primes); pointlesscomputationsbutton.disabled = false; return; } // test this number var candidate = index * (multiplier * math.random()); var isprime = true; for (var c = 2; c <= math.sqrt(candidate); ++c) { if (candidate % c === 0) { // not prime isprime = false; break; } } if (isprime) { primes.push(candidate); } // schedule the next var testfunction = testcandidate.bind(this, index + 1); window.requestanimationframe(testfunction); } var pri...
...go); function go(message) { var iterations = message.data.iterations; var multiplier = message.data.multiplier; primes = calculateprimes(iterations, multiplier); self.postmessage({ "command":"done", "primes": primes }); } function calculateprimes(iterations, multiplier) { var primes = []; for (var i = 0; i < iterations; i++) { var candidate = i * (multiplier * math.random()); var isprime = true; for (var c = 2; c <= math.sqrt(candidate); ++c) { if (candidate % c === 0) { // not prime isprime = false; break; } } if (isprime) { primes.push(candidate); } } return primes; } in the worker, we have to listen for a message telling us to start, and send a "done" message back when we are done.
... the main limitation of web workers is that dom apis are not available to code running in a worker.
Console messages - Firefox Developer Tools
click it to view more information about the error, as well as which dom nodes are affected by the error.
...many events can trigger reflows, including: resizing the browser window, activating pseudoclasses like :hover, or manipulating the dom in javascript.
...for example, code like this will cause an immediate, synchronous, reflow, when it calls window.getcomputedstyle(thing).height: var thing = document.getelementbyid("the-thing"); thing.style.display = "inline-block"; var thingheight = window.getcomputedstyle(thing).height; because of this, it's a good idea to avoid interleaving write and read calls to an element's styles when manipulating the dom, because every time you read back a style that has been invalidated by a previous write call, you force a synchronous reflow.
... for responses that contain objects or variables, the following context menu options are available: reveal in inspector shows the selected dom node in the inspector pane.
Web Console Helpers - Firefox Developer Tools
$$(selector, element) looks up a css selector string selector, returning an array of dom nodes descended from element that match.
...if the argument is a dom node, its outerhtml is copied.
... examples looking at the contents of a dom node let's say you have a dom node with the id "title".
... let's take a look at the contents of that node by using the $() and inspect() functions: inspect($("#title")) this automatically generates rich output for the object, showing you the contents of the dom node that matches the css selector "#title", which is of course the element with id "title".
AbortSignal - Web APIs
the abortsignal interface represents a signal object that allows you to communicate with a dom request (such as a fetch) and abort it if required via an abortcontroller object.
... abort invoked when the dom request(s) the signal is communicating with is/are aborted.
... current version of firefox rejects the promise with a domexception you can find a full working example on github — see abort-api (see it running live also).
... specifications specification status comment domthe definition of 'abortsignal' in that specification.
AudioTrack - Web APIs
id read only a domstring which uniquely identifies the track within the media.
... kind read only a domstring specifying the category into which the track falls.
... label read only a domstring providing a human-readable label for the track.
... language read only a domstring specifying the audio track's primary language, or an empty string if unknown.
BasicCardRequest.supportedNetworks - Web APIs
the supportednetworks property of the basiccardrequest dictionary contains an array of domstrings representing the card networks that the retailer supports (e.g.
...value]] value an array containing one or more domstrings, which describe the card networks the retailer supports.
...sung internetsupportednetworkschrome no support noedge no support ≤18 — 79firefox full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
...android no support nochrome android full support 57firefox android full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
CSSKeyframesRule - Web APIs
the parameter is a domstring containing a keyframe in the same format as an entry of a @keyframes at-rule.
... if it contains more than one keyframe rule, a domexception with a syntax_err is thrown.
...the parameter is the index of the keyframe to be deleted, expressed as a domstring resolving as a number between 0% and 100%.
...the key is a domstring containing an index of the keyframe to be returned, resolving to a percentage between 0% and 100%.
CSSOMString - Web APIs
cssomstring is used to denote string data in cssom specifications and can refer to either domstring or usvstring.
... when a specification says cssomstring, it depends on the browser vendors to choose whether to use domstring or usvstring.
... while browser implementations that use utf-8 internally to represent strings in memory can use usvstring when the specification says cssomstring, implementations that already represent strings as 16-bit sequences might choose to use domstring instead.
... implementation differences browser domstring or usvstring for cssomstring firefox (gecko) usvstring chrome (blink) usvstring safari (webkit) usvstring edge (edgehtml) - opera (blink) usvstring specifications specification status comment css object model (cssom)the definition of 'cssomstring' in that specification.
CSSPrimitiveValue.setStringValue() - Web APIs
if the property attached to this value can't accept the specified unit or the string value, the value will be unchanged and a domexception will be raised.
... stringvalue a domstring representing the new string value.
... exceptions type description domexception an invalid_access_err is raised if the css value doesn't contain a string value or if the string value can't be converted into the specified unit.
... specifications specification status comment document object model (dom) level 2 style specificationthe definition of 'cssprimitivevalue.setstringvalue' in that specification.
CSSStyleDeclaration.getPropertyPriority() - Web APIs
the cssstyledeclaration.getpropertypriority() method interface returns a domstring that provides all explicitly set priorities on the css property.
... syntax var priority = style.getpropertypriority(property); parameters property is a domstring representing the property name to be checked.
... return value priority is a domstring that represents the priority (e.g.
... working draft document object model (dom) level 2 style specificationthe definition of 'cssstyledeclaration' in that specification.
CSSStyleDeclaration.getPropertyValue() - Web APIs
the cssstyledeclaration.getpropertyvalue() method interface returns a domstring containing the value of a specified css property.
... syntax var value = style.getpropertyvalue(property); parameters property is a domstring representing the property name to be checked.
... return value value is a domstring containing the value of the property.
... working draft document object model (dom) level 2 style specificationthe definition of 'cssstyledeclaration' in that specification.
CSSStyleDeclaration.removeProperty() - Web APIs
syntax var oldvalue = style.removeproperty(property); parameters property is a domstring representing the property name to be removed.
... return value oldvalue is a domstring equal to the value of the css property before it was removed.
... exceptions domexception no_modification_allowed_err: if the property or declaration block is read only.
... working draft document object model (dom) level 2 style specificationthe definition of 'cssstyledeclaration' in that specification.
Basic animations - Web APIs
x: innerwidth / 2, y: innerheight / 2 }; window.onmousemove = function(e) { m.x = e.clientx; m.y = e.clienty; } function gc() { var s = "0123456789abcdef"; var c = "#"; for (var i = 0; i < 6; i++) { c += s[math.ceil(math.random() * 15)] } return c } var a = []; window.onload = function myfunction() { cn = document.getelementbyid('cw'); c = cn.getcontext('2d'); for (var i = 0; i < 10; i++) { var r = 30; var x = math.random() * (innerwidth - 2 * r) + r; ...
... var y = math.random() * (innerheight - 2 * r) + r; var t = new ob(innerwidth / 2,innerheight / 2,5,"red",math.random() * 200 + 20,2); a.push(t); } //cn.style.backgroundcolor = "#700bc8"; c.linewidth = "2"; c.globalalpha = 0.5; resize(); anim() } window.onresize = function() { resize(); } function resize() { cn.height = innerheight; cn.width = innerwidth; for (var i = 0; i < 101; i++) { var r = 30; var x = math.random() * (innerwidth - 2 * r) + r; var y = math.random() * (innerheigh...
...t - 2 * r) + r; a[i] = new ob(innerwidth / 2,innerheight / 2,4,gc(),math.random() * 200 + 20,0.02); } // a[0] = new ob(innerwidth / 2, innerheight / 2, 40, "red", 0.05, 0.05); //a[0].dr(); } function ob(x, y, r, cc, o, s) { this.x = x; this.y = y; this.r = r; this.cc = cc; this.theta = math.random() * math.pi * 2; this.s = s; this.o = o; this.t = math.random() * 150; this.o = o; this.dr = function() { const ls = { x: this.x, y: this.y }; ...
...tyle = "#9e9e9e", i.length - 1 != e && 0 != e && c.strokerect(t.x, t.y, this.w, this.h), 0 == e && (c.beginpath(), c.fillstyle = "#f44336", c.arc(t.x + 10, t.y + 2, 5, 360, 0), c.fill()), c.arc(t.x + 10, t.y + 2, 5, 360, 0), c.fill(), c.beginpath() }) } } function gc() { for (var t = "0123456789abcdef", e = "#", i = 0; i < 6; i++) e += t[math.ceil(15 * math.random())]; return e } function food() { this.x = 0, this.y = 0, this.b = 10, this.w = this.b, this.h = this.b, this.color = gc(), this.renew = function () { this.x = math.floor(math.random() * (w - 200) + 10), this.y = math.floor(math.random() * (h - 200) + 30), this.color = gc() }, this.renew(), this.put = (() => { c.fillstyle = this.color, c.ar...
Comment - Web APIs
WebAPIComment
specifications specification status comment domthe definition of 'comment' in that specification.
... document object model (dom) level 3 core specificationthe definition of 'comment' in that specification.
... obsolete no change from document object model (dom) level 2 core specification document object model (dom) level 2 core specificationthe definition of 'comment' in that specification.
... obsolete no change from document object model (dom) level 1 specification document object model (dom) level 1 specificationthe definition of 'comment' in that specification.
CompositionEvent.initCompositionEvent() - Web APIs
syntax compositioneventinstance.initcompositionevent(typearg, canbubblearg, cancelablearg, viewarg, dataarg, localearg) parameters typearg a domstring representing the type of composition event; this will be one of compositionstart, compositionupdate, or compositionend.
... dataarg a domstring representing the value of the data attribute.
... localearg a domstring representing the value of the locale attribute.
... specifications specification status comment document object model (dom) level 3 events specificationthe definition of 'initcompositionevent()' in that specification.
Document.createNSResolver() - Web APIs
notes adapts any dom node to resolve namespaces so that an xpath expression can be easily evaluated relative to the context of the node where it appeared within the document.
... this adapter works like the dom level 3 method lookupnamespaceuri on nodes in resolving the namespaceuri from a given prefix using the current information available in the node's hierarchy at the time lookupnamespaceuri is called.
... creatensresolver was introduced in dom level 3.
... see also document.evaluate introduction to using xpath in javascript specifications specification status comment document object model (dom) level 3 xpath specificationthe definition of 'document.creatensresolver' in that specification.
Document.getElementsByTagName() - Web APIs
the returned htmlcollection is live, meaning that it updates itself automatically to stay in sync with the dom tree without having to call document.getelementsbytagname() again.
... example in the following example, getelementsbytagname() starts from a particular parent element and searches top-down recursively through the dom from that parent element, building a collection of all descendant elements which match the tag name parameter.
... this demonstrates both document.getelementsbytagname() and the functionally identical element.getelementsbytagname(), which starts the search at a specific element within the dom tree.
... specifications specification status comment domthe definition of 'document.getelementsbytagname' in that specification.
Element.attributes - Web APIs
ributes to show"; } } </script> </head> <body> <p id="paragraph" style="color: green;">sample paragraph</p> <form action=""> <p> <input type="button" value="show first attribute name and value" onclick="listattributes();"> <input id="result" type="text" value=""> </p> </form> </body> </html> specifications specification status comment domthe definition of 'element.attributes' in that specification.
... living standard from document object model (dom) level 3 core specification, moved from node to element document object model (dom) level 3 core specificationthe definition of 'element.attributes' in that specification.
... obsolete no change from document object model (dom) level 2 core specification document object model (dom) level 2 core specificationthe definition of 'element.attributes' in that specification.
... obsolete no change from document object model (dom) level 1 specification document object model (dom) level 1 specificationthe definition of 'element.attributes' in that specification.
Element.getClientRects() - Web APIs
the getclientrects() method of the element interface returns a collection of domrect objects that indicate the bounding rectangles for each css border box in a client.
... syntax let rectcollection = object.getclientrects(); return value the returned value is a collection of domrect objects, one for each css border box associated with the element.
... each domrect object contains read-only left, top, right and bottom properties describing the border box, in pixels, with the top-left relative to the top-left of the viewport.
...however, the cssom working draft specifies that it returns a domrect for each border box.
Element.getElementsByTagNameNS() - Web APIs
var table = document.getelementbyid("forecast-table"); var cells = table.getelementsbytagnamens("http://www.w3.org/1999/xhtml", "td"); for (var i = 0; i < cells.length; i++) { var axis = cells[i].getattribute("axis"); if (axis == "year") { // grab the data } } specifications specification status comment domthe definition of 'element.getelementsbytagnamens()' in that specification.
... document object model (dom) level 3 core specificationthe definition of 'element.getelementsbytagnamens()' in that specification.
... obsolete no change from document object model (dom) level 2 core specification.
... document object model (dom) level 2 core specificationthe definition of 'element.getelementsbytagnamens()' in that specification.
Element.hasAttribute() - Web APIs
example var foo = document.getelementbyid("foo"); if (foo.hasattribute("bar")) { // do something } polyfill ;(function(prototype) { prototype.hasattribute = prototype.hasattribute || function(name) { return !!(this.attributes[name] && this.attributes[name].specified); } })(element.prototype); notes dom methods dealing with element's attributes: not namespace-aware, most commonly used methods namespace-aware variants (dom level 2) dom level 1 methods for dealing with attr nodes directly (seldom used) dom level 2 namespace-aware methods for dealing with attr nodes directly (seldom used) setattribute (dom 1) setattributens setattributenode setattributenodens getattribute (dom 1) getattrib...
...utens getattributenode getattributenodens hasattribute (dom 2) hasattributens - - removeattribute (dom 1) removeattributens removeattributenode - specifications specification status comment domthe definition of 'element.hasattribute()' in that specification.
... living standard from document object model (dom) level 3 core specification, moved from node to element document object model (dom) level 3 core specificationthe definition of 'element.hasattribute()' in that specification.
... obsolete no change from document object model (dom) level 2 core specification document object model (dom) level 2 core specificationthe definition of 'element.hasattribute()' in that specification.
Element.innerHTML - Web APIs
WebAPIElementinnerHTML
syntax const content = element.innerhtml; element.innerhtml = htmlstring; value a domstring containing the html serialization of the element's descendants.
...doing so causes the user agent to follow these steps: the specified value is parsed as html or xml (based on the document type), resulting in a documentfragment object representing the new set of dom nodes for the new elements.
... const name = "john"; // assuming 'el' is an html dom element el.innerhtml = name; // harmless in this case // ...
... specification specification status comment dom parsing and serializationthe definition of 'element.innerhtml' in that specification.
Element.insertAdjacentHTML() - Web APIs
the insertadjacenthtml() method of the element interface parses the specified text as html or xml and inserts the resulting nodes into the dom tree at a specified position.
... syntax element.insertadjacenthtml(position, text); parameters position a domstring representing the position relative to the element; must be one of the following strings: 'beforebegin': before the element itself.
... visualization of position names <!-- beforebegin --> <p> <!-- afterbegin --> foo <!-- beforeend --> </p> <!-- afterend --> note: the beforebegin and afterend positions work only if the node is in the dom tree and has a parent element.
... specification specification status comment dom parsing and serializationthe definition of 'element.insertadjacenthtml()' in that specification.
Element.outerHTML - Web APIs
WebAPIElementouterHTML
the outerhtml attribute of the element dom interface gets the serialized html fragment describing the element including its descendants.
... syntax var content = element.outerhtml; element.outerhtml = htmlstring; value reading the value of outerhtml returns a domstring containing an html serialization of the element and its descendants.
... setting the value of outerhtml replaces the element and all of its descendants with a new dom tree constructed by parsing the specified htmlstring.
...his div replaced a paragraph.</div>"; console.log(p.nodename); // still "p"; the returned value will contain html escaped attributes: var anc = document.createelement("a"); anc.href = "https://developer.mozilla.org?a=b&c=d"; console.log(anc.outerhtml); // output: "<a href='https://developer.mozilla.org?a=b&amp;c=d'></a>" specification specification status comment dom parsing and serializationthe definition of 'element.outerhtml' in that specification.
Element.setAttribute() - Web APIs
syntax element.setattribute(name, value); parameters name a domstring specifying the name of the attribute whose value is to be set.
... value a domstring containing the value to assign to the attribute.
... dom methods dealing with element's attributes: not namespace-aware, most commonly used methods namespace-aware variants (dom level 2) dom level 1 methods for dealing with attr nodes directly (seldom used) dom level 2 namespace-aware methods for dealing with attr nodes directly (seldom used) setattribute (dom 1) setattributens setattributenode setattributenodens getattribute (dom 1) getattrib...
...utens getattributenode getattributenodens hasattribute (dom 2) hasattributens - - removeattribute (dom 1) removeattributens removeattributenode - specifications specification status comment domthe definition of 'setattribute()' in that specification.
Event.bubbles - Web APIs
WebAPIEventbubbles
the bubbles read-only property of the event interface indicates whether the event bubbles up through the dom or not.
... syntax var doesitbubble = event.bubbles; value a boolean, which is true if the event bubbles up through the dom.
... specifications specification status comment domthe definition of 'event.bubbles' in that specification.
... living standard document object model (dom) level 2 events specificationthe definition of 'event.bubbles' in that specification.
Event.eventPhase - Web APIs
WebAPIEventeventPhase
for more details, see section 3.1, event dispatch and dom event flow, of the dom level 3 events specification.
..."#f6eedb" : "#cceeff" } } divinfo.innerhtml = '' } result specifications specification status comment domthe definition of 'event.eventphase' in that specification.
... living standard dom4the definition of 'event.eventphase' in that specification.
... obsolete document object model (dom) level 2 events specificationthe definition of 'event.eventphase' in that specification.
Event.initEvent() - Web APIs
WebAPIEventinitEvent
syntax event.initevent(type, bubbles, cancelable); type is a domstring defining the type of event.
...elem.addeventlistener('click', function (e) { // e.target matches elem }, false); elem.dispatchevent(event); specifications specification status comment domthe definition of 'event.initevent()' in that specification.
... living standard from document object model (dom) level 2 events specification, deprecated it, superseded by event constructors.
... document object model (dom) level 2 events specificationthe definition of 'event.initevent()' in that specification.
Event.returnValue - Web APIs
WebAPIEventreturnValue
note: while returnvalue has been adopted into the dom standard, it is present primarily to support existing code.
... usage notes returnvalue was introduced into the dom by internet explorer 6, and due to that browser's ubiquity became so commonly used that other browsers eventually implemented it as well.
... it has been adopted into the dom specification, primarily to ensure that existing web content continues to function going forward.
... specifications specification status comment domthe definition of 'returnvalue' in that specification.
Event.stopPropagation() - Web APIs
examples see example 5: event propagation in the examples chapter for a more detailed example of this method and event propagation in the dom.
... specifications specification status comment domthe definition of 'event.stoppropagation()' in that specification.
... living standard dom4the definition of 'event.stoppropagation()' in that specification.
... obsolete document object model (dom) level 2 events specificationthe definition of 'event.stoppropagation()' in that specification.
EventTarget.removeEventListener() - Web APIs
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.
... else { body.style.backgroundcolor = 'yellow'; } toggle = !toggle; } clicktarget.addeventlistener('click', makebackgroundyellow, false ); mouseovertarget.addeventlistener('mouseover', function () { clicktarget.removeeventlistener('click', makebackgroundyellow, false ); }); specifications specification status comment domthe definition of 'eventtarget.removeeventlistener()' in that specification.
... living standard dom4the definition of 'eventtarget.removeeventlistener()' in that specification.
... obsolete document object model (dom) level 2 events specificationthe definition of 'eventtarget.removeeventlistener()' in that specification.
FileReaderSync.readAsBinaryString() - Web APIs
the readasbinarystring() method of the filereadersync interface allows to read file or blob objects in a synchronous way into an domstring.
... syntax readasbinarystring(file); readasbinarystring(blob); parameters blob the dom file or blob to read.
... return value an domstring representing the input data.
... exceptions the following exceptions can be raised by this method: notfounderror is raised when the resource represented by the dom file or blob cannot be found, e.g.
FileReaderSync.readAsDataURL() - Web APIs
the readasdataurl() method of the filereadersync interface allows to read file or blob objects in a synchronous way into an domstring representing a data url.
... syntax readasdataurl(file); readasdataurl(blob); parameters blob the dom file or blob to read.
... return value an domstring representing the input data as a data url.
... exceptions the following exceptions can be raised by this method: notfounderror is raised when the resource represented by the dom file or blob cannot be found, e.g.
FileReaderSync.readAsText() - Web APIs
the readastext() method of the filereadersync interface allows to read file or blob objects in a synchronous way into an domstring.
... syntax readastext(file); readastext(blob); readastext(file, encoding); readastext(blob, encoding); parameters blob the dom file or blob to read.
... return value an domstring representing the input data.
... exceptions the following exceptions can be raised by this method: notfounderror is raised when the resource represented by the dom file or blob cannot be found, e.g.
HTMLDListElement - Web APIs
recommendation no change from document object model (dom) level 2 html specification.
... document object model (dom) level 2 html specificationthe definition of 'htmldlistelement' in that specification.
... obsolete no change from document object model (dom) level 1 specification.
... document object model (dom) level 1 specificationthe definition of 'htmldlistelement' in that specification.
HTMLElement.dir - Web APIs
WebAPIHTMLElementdir
living standard no change from document object model (dom) level 2 html specification.
... document object model (dom) level 2 html specificationthe definition of 'dir' in that specification.
... obsolete no change from document object model (dom) level 1 specification.
... document object model (dom) level 1 specificationthe definition of 'dir' in that specification.
HTMLElement.title - Web APIs
WebAPIHTMLElementtitle
living standard no change from document object model (dom) level 2 html specification.
... document object model (dom) level 2 html specificationthe definition of 'title' in that specification.
... obsolete no change from document object model (dom) level 1 specification.
... document object model (dom) level 1 specificationthe definition of 'title' in that specification.
HTMLFontElement - Web APIs
implements the document object model (dom) representation of the font element.
... htmlfontelement.color is a domstring that reflects the color html attribute, containing either a named color or a color specified in the hexadecimal #rrggbb format.
... htmlfontelement.face is a domstring that reflects the face html attribute, containing a comma-separated list of one or more font names.
... htmlfontelement.size is a domstring that reflects the size html attribute, containing either a font size number ranging from 1 to 7 or a relative size to the size attribute of the <basefont> element, for example -2 or +1.
HTMLHyperlinkElementUtils - Web APIs
htmlhyperlinkelementutils.hostname this is a usvstring containing the domain of the url.
... htmlhyperlinkelementutils.username this is a usvstring containing the username specified before the domain name.
... htmlhyperlinkelementutils.password this is a usvstring containing the password specified before the domain name.
... htmlhyperlinkelementutils.origin read only this returns a usvstring containing the origin of the url (that is its scheme, its domain and its port).
HTMLLIElement - Web APIs
htmllielement.type is a domstring representing the type of the bullets, "disc", "square" or "circle".
... document object model (dom) level 2 html specificationthe definition of 'htmllielement' in that specification.
... obsolete no change from document object model (dom) level 1 specification.
... document object model (dom) level 1 specificationthe definition of 'htmllielement' in that specification.
HTMLMapElement - Web APIs
htmlmapelement.name is a domstring representing the <map> element for referencing it other context.
... 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 specification.
HTMLOListElement - Web APIs
htmlolistelement.type is a domstring value reflecting the type and defining the kind of marker to be used to display.
... document object model (dom) level 2 html specificationthe definition of 'htmlolistelement' in that specification.
... obsolete no change from document object model (dom) level 1 specification.
... document object model (dom) level 1 specificationthe definition of 'htmlolistelement' in that specification.
HTMLOrForeignElement.tabIndex - Web APIs
living standard no change from document object model (dom) level 2 html specification.
... document object model (dom) level 2 html specificationthe definition of 'tabindex' in that specification.
... obsolete no change from document object model (dom) level 1 specification.
... document object model (dom) level 1 specificationthe definition of 'tabindex' in that specification.
HTMLParagraphElement - Web APIs
htmlparagraphelement.align a domstring representing an enumerated property indicating alignment of the element's contents with respect to the surrounding context.
... document object model (dom) level 2 html specificationthe definition of 'htmlparagraphelement' in that specification.
... obsolete no change from document object model (dom) level 1 specification.
... document object model (dom) level 1 specificationthe definition of 'htmlparagraphelement' in that specification.
HTMLSelectElement.add() - Web APIs
exceptions a domerror of the type hierarchyrequesterror if the item passed to the method is an ancestor of the htmlselectelement.
...it throws a domerror of the type hierarchyrequesterror if the passed item is an ancestor of the htmlselectelement and no longer throws if the before parameter is not found.
... document object model (dom) level 2 html specificationthe definition of 'htmlselectelement.add()' in that specification.
... document object model (dom) level 1 specificationthe definition of 'htmlselectelement.add()' in that specification.
HTMLSelectElement.type - Web APIs
no change from document object model (dom) level 2 html specification.
... document object model (dom) level 2 html specificationthe definition of 'htmlselectelement' in that specification.
... obsolete no change from document object model (dom) level 1 specification.
... document object model (dom) level 1 specificationthe definition of 'htmlselectelement' in that specification.
HTMLSourceElement - Web APIs
htmlsourceelement.media is a domstring reflecting the media html attribute, containing the intended type of the media resource.
... htmlsourceelement.sizes is a domstring representing image sizes between breakpoints htmlsourceelement.src is a domstring reflecting the src html attribute, containing the url for the media resource.
... htmlsourceelement.srcset is a domstring reflecting the srcset html attribute, containing a list of candidate images, separated by a comma (',', u+002c comma).
... htmlsourceelement.type is a domstring reflecting the type html attribute, containing the type of the media resource.
HTMLUListElement - Web APIs
htmlulistelement.type is a domstring value reflecting the type and defining the kind of marker to be used to display.
... document object model (dom) level 2 html specificationthe definition of 'htmlulistelement' in that specification.
... obsolete no change from document object model (dom) level 1 specification.
... document object model (dom) level 1 specificationthe definition of 'htmlulistelement' in that specification.
HTML Drag and Drop API - Web APIs
drag events html drag-and-drop uses the dom event model and drag events inherited from mouse events.
... identify what is draggable making an element draggable requires adding the draggable attribute and the ondragstart global event handler, as shown in the following code sample: <script> function dragstart_handler(ev) { // add the target element's id to the data transfer object ev.datatransfer.setdata("text/plain", ev.target.id); } window.addeventlistener('domcontentloaded', () => { // get the element by id const element = document.getelementbyid("p1"); // add the ondragstart event listener element.addeventlistener("dragstart", dragstart_handler); }); </script> <p id="p1" draggable="true">this element is draggable.</p> for more information, see: draggable attribute reference drag operations guide define the drag's data the ap...
... <script> function dragover_handler(ev) { ev.preventdefault(); ev.datatransfer.dropeffect = "move"; } function drop_handler(ev) { ev.preventdefault(); // get the id of the target and add the moved element to the target's dom const data = ev.datatransfer.getdata("text/plain"); ev.target.appendchild(document.getelementbyid(data)); } </script> <p id="target" ondrop="drop_handler(event)" ondragover="dragover_handler(event)">drop zone</p> note that each handler calls preventdefault() to prevent additional event processing for this event (such as touch events or pointer events).
...dragstart_handler(ev) { // add the target element's id to the data transfer object ev.datatransfer.setdata("application/my-app", ev.target.id); ev.datatransfer.dropeffect = "move"; } function dragover_handler(ev) { ev.preventdefault(); ev.datatransfer.dropeffect = "move" } function drop_handler(ev) { ev.preventdefault(); // get the id of the target and add the moved element to the target's dom const data = ev.datatransfer.getdata("application/my-app"); ev.target.appendchild(document.getelementbyid(data)); } </script> <p id="p1" draggable="true" ondragstart="dragstart_handler(event)">this element is draggable.</p> <div id="target" ondrop="drop_handler(event)" ondragover="dragover_handler(event)">drop zone</div> for more information, see: performing a drop drag end at the end ...
IntersectionObserverEntry - Web APIs
properties intersectionobserverentry.boundingclientrect read only returns the bounds rectangle of the target element as a domrectreadonly.
... intersectionobserverentry.intersectionrect read only returns a domrectreadonly representing the target's visible area.
... intersectionobserverentry.rootbounds read only returns a domrectreadonly for the intersection observer's root.
... intersectionobserverentry.time read only a domhighrestimestamp indicating the time at which the intersection was recorded, relative to the intersectionobserver's time origin.
KeyboardEvent() - Web APIs
syntax event = new keyboardevent(typearg, keyboardeventinit); values typearg is a domstring representing the name of the event.
... keyboardeventinitoptional is a keyboardeventinit dictionary, having the following fields: "key", optional and defaulting to "", of type domstring, that sets the value of keyboardevent.key.
... "code", optional and defaulting to "", of type domstring, that sets the value of keyboardevent.code.
... document object model (dom) level 3 events specificationthe definition of 'keyboardevent()' in that specification.
KeyboardEvent.initKeyEvent() - Web APIs
this method is based on early drafts of document object model (dom) level 2 events specification and is implemented in gecko-based browsers; other browsers implemented keyboardevent.initkeyboardevent based on early drafts of document object model (dom) level 3 events specification.
... syntax event.initkeyevent (type, bubbles, cancelable, viewarg, ctrlkeyarg, altkeyarg, shiftkeyarg, metakeyarg, keycodearg, charcodearg) parameters type is a domstring representing the type of event.
... // altkeyarg, false, // shiftkeyarg, false, // metakeyarg, 9, // keycodearg, 0); // charcodearg); document.getelementbyid('blah').dispatchevent(event); specification this implementation of keyboard events is based on the key events spec in the early versions of dom 2 events, later removed from that spec.
... the initkeyevent 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 modifierslist of type domstring); ...
Location: assign() - Web APIs
WebAPILocationassign
if the assignment can't happen because of a security violation, a domexception of the security_error type is thrown.
... this happens if the origin of the script calling the method is different from the origin of the page originally described by the location object, mostly when the script is hosted on a different domain.
... if the provided url is not valid, a domexception of the syntax_error type is thrown.
... syntax location.assign(url); parameters url is a domstring containing the url of the page to navigate to.
Location: replace() - Web APIs
WebAPILocationreplace
if the assignment can't happen because of a security violation, a domexception of the security_error type is thrown.
... this happens if the origin of the script calling the method is different from the origin of the page originally described by the location object, mostly when the script is hosted on a different domain.
... if the provided url is not valid, a domexception of the syntax_error type is thrown.
... syntax object.replace(url); parameters url is a domstring containing the url of the page to navigate to.
MutationObserver.takeRecords() - Web APIs
the mutationobserver method takerecords() returns a list of all matching dom changes that have been detected but not yet processed by the observer's callback function, leaving the mutation queue empty.
... return value an array mutationrecord objects, each describing one change applied to the observed portion of the document's dom tree.
...this is done immediately prior to calling disconnect() to stop observing the dom.
... specifications specification status comment domthe definition of 'mutationobserver.takerecords()' in that specification.
NameList - Web APIs
WebAPINameList
the dom spec does not specify how the collection is to be implemented.
... namelist.getname() returns a domstring.
... namelist.getnamespaceuri() returns a domstring.
... specifications specification status comment document object model (dom) level 3 core specificationthe definition of 'namelist' in that specification.
NamedNodeMap - Web APIs
specifications specification status comment domthe definition of 'namednodemap' in that specification.
... living standard deals with attr instead of node document object model (dom) level 3 core specificationthe definition of 'namednodemap' in that specification.
... obsolete no change from document object model (dom) level 2 core specification document object model (dom) level 2 core specificationthe definition of 'namednodemap' in that specification.
... obsolete added getnameditemns(), setnameditemns() and removenameditemns() document object model (dom) level 1 specificationthe definition of 'namednodemap' in that specification.
Node.childNodes - Web APIs
WebAPINodechildNodes
specifications specification status comment domthe definition of 'node.childnodes' in that specification.
... living standard no change document object model (dom) level 3 core specificationthe definition of 'node.childnodes' in that specification.
... obsolete no change document object model (dom) level 2 core specificationthe definition of 'node.childnodes' in that specification.
... obsolete no change document object model (dom) level 1 specificationthe definition of 'node.childnodes' in that specification.
Node.cloneNode() - Web APIs
WebAPINodecloneNode
*note: in the dom4 specification (since gecko 13.0 (firefox 13 / thunderbird 13 / seamonkey 2.10)), the optional deep argument defaults to true.
... specifications specification status comment domthe definition of 'node.clonenode()' in that specification.
... living standard document object model (dom) level 3 core specificationthe definition of 'node.clonenode()' in that specification.
... obsolete document object model (dom) level 2 core specificationthe definition of 'node.clonenode()' in that specification.
Node.firstChild - Web APIs
WebAPINodefirstChild
specifications specification status comment domthe definition of 'node.firstchild' in that specification.
... living standard no change document object model (dom) level 3 core specificationthe definition of 'node.firstchild' in that specification.
... obsolete no change document object model (dom) level 2 core specificationthe definition of 'node.firstchild' in that specification.
... obsolete no change document object model (dom) level 1 specificationthe definition of 'node.firstchild' in that specification.
Node.isConnected - Web APIs
WebAPINodeisConnected
the isconnected read-only property of the node interface returns a boolean indicating whether the node is connected (directly or indirectly) to the context object, for example the document object in the case of the normal dom, or the shadowroot in the case of a shadow dom.
... examples standard dom a standard dom example: let test = document.createelement('p'); console.log(test.isconnected); // returns false document.body.appendchild(test); console.log(test.isconnected); // returns true shadow dom a shadow dom example: // create a shadow root var shadow = this.attachshadow({mode: 'open'}); // create some css to apply to the shadow dom var style = document.createelement('style'); console.log(style.isconnected); // returns false style.textcontent = ` .wrapper { position: relative; } .info { font-size: 0.8rem; width: 200px; display: inline-block; border: 1px solid black; pad...
...ding: 10px; background: white; border-radius: 10px; opacity: 0; transition: 0.6s all; positions: absolute; bottom: 20px; left: 10px; z-index: 3 } `; // attach the created style element to the shadow dom shadow.appendchild(style); console.log(style.isconnected); // returns true polyfill node.isconnected can be polyfilled with the following code for ie10 and edgehtml: /* * node.isconnected polyfill for ie and edgehtml * 2020-02-04 * * by eli grey, https://eligrey.com * public domain.
... */ if (!('isconnected' in node.prototype)) { object.defineproperty(node.prototype, 'isconnected', { get() { return ( !this.ownerdocument || !( this.ownerdocument.comparedocumentposition(this) & this.document_position_disconnected ) ); }, }); } specifications specification status comment domthe definition of 'isconnected' in that specification.
Node.lastChild - Web APIs
WebAPINodelastChild
syntax var childnode = node.lastchild; example var tr = document.getelementbyid("row1"); var corner_td = tr.lastchild; specifications specification status comment domthe definition of 'node.lastchild' in that specification.
... living standard no change document object model (dom) level 3 core specificationthe definition of 'node.lastchild' in that specification.
... obsolete no change document object model (dom) level 2 core specificationthe definition of 'node.lastchild' in that specification.
... obsolete no change document object model (dom) level 1 specificationthe definition of 'node.lastchild' in that specification.
ParentNode.prepend() - Web APIs
the parentnode.prepend() method inserts a set of node objects or domstring objects before the first child of the parentnode.
... domstring objects are inserted as equivalent text nodes.
... var parent = document.createelement("div"); with(parent) { prepend("foo"); } // referenceerror: prepend is not defined polyfill you can polyfill the prepend() method if it's not available: // source: https://github.com/jserz/js_piece/blob/master/dom/parentnode/prepend()/prepend().md (function (arr) { arr.foreach(function (item) { if (item.hasownproperty('prepend')) { return; } object.defineproperty(item, 'prepend', { configurable: true, enumerable: true, writable: true, value: function prepend() { var argarr = array.prototype.slice.call(arguments), docfrag = document.createdocumen...
...argitem : document.createtextnode(string(argitem))); }); this.insertbefore(docfrag, this.firstchild); } }); }); })([element.prototype, document.prototype, documentfragment.prototype]); specification specification status comment domthe definition of 'parentnode.prepend()' in that specification.
ParentNode.querySelector() - Web APIs
syntax element = parentnode.queryselector(selectors); parameters selectors a domstring containing one or more selectors to match against.
...see locating dom elements using selectors for more information about using selectors to identify elements.
... specifications specification status comment domthe definition of 'parentnode.queryselector()' in that specification.
... obsolete no change dom4the definition of 'parentnode.queryselector()' in that specification.
performance.measure() - Web APIs
duration - set to a domhighrestimestamp that is the duration of the measure (typically, the end mark timestamp minus the start mark timestamp).
... syntax performance.measure(name); performance.measure(name, startmark); performance.measure(name, startmark, endmark); performance.measure(name, undefined, endmark); arguments name a domstring representing the name of the measure.
... startmark optional a domstring representing the name of the measure's starting mark.
... endmark optional a domstring representing the name of the measure's ending mark.
PerformanceServerTiming - Web APIs
this interface is restricted to the same origin, but you can use the timing-allow-origin header to specify the domains that are allowed to access the server metrics.
... properties performanceservertiming.descriptionread only a domstring value of the server-specified metric description, or an empty string.
... performanceservertiming.nameread only a domstring value of the server-specified metric name.
... methods performanceservertiming.tojson() returns a domstring that is the json representation of the performanceservertiming object.
Using the Performance API - Web APIs
the domhighrestimestamp type (a double) is used by all performance interfaces to hold such time values.
... high precision timing high precision timing is achieved by using the domhighrestimestamp type for time values.
... the following code example shows the use of domhighrestimestamp and the performance.now() method.
... the now() method returns a timestamp (of type domhighrestimestamp) that is a discrete point in time.
PublicKeyCredentialCreationOptions.rp - Web APIs
id a domstring uniquely identifying a relying party.
... the default value of this property is the domain of the current document (e.g.
...it may be overridden with a suffix of the current domain (e.g.
... name a domstring giving a human-readable name for the relying party.
PublicKeyCredentialRequestOptions.rpId - Web APIs
its value can only be a suffix of the current origin's domain.
...if it is not explicitely provided, the user agent will use the value of the current origin's domain.
...its value can only be a suffix of the current origin's domain.
... examples var options = { challenge: new uint8array([/* bytes sent from the server */]), rpid: "example.com" // will only work if the current domain // is something like foo.example.com }; navigator.credentials.get({ "publickey": options }) .then(function (credentialinfoassertion) { // send assertion response back to the server // to proceed with the control of the credential }).catch(function (err) { console.error(err); }); specifications specification status comment web authentication: an api for accessing public key credentials level 1the definition of 'rpid' in that specification.
RTCPeerConnection.setIdentityProvider() - Web APIs
syntax pc.setidentityprovider(domainname [, protocol] [, username]); there is no return value for this method.
... parameters domainname is a domstring is the domain name where the idp is.
... protocol optional is a domstring representing the protocol used to communicate with the idp.
... username optional is a domstring representing the username associated with the idp.
RTCRtpStreamStats - Web APIs
standard fields included for all media types codecid a domstring which uniquely identifies the object which was inspected to produce the rtccodecstats object associated with this rtp stream.
... kind a domstring whose value is "audio" if the associated mediastreamtrack is audio-only or "video" if the track contains video.
... trackid a domstring which uniquely identifies the rtcmediastreamtrackstats object representing the associated mediastreamtrack.
... transportid a domstring uniquely identifying the object which was inspected to produce the rtctransportstats object associated with this rtp stream.
Range.cloneContents() - Web APIs
event listeners added using dom events are not copied during cloning.
... html attribute events are duplicated as they are for the dom core clonenode method.
... syntax documentfragment = range.clonecontents(); example range = document.createrange(); range.selectnode(document.getelementsbytagname("div").item(0)); documentfragment = range.clonecontents(); document.body.appendchild(documentfragment); specifications specification status comment domthe definition of 'range.clonecontents()' in that specification.
... document object model (dom) level 2 traversal and range specificationthe definition of 'range.clonecontents()' in that specification.
Range.collapsed - Web APIs
WebAPIRangecollapsed
it returns true if the start and end boundary points of the range are the same point in the dom, false if not.
... a collapsed range is empty (containing no content), and specifies a single point in a dom tree.
... syntax iscollapsed = range.collapsed; example let range = document.createrange(); range.setstart(startnode, startoffset); range.setend(endnode, endoffset); iscollapsed = range.collapsed; specifications specification status comment domthe definition of 'range.collapsed' in that specification.
... document object model (dom) level 2 traversal and range specificationthe definition of 'range.collapsed' in that specification.
ReadableStream.ReadableStream() - Web APIs
the reason parameter contains a domstring describing why the stream was cancelled.
... examples in the following simple example, a custom readablestream is created using a constructor (see our simple random stream example for the full code).
... the start() function generates a random string of text every second and enqueues it into the stream.
... const stream = new readablestream({ start(controller) { interval = setinterval(() => { let string = randomchars(); // add the string to the stream controller.enqueue(string); // show it on the screen let listitem = document.createelement('li'); listitem.textcontent = string; list1.appendchild(listitem); }, 1000); button.addeventlistener('click', function() { clearinterval(interval); fetchstream(); controller.close(); }) }, pull(c...
SVGAElement - Web APIs
svgaelement.hreflang is a domstring that reflects the hreflang attribute, indicating the language of the linked resource.
... svgaelement.ping is a domstring that reflects the ping attribute, containing 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).
... svgaelement.text is a domstring being a synonym for the node.textcontent property.
... svgaelement.type is a domstring that reflects the type attribute, indicating the mime type of the linked resource.
SVGDocument - Web APIs
interface overview also implement none methods none properties domstring domain domstring referrer svgsvgelement rootelement domstring title domstring url normative document svg 1.1 (2nd edition) properties name type description ...
... domain domstring the domain name of the server that served the document, or a null string if the server cannot be identified by a domain name.
... referrer domstring returns the uri of the page that linked to this page.
... title domstring the title of a document as specified by the "title" sub-element of the "svg" root element (i.e., <svg><title>here is the title</title>...</svg>) url domstring the complete uri of the document.
SVGTextContentElement - Web APIs
svgtextcontentelement.getstartpositionofchar() returns a dompoint representing the position of a typographic character after text layout has been performed.
... svgtextcontentelement.getendpositionofchar() returns a dompoint representing the trailing position of a typographic character after text layout has been performed.
... svgtextcontentelement.getextentofchar() returns a domrect representing the computed tight bounding box of the glyph cell that corresponds to a given typographic character.
... candidate recommendation changed inheritance from svgelement to svggraphicselement and getstartpositionofchar() and removed implementations of svgtests, svglangspace, svgexternalresourcesrequired, svgstylable interfaces and getendpositionofchar() to return a dompoint instead of an svgpoint.
SecurityPolicyViolationEvent - Web APIs
securitypolicyviolationevent.effectivedirectiveread only a domstring representing the directive whose enforcement uncovered the violation.
... securitypolicyviolationevent.originalpolicyread only a domstring containing the policy whose enforcement uncovered the violation.
... securitypolicyviolationevent.sampleread only a domstring representing a sample of the resource that caused the violation, usually the first 40 characters.
... securitypolicyviolationevent.violateddirectiveread only a domstring representing the directive whose enforcement uncovered the violation.
Using Service Workers - Web APIs
if however you find that demo code is not working in your installed versions, you might need to enable a pref: firefox nightly: go to about:config and set dom.serviceworkers.enabled to true; restart browser.
... if successful, the service worker is executed in a serviceworkerglobalscope; this is basically a special kind of worker context, running off the main script execution thread, with no dom access.
... this registers a service worker, which runs in a worker context, and therefore has no dom access.
...this api works in a similar way to the browser’s standard cache, but it is specific to your domain.
ShadowRoot.host - Web APIs
WebAPIShadowRoothost
the host read-only property of the shadowroot returns a reference to the dom element the shadowroot is attached to.
... syntax const someelement = shadowroot.host value a dom element.
... examples let customelem = document.queryselector('my-shadow-dom-element'); let shadow = customelem.shadowroot; ...
... // return the original host element some time later let hostelem = shadow.host; specifications specification status comment domthe definition of 'shadowroot.host' in that specification.
StaticRange.StaticRange() - Web APIs
the staticrange() constructor creates a new staticrange object representing a span of content within the dom.
... exceptions invalidnodetypeerror a domexception fired if either or both of the startcontainer and/or endcontainer are a type of node which you can't include in a range.
... those node types are node.document_type_node (representing the documenttype node derived from the dtd identified using the doctype preamble in the html, for example) and the attr node describing an attribute of an element on the dom..
... specifications specification status comment domthe definition of 'staticrange()' in that specification.
TypeInfo - Web APIs
WebAPITypeInfo
the obsolete typeinfo interface was intended to be used to describe a dom data type by keying its name to a namespace within the document's schema.
... properties typeinfo.typename read only returns a domstring indicating the type's name.
... typeinfo.typenamespace read only returns a domstring indicating the type's namespace within the schema.
... constants constant value derivation_restriction 1 derivation_extension 2 derivation_union 4 derivation_list 8 specifications specification status comment document object model (dom) level 3 core specificationthe definition of 'typeinfo' in that specification.
UIEvent.cancelBubble - Web APIs
it is set to false by default, allowing the event to bubble up the dom, if it is a bubbleable event.
... setting this property to true stops the event from bubbling up the dom.
... not all events are allowed to bubble up the dom.
...although the similar event.cancelbubble property was included in an old working draft of w3c dom level 2.
UIEvent.initUIEvent() - Web APIs
syntax event.inituievent(type, canbubble, cancelable, view, detail) parameters type is a domstring defining the type of event.
... example var e = document.createevent("uievent"); // creates a click event that bubbles, can be cancelled, // and with its view and detail property initialized to window and 1, // respectively e.inituievent("click", true, true, window, 1); specifications specification status comment document object model (dom) level 3 events specificationthe definition of 'uievent.inituievent()' in that specification.
... obsolete from document object model (dom) level 2 events specification, deprecated.
... document object model (dom) level 2 events specificationthe definition of 'uievent.inituievent()' in that specification.
VideoTrack - Web APIs
id read only a domstring which uniquely identifies the track within the media.
... kind read only a domstring specifying the category into which the track falls.
... label read only a domstring providing a human-readable label for the track.
... language read only a domstring specifying the video track's primary language, or an empty string if unknown.
Geometry and reference spaces in WebXR - Web APIs
const radians_per_degree = math.pi / 180.0; let degreestoradians = (deg) => deg * radians_per_degree; let radianstodegrees = (rad) => rad / radians_per_degree; times and durations note that for security reasons, domhighrestimestamp usually introduces a small amount of imprecision to the clock in order to prevent it from being used in fingerprinting and timing-based attacks.
... all times and durations in webxr are measured using the domhighrestimestamp type, which is a double-precision floating-point value specifying the time in milliseconds relative to the starting time.
... for devices with six degrees of freedom (6dof) tracking, the local reference space tries to keep the origin stable relative to the environment.
... xrreferencespace unbounded a tracking space which allows the user total freedom of movement, possibly over extremely long distances from their origin point.
WheelEvent.deltaMode - Web APIs
permitted values are: constant value description dom_delta_pixel 0x00 the delta values are specified in pixels.
... dom_delta_line 0x01 the delta values are specified in lines.
... dom_delta_page 0x02 the delta values are specified in pages.
... syntax var unit = event.deltamode; example var syntheticevent = new wheelevent("syntheticwheel", {"deltax": 4, "deltamode": 0}); console.log(syntheticevent.deltamode); specifications specification status comment document object model (dom) level 3 events specificationthe definition of 'wheelevent.deltamode' in that specification.
WheelEvent - Web APIs
permitted values are: constant value description wheelevent.dom_delta_pixel 0x00 the delta* values are specified in pixels.
... wheelevent.dom_delta_line 0x01 the delta* values are specified in lines.
... wheelevent.dom_delta_page 0x02 the delta* values are specified in pages.
... working draft document object model (dom) level 3 events specificationthe definition of 'wheelevent' in that specification.
Window.crypto - Web APIs
WebAPIWindowcrypto
although window.crypto is available on all windows, the returned crypto object only has one usable feature in insecure contexts: the getrandomvalues() method.
... syntax var cryptoobj = window.crypto || window.mscrypto; // for ie 11 value an instance of the crypto interface, providing access to general-purpose cryptography and a strong random-number generator.
... example this example uses the window.crypto property to access the getrandomvalues() method.
... javascript genrandomnumbers = function getrandomnumbers() { var array = new uint32array(10); window.crypto.getrandomvalues(array); var randtext = document.getelementbyid("myrandtext"); randtext.innerhtml = "the random numbers are: " for (var i = 0; i < array.length; i++) { randtext.innerhtml += array[i] + " "; } } html <p id="myrandtext">the random numbers are: </p> <button type="button" onclick='genrandomnumbers()'>generate 10 random numbers</button> result specifications specification status comment web cryptography apithe definition of 'window.crypto' in that specification.
Window.customElements - Web APIs
schrome full support 54edge full support 79firefox full support 63 full support 63 no support 59 — 63disabled disabled from version 59 until version 63 (exclusive): this feature is behind the dom.webcomponents.customelements.enabled preference (needs to be set to true).
...— 59disabled disabled until version 59 (exclusive): this feature is behind the dom.webcomponents.enabled preference (needs to be set to true) and the dom.webcomponents.customelements.enabled preference (needs to be set to true).
... full support 54chrome android full support 54firefox android full support 63 full support 63 no support 59 — 63disabled disabled from version 59 until version 63 (exclusive): this feature is behind the dom.webcomponents.customelements.enabled preference (needs to be set to true).
...— 59disabled disabled until version 59 (exclusive): this feature is behind the dom.webcomponents.enabled preference (needs to be set to true) and the dom.webcomponents.customelements.enabled preference (needs to be set to true).
WindowEventHandlers.onhashchange - Web APIs
function hashhandler() { console.log('the hash has changed!'); } window.addeventlistener('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) ?
... 'location1' : 'location2'; } the hashchange event the dispatched hashchange event has the following properties: 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
ficate, ssl(4) errname = 'securitybadcertificateerror'; break; case 8: // ssl_error_unsupported_certificate_type, ssl(8) errname = 'securityunsupportedcertificatetypeerror'; break; case 9: // ssl_error_unsupported_version, ssl(9) errname = 'securityunsupportedtlsversionerror'; break; case 12: // ssl_error_bad_cert_domain, ssl(12) errname = 'securitycertificatedomainmismatcherror'; break; default: errname = 'securityerror'; break; } } } else { errtype = 'network'; switch (status) { // connect to host:port failed case 0x804b000c: // ns_error_connection_refused, network(13) errname = 'connectionrefusederror'; break; ...
... // network timeout error case 0x804b000e: // ns_error_net_timeout, network(14) errname = 'networktimeouterror'; break; // hostname lookup failed case 0x804b001e: // ns_error_unknown_host, network(30) errname = 'domainnotfounderror'; break; case 0x804b0047: // ns_error_net_interrupt, network(71) errname = 'networkinterrupterror'; break; default: errname = 'networkerror'; break; } } // xxx we have no tcperror implementation right now because it's really hard to // do on b2g18.
... on mozilla-central we want a proper tcperror that ideally // sub-classes domerror.
... let error = cc["@mozilla.org/dom-error;1"].createinstance(ci.nsidomdomerror); error.wrappedjsobject.init(errname); return error; // xxx: errtype goes unused } function dumpsecurityinfo(xhr, error) { let channel = xhr.channel; try { dump("connection status:\n"); if (!error) { dump("\tsucceeded\n"); } else { dump("\tfailed: " + error.name + "\n"); } let secinfo = channel.securityinfo; // print general connection security state dump("security information:\n"); if (secinfo instanceof ci.nsitransportsecurityinfo) { secinfo.queryinterface(ci.ns...
XMLSerializer.serializeToString() - Web APIs
the xmlserializer method serializetostring() constructs a string representing the specified dom tree in xml form.
... syntax xmlstring = anxmlserializer.serializetostring(rootnode); parameters rootnode the node to use as the root of the dom tree or subtree for which to construct an xml representation.
... return value a domstring containing the xml representation of the specified dom tree.
... specifications specification status comment dom parsing and serializationthe definition of 'serializetostring()' in that specification.
XPathExpression.evaluate() - Web APIs
namespace_err if the expression contains namespace prefixes which cannot be resolved by the specified xpathnsresolver, a domexception of type namespace_error is raised.
... wrong_document_err if the provided context node is from a document that is not supported by the xpathevaluator, a domexception of type wrong_document_err is raised.
... not_supported_err if the provided context node is not a type permitted as an xpath context node or the request type is not permitted by the xpathevaluator, a domexception of type not_supported_err is raised.
.../output></div> javascript var xpath = "//div"; var evaluator = new xpathevaluator(); var expression = evaluator.createexpression("//div"); var result = expression.evaluate(document, xpathresult.ordered_node_snapshot_type); document.queryselector("output").textcontent = result.snapshotlength; result specifications specification status comment document object model (dom) level 3 xpath specificationthe definition of 'xpathexpression.evaluate()' in that specification.
XRSession.requestReferenceSpace() - Web APIs
syntax refspacepromise = xrsession.requestreferencespace(referencespacetype); parameters type a domstring specifying the type of reference space for which an instance is to be returned.
... for devices with six degrees of freedom (6dof) tracking, the local reference space tries to keep the origin stable relative to the environment.
... xrreferencespace unbounded a tracking space which allows the user total freedom of movement, possibly over extremely long distances from their origin point.
... 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.
Web APIs
WebAPI
aambient light eventsbbackground tasksbattery api beaconbluetooth apibroadcast channel apiccss counter stylescss font loading api cssomcanvas apichannel messaging apiconsole apicredential management apiddomeencoding apiencrypted media extensionsffetch apifile system api frame timing apifullscreen apiggamepad api geolocation apihhtml drag and drop apihigh resolution timehistory apiiimage capture apiindexeddbintersection observer apillong tasks api mmedia capabilities api media capture and streamsmedia session apimedia source extensions mediastream recordingnnavigation timingnetwork information a...
...svalue cssvaluelist cssvariablereferencevalue cache cachestorage canvascapturemediastreamtrack canvasgradient canvasimagesource canvaspattern canvasrenderingcontext2d caretposition channelmergernode channelsplitternode characterdata childnode client clients clipboard clipboardevent clipboarditem closeevent comment compositionevent constantsourcenode constrainboolean constraindomstring constraindouble constrainulong contentindex contentindexevent convolvernode countqueuingstrategy crashreportbody credential credentialscontainer crypto cryptokey cryptokeypair customelementregistry customevent d domconfiguration domerror domexception domhighrestimestamp domimplementation domimplementationlist domlocator dommatrix dommatrixreadonly domobject domparser ...
...dompoint dompointinit dompointreadonly domquad domrect domrectreadonly domstring domstringlist domstringmap domtimestamp domtokenlist domuserdata datatransfer datatransferitem datatransferitemlist dedicatedworkerglobalscope delaynode deprecationreportbody devicelightevent devicemotionevent devicemotioneventacceleration devicemotioneventrotationrate deviceorientationevent deviceproximityevent directoryentrysync directoryreadersync displaymediastreamconstraints document documentfragment documentorshadowroot documenttimeline documenttouch documenttype doublerange dragevent dynamicscompressornode e ext_blend_minmax ext_color_buffer_float ext_color_buffer_half_float ext_disjoint_timer_query ext_float_blend ext_frag_depth ext_srgb ext_shader_texture_lod ext_texture_compression_bp...
...bglsampler webglshader webglshaderprecisionformat webglsync webgltexture webgltransformfeedback webgluniformlocation webglvertexarrayobject webkitcssmatrix websocket wheelevent window windowclient windoweventhandlers windoworworkerglobalscope worker workerglobalscope workerlocation workernavigator worklet writablestream writablestreamdefaultcontroller writablestreamdefaultwriter x xdomainrequest xmldocument xmlhttprequest xmlhttprequesteventtarget xmlhttprequestresponsetype xmlserializer xpathevaluator xpathexception xpathexpression xpathnsresolver xpathresult xrboundedreferencespace xrenvironmentblendmode xreye xrframe xrframerequestcallback xrhandedness xrinputsource xrinputsourcearray xrinputsourceevent xrinputsourceeventinit xrinputsourceschangeevent xrinputsourceschang...
:host() - CSS: Cascading Style Sheets
WebCSS:host()
the :host() css pseudo-class function selects the shadow host of the shadow dom containing the css it is used inside (so you can select a custom element from inside its shadow dom) — but only if the selector given as the function's parameter matches the shadow host.
... note: this has no effect when used outside a shadow dom.
...)chrome full support 54edge full support 79firefox full support 63 full support 63 no support 61 — 63disabled disabled from version 61 until version 63 (exclusive): this feature is behind the dom.webcomponents.shadowdom.enabled preference (needs to be set to true).
... full support 54chrome android full support 54firefox android full support 63 full support 63 no support 61 — 63disabled disabled from version 61 until version 63 (exclusive): this feature is behind the dom.webcomponents.shadowdom.enabled preference (needs to be set to true).
:host - CSS: Cascading Style Sheets
WebCSS:host
the :host css pseudo-class selects the shadow host of the shadow dom containing the css it is used inside — in other words, this allows you to select a custom element from inside its shadow dom.
... note: this has no effect when used outside a shadow dom.
...tchrome full support 54edge full support 79firefox full support 63 full support 63 no support 61 — 63disabled disabled from version 61 until version 63 (exclusive): this feature is behind the dom.webcomponents.shadowdom.enabled preference (needs to be set to true).
... full support 54chrome android full support 54firefox android full support 63 full support 63 no support 61 — 63disabled disabled from version 61 until version 63 (exclusive): this feature is behind the dom.webcomponents.shadowdom.enabled preference (needs to be set to true).
Auto-placement in CSS Grid Layout - CSS: Cascading Style Sheets
this means that if you have used the order property at all, the items will be placed by that order, not their dom order.
...the auto-placed items will place themselves before the placed items in dom order, they don’t start after the position of a placed item that comes before them.
...px; } .wrapper div:nth-child(4n+1) { grid-column-end: span 2; grid-row-end: span 2; background-color: #ffa94d; } .wrapper div:nth-child(2) { grid-column: 3; grid-row: 2 / 4; } .wrapper div:nth-child(5) { grid-column: 1 / 3; grid-row: 1 / 3; } filling in the gaps so far, other than items we have specifically placed, grid is always progressing forward and keeping items in dom order.
... having done this, grid will now backfill the gaps, as it moves through the grid it leaves gaps as before, but then if it finds an item that will fit in a previous gap it will pick it up and take it out of dom order to place it in the gap.
CSS reference - CSS: Cascading Style Sheets
WebCSSReference
also included is a brief dom-css / cssom reference.
...note that css rule definitions are entirely (ascii) text-based, whereas dom-css / cssom (the rule management system) is object-based.
...face)unset<url>url()user-zoom (@viewport)v:validvar()vertical-alignvh@viewportviewport-fit (@viewport)visibility:visitedvmaxvminvwwwhite-spacewidowswidthwidth (@viewport)will-changeword-breakword-spacingword-wrapwriting-modexxzz-indexzoom (@viewport)others--* selectors the following are the various selectors, which allow styles to be conditional based on various features of elements within the dom.
...-rules cascade comments descriptor inheritance shorthand properties specificity value definition syntax css unit and value types values actual value computed value initial value resolved value specified value used value layout block formatting context box model containing block layout mode margin collapsing replaced elements stacking context visual formatting model dom-css / cssom major object types documentorshadowroot.stylesheets stylesheets[i].cssrules cssrules[i].csstext (selector & style) cssrules[i].selectortext htmlelement.style htmlelement.style.csstext (just style) element.classname element.classlist important methods cssstylesheet.insertrule() cssstylesheet.deleterule() ...
Event developer guide - Developer guides
WebGuideEvents
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 addeventlistener() 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 movements that can be made with a mouse or trackpad and can be interpreted to perform specific tasks.mutation eventsmutation events provide a mechanism for a web page or an extension to get notified about changes made to the dom.
HTML5 Parser - Developer guides
WebGuideHTMLHTML5HTML5 Parser
the html5 specification provides a more detailed description than previous html standards of how to turn a stream of bytes into a dom tree.
... <svg>…</svg> is assigned to the svg namespace in the dom.
... <math>…</math> is assigned to the mathml namespace in the dom.
... the dom methods and css selectors behave case-sensitively, so you need to write your dom calls and css selectors using the canonical case, which is camelcase for various parts of svg such as viewbox.
<input type="email"> - HTML: Hypertext Markup Language
WebHTMLElementinputemail
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 automatic...
...in simple terms, this means username@domain or username@domain.tld.
... note: there are known specification issues related to international domain names and the validation of e-mail addresses in html.
...this simple regular expression requests a string that consists of at least one character of any kind, then an "@" followed by the domain name "beststartupever.com".
<input>: The Input (Form Input) element - HTML: Hypertext Markup Language
WebHTMLElementinput
note: an element with the autofocus attribute may gain focus before the domcontentloaded event is fired.
... methods the following methods are provided by the htmlinputelement interface which represents <input> elements in the dom.
... for the input types whose domain of possible values is periodic (that is, at the highest possible value, the values wrap back around to the beginning rather than ending), it's possible for the values of the max and min properties to be reversed, which indicates that the range of permitted values starts at min, wraps around to the lowest possible value, then continues on until max is reached.
... menuitemcheckbox, option, switch type=image: link, menuitem, menuitemcheckbox, menuitemradio, radio, switch type=radio: menuitemradio type=text with no list attribute: combobox, searchbox, spinbutton type=color|date|datetime|datetime-local|email|file|hidden|month|number|password|range|reset|search|submit|tel|url|week or text with list attribute: no role permitted dom interface htmlinputelement specifications specification status comment html living standardthe definition of '<input>' in that specification.
Public-Key-Pins-Report-Only - HTTP
header type response header forbidden header name no syntax public-key-pins-report-only: pin-sha256="<pin-value>"; max-age=<expire-time>; includesubdomains; report-uri="<uri>" directives pin-sha256="<pin-value>" the quoted string is the base64 encoded subject public key information (spki) fingerprint.
... includesubdomains optional if this optional parameter is specified, this rule applies to all of the site's subdomains as well.
... example public-key-pins-report-only: pin-sha256="cupctazwkaasuywhhnedttwpy3obake3h2+sozs7sws="; pin-sha256="m8hztczm3eluxkcjr2s5p4hhybnf6lhkmjahkhpgpwe="; includesubdomains; report-uri="https://www.example.org/hpkp-report" in this example, pin-sha256="cupctazwkaasuywhhnedttwpy3obake3h2+sozs7sws=" pins the server's public key used in production.
...this key pinning is also valid for all subdomains, which is told by the includesubdomains declaration.
Public-Key-Pins - HTTP
header type response header forbidden header name no syntax public-key-pins: pin-sha256="<pin-value>"; max-age=<expire-time>; includesubdomains; report-uri="<uri>" directives pin-sha256="<pin-value>" the quoted string is the base64 encoded subject public key information (spki) fingerprint.
... includesubdomains optional if this optional parameter is specified, this rule applies to all of the site's subdomains as well.
... public-key-pins: pin-sha256="cupctazwkaasuywhhnedttwpy3obake3h2+sozs7sws="; pin-sha256="m8hztczm3eluxkcjr2s5p4hhybnf6lhkmjahkhpgpwe="; max-age=5184000; includesubdomains; report-uri="https://www.example.org/hpkp-report" in this example, pin-sha256="cupctazwkaasuywhhnedttwpy3obake3h2+sozs7sws=" pins the server's public key used in production.
...this key pinning is also valid for all subdomains, which is told by the includesubdomains declaration.
Introduction - JavaScript
core javascript can be extended for a variety of purposes by supplementing it with additional objects; for example: client-side javascript extends the core language by supplying objects to control a browser and its document object model (dom).
... this means that in the browser, javascript can change the way the webpage (dom) looks.
...the ecmascript specification does not describe the document object model (dom), which is standardized by the world wide web consortium (w3c) and/or whatwg (web hypertext application technology working group).
... the dom defines the way in which html document objects are exposed to your script.
TypeError: can't access dead object - JavaScript
the javascript exception "can't access dead object" occurs when firefox disallows add-ons to keep strong references to dom objects after their parent document has been destroyed to improve in memory usage and to prevent memory leaks.
... to improve in memory usage and to prevent memory leaks, firefox disallows add-ons to keep strong references to dom objects after their parent document has been destroyed.
... a dead object, is holding a strong (keep alive) reference to a dom element that persists even after it was destroyed in the dom.
... to avoid these issues, references to dom nodes in foreign document should 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.
Performance fundamentals - Web Performance
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.
... keep your interface simple one big performance issue we found in html5 apps was that moving lots of dom elements around makes everything sluggish — especially when they feature lots of gradients and drop shadows.
...instead, keep in your dom tree only the ones that are visible and a few on either side of the currently visible set of tweets.
...keeping the data in a javascript object instead of accessing the dom can vastly improve your app's performance.
Web Performance
optimizing the critical render path improves render performance.the critical rendering path includes the document object model (dom), css object model (cssom), render tree and layout.css and javascript animation performancebrowsers are able to optimize rendering flows.
...this article explains what latency is, how it impacts performance, how to measure latency, and how to reduce it.using dns-prefetchdns-prefetch is an attempt to resolve domain names before resources get requested.
...by minimizing the number of dom nodes, making sure the best order and attributes are used for including content such as styles, scripts, media, and third-party scripts, you can drastically improve the user experience.
... glossary terms beacon brotli compression client hints code splitting cssom domain sharding effective connection type first contentful paint first cpu idle first input delay first interactive first meaningful paint first paint http http/2 jank latency lazy load long task lossless compression lossy compression main thread minification network throttling packet page load time page prediction parse perceived performance prefetch prerender quic rail r...
SVG 2 support in Mozilla - SVG: Scalable Vector Graphics
ge notes svg root and <foreignobject> not overflow:hidden in ua style sheet implementation status unknown allow overflow: auto; to clip and show scroll bars implementation status unknown allow overflow: scroll; to show scroll bars on <svg> elements implementation status unknown basic data types and interfaces change notes dommatrix or dommatrixreadonly instead of svgmatrix implementation status unknown domrect or domrectreadonly instead of svgrect implementation status unknown dompoint or dompointreadonly instead of svgpoint implementation status unknown members of svgstylable and svglangspace available in svgelement implementation status unknown svggraphicselement inste...
...s transforms on outermost <svg> not affecting svgsvgelement.currentscale or svgsvgelement.currenttranslate implementation status unknown rootelement attribute deprecated implementation status unknown svgelementinstance and svgelementinstancelist and corresponding attributes on svguseelement removed implementation status unknown <use> event flow following shadow dom spec.
... unknown reorder descendent elements of <switch> having systemlanguage attribute according to allowreorder smil attribute implementation status unknown made <tspan> and <textpath> graphics elements implementation status unknown allow x, y, width, and height on <symbol> implementation status unknown made <use> element shadow trees consistent with shadow dom spec implementation status unknown role mapping of <a> element depending on whether it is a valid link implementation status unknown aria state and property attributes animatable implementation status unknown styling change notes contentstyletype attribute removed implementation status unknown linkstyle on svgstyleelement ...
...pointer-events not implemented (bug 945187) load, abort, error, and unload instead of svgload, svgabort, svgerror, and svgunload not implemented (bug 620002) only structurally external elements and outermost <svg> element fire load events implementation status unknown resize and scroll instead of svgresize and svgscroll implementation status unknown domactivate removed implementation status unknown focusin and focusout instead of domfocusin and domfocusout implementation status unknown keyboard events implementation status unknown mutation events removed implementation status unknown svgzoomevent removed implementation status unknown <cursor> element deprecated implementation status ...
Porting the Library Detector - Archive of obsolete content
the script listens to gbrowser's domcontentloaded event.
... content script separation the test objects in the original script need access to the dom window object, so in the sdk port, they need to run in a content script.
... in fact, they need access to the un-proxied dom window, so they can see the objects added by libraries, so we’ll need to use the experimental unsafewindow.
Two Types of Scripts - Archive of obsolete content
on the web, javascript executes in the context of a web page, and has access to that page's dom content.
... this enables you to call functions like: window.alert("hello there"); in an add-on's main scripts you can't do that, because the add-on code does not execute in the context of a page, and the dom is therefore not available.
... if you need to access the dom of a particular page, you need to use a content script.
panel - Archive of obsolete content
panel = sdkpanels.panel({ contenturl: self.data.url("panel.html"), onhide: handlehide }); function handlechange(state) { if (state.checked) { mypanel.show({ position: button }); } } function handlehide() { button.state('window', {checked: false}); } updating panel content you can update the panel's content by: sending a message to a content script that updates the dom in the same document.
...this may take one of the following values: "start": load content scripts immediately after the document element for the panel is inserted into the dom, but before the dom content itself has been loaded "ready": load content scripts once dom content has been loaded, corresponding to the domcontentloaded event "end": load content scripts once all the content (dom, js, css, images) for the panel has been loaded, at the time the window.onload event fires this property is optional and defaults to "end".
...this may have one of the following values: "start": load content scripts immediately after the document element for the panel is inserted into the dom, but before the dom content itself has been loaded "ready": load content scripts once dom content has been loaded, corresponding to the domcontentloaded event "end": load content scripts once all the content (dom, js, css, images) for the panel has been loaded, at the time the window.onload event fires contentscriptoptions read-only value exposed to content scripts under addon.options proper...
url - Archive of obsolete content
gettld(url) returns the top-level domain for the given url: that is, the highest-level domain under which individual domains may be registered.
... returns string : the top-level domain for the url.
...for example: var url = require("sdk/url").url("https://developer.mozilla.org/add-ons?example=true&visible=yes#top"); console.log(url.path); // /add-ons?example=true&visible=yes#top hostname the domain of the url, as a string.
widget - Archive of obsolete content
this may take one of the following values: "start": load content scripts immediately after the document element for the widget is inserted into the dom, but before the dom content itself has been loaded "ready": load content scripts once dom content has been loaded, corresponding to the domcontentloaded event "end": load content scripts once all the content (dom, js, css, images) for the widget has been loaded, at the time the window.onload event fires this property is optional and defaults to "end".
...this may have one of the following values: "start": load content scripts immediately after the document element for the widget is inserted into the dom, but before the dom content itself has been loaded "ready": load content scripts once dom content has been loaded, corresponding to the domcontentloaded event "end": load content scripts once all the content (dom, js, css, images) for the widget has been loaded, at the time the window.onload event fires contentscriptoptions read-only value exposed to content scripts under self.options proper...
...this may have one of the following values: "start": load content scripts immediately after the document element for the widget view is inserted into the dom, but before the dom content itself has been loaded "ready": load content scripts once dom content has been loaded, corresponding to the domcontentloaded event "end": load content scripts once all the content (dom, js, css, images) for the widget view has been loaded, at the time the window.onload event fires contentscriptoptions read-only value exposed to content scripts under self.options p...
core/namespace - Archive of obsolete content
let { ns } = require('sdk/core/namespace'); let anamespace = ns(); anamespace(publicapi).secret = secret; one namespace may be used with multiple objects: let { ns } = require('sdk/core/namespace'); let dom = ns(); function view(element) { let view = object.create(view.prototype); dom(view).element = element; // ....
... } view.prototype.destroy = function destroy() { let { element } = dom(this); element.parentnode.removechild(element); // ...
... let { dom } = require('./view'); widget.prototype.setinnerhtml = function setinnerhtml(html) { dom(this).element.innerhtml = string(html); }; ...
frame/hidden-frame - Archive of obsolete content
the following code creates a hidden frame, loads a web page into it, and then logs its title: var hiddenframes = require("sdk/frame/hidden-frame"); let hiddenframe = hiddenframes.add(hiddenframes.hiddenframe({ onready: function() { this.element.contentwindow.location = "http://www.mozilla.org/"; let self = this; this.element.addeventlistener("domcontentloaded", function() { console.log(self.element.contentdocument.title); }, true, true); } })); see the panel module for a real-world example of usage of this module.
... events ready this event is emitted when the dom for a hidden frame content is ready.
... it is equivalent to the domcontentloaded event for the content page in a hidden frame.
package.json - Archive of obsolete content
defaults to a random guid generated by cfx.
... 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.
URI parsing - Archive of obsolete content
grabbing the main domain using the effectivetldservice even using the etldservice, you're unable to get just the base domain sans tld.
... so, here's some sample code to determine the base domain without any suffixes: var etldservice = components.classes["@mozilla.org/network/effective-tld-service;1"].
... getservice(components.interfaces.nsieffectivetldservice); var suffix = etldservice.getpublicsuffix(auri); var basedomain = etldservice.getbasedomain(auri); // this includes the tld basedomain = basedomain.substr(0, (basedomain.length - suffix.length - 1)); // - 1 to remove the period before the tld ...
Appendix: What you should know about open-source software licenses - Archive of obsolete content
and essential freedoms, such as reverse-engineering, are also restricted.
...the ordinary general public license therefore permits such linking only if the entire combination fits its criteria of freedom.
... so oss gives you the freedom to duplicate, distribute, and modify source code, but if you want to contribute those modifications back to the core project, the project’s acceptance is an entirely different matter.
Chapter 3: Introduction to XUL—How to build a more intuitive UI - Archive of obsolete content
because a xul document is also an xml document, it can contain xhtml, svg, mathml, and other elements; if you use external entity 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.
...so when changing the attribute’s value using a dom function for example, do not use setattribute('disabled', false) — instead, use removeattribute('disabled').
... <menuitem label="open project page" oncommand="loaduri(this.value)" value="http://mozilla.org/"/> listing 10: the oncommand event handler because the gecko engine implements dom level 2 event handlers, you can define dynamic event listeners such as the one in listing 11.
Chapter 4: Using XPCOM—Implementing advanced processes - Archive of obsolete content
each component is identified with a contract id in the form @domain_name/module_name/component_name;version_number, and implements one or more interfaces that determine what functions can be called on these components.
...on windows vista, it will be located at c:\users\username\appdata\roaming\mozilla\firefox\profiles\random number.default\ ; on windows xp or 2000, it will be c:\documents and settings\username\application data\mozilla\firefox\profiles\random number.default\ ; on linux, it will be ~/.mozilla/firefox/random number.default/ ; on mac os x, it will be ~/library/application support/firefox/profiles/random number.default/ in the interests of security, delete these lines from prefs.js after finishing these ...
... listing 5: closing all browser windows var browsers = windowmediator.getenumerator('navigator:browser'); var browser; while (browsers.hasmoreelements()) { browser = browsers.getnext().queryinterface(components.interfaces.nsidomwindowinternal); browser.browsertrytoclosewindow(); } this method returns an overview of the specified window type in the form of an iterator pattern object called nsisimpleenumerator.
The Essentials of an Extension - Archive of obsolete content
one is the email-like format in the hello world example, which should be something like <project-name>@<yourdomain>.
... just like in regular js, we can use the dom (document object model) in order to manipulate the xul document.
...if you request the label attribute value for the hello world menu using dom, you get the localized string, not the string key.
MozAudioAvailable - Archive of obsolete content
general info specification dom l3 interface event bubbles no cancelable no target element default action none.
... properties property type description target read only eventtarget the event target (the topmost target in the dom tree).
... type read only domstring the type of event.
List of Mozilla-Based Applications - Archive of obsolete content
jt suite print process software uses xulrunner and spidermonkey prism (was webrunner) single-site browser xulrunner application pro/engineer wildfire cadcam product psycrunner chat, messenger, multicast toolkit about 1,000 users – xulrunner version of psyczilla extension pyjamas-desktop a python web widget toolkit uses xulrunner dom to implement the widgets and event handling.
... python-hulahop is required python-hulahop a python gtk widget uses embedded xulrunner, providing full access to nsi dom and all other xulrunner interfaces, in a gtk window.
... stealthsurfer secure internet tools on usb key uses firefox and thunderbird streambase complex event processing platform seems to use xulrunner stylizer css editor css editor css editor with built-in firebug-like diagnostics and gecko 1.8 preview sun java enterprise system server products uses nss sundial browser with advanced domain name technology based on firefox surfeasy private and secure web browsing sweet16 apple ii computer emulator uses spidermonkey as a scriptable debugger for software running in the emulator mozilla sunbird/mozilla lightning calendar tabpress authoring tool talend open studo data integration software seems to use xu...
MMgc - Archive of obsolete content
in whatever random order the gc decides to destroy objects.
...with a conservative gc, the leaks tend to be random, such that they don't grow over time.
... the occasional random leak from a false positive can be ok.
Source code directories overview - Archive of obsolete content
content was split off from layout and contains objects as they are exposed to the dom.
... dom contains c interfaces and code for implementing and tracking dom (document object model) objects in javascript.
...these include: cookies, irc, wallet, dom inspector, p3p, schema validation, spellchecker, transformiix, typeaheadfind, javascript debugger, xforms, etc.
Using XML Data Islands in Mozilla - Archive of obsolete content
ttp://example.mozilla.org/purchaseorderml"> <lineitem> <name>line item 1</name> <price>1.25</price> </lineitem> <lineitem> <name>line item 2</name> <price>2.48</price> </lineitem> </purchaseorder> </script> the xml source text can then be retrieved like this: var ordersource = document.getelementbyid("purchase-order").textcontent; the xml source text can be parsed into a dom tree using the domparser api: var parser = new domparser(); var doc = parser.parsefromstring(ordersource, "application/xml"); the html5 data block-based way shown here works in firefox, opera, webkit-based browsers such as chrome and safari, and ie9 while ie's xml data islands work only in ie.
...pe="application/xml"> <purchaseorder xmlns="http://example.mozilla.org/purchaseorderml"> <lineitem> <name>line item 1</name> <price>1.25</price> </lineitem> <lineitem> <name>line item 2</name> <price>2.48</price> </lineitem> </purchaseorder> </script> <script> function rundemo() { var ordersource = document.getelementbyid("purchase-order").textcontent; var parser = new domparser(); var doc = parser.parsefromstring(ordersource, "application/xml"); var lineitems = doc.getelementsbytagnamens("http://example.mozilla.org/purchaseorderml", "lineitem"); var firstprice = lineitems[0].getelementsbytagnamens("http://example.mozilla.org/purchaseorderml", "price")[0].textcontent; document.body.textcontent = "the purchase order contains " + lineitems.length + " line ite...
...the price of the first line item is " + firstprice + "."; } </script> </head> <body onload="rundemo()";> demo did not run </body> </html> the xml source text can be parsed into a dom tree using the domparser api: var parser = new domparser(); var doc = parser.parsefromstring(ordersource, "application/xml"); the html5 data block-based way shown here works in firefox, opera, webkit-based browsers such as chrome and safari, and ie9 while ie's xml data islands work only in ie.
Tuning Pageload - Archive of obsolete content
in particular, the way things work right now is that the parser and content sink construct the dom; then every so often, the content sink lets the rendering model constructor (nscssframeconstructor) know that there are new dom nodes.
... the reason for this is that nscssframeconstructor is most efficient when doing a bunch of stuff at once instead of constructing rendering objects for one dom node at a time.
...it's also really a bug per the dom spec and we should stop doing it...
Node - Archive of obsolete content
ArchiveMozillaXULNode
summary this is a scriptable interface corresponding to the nsidomnode xpcom interface.
... constants the nsidomnode interface is the primary datatype for the entire document object model.
...for more information on this interface please see dom-level-2-core short element_node 1 short attribute_node 2 short text_node 3 short cdata_section_node 4 short entity_reference_node 5 short entity_node 6 short processing_instruction_node 7 short comment_node 8 short document_node 9 short document_type_node 10 short document_fragment_node 11 short notation_node 12 methods node appendchild ( node newchild ) node clonenode ( boolean deep ) boolean hasattributes ( ) boolean haschildnodes ( ) node insertbefore ( node newchild , node refchild ) boolean issupported ( string feature , string version ) void normalize ( ) node removechild ( node oldchild ) node replacechild ( node newchild , node oldchild ) ...
Rule Compilation - Archive of obsolete content
this means that you can change the rules using dom methods, rebuild the template, and get different results.
...calling a dom api which needs to get at the generated content will cause the template builder to generate output.
...however, it also means that the dom api usage, such as an attempt to get the number of child nodes as above, will also not include generated items until the menu is opened.
Custom toolbar button - Archive of obsolete content
create a new extension id, in the form: something@domain-name it must contain an at-sign (@), making it look something like an e-mail address, but it does not need to be a real e-mail address.
...if you do not own a domain name, you can make up something else.
... if you want to make it clear that your made-up name is not a real domain, add .invalid to the end.
Adding Methods to XBL-defined Elements - Archive of obsolete content
these elements are created anonymously and are not accessible from the regular dom functions.
...to get elements below that, you can use the regular dom functions because they aren't hidden.
...for example: xul: <box id="outer" class="container"> <button label="one"/> <button label="two"/> <button label="three"/> <button label="four"/> </box> xbl: <binding id="labeledbutton"> <content> <description value="a stack:"/> <stack> <children/> </stack> </content> </binding> if you use the dom functions such as childnodes to get the children of the the xul box element with the id of outer, you willl find that it has has 4 children.
Adding Properties to XBL-defined Elements - Archive of obsolete content
the xbl interface javascript and the dom provide access to get and set the properties of elements.
...the example below creates a button which generates and stores a random number.
...xul: <box id="random-box" class="randomizer"/> <button label="generate" oncommand="document.getelementbyid('random-box').number=math.random();"/> <button label="show" oncommand="alert(document.getelementbyid('random-box').number)"/> xbl: <binding id="randomizer"> <implementation> <field name="number"/> </implementation> </binding> a number field has been defined in the binding, which stores the random number.
Modifying a XUL Interface - Archive of obsolete content
« previousnext » the dom provides various functions to modify the document.
... note: if you're creating the checkbox dynamically and it's not yet added to the dom, you must use setattribute("checked", "false") instead, because the xbl isn't initiated yet.) example 6 : source view <button label="change" oncommand="this.nextsibling.checked = !this.nextsibling.checked;"/> <checkbox label="check for messages"/> radio buttons may be selected as well using properties, however since only one in a group may be selected at a time, the others must all be unchecked ...
...example 7 : source view <script> function updatestate(){ var name = document.getelementbyid("name"); var sindex = document.getelementbyid("group").selectedindex; name.disabled = sindex == 0; } </script> <radiogroup id="group" onselect="updatestate();"> <radio label="random name" selected="true"/> <hbox> <radio label="specify a name:"/> <textbox id="name" value="jim" disabled="true"/> </hbox> </radiogroup> in this example a function updatestate() is called whenever a select event is fired on the radio group.
XUL element attributes - Archive of obsolete content
when the xul document is contained on a remote web site, the datasources may only be loaded from the same domain as the document.
...this results in a performance enhancement, but you will not be able to use the dom functions to retrieve the tree rows.
...you can use this as a parameter to getelementbyid() and other dom functions and to reference the element in style sheets.
XUL Event Propagation - Archive of obsolete content
any xul element may use the dom addeventlistener method to register itself to capture events.
... note: the dom provides the addeventlistener method for creating event listeners on nodes that do not otherwise supply them.
... original author: ian oeschger other documents: w3c dom events, mozilla xul events original document information author(s): ian oeschger last updated date: january 18, 2002 copyright information: copyright (c) ian oeschger ...
menupopup - Archive of obsolete content
anchornode type: nsidomelement this read-only property holds the dom node that was specified as the anchor when opening the popup.
... triggernode type: nsidomnode this read-only property holds the dom node that generated the event triggering the opening of the popup.
... related elements menu, menubar, menuitem, menulist, menuseparator interfaces nsiaccessibleprovider, nsidomxulpopupelement ...
preference - Archive of obsolete content
type getelementvalue(in domelement element); retrieves the value that should be written to preferences based on the current state of the supplied element.
... boolean iselementeditable(in domelement element) returns true, if the given element is "editable" (see below).
... void setelementvalue(in domelement element); initializes the supplied element from the value stored in the preference.
window - Archive of obsolete content
you can use this as a parameter to getelementbyid() and other dom functions and to reference the element in style sheets.
...listen to the sizemodechange event dispatched to the dom window to get notified when the window state changes.
... haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata see also: dom window object methods note the error message "xml parsing error: undefined entity...<window" can be caused by a missing or unreachable dtd file referenced in the xul file.
Building XULRunner with Python - Archive of obsolete content
or, if you are interested in working with xulrunner with python on linux, see mark lise's post with the python extensions enabled xulrunner provides python script access to the dom and xpcom in addition to the usual java script.
... using python in xul applications add the following to yourprefs.js during development pref("browser.dom.window.dump.enabled", true); pref("javascript.options.showinconsole", true); pref("javascript.options.strict", true); pref("nglayout.debug.disable_xul_cache", true); pref("nglayout.debug.disable_xul_fastload", true); html <script> tags specify that python is used withtype="application/x-python" attribute.
... dom scripting is pretty much as with java script.
Debugging a XULRunner Application - Archive of obsolete content
/* debugging prefs */ pref("browser.dom.window.dump.enabled", true); pref("javascript.options.showinconsole", true); pref("javascript.options.strict", true); pref("nglayout.debug.disable_xul_cache", true); pref("nglayout.debug.disable_xul_fastload", true); don't forget to change these preferences back to their defaults when you've finished debugging; leaving them as-is can significantly harm performance and usability.
...this will only work if the pref pref("browser.dom.window.dump.enabled", true) is enabled.
... to output dump calls instead to a file, set browser.dom.window.dump.file to the file destination where the log should be created and restart the application.
Gecko Compatibility Handbook - Archive of obsolete content
these browsers were developed before the relevant w3c recommendations for html, css, and the dom existed.
... neither internet explorer 4 or netscape navigator 4 support the w3 dom.
... report mozilla browser bugs or web site compatibility problems mozilla web developer community references using web standards in your web pages browser detection and cross browser support updating dhtml web pages html element cross reference dom client object cross-reference introduction to cross-browser javascript and dynamic html gecko user agent strings developer tools mozilla's doctype sniffing the main page links to many more resources.
Developing cross-browser and cross-platform pages - Archive of obsolete content
mentbyid(id_attribute_value).style ) { document.getelementbyid(id_attribute_value).style.visibility = "hidden"; }; } // example: // <button type="button" onclick="hideelement('d1');">hide div</button> // <div id="d1">some text</div> these repeated calls to document.getelementbyid are not the most efficient way to check for the existence of particular objects or features in the browser's dom implementation, but they serve to illustrate clearly how object support detection works.
... the top-level if clause looks to see if there is support for a method called getelementbyid on the document object, which is the one of the most basic levels of support for the dom in a browser.
... so, instead of needing to know which browsers and browser versions support a particular dom method (or dom attribute or dom feature), you can verify the support for that particular method in the visiting browser.
Summary of Changes - Archive of obsolete content
non-standard embed html 4.01 object deprecated applet html 4.01 object non-standard marquee html 4.01 div plus scripting non-standard bgsound html 4.01 object proprietary or deprecated feature w3c feature or recommended replacement ie5+ id_attribute_value document.all.id_attribute_value document.all[id_attribute_value] dom level 2: document.getelementbyid(id_attribute_value) ie5+ formname.inputname.value dom level 1: document.forms["formname"].inputname.value ie5+ inputname.value dom level 1: document.forms["formname"].inputname.value ie5+ formctrlname dom level 1: document.forms["formname"].formctrlname ie5+ document.forms(0) dom level 1: ...
... document.forms[0] ie elemref.innertext dom level 1 (core) interface we could introduce dom 3 core textcontent attribute here which is supported by mozilla 1.5+ and is a perfect equivalent to innertext.
... http://www.w3.org/tr/2004/rec-dom-le...e3-textcontent ie5+ elemref.style.pixeltop dom level 2: parseint(elemref.style.top, 10) ie5+ elemref.style.pixelleft = x; elemref.style.pixeltop = y; dom level 2: elemref.style.left = x + "px"; elemref.style.top = y + "px"; ie5+ new activexobject("microsoft.xmlhttp") new xmlhttprequest() proprietary or deprecated feature w3c feature or recommended replacement ...
E4X for templating - Archive of obsolete content
use domparser/domserializer or a non-native jxon algorithm instead.
...rn statements and braces): {_if(elems.length(), function () <> <markup/> <markup/> </>)} note that, while it is convenient to store such e4x in separate file templates (to be eval()d at a later time, taking into account security considerations, such as escaping with the above), e4x content using such functions can also be easily serialized inline (and then perhaps converted to the dom) as needed: var list = <>{_if(elems.length(), function () <> <markup/> <markup/> </>)}</>.toxmlstring(); iterating functions such as the following foreach (which can work with arrays, objects, or e4x objects) are quite convenient in iterating over complex structures such as e4x would not normally allow.
...rapes</item> </fruits>; alert( // using a javascript 1.8 expression closure <output> {sort(fruits.*, function (a, b) a.text() > b.text() /* text() call may not be necessary */ )} </output>.toxmlstring() ); /* <output> <item>banana</item> <item>grapes</item> <item>pear</item> </output> */ the above utility also works if the input is an htmlcollection, an array of strings, an array of dom objects, or an array of e4x objects (assuming the comparison function is changed or adapted accordingly).
E4X - Archive of obsolete content
ArchiveWebE4X
use domparser/domserializer or a non-native jxon algorithm instead.
...the goal is to provide an alternative, simpler syntax for accessing xml documents than via dom interfaces.
... someone verify the above known bugs and limitations it is not currently possible to access a dom object through e4x (bug 270553).
Implementation Status - Archive of obsolete content
4.4.7 xforms-readwrite supported 4.4.8 xforms-required supported 4.4.9 xforms-optional supported 4.4.10 xforms-enabled supported 4.4.11 xforms-disabled supported 4.4.12 domactivate supported 4.4.13 domfocusin supported 4.4.14 domfocusout supported 4.4.15 xforms-select xforms-deselect supported 4.4.16 xforms-in-range supported 4.4.17 xforms-out-of-ran...
....6.9 sequence: submission supported 4.7 resolving id references in xforms unsupported 4.7.1 references to elements within a repeat element unsupported 4.7.2 references to elements within a bind element unsupported 4.8 dom interface for access to instance data supported 4.8.1 getinstancedocument() supported 4.8.2 rebuild() supported 4.8.3 recalculate() supported 4.8.4 revalidate() supported 4.8.5 re...
... 7.7.2 min() supported 7.7.3 max() supported 7.7.4 count-non-empty() supported 7.7.5 index() partial binds using index() are not working 292333; 7.7.6 power() supported 7.7.7 random() supported 7.7.8 compare() supported 7.8.1 if() supported 7.8.2 property() partial returns basic for conformance-level, should return full.
Mozilla XForms Specials - Archive of obsolete content
misc cross domain submission not exactly either a limitation, or an extension, but it is worth mentioning here.
... for security reasons, it is not per default possible for an xforms to submit data to another domain.
...information about how to whitelist domain can be found in the release notes the cross domain check also includes forms loaded from file://.
Obsolete: XPCOM-based scripting for NPAPI plugins - Archive of obsolete content
a couple of lines have been added to the dom code asking a plugin to return a scriptable iid and a pointer to a scriptable instance object.
... // helper class to implement all necessary nsiclassinfo method stubs // and to set flags used by the security system class nsclassinfomixin : public nsiclassinfo { // these flags are used by the dom and security systems to signal that // javascript callers are allowed to call this object's scritable methods.
... ns_imethod getflags(pruint32 *aflags) {*aflags = nsiclassinfo::plugin_object | nsiclassinfo::dom_object; return ns_ok;} ns_imethod getimplementationlanguage(pruint32 *aimplementationlanguage) {*aimplementationlanguage = nsiprogramminglanguage::cplusplus; return ns_ok;} // the rest of the methods can safely return error codes...
Efficient animation for web games - Game development
help the browser help you if you are using dom for your ui, which i would certainly recommend, you really ought to use css transitions and/or css animations, rather than javascript-powered animations.
... use requestanimationframe when you are animating <canvas> content, or when your dom animations absolutely must synchronise with canvas content animations, do make sure to use window.requestanimationframe, and not older methods such as window.settimeout.
...requestanimationframe includes a domhighrestimestamp in its callback function prototype, which you definitely should use (as opposed to using the date object), as this will be the time the frame began rendering, and ought to make your animations look more fluid.
Accessibility tree (AOM) - MDN Web Docs Glossary: Definitions of Web-related terms
browsers convert markup into an internal representation called the dom tree.
... the dom tree contains objects for all the markup’s elements, attributes, and text nodes.
... browsers then create an accessibility tree based on the dom tree, which is used by platform-specific accessibility apis for assistive technologies, such as screen readers.
CSS Object Model (CSSOM) - MDN Web Docs Glossary: Definitions of Web-related terms
the cssom is very similar to the document object model (dom).
... the cssom, together with the dom, to build the render tree, which is in turn used by the browser to layout and paint the web page.
...it is much like the dom, but for the css rather than the html.
How do you upload your files to a web server? - Learn web development
prerequisites: you must know what a web server is and how domain names work.
... however, it is worth knowing that you can also host a website on github, but use a custom domain with it.
... see using a custom domain with github pages for a detailed guide.
Common questions - Learn web development
what is a domain name?
... domain names are a key component of the internet infrastructure.
... this set of articles shows you how to use the developer tools in firefox to debug and improve performance of your website, using the tools to check memory usage, the javascript call tree, the number of dom nodes being rendered, and more.
How the Web works - Learn web development
dns: domain name servers are like an address book for websites.
...that's why domain name servers were invented.
...you can find the ip address of a website by typing its domain into a tool like ip checker.
Creating hyperlinks - Learn web development
ment fragment reference on its own to link to another part of the same document: <p>the <a href="#mailing_address">company mailing address</a> can be found at the bottom of this page.</p> absolute versus relative urls two terms you'll come across on the web are absolute url and relative url: absolute url: points to a location defined by its absolute location on the web, including protocol and domain name.
... for example, if an index.html page is uploaded to a directory called projects that sits inside the root of a web server, and the web site's domain is http://www.example.com, the page would be available at http://www.example.com/projects/index.html (or even just http://www.example.com/projects/, as most web servers just look for a landing page such as index.html to load if it isn't specified in the url.) an absolute url will always point to the same location, no matter where it's used.
...when you use an absolute url, the browser starts by looking up the real location of the server on the domain name system (dns), see how the web works for more information).
General asynchronous programming concepts - Learn web development
in our simple-sync.html example (see it running live), we add a click event listener to a button so that when clicked, it runs a time-consuming operation (calculates 10 million dates then logs the final one to the console) and then adds a paragraph to the dom: const btn = document.queryselector('button'); btn.addeventlistener('click', () => { let mydate; for(let i = 0; i < 10000000; i++) { let date = new date(); mydate = date } console.log(mydate); let pelem = document.createelement('p'); pelem.textcontent = 'this is a newly-added paragraph.'; document.body.appendchild(pelem); }); when running the example, open your javascrip...
... 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.addeventlistener('click', expensiveoperation); alertbtn.addeventlistener('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.
...a major one is they are not able to access the dom — you can't get a worker to directly do anything to update the ui.
Ember interactivity: Events, classes and state - Learn web development
to create a header class to go with your header component, type this in to your terminal: ember generate component-class header this will create the following empty class file — todomvc/app/components/header.js: import component from '@glimmer/component'; export default class headercomponent extends component { } inside this file we will implement the event handler code.
... run this terminal command to generate a service for us to store our todo-list data in: ember generate service todo-data this should give you a terminal output like so: installing service create app/services/todo-data.js installing service-test create tests/unit/services/todo-data-test.js this creates a todo-data.js file inside the todomvc/app/services directory to contain our service, which initially contains an import statement and an empty class: import service from '@ember/service'; export default class tododataservice extends service { } first of all, we want to define what a todo is.
...press ctrl + c to stop the development server, and enter the following terminal command: ember generate component-class todo-list this generates the new component class todomvc/app/components/todo-list.js.
Accessibility in React - Learn web development
targeting our elements in order to focus on an element in our dom, we need to tell react which element we want to focus on and how to find it.
...it’s particularly useful for referring to dom elements.
...in this case however, since we're completely removing elements from the dom, we have no place to go back to.
Beginning our React todo list - Learn web development
the jsx copy the following snippet to your clipboard, then paste it into app.js so that it replaces the existing app() function: function app(props) { return ( <div classname="todoapp stack-large"> <h1>todomatic</h1> <form> <h2 classname="label-wrapper"> <label htmlfor="new-todo-input" classname="label__lg"> what needs to be done?
...tton" classname="btn"> edit <span classname="visually-hidden">repeat</span> </button> <button type="button" classname="btn btn__danger"> delete <span classname="visually-hidden">repeat</span> </button> </div> </li> </ul> </div> ); } now open public/index.html and change the <title> element’s text to todomatic.
... <title>todomatic</title> when your browser refreshes, you should see something like this: it's ugly, and doesn’t function yet, but that's okay — we'll style it in a moment.
TypeScript support in Svelte - Learn web development
we also had a look at using the transition directive to implement animations on dom elements in svelte.
...set its type to htmlelement like this: let nameel: htmlelement // reference to the name input dom node last for this file, we need to specify the correct type for our autofocus variable; update its definition like this: export let autofocus: boolean = false todo.svelte now the only warnings that npm run validate emits are triggered by calling the todo.svelte component; let's fix them.
... ) { // make sure node is defined and has a select() method const onfocus = () => node.select() // event handler node.addeventlistener('focus', onfocus) // when node gets focus call onfocus() return { destroy: () => node.removeeventlistener('focus', onfocus) // this will be executed when the node is removed from the dom } } } now update todo.svelte and newtodo.svelte where we import the actions file.
Embedding API for Accessibility
text zoom on a per-window basis the nsidomwindow::gettextzoom(float *zoomfactor) and nsidomwindow::settextzoom(float zoomfactor) methods can be used to set a wide range of text zoom factors on a content window.
...for double-sized text, use nsidomwindow::settextzoom(2.0); using accessibility preferences there are a number of prefs related to accessibility.
....policy.default.windowinternal.open","noaccess"); // override popping up new windows on target=anything user_pref("browser.block.target_new_window", true); // override popup windows at beginning of new page load (blocks most popup advertisements) user_pref("dom.disable_open_during_load", true); moz 0.8 client side redirects setboolpref("browser.accept.redirects", acceptredirects); no content refreshes setboolpref("browser.accept.refreshes", acceptrefreshes); no plugin content...
mach
of course, in a random dir you just get a cryptic error message to improve the experience.
... some other cases where you should consider implementing something as a mach command: when your tool is a random script in the tree.
... random scripts are hard to find and may not conform to coding conventions or best practices.
Limitations of frame scripts
the exceptions are: content-document-global-created document-element-inserted outer-window-destroyed inner-window-destroyed dom-window-destroyed these must be registered in the content process.
...it looks something like this: window.queryinterface(ci.nsiinterfacerequestor) .getinterface(ci.nsiwebnavigation) .queryinterface(ci.nsidocshelltreeitem) .roottreeitem .queryinterface(ci.nsiinterfacerequestor) .getinterface(ci.nsidomwindow); this will no longer work.
... in the content process the root tree item is an nsitabchild, that cannot be converted to an nsidomwindow, so the second getinterface call here will fail.
Limitations of frame scripts
the exceptions are: content-document-global-created document-element-inserted outer-window-destroyed inner-window-destroyed dom-window-destroyed these must be registered in the content process.
...it looks something like this: window.queryinterface(ci.nsiinterfacerequestor) .getinterface(ci.nsiwebnavigation) .queryinterface(ci.nsidocshelltreeitem) .roottreeitem .queryinterface(ci.nsiinterfacerequestor) .getinterface(ci.nsidomwindow); this will no longer work.
... in the content process, the root tree item is an nsitabchild, that cannot be converted to an nsidomwindow, so the second getinterface call here will fail.
mozbrowsercaretstatechanged
general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
... canselectall: a boolean indicating whether the selectall command is available (true) or not (false.) cancut: a boolean indicating whether the cut command is available (true) or not (false.) cancopy: a boolean indicating whether the copy command is available (true) or not (false.) canpaste: a boolean indicating whether the paste command is available (true) or not (false.) reason a domstring that defines the reason for the state being changed.
...g whether the current selection is collapsed (true) or not (false.) caretvisible a boolean indicating whether the caret is currently visible (true) or not (false.) selectionvisible a boolean indicating whether the current selection is visible (true) or not (false.) selectioneditable a boolean indicating whether the current selection is editable (true) or not (false.) selectedtextcontext a domstring containing the currently-selected text content.
mozbrowseropensearch
general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
... details the details property returns an anonymous javascript object with the following properties: title a domstring representing the title of the search engine.
... href a domstring representing url of the search engine.
mozbrowserusernameandpasswordrequired
general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
... details the details property returns an anonymous javascript object with the following members: host a domstring representing the host requesting the http authentification.
... realm a domstring representing the value of the realm http header.
HTMLIFrameElement.purgeHistory()
syntax there is a domrequest version and a promise version: var mydomrequest = instanceofhtmliframeelement.purgehistory(); instanceofhtmliframeelement.purgehistory().then(function() { ...
... }); returns either a domrequest object that returns an onsuccess handler if the history is deleted, or an onerror handler if not.
... examples domrequest: var browser = document.queryselector('iframe'); var request = browser.purgehistory(); request.onsuccess = function() { console.log('history deleted!'); } request.onerror = function() { console.error(this.error.name); } promise: var browser = document.queryselector('iframe'); browser.purgehistory().then(function() { console.log('history deleted!'); }, function(error) { console.error(this.error.name); }); specification not part of any specification.
HTML parser threading
additionally, each nshtml5parser has an associated nshtml5treeopexecutor that turns the output (tree operations; discussed later) of the portable parser core into actions performed on the gecko dom.
...references to dom nodes in tree ops are of type nsicontent** and are called content handles.
...(this indeed means that removing parser-created nodes from the dom during parsing doesn't release memory until the parser stops parsing, which is, in theory, a problem for long polling using html in an iframe e.g.
Introduction to Layout in Mozilla
uture tech-talks wrap-up, q&a basic data flow source document arrives via network apis incrementally “pumped” through the single-threaded layout engine parse, compute style, render; repeat css used for rendering all content content theoretically separate from “presentation” key data structures content node elements, attributes, leaves dom frame rectangular formatting primitive geometric information [0..n] per content node 2nd thru nth are “continuations” style context non-geometric information may be shared by adjacent frames reference counted, owned by frame view clipping, z-order, transparency [0..1] per frame, owned by frame wid...
...get native window [0..1] per view, owned by view key data structures the document owns the content model, and one or more presentations exposed programmatically via dom apis the presentation owns the frame hierarchy frames own the style contexts, views, widgets presentation has media type, dimensions, etc.
...responsiveness trade-off frame construction runs to completion css parsing runs to completion reflow runs to completion (mostly) painting runs to completion future (?) tech talks content model and dom - jst, jkeiser parser and content sink (esp.
Gecko Profiler FAQ
are the timer probes synchronized, or random/independent?
... (itimer_real (due to posix) requires the signal occur on the calling thread, not a random thread.
...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.
Leak Gauge
nspr_log_modules=domleak:5,documentleak:5,nsdocshellleak:5,nodeinfomanagerleak:5 nspr_log_file=nspr.log # or any other filename of your choice this will overwrite any existing file called nspr.log.
... results of processing log leak.log : summary: leaked 0 out of 11 dom windows leaked 0 out of 44 documents leaked 0 out of 3 docshells leaked content nodes in 0 out of 0 documents if there are leaks, output will look like the following.
...summary: leaked 13 out of 15 dom windows leaked 35 out of 46 documents leaked 4 out of 4 docshells leaked content nodes in 42 out of 53 documents if you see such a results, please file a bug.
browser.urlbar.trimURLs
the preference browser.urlbar.trimurls controls whether the protocol http and the trailing slash behind domain name (if the open page is exactly the domain name) are hidden.
... type:boolean default value: true exists by default: yes application support:firefox 7.0 status: active; last updated 2012-04-03 introduction: pushed to nightly on 2011-06-23 bugs: bug 665580 values true (default) if the active url is exactly the domain name, the trailing slash (/) behind the top level domain will be hidden.
...subdomain nor contains @ (usually for ftp login information), the http:// prefix will be hidden.
Preference reference
accessibility.tabfocusthe preference accessibility.tabfocus controls what elements receive focus when the user presses the tab key.browser.altclicksavethe preference browser.altclicksave controls whether clicking a link while holding the alt key starts the download of that link.browser.dom.window.dump.enabledthis setting enables the dump function, which sends messages to the system console.
... set it to true to enable it, or false to disable it.browser.dom.window.dump.filebrowser.dom.window.dump.file redirects the ouput of window.dump() calls to a file whose address is specified in this preference if browser.dom.window.dump.enabled is set to true.
...h.context.loadinbackgroundbrowser.search.context.loadinbackground controls whether a search from the context menu with "search <search engine> for <selected text>" opening a new tab will give focus to it and load it in the foreground or keep focus on the current tab and open it in the background.browser.urlbar.formatting.enabledthe preference browser.urlbar.formatting.enabled controls whether the domain name including the top level domain is highlighted in the address bar by coloring it black and the other parts grey.browser.urlbar.trimurlsthe preference browser.urlbar.trimurls controls whether the protocol http and the trailing slash behind domain name (if the open page is exactly the domain name) are hidden.dom.event.clipboardevents.enableddom.event.clipboardevents.enabled lets websites get...
L20n HTML Bindings
similarly, href and onclick attributes are not allowed in translations and they are not inserted in the final dom.
... it is important to note that applying translations doesn't replace dom elements, but only modifies their text nodes and their attributes.
... when all dom nodes are localized, the document element will fire a documentlocalized event, which you can listen to: document.addeventlistener('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.
AsyncTestUtils extended framework
subject: (automatically generated random subject) force all the messages to have the same subject you pass in.
... for example, {count: 1, subject: "my suitcase"} would result in a single message with the subject "my suitcase" with a random sender and random recipient.
...for example, {count: 4, from: ["john doe", "john_doe@example.com"]} would result in four messages from john doe to random recipients.
JSS FAQ
MozillaProjectsNSSJSSJSS FAQ
if i don't call setcipherpolicy, is the domestic policy used by default?
.../jss/pkix/crmf/certreqmsg.java org/mozilla/jss/pkix/crmf/certtemplate.java org/mozilla/jss/pkix/primitive/name.java org/mozilla/jss/provider/javax/crypto/jsssecretkeyfactoryspi.java org/mozilla/jss/util/utf8converter.java org/mozilla/jss/util/base64inputstream.java jss/samples/pqggen.java jss/samples/pkcs12.java if i don't call setcipherpolicy, is the domestic policy used by default?
... yes, domestic is the default because we call nss_setdomesticpolicy() during cryptomanager.initialize().
Enc Dec MAC Output Public Key as CSR
nst char *noisefilename, seckeypublickey **pubkeyp, const char *pqgfile, secupwdata *pwdata) { ck_mechanism_type mechanism; secoidtag algtag; pk11rsagenparams rsaparams; void *params; seckeyprivatekey *privkey = null; secstatus rv; unsigned char randbuf[blocksize + 1]; rv = generaterandom(randbuf, blocksize); if (rv != secsuccess) { fprintf(stderr, "error while generating the random numbers : %s\n", port_errortostring(rv)); goto cleanup; } pk11_randomupdate(randbuf, blocksize); switch (keytype) { case rsakey: rsaparams.keysizeinbits = size; rsaparams.pe = publicexponent; mechanis...
... * generate a random value to use as iv for aes cbc * open an input file and an output file, * wrap the symmetric and mac keys using public key * write a header to the output that identifies the two wrapped keys * and public key * loop until eof(input) * read a buffer of plaintext from input file, * mac it, append the mac to the plaintext * encrypt it using cbc, using ...
...y */ rv = wrapkey(mackey, pubkey, &wrappedmackey); if (rv != secsuccess) { pr_fprintf(pr_stderr, "error while wrapping mac key\n"); goto cleanup; } if (noisefilename) { rv = seedfromnoisefile(noisefilename); if (rv != secsuccess) { port_seterror(pr_end_of_file_error); return secfailure; } rv = pk11_generaterandom(iv, blocksize); if (rv != secsuccess) { goto cleanup; } } else { /* generate a random value to use as iv for aes cbc */ generaterandom(iv, blocksize); } headerfile = pr_open(headerfilename, pr_create_file | pr_truncate | pr_rdwr, 00660); if (!headerfile) { pr_fprintf(pr_stderr, "unabl...
Encrypt Decrypt_MAC_Using Token
* get their cka_ids * generate a random value to use as iv for aes cbc * open an input file and an output file, * write a header to the output that identifies the two keys by * their cka_ids, may include original file name and length.
...y cka_id */ rv = gathercka_id(mackey, &macckaid); if (rv != secsuccess) { pr_fprintf(pr_stderr, "can't get the mac key cka_id.\n"); goto cleanup; } if (noisefilename) { rv = seedfromnoisefile(noisefilename); if (rv != secsuccess) { port_seterror(pr_end_of_file_error); return secfailure; } rv = pk11_generaterandom(iv, blocksize); if (rv != secsuccess) { goto cleanup; } } else { /* generate a random value to use as iv for aes cbc.
... */ generaterandom(iv, blocksize); } headerfile = pr_open(headerfilename, pr_create_file | pr_truncate | pr_rdwr, 00660); if (!headerfile) { pr_fprintf(pr_stderr, "unable to open \"%s\" for writing.\n", headerfilename); return secfailure; } encfile = pr_open(encryptedfilename, pr_create_file | pr_truncate | pr_rdwr, 00660); if (!encfile) { pr_fprintf(pr_stderr, "unable to open \"%s\" for writing.\n", encryptedfilename); return secfailure; } /* write to a header file the iv and the cka_ids * identifying the two keys.
NSS Sample Code Utilities_1
ompt, checkpassword); case pw_fromfile: pw = filepasswd(slot, retry, pwdata->data); pwdata->source = pw_plaintext; pwdata->data = pl_strdup(pw); return pw; case pw_plaintext: return pl_strdup(pwdata->data); default: break; } pr_fprintf(pr_stderr, "password check failed: no password found.\n"); return null; } /* * generaterandom */ secstatus generaterandom(unsigned char *rbuf, int rsize) { char meter[] = { "\r| |" }; int fd, count; int c; secstatus rv = secsuccess; cc_t orig_cc_min; cc_t orig_cc_time; tcflag_t orig_lflag; struct termios tio; fprintf(stderr, "to gen...
...erate random numbers, " "continue typing until the progress meter is full:\n\n"); fprintf(stderr, "%s", meter); fprintf(stderr, "\r|"); /* turn off echo on stdin & return on 1 char instead of nl */ fd = fileno(stdin); tcgetattr(fd, &tio); orig_lflag = tio.c_lflag; orig_cc_min = tio.c_cc[vmin]; orig_cc_time = tio.c_cc[vtime]; tio.c_lflag &= ~echo; tio.c_lflag &= ~icanon; tio.c_cc[vmin] = 1; tio.c_cc[vtime] = 0; tcsetattr(fd, tcsaflush, &tio); /* get random noise from keyboard strokes */ count = 0; while (count < rsize) { c = getc(stdin); if (c == eof) { rv = secfailure; break; } *(rbuf + count) = c; if (count == 0 || c != *(rbuf + count -1)) { ...
...; } /* * seedfromnoisefile */ secstatus seedfromnoisefile(const char *noisefilename) { char buf[2048]; prfiledesc *fd; print32 count; fd = pr_open(noisefilename, pr_rdonly, 0); if (!fd) { fprintf(stderr, "failed to open noise file."); return secfailure; } do { count = pr_read(fd,buf,sizeof(buf)); if (count > 0) { pk11_randomupdate(buf,count); } } while (count > 0); pr_close(fd); return secsuccess; } /* * filesize */ long filesize(const char* filename) { struct stat stbuf; stat(filename, &stbuf); return stbuf.st_size; } /* * readderfromfile */ secstatus readderfromfile(secitem *der, const char *infilename, prbool ascii) { secstatus rv = secsuccess; prfiledesc *infi...
NSS sources building testing
in other environments (for example in home networks), you could set the host and domsuf (for domain suffix) environment variables to tell the nss suite which hostname to use.
... as a test, it must be possible to successfully use the command "ping $host.$domsuf" on your computer (ping reports receiving replies).
... on many computers the variables host=localhost domsuf=localdomain works.
PKCS11 Implement
if the token is a removable device, nss may call c_gettokeninfo anytime it's looking for a new token to check whether the token is write protected, whether it can generate random numbers, and so on.
...c_verify ckm_rsa_pkcs ckm_dsa c_verifyrecover ckm_rsa_pkcs c_generatekey c_generatekeypair (if token is read/write)c_generatekeypair (if token is read/write) c_generatekeypair (if token is read/write)c_generatekeypair (if token is read/write) c_wrapkey c_unwrapkey ckm_rsa_pkcs c_unwrapkey ckm_rsa_pkcs c_unwrapkey ckm_rsa_pkcs c_unwrapkey ckm_rsa_pkcs c_generaterandom c_save (when token runs out of sessions) c_restore (when token runs out of sessions) external key tokens need to support c_decrypt and c_sign.
... random-number generation and simple digesting the nss requires that the following functions operate without authenticating to the token: c_seedrandom, c_generaterandom, and c_digest (for sha, md5, and md2).
NSS environment variables
makes nsrandfile usable with /dev/urandom.
... 3.12.3 nsrandfile string (file name) uses this file to seed the pseudo random number generator.
... 3.12 nss_ssl_cbc_random_iv string ("0", "1") controls the workaround for the beast attack on ssl 3.0 and tls 1.0.
NSS tools : certutil
$ certutil -l -d sql:/home/my/sharednssdb certificate nickname trust attri butes ssl,s/mime, jar/xpi ca administrator of instance pki-ca1's example domain id u,u,u tps administrator's example domain id u,u,u google internet authority ,, certificate authority - example domain ct,c,c using additional arguments with -l can return and print the information for a single, specific certificate.
... for example, the -n argument passes the certificate name, while the -a argument prints the certificate in ascii format: $ certutil -l -d sql:/home/my/sharednssdb -a -n "certificate authority - example domain" -----begin certificate----- miidmtccaoggawibagibatanbgkqhkig9w0baqufada5mrcwfqydvqqkew5fegft cgxliervbwfpbjeembwga1ueaxmvq2vydglmawnhdgugqxv0ag9yaxr5mb4xdtew mdqyotixnty1ofoxdteymdqxodixnty1ofowotexmbuga1uechmorxhhbxbszsbe b21haw4xhjacbgnvbamtfunlcnrpzmljyxrlief1dghvcml0etccasiwdqyjkozi hvcnaqebbqadggepadccaqocggebao/bquli2kwqxfkmmmg93kn1sanzntxa/vlf tmrih3hqgjvr1ktiy9ag6cb7dskwmthp/+p4pucmql4zrsgt901qxkepyz2dymm2 rnelk+seuipiutozadhndiyse/yude8vqwj0vhcvl0w72qfucsq/wzt7fcrnuiui udewnopsun70glhcj/lvxl7k9bhyd4sq5czktwytfwliiwv+zy/fl6jgbgaqyqb2 bp4irmflogqsxgub1evwvd...
...id < 1> rsa 40defeeb522ade11090eacebaaf1196a172127df example domain administrator cert < 2> rsa 1d0b06f44f6c03842f7d4f4a1dc78b3bcd1b85a5 john smith user cert there are ways to narrow the keys listed in the search results: * to return a specific key, use the -n name argument with the name of the key.
NSS_3.12.3_release_notes.html
makes nsrandfile usable with /dev/urandom.
...backwards compatibility (wildcards) bug 334678: prng_fips1861.c redefines the macro bsize on hp-ux bug 335016: mpp_pprime (miller-rabin probabilistic 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 466736: incorrect use of nss_use_64 in lib/libpkix/pkix_pl_nss/system/pkix_pl_object.c bug 466745: random number generator fails on windows ce bug 467298: sql db code uses local cache on local file system bug 468279: softoken crash importing email cert into newly upgraded db bug 468532: trusted ca trust flags not being honored in cert_verifycert bug 469583: coverity: uninitialized variable used in sec_pkcs5createalgorithmid bug 469944: when built with microsoft compilers bug 470351: crlut...
NSS Tools modutil
the following mechanisms are currently available: rsa, dsa, rc2, rc4, rc5, des, dh, fortezza, sha1, md5, md2, random (for random number generation), and friendly (meaning certificates are publicly readable).
... rsa: 0x00000001 dsa: 0x00000002 rc2: 0x00000004 rc4: 0x00000008 des: 0x00000010 dh: 0x00000020 fortezza: 0x00000040 rc5: 0x00000080 sha1: 0x00000100 md5: 0x00000200 md2: 0x00000400 random: 0x08000000 friendly: 0x10000000 own_pw_defaults: 0x20000000 disable: 0x40000000 cipherenableflags specifies ciphers that this module provides but netscape communicator does not, so that communicator can enable them.
... adding a cryptographic module this example adds a new cryptographic module to the database: c:\modutil> modutil -dbdir "c:\databases" -add "cryptorific module" -libfile "c:\winnt\system32\crypto.dll" -mechanisms rsa:dsa:rc2:random the security module database tool displays a warning: warning: performing this operation while communicator is running couldcause corruption of your security databases.
certutil
$ certutil -l -d sql:/home/my/sharednssdb certificate nickname trust attributes ssl,s/mime,jar/xpi ca administrator of instance pki-ca1's example domain id u,u,u tps administrator's example domain id u,u,u google internet authority ,, certificate authority - example domain ct,c,c using additional arguments with -l can return and print the information for a single, specific certificate.
... for example, the -n argument passes the certificate name, while the -a argument prints the certificate in ascii format: $ certutil -l -d sql:/home/my/sharednssdb -a -n "certificate authority - example domain" -----begin certificate----- miidmtccaoggawibagibatanbgkqhkig9w0baqufada5mrcwfqydvqqkew5fegft cgxliervbwfpbjeembwga1ueaxmvq2vydglmawnhdgugqxv0ag9yaxr5mb4xdtew mdqyotixnty1ofoxdteymdqxodixnty1ofowotexmbuga1uechmorxhhbxbszsbe b21haw4xhjacbgnvbamtfunlcnrpzmljyxrlief1dghvcml0etccasiwdqyjkozi hvcnaqebbqadggepadccaqocggebao/bquli2kwqxfkmmmg93kn1sanzntxa/vlf tmrih3hqgjvr1ktiy9ag6cb7dskwmthp/+p4pucmql4zrsgt901qxkepyz2dymm2 rnelk+seuipiutozadhndiyse/yude8vqwj0vhcvl0w72qfucsq/wzt7fcrnuiui udewnopsun70glhcj/lvxl7k9bhyd4sq5czktwytfwliiwv+zy/fl6jgbgaqyqb2 bp4irmflogqsxgub1evwvdf1ha...
...id < 1> rsa 40defeeb522ade11090eacebaaf1196a172127df example domain administrator cert < 2> rsa 1d0b06f44f6c03842f7d4f4a1dc78b3bcd1b85a5 john smith user cert there are ways to narrow the keys listed in the search results: o to return a specific key, use the -n name argument with the name of the key.
JSClass.flags
mxr id search for jsclass_private_is_nsisupports jsclass_is_domjsclass added in spidermonkey 17 objects are dom.
... mxr id search for jsclass_is_domjsclass jsclass_emulates_undefined added in spidermonkey 24 causes objects which have this class to emulate undefined in certain circumstances.
... see also bug 527805 - removed jsclass_share_all_properties bug 571789 - removed jsclass_is_extended bug 638291 - removed jsclass_mark_is_trace bug 641025 - added jsclass_implements_barriers bug 702507 - removed jsclass_construct_prototype bug 758913 - removed jsclass_new_resolve_gets_start bug 766447 - added jsclass_is_domjsclass bug 792108 - added jsclass_emulates_undefined bug 993026 - removed jsclass_new_resolve bug 1097267 - removed jsclass_new_enumerate ...
Web Replay
replaying processes preserve all the same js behavior, dom structures, graphical updates, and most other behaviors that occurred while recording.
... for now only js state can be inspected by the debugger, though extending this to cover dom inspection and other devtools features should not be too hard.
... dom workers are not supported yet.
WebReplayRoadmap
dom/css integration (partially implemented) when paused, the inspector panel can be used to inspect the dom and css state of the page.
... new features are possible with time travel, though, which would be nice to support: supporting the debugger's event breakpoints would allow searching the recording for places where particular dom events occur, and -- in the same manner as logpoints -- logging them to the console and allowing them to be seeked to later.
... similarly, when the debugger supports dom mutation breakpoints (bug 1547692), the recording can be searched for dom mutations, and mutations can be logged to the console and seeked to later.
Redis Tips
yet redis is so easy to learn and use that you'll seldom feel you need to consult it.
... keyspace design here are some things i keep in mind when creating keys: keys are like urls and should read like nice urls keys are like urls with paths separated by a colon, ':' (this is convention only) use a common prefix for all keys in your app (like a domain) be careful about possible name collisions key names should make it obvious what the values are for redis data structures are like program variables; how would you structure your data types in your program?
... in this case, it might be: ptu:assertion:email:<email>:origin:<domain> and since assertions time out, i would do a setex or expireat on that key when i created it.
Gecko events
event_dom_create an object has been created.
... is supported: yes event_dom_destroy an object has been destroyed.
... is supported: yes event_dom_significant_change an object's properties or content have changed significantly so that the type of object has really changed, and therefore the accessible should be destroyed or recreated.
Components.utils.cloneInto
wrapreflectors: a boolean value that determines if objects reflected from c++, such as dom objects, should be cloned.
...see cloning objects that contain dom elements below.
...llo from add-on"); } }; contentwindow.addonscriptobject = cloneinto(addonscriptobject, contentwindow, {clonefunctions: true}); // page script var test = document.getelementbyid("test"); test.addeventlistener("click", function() { window.addonscriptobject.greetme(); }, false); cloning objects that contain dom elements by default, if the object you clone contains objects that are reflected from c++, such as dom elements, the cloning operation will fail with an error.
amIWebInstaller
1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) method overview boolean installaddonsfromwebpage(in astring amimetype, in nsidomwindow awindow, in nsiuri areferer, [array, size_is(ainstallcount)] in wstring auris, [array, size_is(ainstallcount)] in wstring ahashes, [array, size_is(ainstallcount)] in wstring anames, [array, size_is(ainstallcount)] in wstring aicons, [optional] in amiinstallcallback acallback, [optional] in pruint32 ainstallcount); boolean isinstallenabled(in astring amimetype, in nsiuri areferer); note: pri...
...or to gecko 8.0, all references to nsidomwindow used in this interface were nsidomwindow.
...boolean installaddonsfromwebpage( in astring amimetype, in nsidomwindow awindow, in nsiuri areferer, [array, size_is(ainstallcount)] in wstring auris, [array, size_is(ainstallcount)] in wstring ahashes, [array, size_is(ainstallcount)] in wstring anames, [array, size_is(ainstallcount)] in wstring aicons, in amiinstallcallback acallback, optional in pruint32 ainstallcount optional ); parameters amimetype the mimetype for the add-ons.
nsIAuthModule
inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void getnexttoken([const] in voidptr aintoken, in unsigned long aintokenlength, out voidptr aouttoken, out unsigned long aouttokenlength); void init(in string aservicename, in unsigned long aserviceflags, in wstring adomain, in wstring ausername, in wstring apassword); void unwrap([const] in voidptr aintoken, in unsigned long aintokenlength, out voidptr aouttoken, out unsigned long aouttokenlength); void wrap([const] in voidptr aintoken, in unsigned long aintokenlength, in boolean confidential, out voidptr aouttoken, out unsigned long aouttokenlength); constants constant value description req_defaul...
...void init( in string aservicename, in unsigned long aserviceflags, in wstring adomain, in wstring ausername, in wstring apassword ); parameters aservicename the service name, which may be null if not applicable (for example, for ntlm, this parameter should be null).
...adomain the authentication domain, which may be null if not applicable.
nsICommandLineRunner
last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) inherits from: nsicommandline method overview void init(in long argc, in nscharptrarray argv, in nsifile workingdir, in unsigned long state); void run(); void setwindowcontext(in nsidomwindow awindow); attributes attribute type description helptext autf8string process and combine the help text provided by each command-line handler.
...void setwindowcontext( in nsidomwindow awindow ); parameters awindow the dom window object which will be set.
... it is an nsidomwindow object.
nsICookiePromptService
last changed in gecko 1.9 (firefox 3) inherits from: nsisupports method overview long cookiedialog(in nsidomwindow parent, in nsicookie cookie, in acstring hostname, in long cookiesfromhost, in boolean changingcookie, out boolean rememberdecision); constants constant value description deny_cookie 0 holds the value for a denying the cookie.
... long cookiedialog( in nsidomwindow parent, in nsicookie cookie, in acstring hostname, in long cookiesfromhost, in boolean changingcookie, out boolean rememberdecision ); parameters parent the parent window for the dialog.
...hostname the host that wants to set the cookie, not the domain; this is part of the cookie.
nsIDownloadManager
isprivate); void addlistener(in nsidownloadprogresslistener alistener); 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 adownload); 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 lo...
... void open( in nsidomwindow aparent, in nsidownload adownload ); parameters aparent the parent, or opener, of the front end.
... void openprogressdialogfor( in nsidownload adownload, in nsidomwindow aparent, in boolean acanceldownloadonclose ); parameters adownload the download object to display progress for, as returned by getdownload() or adddownload().
nsIDragSession
datatransfer nsidomdatatransfer the data transfer object for the current drag operation.
... sourcedocument nsidomdocument the document where the drag was started, which will be null if the drag originated outside the application.
... sourcenode nsidomnode the dom node that was originally dragged to start the session, which will be null if the drag originated outside the application.
nsIFrameLoader
see nsidomwindowutils.sendkeyevent() for details; this method is its equivalent for cross-process event handling.
...see nsidomwindowutils.sendmouseevent() for details; this method is its equivalent for cross-process event handling.
... see also content process event handling nsiframeloaderowner nsiframemessagelistener nsichromeframemessagemanager nsidomwindowutils ...
nsIJSON
dom/interfaces/json/nsijson.idlscriptable this interface provides a convenient way to encode and decode json strings from javascript code.
... implemented by: @mozilla.org/dom/json;1.
... to create an instance, use: var nativejson = components.classes["@mozilla.org/dom/json;1"] .createinstance(components.interfaces.nsijson); method overview note: the idl file has portions of the idl commented out because they represent things that can't actually be properly described by idl; however, for the purposes of this article, we'll pretend they can be and ignore that issue.
nsILoginManager
to create an instance, use: var loginmanager = components.classes["@mozilla.org/login-manager;1"] .getservice(components.interfaces.nsiloginmanager); method overview void addlogin(in nsilogininfo alogin); nsiautocompleteresult autocompletesearch(in astring asearchstring, in nsiautocompleteresult apreviousresult, in nsidomhtmlinputelement aelement); unsigned long countlogins(in astring ahostname, in astring aactionurl, in astring ahttprealm); boolean fillform(in nsidomhtmlformelement aform); void findlogins(out unsigned long count, in astring ahostname, in astring aactionurl, in astring ahttprealm, [retval, array, size_is(count)] out nsilogininfo logins); void getalldisabledhost...
... nsiautocompleteresult autocompletesearch( in astring asearchstring, in nsiautocompleteresult apreviousresult, in nsidomhtmlinputelement aelement ); parameters asearchstring missing description apreviousresult missing description aelement missing description return value missing description countlogins() returns the number of logins matching the specified criteria.
... boolean fillform( in nsidomhtmlformelement aform ); parameters aform the htmlform to attempt to fill out.
nsIMacDockSupport
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 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'); macmenuitem.addeventlistener('command', function(){ var docksupport = cc['@mozilla.org/widget/macdocksupport;1'].getservice(ci.nsimacdocksupport); docksupport.activateapplication(true); services.wm.getmostrecentwindow(null).focus() }) services.appshell.hiddendomwindow.document.getelementbyid('menu_mac_dockmenu').appendchild(macmenuitem) this adds the "show most recent window" menuitem from the previous example as a third item.
nsIMicrosummaryGenerator
1.0 66 introduced gecko 1.8 obsolete gecko 6.0 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) warning: microsummary support was removed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) method overview long calculateupdateinterval(in nsidomnode apagecontent); boolean equals(in nsimicrosummarygenerator aother); astring generatemicrosummary(in nsidomnode apagecontent); attributes attribute type description loaded boolean has the generator itself (which may be a remote resource) been loaded.
...long calculateupdateinterval( in nsidomnode apagecontent ); parameters apagecontent the content of the page being summarized.
...astring generatemicrosummary( in nsidomnode apagecontent ); parameters apagecontent the content of the page being summarized.
nsIParserUtils
implemented by: @mozilla.org/parserutils;1 as a service: var parserutils = components.classes["@mozilla.org/parserutils;1"] .getservice(components.interfaces.nsiparserutils); method overview astring converttoplaintext(in astring src, in unsigned long flags, in unsigned long wrapcol); nsidomdocumentfragment parsefragment(in astring fragment, in unsigned long flags, in boolean isxml, in nsiuri baseuri, in nsidomelement element); astring sanitize(in astring src, in unsigned long flags); constants constant value description sanitizerallowcomments (1 << 0) flag for sanitizer: allow comment nodes.
... nsidomdocumentfragment parsefragment( in astring fragment, in unsigned long flags, in boolean isxml, in nsiuri baseuri, in nsidomelement element ); parameters fragment the input markup.
... return value an nsidomdocumentfragment object for the resulting sanitized document fragment.
nsIPrefBranch2
method overview void addobserver(in string adomain, in nsiobserver aobserver, in boolean aholdweak); void removeobserver(in string adomain, in nsiobserver aobserver); methods addobserver() add a preference change observer.
... void addobserver( in string adomain, in nsiobserver aobserver, in boolean aholdweak ); parameters adomain the preference on which to listen for changes.
... void removeobserver( in string adomain, in nsiobserver aobserver ); parameters adomain the preference which is being observed for changes.
nsIPrivateBrowsingService
method overview void removedatafromdomain(in autf8string adomain); attributes attribute type description autostarted boolean indicates whether or not private browsing was started automatically at application launch time.
... methods removedatafromdomain() removes all data stored for the specified domain, including its subdomains.
... void removedatafromdomain( in autf8string adomain ); parameters adomain the domain for which data should be removed.
nsIPushMessage
dom/interfaces/push/nsipushnotifier.idlscriptable a push message sent to a system subscription.
... method overview domstring text(); jsval json(); void binary([optional] out uint32_t datalen, [array, retval, size_is(datalen)] out uint8_t data); methods text() extracts the message data as a utf-8 text string.
... domstring text(); parameters none.
nsIPushSubscription
dom/interfaces/push/nsipushservice.idlscriptable includes information needed to send a push message to privileged code.
... method overview void getkey(in domstring name, [optional] out uint32_t keylen, [array, size_is(keylen), retval] out uint8_t key); bool quotaapplies(); bool isexpired(); attributes attribute type description endpoint domstring the subscription url.
... void getkey( in domstring name, [optional] out uint32_t keylen, [array, size_is(keylen), retval] out uint8_t key ); parameters name the encryption key name.
nsITaskbarPreviewController
method overview boolean drawpreview(in nsidomcanvasrenderingcontext2d ctx); boolean drawthumbnail(in nsidomcanvasrenderingcontext2d ctx, in unsigned long width, in unsigned long height); boolean onactivate(); void onclick(in nsitaskbarpreviewbutton button); void onclose(); attributes attribute type description height unsigned long the height in pixels of the preview im...
... boolean drawpreview( in nsidomcanvasrenderingcontext2d ctx ); parameters ctx an nsidomcanvasrenderingcontext2d object representing the drawing context into which the preview is to be rendered.
... boolean drawthumbnail( in nsidomcanvasrenderingcontext2d ctx, in unsigned long width, in unsigned long height ); parameters ctx an nsidomcanvasrenderingcontext2d object representing the drawing context into which the thumbnail is to be rendered.
nsIWebBrowserChrome3
1.0 66 introduced gecko 2.0 inherits from: nsiwebbrowserchrome2 last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview astring onbeforelinktraversal(in astring originaltarget, in nsiuri linkuri, in nsidomnode linknode, in prbool isapptab); methods onbeforelinktraversal() determines the appropriate target for a link.
... astring onbeforelinktraversal( in astring originaltarget, in nsiuri linkuri, in nsidomnode linknode, in prbool isapptab ); parameters originaltarget the original link target.
... linknode link dom node.
nsIWorkerFactory
dom/interfaces/threads/nsidomworkers.idlscriptable creates and returns a new worker 1.0 66 introduced gecko 2.0 obsolete gecko 8.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) this interface was removed in gecko 8.0.
...to create an instance, use: var workerfactory = components.classes['@mozilla.org/threads/workerfactory;1'] .createinstance(components.interfaces.nsiworkerfactory); method overview nsiworker newchromeworker(in domstring ascripturl); methods newchromeworker() returns a new chromeworker that will run a specified script.
... nsiworker newchromeworker( in domstring ascripturl ); parameters ascripturl the url of the script to load into the new worker.
nsIWorkerMessagePort
dom/interfaces/threads/nsidomworkers.idlscriptable this interface represents a worker thread's message port, which is used to allow the worker to post messages back to its creator.
... 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 postmessage(in domstring amessage); methods postmessage() posts a message into the event queue.
... void postmessage( in domstring amessage ); parameters amessage the message to post.
nsIXULTemplateResult
method overview astring getbindingfor(in nsiatom avar); nsisupports getbindingobjectfor(in nsiatom avar); void hasbeenremoved(); void rulematched(in nsisupports aquery, in nsidomnode arulenode); attributes attribute type description id astring id of the result.
... the dom element created for this result, if any, will have its id attribute set to this value.
...void rulematched( in nsisupports aquery, in nsidomnode arulenode ); parameters aquery the query that matched.
Working with Multiple Versions of Interfaces
to do this i used the accessibility framework: hwnd gethwnd(nsidomnode *node){ hwnd self = null; nsresult rv; nscomptr<nsiaccessibleretrieval> refp; refp = do_createinstance( "@mozilla.org/accessibleretrieval;1", &rv); if (ns_failed(rv)){ return self; } //line 6.
... hwnd gethwndb(nsidomnode *node){ hwnd self = null; nsresult rv; nscomptr<nsicomponentmanager> compmgr; rv = ns_getcomponentmanager(getter_addrefs(compmgr)); if (ns_failed(rv)){ return self; } nscomptr<nsiaccessibleretrieval> refp; rv = compmgr->createinstancebycontractid(accretcid, 0, iar_iid_old, getter_addrefs(refp)); if (ns_failed(rv)){ return self; } nscomptr<nsiaccessible> accnode; rv = refp...
...i did have to delve into my old versions and change: ns_define_static_iid_accessor(...) to ns_declare_static_iid_accessor(...) this ugliness aside, my plan b routine now looks like: hwnd gethwndb(nsidomnode *node){ hwnd self = null; nsresult rv; nscomptr<nsicomponentmanager> compmgr; rv = ns_getcomponentmanager(getter_addrefs(compmgr)); if (ns_failed(rv)){ return self; } nscomptr<nsiaccessibleretrieval_old> refp; //n.b.
Index
some of these are standard events, such as those created by the dom.
...we add widgets by inserting new xul dom elements into the application window and modify them using scripts and attaching event handlers.
...as an example, i received the following inquiry, and i decided to follow my usual path and document what i do: 88 styling the folder pane the folder pane in thunderbird is predominantly controlled by code in folderpane.js.
Zombie compartments
mb (00.00%) -- sundries │ │ │ │ ├──0.01 mb (00.00%) ── malloc-heap [2] │ │ │ │ └──0.00 mb (00.00%) ── gc-heap [2] │ │ │ └───5.83 mb (01.17%) -- (4 tiny) │ │ │ ├──4.19 mb (00.84%) ++ layout │ │ │ ├──1.03 mb (00.21%) ── style-sheets [2] │ │ │ ├──0.60 mb (00.12%) ++ dom │ │ │ └──0.01 mb (00.00%) ── property-tables [2] │ │ ├───8.86 mb (01.78%) -- cached/window(https://www.google.de/?gws_rd=ssl) │ │ │ ├──4.23 mb (00.85%) -- layout │ │ │ │ ├──3.80 mb (00.76%) ── style-sets │ │ │ │ ├──0.29 mb (00.06%) ── pres-shell │ │ │ │ ├──0.05 mb (00.01%) �...
...│ │ │ ├──0.01 mb (00.00%) ── pres-contexts │ │ │ │ ├──0.01 mb (00.00%) ── line-boxes │ │ │ │ └──0.00 mb (00.00%) ── text-runs │ │ │ ├──3.78 mb (00.76%) ++ js-compartment(https://www.google.de/?gws_rd=ssl) │ │ │ ├──0.51 mb (00.10%) ── style-sheets │ │ │ ├──0.33 mb (00.07%) -- dom │ │ │ │ ├──0.17 mb (00.04%) ── text-nodes │ │ │ │ ├──0.13 mb (00.03%) ── element-nodes │ │ │ │ ├──0.02 mb (00.00%) ── other │ │ │ │ ├──0.01 mb (00.00%) ── orphan-nodes │ │ │ │ └──0.00 mb (00.00%) ── event-targets │ │ │ └──0.00 mb (00.00%) ── property-tables ...
...0.21%) -- type-objects │ │ │ ├──1.04 mb (00.21%) ── gc-heap │ │ │ └──0.03 mb (00.01%) ── malloc-heap │ │ ├──0.23 mb (00.05%) ++ strings │ │ └──0.18 mb (00.04%) ── gc-heap-arena-admin the first line says that the window from www.google.de is taking up 28.45 mb and futher breaks it down into zones, compartments, dom etc.
Tree map view - Firefox Developer Tools
for the treemaps shown in the memory tool, things on the heap are divided at the top level into four categories: objects: javascript and dom objects, such as function, object, or array, and dom types like window and htmldivelement.
... here are some example snapshots, as they appear in the tree map view: this treemap is from the dom allocation example, which simply runs a script that creates a large number of dom nodes (200 htmldivelement objects and 4000 htmlspanelement objects).
... this treemap is from the monster allocation example, which creates three arrays, each containing 5000 monsters, each monster having a randomly-generated name.
Network request details - Firefox Developer Tools
block the domain involved in this request.
... the domain is added to the blocking sidebar.
...see https://en.wikipedia.org/wiki/special:centralautologin/p3p for more info.\"" }, { "name": "server", "value": "mw1316.eqiad.wmnet" }, { "name": "server-timing", "value": "cache;desc=\"pass\"" }, { "name": "strict-transport-security", "value": "max-age=106384710; includesubdomains; preload" }, { "name": "vary", "value": "accept-encoding,treat-as-untrusted,x-forwarded-proto,cookie,authorization,x-seven" }, { "name": "via", "value": "1.1 varnish (varnish/5.1), 1.1 varnish (varnish/5.1)" }, { "name": "x-analytics", "value": "ns=-1;special=badtitle;wmf-last-access=11-jun-2019;wmf-last-acces...
The JavaScript input interpreter - Firefox Developer Tools
there are three ways to select an iframe using cd(): you can pass the iframe dom element: var frame = document.getelementbyid("frame1"); cd(frame); you can pass a css selector that matches the iframe: cd("#frame1"); you can pass the iframe's global window object: var frame = document.getelementbyid("frame1"); cd(frame.contentwindow); to switch the context back to the top-level window, call cd() with no arguments: cd(); for example, suppose we have a document that emb...
... $$(selector, element) looks up a css selector string selector, returning an array of dom nodes descended from element that match.
...if the argument is a dom node, its outerhtml is copied.
Web Console remoting - Firefox Developer Tools
console api messages come through the nsiob serverservice - the console object implementation lives in dom/base/consoleapi.js.
...to see these differences please look in the console api implementation: dom/base/consoleapi.js.
... autocomplete and more the autocomplete request packet: { "to": "conn0.console9", "type": "autocomplete", "text": "d", "cursor": 1 } the response packet: { "from": "conn0.console9", "matches": [ "decodeuri", "decodeuricomponent", "defaultstatus", "devicepixelratio", "disableexternalcapture", "dispatchevent", "domyxhr", "document", "dump" ], "matchprop": "d" } there's also the clearmessagescache request packet that has no response.
AnimationEvent() - Web APIs
type a domstring representing the name of the type of the animationevent.
... animationname optional a domstring containing the value of the animation-name css property associated with the transition.
... pseudoelement optional is a domstring, starting with "::", containing the name of the pseudo-element the animation runs on.
Attr.prefix - Web APIs
WebAPIAttrprefix
before dom4 this api was defined within the node interface.
... specifications specification status comment domthe definition of 'attr: prefix' in that specification.
... living standard dom4the definition of 'attr.prefix' in that specification.
AudioProcessingEvent - Web APIs
property type description target read only eventtarget the event target (the topmost target in the dom tree).
... type read only domstring the type of event.
...{ var inputdata = inputbuffer.getchanneldata(channel); var outputdata = outputbuffer.getchanneldata(channel); // loop through the 4096 samples for (var sample = 0; sample < inputbuffer.length; sample++) { // make output equal to the same as the input outputdata[sample] = inputdata[sample]; // add noise to each output sample outputdata[sample] += ((math.random() * 2) - 1) * 0.2; } } } getdata(); // wire up play button playbutton.onclick = function() { source.connect(scriptnode); scriptnode.connect(audioctx.destination); source.start(); } // when the buffer source stops playing, disconnect everything source.onended = function() { source.disconnect(scriptnode); scriptnode.disconnect(audioctx.destination); } ...
BasicCardResponse.cardNumber - Web APIs
syntax "cardnumber" : "number" value a domstring representing the credit card number.
... iossamsung internetcardnumberchrome no support noedge no support ≤18 — 79firefox full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
...android no support nochrome android full support 57firefox android full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
BasicCardResponse.cardSecurityCode - Web APIs
syntax "cardsecuritycode" : "number" value a domstring representing the card security code.
...msung internetcardsecuritycodechrome no support noedge no support ≤18 — 79firefox full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
...android no support nochrome android full support 57firefox android full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
BasicCardResponse.cardholderName - Web APIs
syntax name = basiccardresponse.cardholdername; value a domstring indicating the name of the cardholder.
...samsung internetcardholdernamechrome no support noedge no support ≤18 — 79firefox full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
...android no support nochrome android full support 57firefox android full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
BasicCardResponse.expiryMonth - Web APIs
syntax "expirymonth" : "number" value a domstring representing the card expiry month as a two-digit number in the range 01 to 12.
...iossamsung internetexpirymonthchrome no support noedge no support ≤18 — 79firefox full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
...android no support nochrome android full support 57firefox android full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
BasicCardResponse.expiryYear - Web APIs
syntax "expiryyear" : "number" value a domstring representing the card expiry year as a four-digit number in the range 0000 to 9999.
... iossamsung internetexpiryyearchrome no support noedge no support ≤18 — 79firefox full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
...android no support nochrome android full support 57firefox android full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
BlobBuilder - Web APIs
method overview void append(in arraybuffer data); void append(in blob data); void append(in string data, [optional] in string endings); blob getblob([optional] in domstring contenttype); file getfile(in domstring name, [optional] in domstring contenttype); methods append() appends the contents of the specified javascript object to the blob being built.
... blob getblob( in domstring contenttype optional ); parameters contenttype optional the mime type of the data to be returned in the blob.
... file getfile( in domstring name, [optional] in domstring contenttype ); parameters name the file name.
BluetoothDevice - Web APIs
y="1" width="150" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="226" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">bluetoothdevice</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} interface interface bluetoothdevice { readonly attribute domstring id; readonly attribute domstring?
...ribute frozenarray uuids; promise watchadvertisements(); void unwatchadvertisements(); readonly attribute boolean watchingadvertisements; }; bluetoothdevice implements eventtarget; bluetoothdevice implements bluetoothdeviceeventhandlers; bluetoothdevice implements characteristiceventhandlers; bluetoothdevice implements serviceeventhandlers; properties bluetoothdevice.id read only a domstring that uniquely identifies a device.
... bluetoothdevice.name read only a domstring that provices a human-readable name for the device.
CSS.registerProperty() - Web APIs
syntax css.registerproperty(propertydefinition); parameters a propertydefinition dictionary object, which can contain the following members: name a domstring indicating the name of the property being defined.
... syntax optional a domstring representing the expected syntax of the defined property.
... initialvalue optional a domstring representing the initial value of the defined property.
CSS.supports() - Web APIs
WebAPICSSsupports
the first one allows to test the support of a pair property-value: propertyname a domstring containing the name of the css property to check.
... value a domstring containing the value of the css property to check.
... the second syntax takes one parameter matching the condition of @supports: supportcondition a domstring containing the condition to check.
CSSNamespaceRule - Web APIs
interface cssnamespacerule : cssrule { readonly attribute domstring namespaceuri; readonly attribute domstring?
...it has some specific properties: cssnamespacerule.namespaceuri returns a domstring containing the text of the uri of the given namespace.
... cssnamespacerule.prefix returns a domstring with the name of the prefix associated to this namespace.
CSSPrimitiveValue.getCounterValue() - Web APIs
if this css value doesn't contain a counter value, a domexception is raised.
... exceptions type description domexception an invalid_access_err is raised if the css value doesn't contain a counter value (e.g.
... specifications specification status comment document object model (dom) level 2 style specificationthe definition of 'cssprimitivevalue.getcountervalue' in that specification.
CSSPrimitiveValue.getFloatValue() - Web APIs
if this css value doesn't contain a float value or can't be converted into the specified unit, a domexception is raised.
... exceptions type description domexception an invalid_access_err is raised if the css value doesn't contain a float value or if the float value can't be converted into the specified unit.
... example var cs = window.getcomputedstyle(document.body); var cssvalue = cs.getpropertycssvalue("margin-top"); console.log(cssvalue.getfloatvalue(cssprimitivevalue.css_cm)); specifications specification status comment document object model (dom) level 2 style specificationthe definition of 'cssprimitivevalue.getfloatvalue' in that specification.
CSSPrimitiveValue.getRGBColorValue() - Web APIs
if this css value doesn't contain a rgb color value, a domexception is raised.
... exceptions type description domexception an invalid_access_err is raised if the attached property can't return an rgb color value (i.e.
... example var cs = window.getcomputedstyle(document.body); var cssvalue = cs.getpropertycssvalue("color"); console.log(cssvalue.getrgbcolorvalue()); specifications specification status comment document object model (dom) level 2 style specificationthe definition of 'cssprimitivevalue.getrgbcolorvalue' in that specification.
CSSPrimitiveValue.getRectValue() - Web APIs
if this css value doesn't contain a rect value, a domexception is raised.
... exceptions type description domexception an invalid_access_err is raised if the css value doesn't contain a rect value.
... example var cs = window.getcomputedstyle(document.getelementbyid("clippeddiv")); var cssvalue = cs.getpropertycssvalue("clip"); console.log(cssvalue.getrectvalue()); specifications specification status comment document object model (dom) level 2 style specificationthe definition of 'cssprimitivevalue.getrectvalue' in that specification.
CSSPrimitiveValue.getStringValue() - Web APIs
if this css value doesn't contain a string value, a domexception is raised.
... exceptions type description domexception an invalid_access_err is raised if the css value doesn't contain a string value.
... example var cs = window.getcomputedstyle(document.body); var cssvalue = cs.getpropertycssvalue("display"); console.log(cssvalue.getstringvalue()); specifications specification status comment document object model (dom) level 2 style specificationthe definition of 'cssprimitivevalue.getstringvalue' in that specification.
CSSPrimitiveValue.setFloatValue() - Web APIs
if the property attached to this value can't accept the specified unit or the float value, the value will be unchanged and a domexception will be raised.
... exceptions type description domexception an invalid_access_err is raised if the css value doesn't contain a float value or if the string value can't be converted into the specified unit.
... specifications specification status comment document object model (dom) level 2 style specificationthe definition of 'cssprimitivevalue.setfloatvalue' in that specification.
CSSStyleDeclaration - Web APIs
this is mostly useful for non-javascript dom implementations.
... working draft merged the dom level 2 style css2properties interface into cssstyledeclaration.
... document object model (dom) level 2 style specificationthe definition of 'cssstyledeclaration' in that specification.
CanvasPattern.setTransform() - Web APIs
the canvaspattern.settransform() method uses an svgmatrix or dommatrix object as the pattern's transformation matrix and invokes it on the pattern.
... syntax void pattern.settransform(matrix); parameters matrix an svgmatrix or dommatrix to use as the pattern's transformation matrix.
...byid('svg1'); var matrix = svg1.createsvgmatrix(); var img = new image(); img.src = 'https://mdn.mozillademos.org/files/222/canvas_createpattern.png'; img.onload = function() { var pattern = ctx.createpattern(img, 'repeat'); pattern.settransform(matrix.rotate(-45).scale(1.5)); ctx.fillstyle = pattern; ctx.fillrect(0, 0, 400, 400); }; note that newer browser versions started to support dommatrix as an input to settransform(), so for example you could replace the svgmatrix in the above example with the following: const matrix = new dommatrix([1, .2, .8, 1, 0, 0]); edit the code below and see your changes update live in the canvas: playable code <canvas id="canvas" width="400" height="200" class="playable-canvas"></canvas> <svg id="svg1" style="display:none"></svg> <div class="p...
CanvasRenderingContext2D.getTransform() - Web APIs
return value a dommatrix object.
... the transformation matrix is described by: [acebdf001]\left[ \begin{array}{ccc} a & c & e \\ b & d & f \\ 0 & 0 & 1 \end{array} \right] note: the returned object is not live, so updating it will not affect the current transformation matrix, and updating the current transformation matrix will not affect an already returned dommatrix.
... we then apply the retrieved matrix directly to the second canvas context by passing the dommatrix object directly to settransform(), and draw a circle on it.
CanvasRenderingContext2D.setTransform() - Web APIs
the newer type consists of a single parameter, matrix, representing a 2d transformation matrix to set (technically, a dommatrixinit object; any object will do as long as it contains the above components as properties).
... html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.settransform(1, .2, .8, 1, 0, 0); ctx.fillrect(0, 0, 100, 100); result retrieving and passing a dommatrix object in the following example, we have two <canvas> elements.
... we then apply the retrieved matrix directly to the second canvas context by passing the dommatrix object directly to settransform() (i.e.
Basic usage of canvas - Web APIs
these are both optional and can also be set using dom properties.
...providing a useful fallback text or sub dom helps to make the canvas more accessible.
... var canvas = document.getelementbyid('tutorial'); var ctx = canvas.getcontext('2d'); the first line in the script retrieves the node in the dom representing the <canvas> element by calling the document.getelementbyid() method.
Compositing and clipping - Web APIs
a clip example in this example, we'll use a circular clipping path to restrict the drawing of a set of random stars to a particular region.
... 0, 60, 0, math.pi * 2, true); ctx.clip(); // draw background var lingrad = ctx.createlineargradient(0, -75, 0, 75); lingrad.addcolorstop(0, '#232256'); lingrad.addcolorstop(1, '#143778'); ctx.fillstyle = lingrad; ctx.fillrect(-75, -75, 150, 150); // draw stars for (var j = 1; j < 50; j++) { ctx.save(); ctx.fillstyle = '#fff'; ctx.translate(75 - math.floor(math.random() * 150), 75 - math.floor(math.random() * 150)); drawstar(ctx, math.floor(math.random() * 4) + 2); ctx.restore(); } } function drawstar(ctx, r) { ctx.save(); ctx.beginpath(); ctx.moveto(r, 0); for (var i = 0; i < 9; i++) { ctx.rotate(math.pi / 5); if (i % 2 === 0) { ctx.lineto((r / 0.525731) * 0.200811, 0); } else { ctx.lineto(r, 0); ...
...after this a set of 50 randomly positioned and scaled stars is drawn, using the custom drawstar() function.
Using images - Web APIs
using images from the same page we can obtain a reference to images on the same page as the canvas by using one of: the document.images collection the document.getelementsbytagname() method if you know the id of the specific image you wish to use, you can use document.getelementbyid() to retrieve that specific image using images from other domains using the crossorigin attribute of an <img> element (reflected by the htmlimageelement.crossorigin property), you can request permission to load an image from another domain for use in your call to drawimage().
... if the hosting domain permits cross-domain access to the image, the image can be used in your canvas without tainting it; otherwise using the image will taint the canvas.
...probably the only thing to note, for those not so familiar with the dom, is the use of the node.insertbefore method.
ClipboardEvent() - Web APIs
type is a domstring representing the name of the type of the clipboardevent.
... datatype : a domstring containing the mime-type of the data contained in the data argument.
... data : a domstring containing the data concerned by the clipboard event.
console.log() - Web APIs
WebAPIConsolelog
another useful difference in chrome exists when sending dom elements to the console.
... notice: console.log prints the element in an html-like tree console.dir prints the element in a json-like tree specifically, console.log gives special treatment to dom elements, whereas console.dir does not.
... this is often useful when trying to see the full representation of the dom js object.
CredentialsContainer.get() - Web APIs
the available options are: providers: an array of domstring instances of identity providers to search for.
... protocols an array of domstring instances of federation protocols to search for.
...an aborted operation may complete normally (generally if the abort was received after the operation finished) or reject with an "aborterror" domexception.
CustomEvent.initCustomEvent() - Web APIs
syntax event.initcustomevent(type, canbubble, cancelable, detail); parameters type is a domstring containing the name of the event.
... canbubble is a boolean indicating whether the event bubbles up through the dom or not.
... specifications specification status comment domthe definition of 'customevent' in that specification.
DataTransfer.getData() - Web APIs
the datatransfer.getdata() method retrieves drag data (as a domstring) for the specified type.
... syntax datatransfer.getdata(format); arguments format a domstring representing the type of data to retrieve.
... return value domstring a domstring representing the drag data for the specified format.
DirectoryEntrySync - Web APIs
var direntry = fs.root.getdirectory('superseekrit', {create: true}); method overview directoryreadersync createreader () raises (fileexception); fileentrysync getfile (in domstring path, in optional flags options) raises (fileexception); directoryentrysync getdirectory (in domstring path, in optional flags options) raises (fileexception); void removerecursively () raises (fileexception); methods createreader() creates a new directoryreadersync to read entries from this directory.
... void getfile ( in domstring path, in optional flags options ) raises (fileexception); parameter path either an absolute path or a relative path from the directory to the file to be looked up or created.
... void getdirectory ( in domstring path, in optional flags options ) raises (fileexception); parameter path either an absolute path or a relative path from the directory to the file to be looked up or created.
DisplayMediaStreamConstraints.video - Web APIs
cursor a constraindomstring which specifies whether or not to include the mouse cursor in the generated track, and if so, whether or not to hide it while not moving.
... always the mouse is always visible in the video content of the {domxref("mediastream"), unless the mouse has moved outside the area of the content.
... displaysurface a constraindomstring which specifies the types of display surface that may be selected by the user.
Document.createCDATASection() - Web APIs
example var docu = new domparser().parsefromstring('<xml></xml>', 'application/xml') var cdata = docu.createcdatasection('some <cdata> data & then some'); docu.getelementsbytagname('xml')[0].appendchild(cdata); alert(new xmlserializer().serializetostring(docu)); // displays: <xml><![cdata[some <cdata> data & then some]]></xml> notes this will only work with xml, not html documents (as html documents do not support cdata sections); attempting it on an html document will throw not_supported_err.
... will throw a ns_error_dom_invalid_character_err exception if one tries to submit the closing cdata sequence ("]]>") as part of the data, so unescaped user-provided data cannot be safely used without with this method getting this exception (createtextnode() can often be used in its place).
... specifications specification status comment domthe definition of 'document.createcdatasection' in that specification.
Document.doctype - Web APIs
WebAPIDocumentdoctype
use domimplementation.createdocumenttype() to create a documenttype.
... dom level 2 doesn't support editing the document type declaration.
... specifications specification status comment domthe definition of 'document: doctype' in that specification.
Document.getElementsByClassName() - Web APIs
<html> <body> <div id="parent-id"> <p>hello world 1</p> <p class="test">hello world 2</p> <p>hello world 3</p> <p>hello world 4</p> </div> <script> var parentdom = document.getelementbyid("parent-id"); var test = parentdom.getelementsbyclassname("test"); // a list of matching elements, *not* the element itself console.log(test); //htmlcollection[1] var testtarget = parentdom.getelementsbyclassname("test")[0]; // the first element, as we wanted console.log(testtarget); //<p class="test">hello world 2</p> </script> </bo...
... html <span class="orange fruit">orange fruit</span> <span class="orange juice">orange juice</span> <span class="apple juice">apple juice</span> <span class="foo bar">something random</span> <textarea id="resultarea" style="width:98%;height:7em"></textarea> javascript // getelementsbyclassname only selects elements that have both given classes var allorangejuicebyclass = document.getelementsbyclassname('orange juice'); var result = "document.getelementsbyclassname('orange juice')"; for (var i=0, len=allorangejuicebyclass.length|0; i<len; i=i+1|0) { result += "\n " + allorang...
...hes var allorangejuicequery = document.queryselectorall('.orange.juice'); result += "\n\ndocument.queryselectorall('.orange.juice')"; for (var i=0, len=allorangejuicequery.length|0; i<len; i=i+1|0) { result += "\n " + allorangejuicequery[i].textcontent; } document.getelementbyid("resultarea").value = result; result specifications specification status comment domthe definition of 'document.getelementsbyclassname' in that specification.
Document.getElementsByTagNameNS() - Web APIs
example in the following example getelementsbytagnamens starts from a particular parent element, and searches topdown recursively through the dom from that parent element, looking for child elements matching the tag name parameter.
...aelems();"> show all p elements in document</button><br /> <button onclick="div1paraelems();"> show all p elements in div1 element</button><br /> <button onclick="div2paraelems();"> show all p elements in div2 element</button> </body> </html> potential workaround for other browsers which do not support if the desired browser did not support xpath, another approach (such as traversing the dom through all its children, identifying all @xmlns instances, etc.) would be necessary to find all tags with the desired local name and namespace, but xpath is much faster.
... context = doc; } var result = doc.evaluate('//*[local-name()="'+elname+'" and namespace-uri() = "'+ns+'"]', context, null, xpathresult.ordered_node_snapshot_type, null); var a = []; for(var i = 0; i < result.snapshotlength; i++) { a[i] = result.snapshotitem(i); } return a; } specifications specification status comment domthe definition of 'document.getelementsbytagnamens' in that specification.
Document.querySelector() - Web APIs
syntax element = document.queryselector(selectors); parameters selectors a domstring containing one or more selectors to match.
...see locating dom elements using selectors for more about selectors and how to manage them.
... specifications specification status comment domthe definition of 'document.queryselector()' in that specification.
Document.readyState - Web APIs
we can now access the dom elements.
... console.log("the first css rule is: " + document.stylesheets[0].cssrules[0].csstext); break; } readystatechange as an alternative to domcontentloaded event // alternative to domcontentloaded event document.onreadystatechange = function () { if (document.readystate === 'interactive') { initapplication(); } } readystatechange as an alternative to load event // alternative to load event document.onreadystatechange = function () { if (document.readystate === 'complete') { initapplication(); } } readystatechange as...
... event listener to insert or modify the dom before domcontentloaded document.addeventlistener('readystatechange', event => { if (event.target.readystate === 'interactive') { initloader(); } else if (event.target.readystate === 'complete') { initapp(); } }); specifications specification status comment html living standardthe definition of 'document readiness' in that specification.
Document.requestStorageAccess() - Web APIs
to make testing easier, we have added two preferences in about:config that control prompting upon requeststorageaccess() calls: dom.storage_access.auto_grants can be set to false to disable the automatic granting of ephemeral storage access grants.
... dom.storage_access.max_concurrent_auto_grants controls the threshold number of storage access grants at which users will begin to receive prompts.
... for example, if you want to configure firefox to automatically grant access on the first site where requeststorageaccess() is called and then prompt afterwards, you should adjust the value of the dom.storage_access.max_concurrent_auto_grants preference to 1.
Element.createShadowRoot() - Web APIs
use element.createshadowroot to create an instance of shadow dom.
... when shadow dom is created, it is always attached to an existing element.
... after the shadow dom is created, the element that it is attached to is called the shadow root.
Element.getAttributeNode() - Web APIs
example // html: <div id="top" /> let t = document.getelementbyid("top"); let idattr = t.getattributenode("id"); alert(idattr.value == "top") notes when called on an html element in a dom flagged as an html document, getattributenode lower-cases its argument before proceeding.
... dom methods dealing with element's attributes: not namespace-aware, most commonly used methods namespace-aware variants (dom level 2) dom level 1 methods for dealing with attr nodes directly (seldom used) dom level 2 namespace-aware methods for dealing with attr nodes directly (seldom used) setattribute (dom 1) setattributens setattributenode setattributenodens getattribute (dom 1) getattributens getattr...
...ibutenode getattributenodens hasattribute (dom 2) hasattributens - - removeattribute (dom 1) removeattributens removeattributenode - specifications specification status comment domthe definition of 'getattributenode()' in that specification.
Element.getElementsByClassName() - Web APIs
syntax var elements = element.getelementsbyclassname(names); parameters names a domstring containing one or more class names to match on, separated by whitespace.
... 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.
...here we'll find all <div> elements that have a class of test: var testelements = document.getelementsbyclassname('test'); var testdivs = array.prototype.filter.call(testelements, function(testelement) { return testelement.nodename === 'div'; }); specifications specification status comment domthe definition of 'element.getelementsbyclassname()' in that specification.
Element.hasAttributes() - Web APIs
examples let foo = document.getelementbyid('foo'); if (foo.hasattributes()) { // do something with 'foo.attributes' } polyfill ;(function(prototype) { prototype.hasattributes = prototype.hasattributes || function() { return (this.attributes.length > 0); } })(element.prototype); specifications specification status comment domthe definition of 'element.hasattributes()' in that specification.
... document object model (dom) level 3 core specificationthe definition of 'hasattributes()' in that specification.
... obsolete no change from document object model (dom) level 2 core specification document object model (dom) level 2 core specificationthe definition of 'hasattributes()' in that specification.
Element.insertAdjacentElement() - Web APIs
syntax targetelement.insertadjacentelement(position, element); parameters position a domstring representing the position relative to the targetelement; must match (case-insensitively) one of the following strings: 'beforebegin': before the targetelement itself.
... example beforebtn.addeventlistener('click', function() { var tempdiv = document.createelement('div'); tempdiv.style.backgroundcolor = randomcolor(); if (activeelem) { activeelem.insertadjacentelement('beforebegin',tempdiv); } setlistener(tempdiv); }); afterbtn.addeventlistener('click', function() { var tempdiv = document.createelement('div'); tempdiv.style.backgroundcolor = randomcolor(); if (activeelem) { activeelem.insertadjacentelement('afterend',tempdiv); } setlistener(tempdiv); }); have a look at our ins...
... specification specification status comment domthe definition of 'insertadjacentelement()' in that specification.
Element.insertAdjacentText() - Web APIs
syntax element.insertadjacenttext(position, element); parameters position a domstring representing the position relative to the element; must be one of the following strings: 'beforebegin': before the element itself.
... element a domstring representing the text to be inserted into the tree.
...following code: if (!element.prototype.insertadjacenttext) element.prototype.insertadjacenttext = function(type, txt){ this.insertadjacenthtml( type, (txt+'') // convert to string .replace(/&/g, '&amp;') // embed ampersand symbols .replace(/</g, '&lt;') // embed less-than symbols ) } specification specification status comment domthe definition of 'insertadjacenttext()' in that specification.
Element.removeAttribute() - Web APIs
syntax element.removeattribute(attrname); parameters attrname a domstring specifying the name of the attribute to remove from the element.
... dom methods dealing with element's attributes: not namespace-aware, most commonly used methods namespace-aware variants (dom level 2) dom level 1 methods for dealing with attr nodes directly (seldom used) dom level 2 namespace-aware methods for dealing with attr nodes directly (seldom used) setattribute (dom 1) setattributens setattributenode setattributenodens getattribute (dom 1) getattributens getattributenode getattributenodens hasattribute (dom 2) hasa...
...ttributens - - removeattribute (dom 1) removeattributens removeattributenode - example // given: <div id="div1" align="left" width="200px"> document.getelementbyid("div1").removeattribute("align"); // now: <div id="div1" width="200px"> specifications specification status comment domthe definition of 'element" removeattribute' in that specification.
Element.setAttributeNS() - Web APIs
example let d = document.getelementbyid('d1'); d.setattributens('http://www.mozilla.org/ns/specialspace', 'spec:align', 'center'); notes dom methods dealing with element's attributes: not namespace-aware, most commonly used methods namespace-aware variants (dom level 2) dom level 1 methods for dealing with attr nodes directly (seldom used) dom level 2 namespace-aware methods for dealing with attr nodes directly (seldom used) setattribute (dom 1) setattributens setattributenode setattributenodens getattribute (dom 1) getattrib...
...utens getattributenode getattributenodens hasattribute (dom 2) hasattributens - - removeattribute (dom 1) removeattributens removeattributenode - setattributens is the only method for namespaced attributes which expects the fully qualified name, i.e.
... specifications specification status comment domthe definition of 'document.setattributens' in that specification.
Element.slot - Web APIs
WebAPIElementslot
the slot property of the element interface returns the name of the shadow dom slot the element is inserted in.
... syntax var astring = element.slot element.slot = astring value a domstring.
... let slottedspan = document.queryselector('my-paragraph span') console.log(slottedspan.slot); // logs 'my-text' specifications specification status comment domthe definition of 'slot' in that specification.
Element.tagName - Web APIs
WebAPIElementtagName
this string's capitalization depends on the document type: for dom trees which represent html documents, the returned tag name is always in the canonical upper-case form.
... the tag names of elements in an xml dom tree are returned in the same case in which they're written in the original xml file.
... specifications specification status comment domthe definition of 'element: tagname' in that specification.
Element.toggleAttribute() - Web APIs
syntax element.toggleattribute(name [, force]); parameters name a domstring specifying the name of the attribute to be toggled.
... html <input value="text"> <button>toggleattribute("readonly")</button> javascript var button = document.queryselector("button"); var input = document.queryselector("input"); button.addeventlistener("click", function(){ input.toggleattribute("readonly"); }); result dom methods dealing with element's attributes: not namespace-aware, most commonly used methods namespace-aware variants (dom level 2) dom level 1 methods for dealing with attr nodes directly (seldom used) dom level 2 namespace-aware methods for dealing with attr nodes directly (seldom used) setattribute (dom 1) setattributens setattributenode setattributenodens getattribute (dom 1) getattrib...
...utens getattributenode getattributenodens hasattribute (dom 2) hasattributens - - removeattribute (dom 1) removeattributens removeattributenode - polyfill if (!element.prototype.toggleattribute) { element.prototype.toggleattribute = function(name, force) { if(force !== void 0) force = !!force if (this.hasattribute(name)) { if (force) return true; this.removeattribute(name); return false; } if (force === false) return false; this.setattribute(name, ""); return true; }; } specification specification status comment domthe definition of 'element.toggleattribute' in that specification.
Comparison of Event Targets - Web APIs
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 eventlisteners are currently being processed.
... event.relatedtarget dom mouseevent interface identifies a secondary target for the event.
... event.composedtarget event.webidl the original non-native target of the event before composition from shadow dom.
Event.target - Web APIs
WebAPIEventtarget
hide(evt) { // e.target refers to the clicked <li> element // this is different than e.currenttarget, which would refer to the parent <ul> in this context evt.target.style.visibility = 'hidden'; } // attach the listener to the list // it will fire when each <li> is clicked ul.addeventlistener('click', hide, false); specifications specification status comment domthe definition of 'event.target' in that specification.
... 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.
Event.timeStamp - Web APIs
WebAPIEventtimeStamp
in newer implementations, the value is a domhighrestimestamp accurate to 5 microseconds (0.005 ms).
... in older implementations, the value is a domtimestamp, accurate to a millisecond.
... specifications specification status comment domthe definition of 'event.timestamp' in that specification.
Event.type - Web APIs
WebAPIEventtype
syntax let eventtype = event.type; value a domstring containing the type of event.
... false); // second document.addeventlistener('keyup', geteventtype, false); // third // mouse events document.addeventlistener('mousedown', geteventtype, false); // first document.addeventlistener('mouseup', geteventtype, false); // second document.addeventlistener('click', geteventtype, false); // third result specifications specification status comment domthe definition of 'event.type' in that specification.
... living standard document object model (dom) level 2 events specificationthe definition of 'event.type' in that specification.
EventTarget.dispatchEvent() - Web APIs
notes unlike "native" events, which are fired by the dom and invoke event handlers asynchronously via the event loop, dispatchevent() invokes event handlers synchronously.
... specifications specification status comment domthe definition of 'eventtarget.dispatchevent()' in that specification.
... living standard initial definition in the dom 2 events specification.
ExtendableMessageEvent() - Web APIs
syntax var extendablemessageevent = new extendablemessageevent(type, init); parameters type a domstring that defines the type of the message event being created.
... origin: a domstring that defines the origin of the corresponding service worker's environment settings object.
... lasteventid: a domstring that defines the last event id of the event source.
FetchEvent() - Web APIs
syntax var fetchevent = new fetchevent(type, init); parameters type a domstring object specifying which event the object represents.
... replacesclientid read only a domstring which identifies the client which is being replaced by resultingclientid.
... resultingclientid read only a domstring containing the new clientid if the client changes as a result of the page load.
FileReaderSync - Web APIs
filereadersync.readasbinarystring() this method converts a specified blob or a file into a domstring representing the input data as a binary string.
... filereadersync.readastext() this method converts a specified blob or a file into a domstring representing the input data as a text string.
... filereadersync.readasdataurl() this method converts a specified blob or a file into a domstring representing the input data as a data url.
FileSystemDirectoryEntry.getFile() - Web APIs
the {domxref("fileerror.code")}} specifies what type of error occurred, as follows: fileerror.not_found_err the create option was not specified (or was specified as false), and the file doesn't exist.
...oidopera for androidsafari on iossamsung internetgetfile experimentalchrome full support 8edge full support 79firefox full support 50notes full support 50notes notes in firefox, the errorcallback's input parameter is a domexception rather than a fileerror object.ie no support noopera no support nosafari full support 11.1webview android full support ≤37chrome android full support 18firefox and...
...roid full support 50notes full support 50notes notes in firefox, the errorcallback's input parameter is a domexception rather than a fileerror object.opera android no support nosafari ios full support 11.3samsung internet android full support yeslegend full support full support no support no supportexperimental.
GamepadEvent - Web APIs
�� 34prefixed prefixed implemented with the vendor prefix: webkitedge full support ≤18firefox full support 29 full support 29 no support 24 — 28disabled disabled from version 24 until version 28 (exclusive): this feature is behind the dom.gamepad.enabled preference (needs to be set to true).
...rchrome full support 35edge full support 12firefox full support 29 full support 29 no support 24 — 28disabled disabled from version 24 until version 28 (exclusive): this feature is behind the dom.gamepad.enabled preference (needs to be set to true).
...1 — 34prefixed prefixed implemented with the vendor prefix: webkitedge full support 12firefox full support 29 full support 29 no support 24 — 28disabled disabled from version 24 until version 28 (exclusive): this feature is behind the dom.gamepad.enabled preference (needs to be set to true).
HTMLAnchorElement.rel - Web APIs
it is a domstring containing a space-separated list of link types indicating the relationship between the resource represented by the <a> element and the current document.
... living standard no change from document object model (dom) level 2 html specification document object model (dom) level 2 html specificationthe definition of 'rel' in that specification.
... obsolete no change from document object model (dom) level 1 specification document object model (dom) level 1 specificationthe definition of 'rel' in that specification.
HTMLHeadElement - Web APIs
htmlheadelement.profile is a domstring representing the uris of one or more metadata profiles (white space separated).
... document object model (dom) level 2 html specificationthe definition of 'htmlheadelement' in that specification.
... obsolete no change document object model (dom) level 1 specificationthe definition of 'htmlheadelement' in that specification.
HTMLHeadingElement - Web APIs
htmlheadingelement.align is a domstring representing an enumerated attribute indicating alignment of the heading with respect to the surrounding context.
... document object model (dom) level 2 html specificationthe definition of 'htmlheadingelement' in that specification.
... obsolete no change document object model (dom) level 1 specificationthe definition of 'htmlheadingelement' in that specification.
HTMLHtmlElement - Web APIs
htmlhtmlelement.version is a domstring representing the version of the html document type definition (dtd) that governs this document.
... document object model (dom) level 2 html specificationthe definition of 'htmlhtmlelement' in that specification.
... document object model (dom) level 1 specificationthe definition of 'htmlhtmlelement' in that specification.
HTMLIsIndexElement - Web APIs
htmlisindexelement.prompt is a domstring representing a text to be prompted for the field.
... document object model (dom) level 2 html specificationthe definition of 'htmlisindexelement' in that specification.
... obsolete no change from document object model (dom) level 1 specification document object model (dom) level 1 specificationthe definition of 'htmlisindexelement' in that specification.
HTMLLabelElement - Web APIs
document object model (dom) level 2 html specificationthe definition of 'htmllabelelement' in that specification.
... obsolete no change from document object model (dom) level 1 specification.
... document object model (dom) level 1 specificationthe definition of 'htmllabelelement' in that specification.
HTMLLinkElement.rel - Web APIs
it is a domstring containing a space-separated list of link types indicating the relationship between the resource represented by the <link> element and the current document.
... living standard no change from document object model (dom) level 2 html specification document object model (dom) level 2 html specificationthe definition of 'rel' in that specification.
... obsolete no change from document object model (dom) level 1 specification document object model (dom) level 1 specificationthe definition of 'rel' in that specification.
HTMLMediaElement.controlsList - Web APIs
the controlslist property of the htmlmediaelement interface returns a domtokenlist 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 domtokenlist takes one or more of three possible values: nodownload, nofullscreen, and noremoteplayback.
... syntax var domtokenlist = htmlmediaelement.controlslist; value a domtokenlist.
HTMLElement.focus() - Web APIs
recommendation document object model (dom) level 2 html specificationthe definition of 'focus' in that specification.
... obsolete document object model (dom) level 1 specificationthe definition of 'focus' in that specification.
... obsolete notes if you call htmlelement.focus() from a mousedown event handler, you must call event.preventdefault() to keep the focus from leaving the htmlelement behaviour of the focus in relation to different html features like tabindex or shadow dom, which previously remained under-specified, were recently updated (as october of 2019).
HTMLPreElement - Web APIs
document object model (dom) level 2 html specificationthe definition of 'htmlpreelement' in that specification.
... obsolete no change from document object model (dom) level 1 specification.
... document object model (dom) level 1 specificationthe definition of 'htmlpreelement' in that specification.
HTMLVideoElement - Web APIs
htmlvideoelement.height is a domstring that reflects the height html attribute, which specifies the height of the display area, in css pixels.
... htmlvideoelement.poster is a domstring that reflects the poster html attribute, which specifies an image to show while no video data is available.
... htmlvideoelement.width is a domstring that reflects the width html attribute, which specifies the width of the display area, in css pixels.
Recommended Drag Types - Web APIs
updates to datatransfer.types the latest spec dictates that datatransfer.types should return a frozen array of domstrings rather than a domstringlist (this is supported in firefox 52 and above).
...the data for the type should be a dom node.
...note that callers from a different domain will not be able to access the node even when it has been dropped.
HkdfParams - Web APIs
properties name a domstring.
... hash a domstring representing the digest algorithm to use.
...ideally, the salt is a random or pseudo-random value with the same length as the output of the digest function.
IDBIndexSync - Web APIs
(idbdatabaseexception); void openobjectcursor (in optional idbkeyrange range, in optional unsigned short direction) raises (idbdatabaseexception); any put (in any value, in optional any key) raises (idbdatabaseexception); void remove (in any key) raises (idbdatabaseexception); attributes attribute type description keypath readonly domstring the key path of this index.
... name readonly domstring the name of this index.
... storename readonly domstring this index's referenced object store.
IDBRequest.error - Web APIs
WebAPIIDBRequesterror
syntax var myerror = request.error; value a domerror containing the relevant error.
... in chrome 48+/firefox 58+ this property returns a domexception because domerror has been removed from the dom standard.
...pera android full support 14safari ios full support 8samsung internet android full support 1.5 full support 1.5 no support 1.5 — 7.0prefixed prefixed implemented with the vendor prefix: webkitdomexception value instead of domerrorchrome full support 48edge full support ≤18firefox full support 58ie no support noopera full support yessafari no support ...
IDBTransaction.error - Web APIs
syntax var myerror = transaction.error; value a domerror containing the relevant error.
... in chrome 48+/firefox 58+ this property returns a domexception because domerror has been removed from the dom standard.
...pera android full support 14safari ios full support 8samsung internet android full support 1.5 full support 1.5 no support 1.5 — 7.0prefixed prefixed implemented with the vendor prefix: webkitdomexception value instead of domerrorchrome full support 48edge full support ≤18firefox full support 58ie no support noopera full support yessafari no support ...
MediaDeviceInfo - Web APIs
properties mediadeviceinfo.deviceidread only returns a domstring that is an identifier for the represented device that is persisted across sessions.
... mediadeviceinfo.groupidread only returns a domstring that is a group identifier.
... mediadeviceinfo.labelread only returns a domstring that is a label describing this device (for example "external usb webcam").
MediaStreamTrack - Web APIs
mediastreamtrack.id read only returns a domstring containing a unique identifier (guid) for the track; it is generated by the browser.
... mediastreamtrack.kind read only returns a domstring set to "audio" if the track is an audio track and to "video", if it is a video track.
... mediastreamtrack.label read only returns a domstring containing a user agent-assigned label that identifies the track source, as in "internal microphone".
MouseEvent() - Web APIs
syntax event = new mouseevent(typearg, mouseeventinit); values typearg is a domstring representing the name of the event.
... "region", optional and defaulting to null, of type domstring, is the id of the hit region affected by the event.
... document object model (dom) level 3 events specificationthe definition of 'mouseevent()' in that specification.
MouseEvent.altKey - Web APIs
WebAPIMouseEventaltKey
html <p>click anywhere to test the <code>altkey</code> property.</p> <p id="log"></p> javascript let log = document.queryselector('#log'); document.addeventlistener('click', logkey); function logkey(e) { log.textcontent = `the alt key is pressed: ${e.altkey}`; } result specifications specification status comment document object model (dom) level 3 events specificationthe definition of 'mouseevent.altkey' in that specification.
... obsolete no change from document object model (dom) level 2 events specification.
... document object model (dom) level 2 events specificationthe definition of 'mouseevent.altkey' in that specification.
MouseEvent.button - Web APIs
WebAPIMouseEventbutton
ntent = 'left button clicked.'; break; case 1: log.textcontent = 'middle button clicked.'; break; case 2: log.textcontent = 'right button clicked.'; break; default: log.textcontent = `unknown button code: ${e.button}`; } } } result specifications specification status comment document object model (dom) level 3 events specificationthe definition of 'mouseevent.button' in that specification.
... obsolete compared to document object model (dom) level 2 events specification, the return value can be negative.
... document object model (dom) level 2 events specificationthe definition of 'mouseevent.button' in that specification.
MouseEvent.clientX - Web APIs
document object model (dom) level 3 events specificationthe definition of 'mouseevent.clientx' in that specification.
... obsolete no change from document object model (dom) level 2 events specification.
... document object model (dom) level 2 events specificationthe definition of 'mouseevent.clientx' in that specification.
MouseEvent.clientY - Web APIs
document object model (dom) level 3 events specificationthe definition of 'mouseevent.clienty' in that specification.
... obsolete no change from document object model (dom) level 2 events specification.
... document object model (dom) level 2 events specificationthe definition of 'mouseevent.clienty' in that specification.
MouseEvent.ctrlKey - Web APIs
html <p>click anywhere to test the <code>ctrlkey</code> property.</p> <p id="log"></p> javascript let log = document.queryselector('#log'); document.addeventlistener('click', logkey); function logkey(e) { log.textcontent = `the ctrl key is pressed: ${e.ctrlkey}`; } result specifications specification status comment document object model (dom) level 3 events specificationthe definition of 'mouseevent.ctrlkey' in that specification.
... obsolete no change from document object model (dom) level 2 events specification.
... document object model (dom) level 2 events specificationthe definition of 'mouseevent.ctrlkey' in that specification.
MouseEvent.initMouseEvent() - Web APIs
document.getelementbyid("out").innerhtml = stag; }; var simulateclick = function(){ var evt = document.createevent("mouseevents"); evt.initmouseevent("click", true, true, window, 0, 0, 0, 80, 20, false, false, false, false, 0, null); document.body.dispatchevent(evt); } simulateclick(); result specifications specification status comment document object model (dom) level 3 events specificationthe definition of 'mouseevent.initmouseevent()' in that specification.
... obsolete from document object model (dom) level 2 events specification, deprecated.
... document object model (dom) level 2 events specificationthe definition of 'mouseevent.initmouseevent()' in that specification.
MouseEvent.metaKey - Web APIs
html <p>click anywhere to test the <code>metakey</code> property.</p> <p id="log"></p> javascript let log = document.queryselector('#log'); document.addeventlistener('click', logkey); function logkey(e) { log.textcontent = `the meta key is pressed: ${e.metakey}`; } result specifications specification status comment document object model (dom) level 3 events specificationthe definition of 'mouseevent.metakey' in that specification.
... obsolete no change from document object model (dom) level 2 events specification.
... document object model (dom) level 2 events specificationthe definition of 'mouseevent.metakey' in that specification.
MouseEvent.relatedTarget - Web APIs
working draft document object model (dom) level 3 events specificationthe definition of 'mouseevent.relatedtarget' in that specification.
... obsolete no change from document object model (dom) level 2 events specification.
... document object model (dom) level 2 events specificationthe definition of 'mouseevent.altkey' in that specification.
MouseEvent.screenX - Web APIs
document object model (dom) level 3 events specificationthe definition of 'mouseevent.screenx' in that specification.
... obsolete no change from document object model (dom) level 2 events specification.
... document object model (dom) level 2 events specificationthe definition of 'mouseevent.sceenx' in that specification.
MouseEvent.screenY - Web APIs
document object model (dom) level 3 events specificationthe definition of 'mouseevent.screeny' in that specification.
... obsolete no change from document object model (dom) level 2 events specification.
... document object model (dom) level 2 events specificationthe definition of 'mouseevent.sceeny' in that specification.
MouseEvent.shiftKey - Web APIs
html <p>click anywhere to test the <code>shiftkey</code> property.</p> <p id="log"></p> javascript let log = document.queryselector('#log'); document.addeventlistener('click', logkey); function logkey(e) { log.textcontent = `the shift key is pressed: ${e.shiftkey}`; } result specifications specification status comment document object model (dom) level 3 events specificationthe definition of 'mouseevent.shiftkey' in that specification.
... obsolete no change from document object model (dom) level 2 events specification.
... document object model (dom) level 2 events specificationthe definition of 'mouseevent.shiftkey' in that specification.
MutationObserverInit.childList - Web APIs
by setting childlist to true, your callback will be invoked any time nodes are added to or removed from the dom node or nodes being watched.
... syntax var options = { childlist: true | false } value a boolean value indicating whether or not to invoke the callback function when new nodes are added to or removed from the section of the dom being monitored..
... example specifications specification status comment domthe definition of 'mutationobserverinit.childlist' in that specification.
Navigation Timing API - Web APIs
this api lets you measure data that was previously difficult to obtain, such as the amount of time needed to unload the previous page, how long domain lookups take, the total time spent executing the window's load handler, and so forth.
... the navigation timing api can be used to gather performance data on the client side to be sent to a server via xhr as well as measure data that was very difficult to measure by other means such as time to unload a previous page, domain look up time, window.onload total time, etc.
... calculate page render time as another example of an interesting piece of data you can obtain using the navigation timing api that you can't otherwise easily get, you can get the amount of time it took to render the page: const rendertime = perfdata.domcomplete - perfdata.domloading; this is obtained by starting with the time at which loading of the dom and its dependencies is complete (domcomplete) and subtracting from it the time at which parsing of the dom began (domloading).
Node.getRootNode() - Web APIs
WebAPINodegetRootNode
calling it on an element inside a shadow dom will return the associated shadowroot.
...(see the full source code): <!-- source: https://github.com/jserz/js_piece/blob/master/dom/node/getrootnode()/demo/getrootnode.html --> <div class="js-parent"> <div class="js-child"></div> </div> <div class="js-shadowhost"></div> <script> // works on chrome 54+,opera 41+ var parent = document.queryselector('.js-parent'), child = document.queryselector('.js-child'), shadowhost = document.queryselector('.js-shadowhost'); console.log(parent.getrootnode().nodename); // #document console.log(child.getrootnode().nodename); // #document //...
... shadowroot.queryselector('.js-shadowchild'); // the default value of composed is false console.log(shadowchild.getrootnode() === shadowroot); // true console.log(shadowchild.getrootnode({composed:false}) === shadowroot); // true console.log(shadowchild.getrootnode({composed:true}).nodename); // #document </script> specifications specification status comment domthe definition of 'getrootnode()' in that specification.
Node.nodeName - Web APIs
WebAPINodenodeName
syntax var str = node.nodename; value a domstring.
...however, in html, text_field's value would read "div", because nodename and tagname return in upper case on html elements in doms flagged as html documents.
... specifications specification status comment domthe definition of 'nodename' in that specification.
Node.parentElement - Web APIs
the node.parentelement read-only property returns the dom node's parent element, or null if the node either has no parent, or its parent isn't a dom element.
...this is always a dom element object, or null.
... example if (node.parentelement) { node.parentelement.style.color = "red"; } specifications specification status comment domthe definition of 'parentelement' in that specification.
Node.prefix - Web APIs
WebAPINodeprefix
in dom4 this api was moved from node to the element and attr interfaces.
... specifications specification status comment document object model (dom) level 3 core specificationthe definition of 'node.prefix' in that specification.
... document object model (dom) level 2 core specificationthe definition of 'initial definition' in that specification.
NodeIterator.filter - Web APIs
syntax nodefilter = nodeiterator.filter; example const nodeiterator = document.createnodeiterator( document.body, nodefilter.show_element, { acceptnode: function(node) { return nodefilter.filter_accept; } }, false ); nodefilter = nodeiterator.filter; specifications specification status comment domthe definition of 'nodeiterator.filter' in that specification.
... living standard no change from document object model (dom) level 2 traversal and range specification.
... document object model (dom) level 2 traversal and range specificationthe definition of 'nodeiterator.filter' in that specification.
NodeIterator.nextNode() - Web APIs
in old browsers, as specified in old versions of the specifications, the method may throws the invalid_state_err domexception if this method is called after the nodeiterator.detach()method.
...nodeiterator.nextnode(); example var nodeiterator = document.createnodeiterator( document.body, nodefilter.show_element, { acceptnode: function(node) { return nodefilter.filter_accept; } }, false // this optional argument is not used any more ); currentnode = nodeiterator.nextnode(); // returns the next node specifications specification status comment domthe definition of 'nodeiterator.nextnode' in that specification.
... document object model (dom) level 2 traversal and range specificationthe definition of 'nodeiterator.nextnode' in that specification.
NodeIterator.previousNode() - Web APIs
in old browsers, as specified in old versions of the specifications, the method may throws the invalid_state_err domexception if this method is called after the nodeiterator.detach()method.
... nodefilter.show_element, { acceptnode: function(node) { return nodefilter.filter_accept; } }, false // this optional argument is not used any more ); currentnode = nodeiterator.nextnode(); // returns the next node previousnode = nodeiterator.previousnode(); // same result, since we backtracked to the previous node specifications specification status comment domthe definition of 'nodeiterator.previousnode' in that specification.
... document object model (dom) level 2 traversal and range specificationthe definition of 'nodeiterator.previousnode' in that specification.
NodeIterator.root - Web APIs
WebAPINodeIteratorroot
syntax root = nodeiterator.root; example var nodeiterator = document.createnodeiterator( document.body, nodefilter.show_element, { acceptnode: function(node) { return nodefilter.filter_accept; } }, false ); root = nodeiterator.root; // document.body in this case specifications specification status comment domthe definition of 'nodeiterator.root' in that specification.
... living standard no change from document object model (dom) level 2 traversal and range specification.
... document object model (dom) level 2 traversal and range specificationthe definition of 'nodeiterator.root' in that specification.
NodeIterator.whatToShow - Web APIs
ement + nodefilter.show_comment + nodefilter.show_text, { acceptnode: function(node) { return nodefilter.filter_accept; } }, false ); if( (nodeiterator.whattoshow == nodefilter.show_all) || (nodeiterator.whattoshow % (nodefilter.show_comment*2)) >= nodefilter.show_comment) { // nodeiterator will show comments } specifications specification status comment domthe definition of 'nodeiterator.whattoshow' in that specification.
... living standard no change from document object model (dom) level 2 traversal and range specification.
... document object model (dom) level 2 traversal and range specificationthe definition of 'nodeiterator.whattoshow' in that specification.
NodeIterator - Web APIs
the nodeiterator interface represents an iterator over the members of a list of the nodes in a subtree of the dom.
... specifications specification status comment domthe definition of 'nodeiterator' in that specification.
... document object model (dom) level 2 traversal and range specificationthe definition of 'nodeiterator' in that specification.
Notification.Notification() - Web APIs
it defaults to auto, which just adopts the browser's language setting behavior, but you can override that behaviour by setting values of ltr and rtl (although most browsers seem to ignore these settings.) lang: the notification's language, as specified using a domstring representing a bcp 47 language tag.
... body: a domstring representing the body text of the notification, which is displayed below the title.
... tag: a domstring representing an identifying tag for the notification.
ParentNode.replaceChildren() - Web APIs
these can be domstring or node objects.
... syntax // [throws, unscopable] parentnode.replacechildren(...nodesordomstrings) // returns undefined parameters nodesordomstrings a set of node or domstring objects to replace the parentnode's existing children with.
...ingyesoptions); }); nobtn.addeventlistener('click', () => { const selectedtransferoptions = document.queryselectorall('#yes option:checked'); const existingnooptions = document.queryselectorall('#no option'); noselect.replacechildren(...selectedtransferoptions, ...existingnooptions); }); the end result looks like this: specification specification status comment domthe definition of 'parentnode.replacechildren()' in that specification.
PaymentAddress.addressLine - Web APIs
the addressline read-only property of the paymentaddress interface is an array of domstring objects, each specifying a line of the address that is not covered by one of the other properties of paymentaddress.
... syntax var paymentaddresslines = paymentaddress.addressline; value an array of domstring objects, each containing one line of the address.
...ss in london index addressline[] value 0 metal box factory 1 suite 441, 4th floor 2 30 great guildford street these, combined with additional values for other properties of the paymentaddress, would represent the full address, which is: mozilla metal box factory suite 441, 4th floor 30 great guildford street london se1 0hs united kingdom specifications specification status comment payment request apithe definition of 'paymentaddress.addressline' in that specification.
PaymentAddress.dependentLocality - Web APIs
the read-only dependentlocality property of the paymentaddress interface is a string containing a sublocality designation within a city, such as a neighborhood, borough, district, or, in the united kingdom, a dependent locality.
... syntax var paymentdependentlocality = paymentaddress.dependentlocality; value a domstring indicating the sublocality portion of the address.
...in the united kingdom, this is used to indicate the post town in the united kingdom (known officially by the royal mail as the dependent locality).
PaymentRequest.canMakePayment() - Web APIs
note: if you call this too often, the browser may reject the returned promise with a domexception.
...tcanmakepayment()chrome full support 61edge full support 16firefox full support 55notes disabled full support 55notes disabled notes available only in nightly builds.disabled from version 55: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
...android no support nochrome android full support 53firefox android full support 55notes disabled full support 55notes disabled notes available only in nightly builds.disabled from version 55: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
PaymentRequest.prototype.id - Web APIs
WebAPIPaymentRequestid
const response = await request.show(); console.log(response.requestid === request.id); // and in serialized form too const json = response.tojson(); console.log(json.requestid,response.requestid, request.id); syntax var id = paymentrequest.id value a domstring.
...amsung internetidchrome full support 61edge full support 16firefox full support 55notes disabled full support 55notes disabled notes available only in nightly builds.disabled from version 55: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
...android no support nochrome android full support 60firefox android full support 55notes disabled full support 55notes disabled notes available only in nightly builds.disabled from version 55: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
PaymentResponse.complete() - Web APIs
syntax completepromise = paymentrequest.complete(result); parameters result optional a domstring indicating the state of the payment operation upon completion.
...nternetcomplete()chrome full support 61edge full support 15firefox full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
...to change preferences in chrome, visit chrome://flags.firefox android full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
PaymentResponse.requestId - Web APIs
syntax var id = paymentrequest.id value a domstring.
...internetrequestidchrome full support 61edge full support 16firefox full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
...android no support nochrome android full support 60firefox android full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
Pbkdf2Params - Web APIs
properties name a domstring.
... hash a domstring representing the digest algorithm to use.
...this should be a random or pseudo-random value of at least 16 bytes.
PerformanceEntry.name - Web APIs
domstring performancemark mark the name used when the mark was created by calling performance.mark().
... domstring performancemeasure measure name used when the measure was created by calling performance.measure().
... domstring performancepainttiming paint either 'first-paint' or 'first-contentful-paint'.
PerformanceEntry - Web APIs
performanceentry.entrytype read only a domstring representing the type of performance metric such as, for example, "mark".
... performanceentry.starttime read only a domhighrestimestamp representing the starting time for the performance metric.
... performanceentry.duration read only a domhighrestimestamp representing the time value of the duration of the performance event.
PerformanceObserver.observe() - Web APIs
the performance entry types are specified as an array of domstring objects, each naming one entry type; the type names are documented in performance entry type names in performanceentry.entrytype.
... syntax observer.observe(options); parameters options a performanceobserverinit dictionary with the following possible members: entrytypes: an array of domstring objects, each specifying one performance entry type to observe.
... type: a single domstring specifying exactly one performance entry type to observe.
PerformanceResourceTiming.workerStart - Web APIs
the workerstart read-only property of the performanceresourcetiming interface returns a domhighrestimestamp immediately before dispatching the fetchevent if a service worker thread is already running, or immediately before starting the service worker thread if it is not already running.
... syntax resource.workerstart; value a domhighrestimestamp.
...entries() { // use getentriesbytype() to just get the "resource" events var p = performance.getentriesbytype("resource"); for (var i=0; i < p.length; i++) { print_start_and_end_properties(p[i]); } } function print_start_and_end_properties(perfentry) { // print timestamps of the performanceentry *start and *end properties properties = ["connectstart", "connectend", "domainlookupstart", "domainlookupend", "fetchstart", "redirectstart", "redirectend", "requeststart", "responsestart", "responseend", "secureconnectionstart", "workerstart"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in perfentry; if (supported) { ...
Pointer events - Web APIs
pointer events are dom events that are fired for a pointing device.
... they are designed to create a single dom event model to handle pointing input devices such as a mouse, pen/stylus or touch (such as one or more fingers).
... pointer event a dom event fired for a pointer.
RTCDataChannel - Web APIs
propertiesalso inherits properties from: eventtargetbinarytype the property binarytype on the rtcdatachannel interface is a domstring which specifies the type of javascript object which should be used to represent binary data received on the rtcdatachannel.
...lowthreshold the rtcdatachannel property bufferedamountlowthreshold is used to specify the number of bytes of buffered outgoing data that is considered "low." the default value is 0.id read only the read-only rtcdatachannel property id returns an id number (between 0 and 65,534) which uniquely identifies the rtcdatachannel.label read only the read-only rtcdatachannel property label returns a domstring containing a name describing the data channel.
...tcdatachannel's connection was negotiated by the web app (true) or by the webrtc layer (false).ordered read only the read-only rtcdatachannel property ordered indicates whether or not the data channel guarantees in-order delivery of messages; the default is true, which indicates that the data channel is indeed ordered.protocol read only the read-only rtcdatachannel property protocol returns a domstring containing the name of the subprotocol in use.
RTCIceTransport - Web APIs
gatheringstate read only a domstring indicating which gathering state the ice agent is currently in.
... role read only returns a domstring whose value is one of the members of the rtcicerole enumerated type: "controlling" or "controlled"; this indicates whether the ice agent is the one that makes the final decision as to the candidate pair to use or not.
... state read only a domstring indicating what the current state of the ice agent is.
RTCIdentityErrorEvent - Web APIs
rtcidentityerrorevent.idp read only is a domstring describing the domain name of the identity provider (idp) generating the error response.
... rtcidentityerrorevent.loginurl read only is a domstring giving the url where the user can complete the authentication.
... rtcidentityerrorevent.protocol read only is a domstring describing the idp protocol in use.
RTCPeerConnectionIceErrorEvent - Web APIs
properties the rtcpeerconnectioniceerrorevent interface includes the properties found on the event interface, as well as the following properties: address read only a domstring providing the local ip address used to communicate with the stun or turn server being used to negotiate the connection, or null if the local ip address has not yet been exposed as part of a local ice candidate.
... errortext read only a domstring containing the stun reason text returned by the stun or turn server.
... url read only a domstring indicating the url of the stun or turn server with which the error occurred.
RTCStats - Web APIs
WebAPIRTCStats
properties id a domstring which uniquely identifies the object which was inspected to produce this object based on rtcstats.
... timestamp a domhighrestimestamp object indicating the time at which the sample was taken for this statistics object.
... type a domstring indicating the type of statistics the object contains, taken from the enum type rtcstatstype.
RTCStatsReport - Web APIs
properties common to all statistic categories all webrtc statistics objects are fundamentally based on the rtcstats dictionary, which provides the most fundamental information: the timestamp, the statistic type string, and an id uniquely identifying the source of the data: id a domstring which uniquely identifies the object which was inspected to produce this object based on rtcstats.
... timestamp a domhighrestimestamp object indicating the time at which the sample was taken for this statistics object.
... type a domstring indicating the type of statistics the object contains, taken from the enum type rtcstatstype.
Range.collapse() - Web APIs
WebAPIRangecollapse
a collapsed range is empty, containing no content, specifying a single-point in a dom tree.
... example var range = document.createrange(); referencenode = document.getelementsbytagname("div").item(0); range.selectnode(referencenode); range.collapse(true); specifications specification status comment domthe definition of 'range.collapse()' in that specification.
... document object model (dom) level 2 traversal and range specificationthe definition of 'range.collapse()' in that specification.
Range.compareBoundaryPoints() - Web APIs
if the value of the parameter is invalid, a domexception with a notsupportederror code is thrown.
... example var range, sourcerange, compare; range = document.createrange(); range.selectnode(document.getelementsbytagname("div")[0]); sourcerange = document.createrange(); sourcerange.selectnode(document.getelementsbytagname("div")[1]); compare = range.compareboundarypoints(range.start_to_end, sourcerange); specifications specification status comment domthe definition of 'range.compareboundarypoints()' in that specification.
... document object model (dom) level 2 traversal and range specificationthe definition of 'range.compareboundarypoints()' in that specification.
Range.extractContents() - Web APIs
event listeners added using dom events are not retained during extraction.
...documentfragment = range.extractcontents(); list2.appendchild(documentfragment); } else if (range.commonancestorcontainer === list2 || range.commonancestorcontainer.parentnode === list2) { const documentfragment = range.extractcontents(); list1.appendchild(documentfragment); } } }); result specifications specification status comment domthe definition of 'range.extractcontents()' in that specification.
... document object model (dom) level 2 traversal and range specificationthe definition of 'range.extractcontents()' in that specification.
Range.setEnd() - Web APIs
WebAPIRangesetEnd
exceptions exceptions are thrown as domexception objects of the following types: invalidnodetypeerror the node specified by endnode is a doctype node; range endpoints cannot be located inside a doctype node.
... specifications specification status comment domthe definition of 'range.setend()' in that specification.
... document object model (dom) level 2 traversal and range specificationthe definition of 'range.setend()' in that specification.
ReadableStreamDefaultController.close() - Web APIs
examples in the following simple example, a custom readablestream is created using a constructor (see our simple random stream example for the full code).
... the start() function generates a random string of text every second and enqueues it into the stream.
... const stream = new readablestream({ start(controller) { interval = setinterval(() => { let string = randomchars(); // add the string to the stream controller.enqueue(string); // show it on the screen let listitem = document.createelement('li'); listitem.textcontent = string; list1.appendchild(listitem); }, 1000); button.addeventlistener('click', function() { clearinterval(interval); fetchstream(); controller.close(); }) }, pull(c...
ReadableStreamDefaultController.enqueue() - Web APIs
examples in the following simple example, a custom readablestream is created using a constructor (see our simple random stream example for the full code).
... the start() function generates a random string of text every second and enqueues it into the stream — see controller.enqueue(string).
... const stream = new readablestream({ start(controller) { interval = setinterval(() => { let string = randomchars(); // add the string to the stream controller.enqueue(string); // show it on the screen let listitem = document.createelement('li'); listitem.textcontent = string; list1.appendchild(listitem); }, 1000); button.addeventlistener('click', function() { clearinterval(interval); fetchstream(); controller.close(); }) }, pull(c...
ReadableStreamDefaultController - Web APIs
examples in the following simple example, a custom readablestream is created using a constructor (see our simple random stream example for the full code).
... the start() function generates a random string of text every second and enqueues it into the stream.
... const stream = new readablestream({ start(controller) { interval = setinterval(() => { let string = randomchars(); // add the string to the stream controller.enqueue(string); // show it on the screen let listitem = document.createelement('li'); listitem.textcontent = string; list1.appendchild(listitem); }, 1000); button.addeventlistener('click', function() { clearinterval(interval); fetchstream(); controller.close(); }) }, pull(c...
Using the Resource Timing API - Web APIs
timing resource loading phases the following example illustrates using the resource timing properties to calculate the amount of time the following phases take: redirection (redirectstart and redirectend ), dns lookup (domainlookupstart and domainlookupend), tcp handshake (connectstart and connectend), and response (responsestart and responseend).
...redirect time = " + t); // dns time t = resources[i].domainlookupend - resources[i].domainlookupstart; console.log("...
... the properties which are returned as 0 by default when loading a resource from a domain other than the one of the web page itself: redirectstart, redirectend, domainlookupstart, domainlookupend, connectstart, connectend, secureconnectionstart, requeststart, and responsestart.
SVGAnimatedString - Web APIs
properties svganimatedstring.animval read only this is a domstring representing the animation value.
... svganimatedstring.baseval this is a domstring representing the base value.
...setter throws domexception.
SVGElement - Web APIs
all of the svg dom interfaces that correspond directly to elements in the svg language derive from the svgelement interface.
...olas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties also inherits properties from: documentandelementeventhandlers, element, elementcssinlinestyle, globaleventhandlers, htmlorforeignelement, svgelementinstance svgelement.datasetread only a domstringmap object which provides a list of key/value pairs of named data attributes which correspond to custom data attributes attached to the element.
... unload fired when the dom implementation removes an svg document from a window or frame.
SVGGraphicsElement - Web APIs
svggraphicselement.getbbox() returns a domrect representing the computed bounding box of the current element.
... svggraphicselement.getctm() returns a dommatrix representing the matrix that transforms the current element's coordinate system to its svg viewport's coordinate system.
... svggraphicselement.getscreenctm() returns a dommatrix representing the matrix that transforms the current element's coordinate system to the coordinate system of the svg viewport for the svg document fragment.
SVGRect - Web APIs
WebAPISVGRect
methods this interface also inherits properties from its parent, domrectreadonly.
... specifications specification status comment geometry interfaces module level 1the definition of 'domrect' in that specification.
... candidate recommendation changed svgrect as a legacy alias of domrect.
SVGScriptElement - Web APIs
x="321" y="65" width="160" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="401" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgscriptelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties svgscriptelement.type read only a domstring corresponding to the type attribute of the given <script> element.
... a domexception is raised with the code no_modification_allowed_err on an attempt to change the value of a read only attribut.
... svgscriptelement.crossorigin read only a domstring corresponding to the crossorigin attribute of the given <script> element.
Selection - Web APIs
WebAPISelection
selection.typeread only returns a domstring describing the type of the current selection.
... selection.setbaseandextent() sets the selection to be a range including all or parts of two specified dom nodes, and any content located between them.
...range objects can also be created via the dom and programmatically added or removed from a selection.
Using server-sent events - Web APIs
this limit is per browser + domain, which means that you can open 6 sse connections across all of the tabs to www.example1.com and another 6 sse connections to www.example2.com (per stackoverflow).
...'"}'; echo "\n\n"; // send a simple message at random intervals.
...at random intervals, a simple message (with no event type) is sent.
ServiceWorkerMessageEvent.ServiceWorkerMessageEvent() - Web APIs
syntax var myswme = new serviceworkermessageevent(type, init); parameters type a domstring that defines the type of the message event being created.
... origin: a domstring that defines the origin of the corresponding service worker's environment settings object.
... lasteventid: a domstring that defines the last event id of the event source.
ServiceWorkerRegistration.showNotification() - Web APIs
it may contain the following values: action: a domstring identifying a user action to be displayed on the notification.
... title: a domstring containing action text to be shown to the user.
... timestamp: a domtimestamp representing the time when the notification was created.
ShadowRoot.innerHTML - Web APIs
the innerhtml property of the shadowroot interface sets or returns a reference to the dom tree inside the shadowroot.
... syntax var domstring = shadowroot.innerhtml shadowroot.innerhtml = domstring value a domstring.
... examples let customelem = document.queryselector('my-shadow-dom-element'); let shadow = customelem.shadowroot; shadow.innerhtml = '<strong>this element should be more important!</strong>'; specifications this property is not defined by any specifications yet; see this open spec issue to specify it.
Streams API - Web APIs
examples we have created a directory of examples to go along with the streams api documentation — see mdn/dom-examples/streams.
... simple random stream: this example shows how to use a custom stream to generate random strings, enqueue them as chunks, and then read them back out again.
... simple tee example: this example extends the simple random stream example, showing how a stream can be teed and both resulting streams can be read independently.
SubtleCrypto.encrypt() - Web APIs
function getmessageencoding() { const messagebox = document.queryselector(".aes-ctr #message"); let message = messagebox.value; let enc = new textencoder(); return enc.encode(message); } function encryptmessage(key) { let encoded = getmessageencoding(); // counter will be needed for decryption counter = window.crypto.getrandomvalues(new uint8array(16)); return window.crypto.subtle.encrypt( { name: "aes-ctr", counter, length: 64 }, key, encoded ); } let iv = new uint8array(16); let key = new uint8array(16); let data = new uint8array(12345); //crypto functions are wrapped in promises so we have to use await and make sure the function that //contains this code is an async function /...
... function getmessageencoding() { const messagebox = document.queryselector(".aes-cbc #message"); let message = messagebox.value; let enc = new textencoder(); return enc.encode(message); } function encryptmessage(key) { let encoded = getmessageencoding(); // iv will be needed for decryption iv = window.crypto.getrandomvalues(new uint8array(16)); return window.crypto.subtle.encrypt( { name: "aes-cbc", iv }, key, encoded ); } aes-gcm this code fetches the contents of a text box, encodes it for encryption, and encrypts it using aes in gcm mode.
... function getmessageencoding() { const messagebox = document.queryselector(".aes-gcm #message"); let message = messagebox.value; let enc = new textencoder(); return enc.encode(message); } function encryptmessage(key) { let encoded = getmessageencoding(); // iv will be needed for decryption iv = window.crypto.getrandomvalues(new uint8array(12)); return window.crypto.subtle.encrypt( { name: "aes-gcm", iv: iv }, key, encoded ); } specifications specification status comment web cryptography apithe definition of 'subtlecrypto.encrypt()' in that specification.
Text.wholeText - Web APIs
WebAPITextwholeText
syntax str = textnode.wholetext; notes and example suppose you have the following simple paragraph within your webpage (with some whitespace added to aid formatting throughout the code samples here), whose dom node is stored in the variable para: <p>thru-hiking is great!
... specifications specification status comment domthe definition of 'text.wholetext' in that specification.
... document object model (dom) level 3 core specificationthe definition of 'text.wholetext' in that specification.
TextDecoder() - Web APIs
if the value for utflabel is unknown, or is one of the two values leading to a 'replacement' decoding algorithm ( "iso-2022-cn" or "iso-2022-cn-ext"), a domexception with the "typeerror" value is thrown.
... syntax decoder = new textdecoder(utflabel, options); parameters utflabeloptional is a domstring, defaulting to "utf-8", containing the label of the encoder.
..."iso-2022-kr" 'iso-2022-kr' "utf-16be" 'utf-16be' "utf-16", "utf-16le" 'utf-16le' "x-user-defined" 'x-user-defined' "iso-2022-cn", "iso-2022-cn-ext" 'replacement' optionsoptional is a textdecoderoptions dictionary with the property: fatal a boolean flag indicating if the textdecoder.decode() method must throw a domexception with the "encodingerror" value when an coding error is found.
TransitionEvent() - Web APIs
type is a domstring representing the name of the type of the transitionevent.
... propertyname optional is a domstring containing the value of the property-name css property associated with the transition.
... pseudoelement optional is a domstring, starting with "::", containing the name of the pseudo-element the animation runs on.
UIEvent.view - Web APIs
WebAPIUIEventview
specifications specification status comment document object model (dom) level 3 events specificationthe definition of 'uievent' in that specification.
... obsolete from document object model (dom) level 2 events specification, changed the type of view from abstractview to windowproxy.
... document object model (dom) level 2 events specificationthe definition of 'uievent' in that specification.
UserDataHandler - Web APIs
key (domstring) is the user key.
... data (domuserdata) is the user data.
...alue operation node_cloned 1 node.clonenode() node_imported 2 document.importnode() node_deleted unimplemented (see bug 550400) 3 node_renamed unimplemented 4 node.renamenode() node_adopted 5 document.adoptnode() (node_renamed is currently not supported since node.renamenode() is not supported.) specification dom level 3 core: userdatahandler ...
ValidityState.typeMismatch - Web APIs
a valid email address includes an email prefix and a domain, with or without a top level domain.
...a valid url includes a protocol, optionally with an ip address, or an optional subdomain, domain, and top level domain combination.
...x://y.z protocol or full url with protocol examples given the following: <p> <label> enter an email address: <input type="email" value="example.com"/> </label> </p> <p> <label> enter a url: <input type="url" value="example.com"/> </label> </p> input:invalid { border: red solid 3px; } the above each produce a typemismatch because the email address is just a domain and the url has no protocol the typemismatch occurs when there is a disconnect between the value expected via the type attribute and the data that is actually present.
WebGLRenderingContext.getShaderSource() - Web APIs
the webglrenderingcontext.getshadersource() method of the webgl api returns the source code of a webglshader as a domstring.
... syntax domstring gl.getshadersource(shader); parameters shader a webglshader object to get the source code from.
... return value a domstring containing the source code of the shader.
Color masking - Web APIs
« previousnext » this webgl example modifies random colors by applying color masking to limit the range of displayed colors to specific shades.
... masking random colors this example modifies the random color animation by applying color masking with colormask().
...ction 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 evt.target.innerhtml="off"; gl.colormask(mask[0], mask[1], mask[2], true); drawanimation(); }; function drawanimation () { var color = getrandomcolor(); gl.clearcolor(color[0], color[1], color[2], 1.0); gl.clear(gl.color_buffer_bit); } function getrandomcolor() { return [math.random(), math.random(), math.random()]; } }, false); the source code of this example is also available on github.
Scissor animation - Web APIs
var gl, color = getrandomcolor(), position; function setupanimation (evt) { window.removeeventlistener(evt.type, setupanimation, false); if (!(gl = getrenderingcontext())) return; gl.enable(gl.scissor_test); gl.clearcolor(color[0], color[1], color[2], 1.0); // unlike the browser window, vertical position in webgl is // measured from bottom to top.
... if (position[1] < 0) { // horizontal position chosen randomly, and vertical // position at the top of the drawing buffer.
... position = [ math.random()*(gl.drawingbufferwidth - size[0]), gl.drawingbufferheight ]; // random velocity between 1.0 and 7.0 velocity = 1.0 + 6.0*math.random(); color = getrandomcolor(); gl.clearcolor(color[0], color[1], color[2], 1.0); } } function getrandomcolor() { return [math.random(), math.random(), math.random()]; } function getrenderingcontext() { var canvas = document.queryselector("canvas"); canvas.width = canvas.clientwidth; canvas.height = canvas.clientheight; var gl = canvas.getcontext("webgl") || canvas.getcontext("experimental-webgl"); if (!gl) { var paragraph = document.queryselector("p"); paragraph.innerhtml = "failed to get webgl context." + "your browser or device may not support webgl."; return ...
WebGL by example - Web APIs
clearing the rendering context with a random color when the user clicks.
... simple color animation a very basic color animation, done by clearing the webgl drawing buffer with a different random color every second.
... color masking modifying random colors by applying color masking and thus limiting the range of displayed colors to specific shades.
Web Video Text Tracks Format (WebVTT) - Web APIs
following interface can be used to expose webvtt cues in dom api: enum autokeyword { "auto" }; enum directionsetting { "" /* horizontal */, "rl", "lr" }; enum linealignsetting { "start", "center", "end" }; enum positionalignsetting { "line-left", "center", "line-right", "auto" }; enum alignsetting { "start", "center", "end", "left", "right" }; [constructor(double starttime, double endtime, domstring text)] interface vttcue : texttrackcue { attribute vtt...
...region; attribute directionsetting vertical; attribute boolean snaptolines; attribute (double or autokeyword) line; attribute linealignsetting linealign; attribute (double or autokeyword) position; attribute positionalignsetting positionalign; attribute double size; attribute alignsetting align; attribute domstring text; documentfragment getcueashtml(); }; vtt region interface this is the second interface in webvtt api.
...the interface code is given below which can be used to expose the webvtt regions in dom api: enum scrollsetting { "" /* none */, "up" }; [constructor] interface vttregion { attribute double width; attribute long lines; attribute double regionanchorx; attribute double regionanchory; attribute double viewportanchorx; attribute double viewportanchory; attribute scrollsetting scroll; }; methods and properties the methods used in webvtt are those which are used to alter ...
Inputs and input sources - Web APIs
handedness the most direct way to decide which controller is primary is to have a user-definable "handedness" preference that the user sets to indicate which of their hands is dominant.
... when the user releases the mouse button, the select event is sent to the xrsession, then the dom receives a click event.
... to accomplish that, we include in the avatar object a posdelta property, of type dompoint, which includes the offsets to apply to all three axes in order to adjust the avatar's position (the viewer pose's reference space's origin) to include movement and rotation from the keyboard and mouse.
Rendering and the WebXR frame animation callback - Web APIs
in this context, "repaint" simply means the process of ensuring that the screen's displayed content matches what the dom and the elements within are trying to present at the moment.
...the result is a domhighrestimestamp value indicating the number of milliseconds that have elapsed since the last frame was rendered.
...this domhighrestimestamp value is a floating-point value indicating the time at which the frame was scheduled for rendering.
Using the Web Audio API - Web APIs
also, for accessibility, it's nice to expose that track in the dom.
... <audio src="mycooltrack.mp3"></audio> note: if the sound file you're loading is held on a different domain you will need to use the crossorigin attribute; see cross origin resource sharing (cors) for more information.
...lucky for us there's a method that allows us to do just that — audiocontext.createmediaelementsource: // get the audio element const audioelement = document.queryselector('audio'); // pass it into the audio context const track = audiocontext.createmediaelementsource(audioelement); note: the <audio> element above is represented in the dom by an object of type htmlmediaelement, which comes with its own set of functionality.
Functions and classes available to Web Workers - Web APIs
in addition to the standard javascript set of functions (such as string, array, object, json, etc), there are a variety of functions available from the dom to workers.
...it allows access to a cryptographically strong random number generator and to cryptographic primitives.
... 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.
Using Web Workers - Web APIs
for example, you can't directly manipulate the dom from inside a worker, or use some default methods and properties of the window object.
...there's no access to non-threadsafe components or the dom.
...this includes manipulating the dom and using that page's objects.
Window.event - Web APIs
WebAPIWindowevent
specifications specification status comment domthe definition of 'window.event' in that specification.
... full support 12firefox full support 63notes disabled full support 63notes disabled notes this was briefly enabled by default in 65, then removed again while related compatibility issues are sorted out (see bug 1520756).disabled from version 63: this feature is behind the dom.window.event.enabled preference (needs to be set to true).
...full support 18firefox android full support 63notes disabled full support 63notes disabled notes this was briefly enabled by default in 65, then removed again while related compatibility issues are sorted out (see bug 1520756).disabled from version 63: this feature is behind the dom.window.event.enabled preference (needs to be set to true).
Worker() - Web APIs
WebAPIWorkerWorker
available properties are as follows: type: a domstring specifying the type of worker to create.
... credentials: a domstring specifying the type of credentials to use for the worker.
... name: a domstring specifying an identifying name for the dedicatedworkerglobalscope representing the scope of the worker, which is mainly useful for debugging purposes.
XMLHttpRequest - Web APIs
xmlhttprequest.response read only returns an arraybuffer, blob, document, javascript object, or a domstring, depending on the value of xmlhttprequest.responsetype, that contains the response entity body.
... xmlhttprequest.responsetext read only returns a domstring that contains the response to the request as text, or null if the request was unsuccessful or has not yet been sent.
... xmlhttprequest.statustext read only returns a domstring containing the response string returned by the http server.
XPathEvaluator.createExpression() - Web APIs
syntax xpathexpression xpathevaluator.createexpression(expression, resolver); parameters expression a domstring representing representing the xpath expression to be created.
... namespace_err if the expression contains namespace prefixes which cannot be resolved by the specified xpathnsresolver, a domexception of type namespace_error is raised.
.../output></div> javascript var xpath = "//div"; var evaluator = new xpathevaluator(); var expression = evaluator.createexpression("//div"); var result = expression.evaluate(document, xpathresult.ordered_node_snapshot_type); document.queryselector("output").textcontent = result.snapshotlength; result specifications specification status comment document object model (dom) level 3 xpath specificationthe definition of 'xpathevaluator.createexpression()' in that specification.
XPathEvaluator.createNSResolver() - Web APIs
this method adapts any dom node to resolve namespaces so that an xpath expression can be easily evaluated relative to the context of the node where it appeared within the document.
... this adapter works like the dom level 3 method node.lookupnamespaceuri() in resolving the namespace uri from a given prefix using the current information available in the node's hierarchy at the time the method is called, also correctly resolving the implicit xml prefix.
... specifications specification status comment document object model (dom) level 3 xpath specificationthe definition of 'xpathevaluator.creatensresolver()' in that specification.
XPathNSResolver.lookupNamespaceURI() - Web APIs
syntax domstring xpathnsresolver.lookupnamespaceuri(prefix); parameters prefix a domstring representing the prefix to look for.
... return value a domstring representing the associated namespace uri or null if none is found.
... specifications specification status comment document object model (dom) level 3 xpath specificationthe definition of 'xpathnsresolver.lookupnamespaceuri()' in that specification.
XRInputSource - Web APIs
handednessread only a domstring that indicates which hand the device represented by this xrinputsource is being used in, if any.
... profilesread only an array of domstring objects, each specifying the name of an input profile describing the preferred visual representation and behavior of this input source.
... targetraymoderead only a domstring indicating the methodology used to produce the target ray: gaze, tracked-pointer, or screen.
XRPermissionStatus.granted - Web APIs
syntax grantedfeatures = xrpermissionstatus.granted; value an array of domstring objects, each identifying a single webxr feature which the app or site has been granted permission to use.
... for devices with six degrees of freedom (6dof) tracking, the local reference space tries to keep the origin stable relative to the environment.
... xrreferencespace unbounded a tracking space which allows the user total freedom of movement, possibly over extremely long distances from their origin point.
XRRigidTransform() - Web APIs
syntax let xrrigidtransform = new xrrigidtransform(position, orientation); parameters position optional an object conforming to dompointinit which specifies the coordinates at which the point or object is located.
...if this parameter is left out or is not compatible with dompointinit, the position used is assumed to be {x: 0, y: 0, z: 0, w: 1}.
... orientation optional an object conforming to dompointinit which specifies the direction in which the object is facing.
XRSystem: isSessionSupported() - Web APIs
if the no devices are available or the browser doesn't have permission to use the xr device, the promise is rejected with an appropriate domexception.
... syntax var issupportedpromise = xr.issessionsupported(xrsessionmode) parameters xrsessionmode a domstring specifying the webxr session mode for which support is to be checked.
... exceptions rather than throwing true exceptions, issessionsupported() rejects the returned promise, passing to the rejection handler a domexception whose name is one of the following strings.
XSL Transformations in Mozilla FAQ - Web APIs
mozilla won't load xslt stylesheets from a different domain for security reasons.
...this is achieved by printing the current dom tree.
... this does not affect css stylesheets loaded from the generated dom, those honor media just like in pages without xslt.
ARIA: rowgroup role - Accessibility
6</span> </div> <div role="row" aria-rowindex="18"> <span role="cell">rowgroup</span> <span role="cell">thead</span> </div> <div role="row" aria-rowindex="24"> <span role="cell">term</span> <span role="cell">dt</span> </div> </div> </div> the above is a non-semantic aria table with a table header and table body, with five of 81 rows present in the dom: one within a table header and four rows within the table body.
...the table body is a separate rowgroup, with four rows currently in the dom.
... because not all the rows are in the dom, we've included the aria-rowindex property on every row.
ARIA: listbox role - Accessibility
if the id does not refer to a dom descendant of the listbox, then that id must be included among the ids in the aria-owns attrubute.
... aria-owns this is a space-separated list of element ids which are not dom child elements of the listbox.
... if one or more entries are not dom children of listbox, additional aria-* properties will need to be set (see aria best practices).
::slotted() - CSS: Cascading Style Sheets
WebCSS::slotted
this only works when used inside css placed within a shadow dom.
...dchrome full support 50edge full support 79firefox full support 63 full support 63 no support 59 — 63disabled disabled from version 59 until version 63 (exclusive): this feature is behind the dom.webcomponents.shadowdom.enabled preference (needs to be set to true).
... full support 50chrome android full support 50firefox android full support 63 full support 63 no support 59 — 63disabled disabled from version 59 until version 63 (exclusive): this feature is behind the dom.webcomponents.shadowdom.enabled preference (needs to be set to true).
:host-context() - CSS: Cascading Style Sheets
the :host-context() css pseudo-class function selects the shadow host of the shadow dom containing the css it is used inside (so you can select a custom element from inside its shadow dom) — but only if the selector given as the function's parameter matches the shadow host's ancestor(s) in the place it sits inside the dom hierarchy.
... in other words, this allows a custom element, or anything within that custom element's shadow dom, to apply different styles based on its position within the outer dom or classes/attributes applied to ancestor elements.
... note: this has no effect when used outside a shadow dom.
@document - CSS: Cascading Style Sheets
WebCSS@document
domain(), which matches if the document url is on the domain provided (or a subdomain of it).
... the values provided to the url(), url-prefix(), domain(), and media-document() functions can be optionally enclosed by single or double quotes.
... formal syntax @document [ <url> | url-prefix(<string>) | domain(<string>) | media-document(<string>) | regexp(<string>) ]# { <group-rule-body> } examples specifying document for css rule @document url("http://www.w3.org/"), url-prefix("http://www.w3.org/style/"), domain("mozilla.org"), media-document("video"), regexp("https:.*") { /* css rules here apply to: - the page "http://www.w3.org/" - any page...
User input and controls - Developer guides
mouse the events occurring when the user interacts with a pointing device such as a mouse are represented by the mouseevent dom interface.
...to use touch events, you need to add event listeners and specify handler functions, which will be called when the event gets fired: element.addeventlistener("touchstart", handlestart, false);
 element.addeventlistener("touchcancel", handlecancel, false);
 element.addeventlistener("touchend", handleend, false);
 element.addeventlistener("touchmove", handlemove, false); where element is the dom element you want to register the touch events on.
... contenteditable in open web apps any dom element can be made directly editable using the contenteditable attribute.
<input type="search"> - HTML: Hypertext Markup Language
WebHTMLElementinputsearch
value a domstring representing the value contained in the search field.
... value the value attribute contains a domstring representing the value contained in the search field.
...the following screenshot comes from chrome: in addition, modern browsers also tend to automatically store search terms previously entered across domains, which then come up as autocomplete options when subsequent searches are performed in search inputs on that domain.
<input type="time"> - HTML: Hypertext Markup Language
WebHTMLElementinputtime
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.
... value a domstring containing the value of the time entered into the input.
...escribed under time value format min the earliest time to accept as a valid input readonly a boolean attribute which, if present, indicates that the contents of the time input should not be user-editable step the stepping interval to use both for user interfaces purposes and during constraint validation unlike many data types, time values have a periodic domain, meaning that the values reach the highest possible value, then wrap back around to the beginning again.
<main> - HTML: Hypertext Markup Language
WebHTMLElementmain
the html <main> element represents the dominant content of the <body> of a document.
... implicit aria role main permitted aria roles no role permitted dom interface htmlelement attributes this element only includes the global attributes.
... <main> doesn't contribute to the document's outline; that is, unlike elements such as <body>, headings such as <h2>, and such, <main> doesn't affect the dom's concept of the structure of the page.
<slot> - HTML: Hypertext Markup Language
WebHTMLElementslot
the html <slot> element—part of the web components technology suite—is a placeholder inside a web component that you can fill with your own markup, which lets you create separate dom trees and present them together.
... permitted parents any element that accepts phrasing content implicit aria role no corresponding role permitted aria roles no role permitted dom interface htmlslotelement attributes this element includes the global attributes.
... living standard domthe definition of 'slots' in that specification.
Clear-Site-Data - HTTP
this affects the entire registered domain, including subdomains.
... "storage" indicates that the server wishes to remove all dom storage for the origin of the response url.
...you can achieve that by adding the clear-site-data header when sending the page confirming that logging out from the site has been accomplished successfully (https://example.com/logout, for example): clear-site-data: "cache", "cookies", "storage", "executioncontexts" clearing cookies if this header is delivered with the response at https://example.com/clear-cookies, all cookies on the same domain https://example.com and any subdomains (like https://stage.example.com, etc), will be cleared out.
CSP: base-uri - HTTP
examples: http://*.example.com: matches all attempts to load from any subdomain of example.com using the http: url scheme.
... *.example.com: matches all attempts to load from any subdomain of example.com using the current protocol.
... examples meta tag configuration <meta http-equiv="content-security-policy" content="base-uri 'self'"> apache configuration <ifmodule mod_headers.c> header set content-security-policy "base-uri 'self'"; </ifmodule> nginx configuration add_header content-security-policy "base-uri 'self';" violation case since your domain isn't example.com, a <base> element with its href set to https://example.com will result in a csp violation.
CSP: report-uri - HTTP
'/csp-violations.log'; $log_file_size_limit = 1000000; // bytes - once exceeded no further entries are added $email_address = 'admin@example.com'; $email_subject = 'content-security-policy violation'; // end configuration $current_domain = preg_replace('/www\./i', '', $_server['server_name']); $email_subject = $email_subject .
...$current_domain; http_response_code(204); // http 204 no content $json_data = file_get_contents('php://input'); // we pretty print the json before adding it to the log file if ($json_data = json_decode($json_data)) { $json_data = json_encode($json_data, json_pretty_print | json_unescaped_slashes); if (!file_exists($log_file)) { // send an email $message = "the following content-security-policy violation occurred on " .
... $current_domain .
CSP: style-src-attr - HTTP
the http content-security-policy (csp) style-src-attr directive specifies valid sources for inline styles applied to individual dom elements.
... examples: http://*.example.com: matches all attempts to load from any subdomain of example.com using the http: url scheme.
... *.example.com: matches all attempts to load from any subdomain of example.com using the current protocol.
CSP: trusted-types - HTTP
the http content-security-policy (csp) trusted-types directive instructs user agents to restrict usage of known dom xss sinks to a predefined set of functions that only accept non-spoofable, typed values in place of strings.
... this allows authors to define rules guarding writing values to the dom and thus reducing the dom xss attack surface to small, isolated parts of the web application codebase, facilitating their monitoring and code review.
... syntax content-security-policy: trusted-types; content-security-policy: trusted-types <policyname>; content-security-policy: trusted-types <policyname> <policyname> 'allow-duplicates'; <domstring> any string can be a trusted type policy name.
Content-Security-Policy - HTTP
style-src-attr specifies valid sources for inline styles applied to individual dom elements.
... require-trusted-types-for enforces trusted types at the dom xss injection sinks.
...trusted types allows applications to lock down dom xss injection sinks to only accept non-spoofable, typed values in place of strings.
Link prefetching FAQ - HTTP
basically, there are two ways of looking at this issue: websites can already cause things to be silently downloaded using js/dom hacks.
... it is important that websites adopt <link> tag based prefetching instead of trying to roll-in silent downloading using various js/dom hacks.
...the user preference to disable <link> tag prefetching may simply encourage websites to stick with js/dom hacks, and that would not be good for users.
HTTP
WebHTTP
the cookie can also be set to expire on a certain date, or restricted to a specific domain and path.
... cross-origin resource sharing (cors) cross-site http requests are http requests for resources from a different domain than the domain of the resource making the request.
... for instance, an html page from domain a (http://domaina.example/) makes a request for an image on domain b (http://domainb.foo/image.jpg) via the img element.
Unicode property escapes - JavaScript
if a character is used in a limited set of scripts, the script property will only match for the "predominant" used script.
... if we want to match characters based on a "non-predominant" script, we could use the script_extensions property (scx for short).
... // Ù¢ is the digit 2 in arabic-indic notation // while it is predominantly written within the arabic script // it can also be written in the thaana script "Ù¢".match(/\p{script=thaana}/u); // null as thaana is not the predominant script super() "Ù¢".match(/\p{script_extensions=thaana}/u); // ["Ù¢", index: 0, input: "Ù¢", groups: undefined] unicode property escapes vs.
Object.prototype.__lookupGetter__() - JavaScript
examples standard-compliant and non-standard ways to get a property getter var obj = { get foo() { return math.random() > 0.5 ?
... 'foo' : 'bar'; } }; // non-standard and deprecated way obj.__lookupgetter__('foo'); // (function() { return math.random() > 0.5 ?
... 'foo' : 'bar'; }) // standard-compliant way object.getownpropertydescriptor(obj, "foo").get; // (function() { return math.random() > 0.5 ?
Promise - JavaScript
"use strict"; // to experiment with error handling, "threshold" values cause errors randomly const threshold_a = 8; // can use zero 0 to guarantee error function tetheredgetnumber(resolve, reject) { try { settimeout( function() { const randomint = date.now(); const value = randomint % 10; try { if(value >= threshold_a) { throw new error(`too large: ${value}`); } } catch(msg) { reject(`error in call...
...it creates a promise that will be fulfilled, using window.settimeout(), to the promise count (number starting from 1) every 1-3 seconds, at random.
... resolve(thispromisecount); }, math.random() * 2000 + 1000); }); // we define what to do when the promise is resolved with the then() call, // and what to do when the promise is rejected with the catch() call p1.then(function(val) { // log the fulfillment value log.insertadjacenthtml('beforeend', val + ') promise fulfilled (async code terminated)'); }).catch((reason) => { // log the rejection reason console.log(...
Proxy - JavaScript
const target = {}; const p = new proxy(target, {}); p.a = 37; // operation forwarded to the target console.log(target.a); // 37 // (the operation has been properly forwarded!) note that while this "no-op" works for javascript objects, it does not work for native browser objects like dom elements.
...y; object.defineproperty(base.prototype, 'constructor', descriptor); return proxy; } var person = function(name) { this.name = name; }; var boy = extend(person, function(name, age) { this.age = age; }); boy.prototype.gender = 'm'; var peter = new boy('peter', 13); console.log(peter.gender); // "m" console.log(peter.name); // "peter" console.log(peter.age); // 13 manipulating dom nodes sometimes you want to toggle the attribute or class name of two different elements.
...get the "doccookies" object here: https://developer.mozilla.org/docs/dom/document.cookie#a_little_framework.3a_a_complete_cookies_reader.2fwriter_with_full_unicode_support */ var doccookies = new proxy(doccookies, { get: function (otarget, skey) { return otarget[skey] || otarget.getitem(skey) || undefined; }, set: function (otarget, skey, vvalue) { if (skey in otarget) { return false; } return otarget.setitem(skey, vvalue); }, deleteproperty: fu...
Authoring MathML - MathML
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.
... client-side conversion in a web environment, the most obvious method to convert a simple syntax into a dom tree is to use javascript and of course many libraries have been developed to perform that task.
...this is still a work-in-progress, but could be improved in the future thanks to web components and shadow dom.
How to make PWAs re-engageable using Notifications and Push - Progressive web apps (PWAs)
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.addeventlistener('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.
... create a notification the example app creates a notification out of the available data — a game is picked at random, and the chosen one feeds the notification with the content: it sets the game's name as the title, mentioning the author in the body, and showing the image as an icon: function randomnotification() { var randomitem = math.floor(math.random()*games.length); var notiftitle = games[randomitem].name; var notifbody = 'created by '+games[randomitem].author+'.'; var notifimg = 'data/img/'+games[rand...
...omitem].slug+'.jpg'; var options = { body: notifbody, icon: notifimg } var notif = new notification(notiftitle, options); settimeout(randomnotification, 30000); } a new random notification is created every 30 seconds until it becomes too annoying and is disabled by the user.
SVG Presentation Attributes - SVG: Scalable Vector Graphics
alignment-baseline baseline-shift clip clip-path clip-rule color color-interpolation color-interpolation-filters color-profile color-rendering cursor direction display dominant-baseline enable-background fill fill-opacity fill-rule filter flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-orientation-horizontal glyph-orientation-vertical image-rendering kerning letter-spacing lighting-color marker-end marker-mid marker-start mask opacity overflow pointer-events shape-rendering solid-color solid-opacity stop-color stop-opacity stroke stroke-dasharray stroke-dashoffset stroke-li...
... value: auto|baseline|before-edge|text-before-edge|middle|central|after-edge|text-after-edge|ideographic|alphabetic|hanging|mathematical|inherit; animatable: yes baseline-shift it allows repositioning of the dominant-baseline relative to the dominant-baseline of the parent text content element.
... value: see css display; animatable: yes dominant-baseline it defines the baseline used to align the box’s text and inline-level contents.
alignment-baseline - SVG: Scalable Vector Graphics
t but it has effect only on the following four elements: <tspan>, <tref>, <altglyph>, and <textpath> usage notes value auto | baseline | before-edge | text-before-edge | middle | central | after-edge | text-after-edge | ideographic | alphabetic | hanging | mathematical | top | center | bottom default value auto animatable yes auto the value is the dominant-baseline of the script to which the character belongs - i.e., use the dominant-baseline of the parent.
... baseline uses the dominant baseline choice of the parent.
..." x="60" y="110">a baseline</text> <!-- materialisation of anchors --> <circle cx="60" cy="10" r="3" fill="red" /> <circle cx="60" cy="65" r="3" fill="red" /> <circle cx="60" cy="110" r="3" fill="red" /> <style><![cdata[ text{ font: bold 36px verdana, helvetica, arial, sans-serif; } ]]></style> </svg> for object alignment in other elements (such as <text>), see dominant-baseline.
begin - SVG: Scalable Vector Graphics
WebSVGAttributebegin
each value can be one of the following: <offset-value> this value defines a clock-value that represents a point in time relative to the beginning of the svg document (usually the load or domcontentloaded event).
...all valid events (not necessarily supported by all elements) are defined by the dom and html specifications.
... editor's draft refers to the specifications in dom ui events and html for the <event-value>.
Texts - SVG: Scalable Vector Graphics
WebSVGTutorialTexts
the attribute dominant-baseline decides the vertical alignment.
... <text> this is <tspan font-weight="bold" fill="red">bold and red</tspan> </text> playable code <svg width="350" height="60" xmlns="http://www.w3.org/2000/svg"> <text> this is <tspan font-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.
... </textpath> </text> <style><![cdata[ text{ dominant-baseline: hanging; font: 28px verdana, helvetica, arial, sans-serif; } ]]></style> </svg> « previousnext » ...
SVG: Scalable Vector Graphics
WebSVG
as such, it's a text-based, open web standard for describing images that can be rendered cleanly at any size and are designed specifically to work well with other web standards including css, dom, javascript, and smil.
... svg dom interface reference details about the svg dom api, for interaction with javascript.
... other resources: xml, css, dom, canvas examples google maps (route overlay) & docs (spreadsheet charting) svg bubble menus svg authoring guidelines an overview of the mozilla svg project frequently asked questions regarding svg and mozilla svg as an image svg animation with smil svg art gallery animation and interactions like html, svg has a document model (dom) and events, and is accessible from javascript.
How to fix a website with blocked mixed content - Web security
for your own domain, serve all content as https and fix your links.
... for other domains, use the site's https version if available.
... if https is not available, you can try contacting the domain and asking them if they can make the content available via https.
Index - XPath
WebXPathIndex
found 57 pages: # page tags and summary 1 xpath css selectors, dom, jxon, landing, path, xml, xpath, xslt xpath stands for xml path language.
... 55 index index, reference, xpath, xslt found 57 pages: 56 introduction to using xpath in javascript add-ons, dom, extensions, javascript, transforming_xml_with_xslt, web development, xml, xpath, xslt this document describes the interface for using xpath in javascript internally, in extensions, and from websites.
... mozilla implements a fair amount of the dom 3 xpath, which means that xpath expressions can be run against both html and xml documents.
XPath
xpath is mainly used in xslt, but can also be used as a much more powerful way of navigating through the dom of any xml-like language document using xpathexpression, such as html and svg, instead of relying on the document.getelementbyid() or parentnode.queryselectorall() methods, the node.childnodes properties, and other dom core features.
... xpath snippets these are javascript utility functions, that can be used in your own code, based on dom level 3 xpath apis.
... related topics xslt, xquery, xml, dom, jxon, jsonpath comparison of css selectors and xpath ...
Advanced Example - XSLT: Extensible Stylesheet Language Transformations
figure 7: sorting based on div contentview example // xhtml fragment: <div id="example"> <div>1</div> <div>2</div> <div>3</div> <div>4</div> <div>5</div> <div>6</div> <div>7</div> <div>8</div> <div>9</div> <div>10</div> </div> // javascript var xslref; var xslloaded = false; var xsltprocessor = new xsltprocessor(); var mydom; var xmlref = document.implementation.createdocument("", "", null); function sort() { if (!xslloaded){ p = new xmlhttprequest(); p.open("get", "example2.xsl", false); p.send(null); xslref = p.responsexml; xsltprocessor.importstylesheet(xslref); xslloaded = true; } // create a new xml document in memory xmlref = document.implementation.createdocument("", "", nul...
...l); // we want to move a part of the dom from an html document to an xml document.
....getparameter(null, "myorder"); if (sortval == "" || sortval == "descending") xsltprocessor.setparameter(null, "myorder", "ascending"); else xsltprocessor.setparameter(null, "myorder", "descending"); // initiate the transformation var fragment = xsltprocessor.transformtofragment(xmlref, document); // clear the contents document.getelementbyid("example").innerhtml = ""; mydom = fragment; // add the new content from the transformation document.getelementbyid("example").appendchild(fragment) } // xsl stylesheet: <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns="http://www.w3.org/1999/xhtml" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:xsl="http://www.w3.org/1999/xsl/transform"> <xsl:output method="html" indent="yes" /> <xsl:param ...
WebAssembly Concepts - WebAssembly
a set of web apis that the web app can call to control web browser/device functionality and make things happen (dom, cssom, webgl, indexeddb, web audio api, etc.).
...we have run into performance problems, however, when trying to use javascript for more intensive use cases like 3d games, virtual and augmented reality, computer vision, image/video editing, and a number of other domains that demand native performance (see webassembly use cases for more ideas).
... by itself, webassembly cannot currently directly access the dom; it can only call javascript, passing in integer and floating point primitive data types.
Navigator.mozNotification - Archive of obsolete content
method overview notification createnotification(in domstring title, in domstring description, in domstring iconurl optional); methods createnotification() creates and returns a notification object that can be used to display the specified message with an optional url.
... notification createnotification( in domstring title, in domstring description, in domstring iconurloptional ); parameters title the notification title.
Content Processes - Archive of obsolete content
in the next section, we will look at how content scripts interact with the dom in a content process.
... accessing the dom the global for the content sandbox has the window object as its prototype.
content/symbiont - Archive of obsolete content
this may take one of the following values: "start": load content scripts immediately after the document element for the page is inserted into the dom, but before the dom content itself has been loaded "ready": load content scripts once dom content has been loaded, corresponding to the domcontentloaded event "end": load content scripts once all the content (dom, js, css, images) for the page has been loaded, at the time the window.onload event fires this property is optional and defaults to "end".
...this may have one of the following values: "start": load content scripts immediately after the document element for the page is inserted into the dom, but before the dom content itself has been loaded "ready": load content scripts once dom content has been loaded, corresponding to the domcontentloaded event "end": load content scripts once all the content (dom, js, css, images) for the page has been loaded, at the time the window.onload event fires contentscriptoptions read-only value exposed to content scripts under self.options property...
frame/utils - Archive of obsolete content
usage module exports create function that takes the nsidomdocument of a privileged document and creates a browser element in its documentelement: let { open } = require('sdk/window/utils'); let { create } = require('sdk/frame/utils'); let window = open('data:text/html,foo'); let frame = create(window.document); optionally create can be passed set of options to configure created frame even further.
... parameters document : nsidomdocument options : object optional options: name type type string string that defines access type of the document loaded into it.
loader/sandbox - Archive of obsolete content
the argument may be: a url string, in which case the sandbox will get the same privileges as a script loaded from that url a dom window object, to inherit privileges from the window being passed.
...this argument can be: a uri string, giving the sandbox the same privileges as a script loaded from that url a dom window object, giving the sandbox the same privileges as the dom window null, to give the sandbox chrome privileges.
remote/parent - Archive of obsolete content
frame every dom page loaded as a part of the application is loaded in a content frame.
... frameelement the dom element that displays this frame in the main process.
stylesheet/utils - Archive of obsolete content
parameters window : nsidomwindow uri : string, nsiuri} type : string the type of the sheet.
... parameters window : nsidomwindow uri : string, nsiuri} type : string the type of the sheet.
util/match-pattern - Archive of obsolete content
example pattern example matching urls example non-matching urls "*" http://example.com/ https://example.com/ ftp://example.com/ http://bar.com/foo.js http://foo.com/ file://example.js resource://me/my-addon/data/file.html data:text/html,hi there a domain name prefixed with an asterisk and dot matches any url of that domain or a subdomain, using any of http, https, ftp.
... https://mozilla.org http://foo.com/mozilla http://hemozoon.org mozscheme://foo.org http://foo.org /https:\/\/www\.moz.*/ https://www.mozilla.org https://www.mozzarella.com http://www.mozilla.org https://foo.mozilla.org/ https://foo.com/moz /http.*moz.*/ http://foo.mozilla.org/ http://mozilla.org http://hemozoon.org/ https://anydomain.com/foomozbar/ ftp://http/mozilla.org /[^:/]+:\/\/[^/]*mozilla\.org\/.*/ ftp://foo.mozilla.org/ http://www.mozilla.org/ https://developer.mozilla.org/any ftp://http/mozilla.org http://anydomain.com/mozilla.org/ examples var { matchpattern } = require("sdk/util/match-pattern"); var pattern = new matchpattern("http://example.com/*"); console.log(pattern.test...
Creating annotations - Archive of obsolete content
selector page-mod selector content scripts the content script for the selector page-mod uses jquery to examine and manipulate the dom.
...an element is eligible if it, or one of its ancestors in the dom tree, has an attribute named "id".
Overview - Archive of obsolete content
the annotator uses content scripts to build user interfaces, get user input, and examine the dom of pages loaded by the user.
... working with the dom we'll use two page-mods to interact with the doms of pages that the user has opened.
Logging - Archive of obsolete content
the dom console object is useful for debugging javascript.
... because dom objects aren't available to the main add-on code, the sdk provides its own global console object with most of the same methods as the dom console, including methods to log error, warning, or informational messages.
HTML in XUL for rich tooltips - Archive of obsolete content
he element that the mouse is over (which will soon launch the tooltip) var txt = event.target.getattribute("tooltiphtml"); // get the html div element that is inside the custom xul tooltip var div = document.getelementbyid("myhtmltipdiv"); //clear the html div element of any prior shown custom html while(div.firstchild) div.removechild(div.firstchild); //safely convert html string to a simple dom object, stripping it of javascript and more complex tags var injecthtml = components.classes["@mozilla.org/feed-unescapehtml;1"] .getservice(components.interfaces.nsiscriptableunescapehtml) .parsefragment(txt, false, null, div); //attach the dom object to the html div element div.appendchild(injecthtml); } } window.addeventlistener('load', htmltip.onload, false); in the xul overlay, xmlns:h...
...this is done by calling the onmousetooltip function, which will take the tooltiphtml attribute of the element that is being hovered over and safely convert that into dom and inject it into the tooltip that will soon be shown.
JavaScript timers - Archive of obsolete content
functions available to workers in addition to the standard javascript set of functions (such as string, array, object, json etc), there are a variety of functions available from the dom to workers.
... timer.jsm the timer.jsm javascript code module contains pure-javascript implementations of settimeout and cleartimeout that are compatible with the dom window functions, but that can be used by code that does not have access to a dom window (for example, javascript code modules or content frame scripts).
getAttributeNS - Archive of obsolete content
note that all gecko-based browsers (including firefox) support dom:element.getattributens.
...on current element, conditionally on whether its prefix matches a declared namespace see also http://www.w3.org/tr/dom-level-3-cor...mespaceurialgo ...
Code snippets - Archive of obsolete content
miscellaneous miscellaneous useful code fragments html to dom using a hidden browser element to parse html to a window's dom javascript libraries here are some javascript libraries that may come in handy.
...ogress password manager code used to read and write passwords to/from the integrated password manager bookmarks code used to read and write bookmarks javascript debugger service code used to interact with the javascript debugger service svg general general information and utilities svg animation animate svg using javascript and smil svg interacting with script using javascript and dom events to create interactive svg embedding svg in html and xul using svg to enhance html or xul based markup xul widgets html in xul for rich tooltips dynamically embed html into a xul element to attain markup in a tooltip label and description special uses and line breaking examples tree setup and manipulation of trees using xul and js scrollbar changing style of scrollbars.
Extension Etiquette - Archive of obsolete content
expando properties of shared objects, such as document objects, or dom nodes.
...xpcom contract ids, for instance, should always begin with an @, followed by a domain name that the author controls, e.g., "@example.com/foo/bar;1" it is important that the prefix that you use be unlikely to conflict with other code, and that it be indicative of the name of your add-on.
Chapter 1: Introduction to Extensions - Archive of obsolete content
locationbar separates a url’s domain and path in the location bar for easier reading.
...users have flexible customization options, using css in user style sheets and javascript/dom in user scripts (these depend on stylish, greasemonkey, and userchrome.js).
Adding Toolbars and Toolbar Buttons - Archive of obsolete content
all of this is very important to test because, when the dialog is opened, firefox changes the dom of the toolbar, adding wrapper elements that allow the customization.
... this tends to break very specific css, and xbl bindings lose their internal state when moved around the dom.
Adding menus and submenus - Archive of obsolete content
dom functions like createelement and appendchild can be used to accomplish this.
...you can access these items by id through the dom, but their parent menu is not easily accessible.
Appendix A: Add-on Performance - Archive of obsolete content
a very common filter is the url of the page, since most add-ons are limited to one or a few domains.
... if your add-on needs to perform a heavy operation like sorting or a complex mathematical calculation, you should use dom workers to offload the work to other threads.
Appendix C: Avoiding using eval in Add-ons - Archive of obsolete content
even if you trust the remote server; for example, because it is one you rent and administer yourself, there is a huge security risk, because of, but not limited to: you might discontinue your project or sell it, so that it is possible another person with malicious intentions takes over your domain.
... the server and/or domain name might be compromised.
JavaScript Object Management - Archive of obsolete content
the load event is fired after the dom on the window has loaded completely, but before it's displayed to the user.
... */ init : function(aevent) { this._stringbundle = document.getelementbyid("xulschoolhello-string-bundle"); // you can make changes to the window dom here.
Security best practices in extensions - Archive of obsolete content
content from a domain (such as http://www.example.com) can only access that same domain.
...one way to do this is to use custom dom events; see interaction between privileged and non-privileged pages.
Promises - Archive of obsolete content
yield os.file.writeatomic(config.processedpath, processor.process(), { tmppath: config.processedpath + "." + math.random() }); // and write out a new config file.
... config.indexstats = processor.stats; yield os.file.writeatomic(configpath, json.stringify(config), { tmppath: configpath + "." + math.random(), encoding: "utf-8" }) timestamp = new date; }); http requests http requests should, in nearly all circumstances, be made via the standard xmlhttprequest api.
Add-ons - Archive of obsolete content
interaction between privileged and non-privileged pages an easy way to send data from a web page to an extension is by using custom dom events.
... in your extension's browser.xul overlay, write code which listens for a custom dom event.
Creating a dynamic status bar extension - Archive of obsolete content
we use the window.addeventlistener() dom function to tell firefox to call the stockwatcher.startup() function when a new browser window is opened: window.addeventlistener("load", function(e) { stockwatcher.startup(); }, false); our new extension has two primary functions: startup() and refreshinformation().
...nel.label = 'goog: ' + fieldarray[1]; samplepanel.tooltiptext = 'chg: ' + fieldarray[4] + ' | ' + 'open: ' + fieldarray[5] + ' | ' + 'low: ' + fieldarray[6] + ' | ' + 'high: ' + fieldarray[7] + ' | ' + 'vol: ' + fieldarray[8]; } } the first thing we do here is get the status bar panel into the variable samplepanel by calling the document.getelementbyid() dom function.
MozBeforeResize - Archive of obsolete content
general info specification mozilla specific interface event bubbles no cancelable no target window default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree).
... type read only domstring the type of event.
Automated testing tips and tricks - Archive of obsolete content
in test scripts, <code>sleep 5 after the above command should ensure the profile is created before the next command in the test script is run how to enable dump in a new profile add user_pref("browser.dom.window.dump.enabled", true); to profiledir/user.js how to execute test code with chrome privileges using a chrome doc - see sbtests.xul in http://people.mozilla.com/~davel/scripts/ for an example firefox-bin -p sbtestprofile -chrome chrome://sbtests/content/ above code calls the quit function in quit.js to exit after test is finished how to detect content o...
...nload event from chrome use the domcontentloaded event chromewindow.addeventlistener('domcontentloaded',callbackfunction,false); ...
Creating a Firefox sidebar extension - Archive of obsolete content
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</em:name> <em:version>1.0</em:version> <em:creator>your name</em:creator> <em:description>example extension for creation and registration of a sidebar.</em:description> <em:targetapplication> <description> <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> <!-- firefox --> <em:minversion>1.5</em:minversion...
...emptysidebar@yourdomain.com now you're ready to test your extension!
Creating regular expressions for a microsummary generator - Archive of obsolete content
urls 101 urls for auction item pages on ebay, like those on many other sites, usually start with the string "http://" and contain a domain name, a file path, and some query parameters.
... here's a url for an auction item page on ebay: http://cgi.ebay.com/ws/ebayisapi.dll?viewitem&item=280018439106 in this url, the domain name is "cgi.ebay.com", the file path is "/ws/ebayisapi.dll", and the query parameters are "?viewitem&item=280018439106".
Embedding FAQ - Archive of obsolete content
here is the code : import org.eclipse.swt.swt; import org.eclipse.swt.browser.mozillabrowser; import org.eclipse.swt.browser.progressevent; import org.eclipse.swt.browser.progresslistener; import org.eclipse.swt.widgets.display; import org.eclipse.swt.widgets.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.addprogresslistener(new progresslistener() { ...
... public void changed(progressevent event) { } public void completed(progressevent event) { nsidomdocument doc = browser.getdocument(); system.out.println(doc); } }); while (!shell.isdisposed()) { if (!display.readanddispatch()) { display.sleep(); } } } how to map a javascript function to a c++ function define an xpcom class defining the function you'll be doing in javascript.
Exception logging in JavaScript - Archive of obsolete content
exception reporting in firefox 3 firefox 3 improves reporting of unhandled exceptions by establishing a set of rules that determines whether or not an exception is worth reporting: any methods on interfaces annotated with the [function] attribute in idl (see, for example, nsidomeventlistener) that throw exceptions always report those exceptions into the error console.
...first, you can set the boolean preference dom.report_all_js_exceptions.
Layout System Overview - Archive of obsolete content
these dynamic changes are caused by manipulations of the content model via the dom (generally through javascript).
...in both cases, the content is manipulated by the user (via the dom) and the resulting visual impacts must be shown as quickly as possible, without disconcerting flicker or other artifacts that might bother the user.
popChallengeResponse - Archive of obsolete content
witness octet string, -- the result of applying the one-way function (owf) to a -- randomly-generated integer, a.
... -- request is being made) of rand, where rand is specified as -- rand ::= sequence { -- int integer, -- - the randomly-generated integer a (above) -- senderhash octet string -- - the result of applying the one-way function (owf) to -- - the sender's general name -- } -- the size of "int" must be small enough such that "rand" can be -- contained within a single pkcs #1 encryption block.
Microsummary topics - Archive of obsolete content
"http://www.w3.org/1999/xsl/transform" version="1.0"> \ <output method="text"/> \ <template match="/"> \ <value-of select="id(\'download-count\')"/> \ <text> fx downloads</text> \ </template> \ </transform> \ </template> \ <pages> <include>http://(www\.)?spreadfirefox\.com/(index\.php)?</include> </pages> </generator> \ '; var domparser = components.classes["@mozilla.org/xmlextras/domparser;1"].
... createinstance(components.interfaces.nsidomparser); var generatordoc = domparser.parsefromstring(generatortext, "text/xml"); var microsummaryservice = components.classes["@mozilla.org/microsummary/service;1"].
New Skin Notes - Archive of obsolete content
--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.
...if you don't use it they overlap with headings, which is something we seldom want.
File object - Archive of obsolete content
file.hasrandomaccess true if random access is supported for this file.
... binary (utf-8) files and pipelines (including file.intput) do not support random access.
Supporting private browsing mode - Archive of obsolete content
note: it is not acceptable for an extension that records things like urls or domains visited to even offer the option to opt out of private browsing mode.
... the domains of sites the user has visited.
Table Layout Regression Tests - Archive of obsolete content
++webshell == 1 ++domwindow == 1 ++webshell == 2 ++domwindow == 2 note: styleverifytree is disabled note: frameverifytree is disabled note: verifyreflow is disabled ++webshell == 3 ++domwindow == 3 running baseline test for e:\moz_src\mozilla\layout\html\tests\block\rtest.lst.
...++webshell == 1 ++domwindow == 1 ++webshell == 2 ++domwindow == 2 note: styleverifytree is disabled note: frameverifytree is disabled note: verifyreflow is disabled ++webshell == 3 ++domwindow == 3 running verify test for e:\moz_src\mozilla\layout\html\tests\block\rtest.lst.
XBL 1.0 Reference - Archive of obsolete content
bindings can be bound to elements using cascading style sheets (css) or dom.
... bindings binding content children implementation constructor destructor field property getter setter method parameter body handlers handler resources stylesheet image binding attachment and detachment attachment using css attachment using element.style property <constructor> call <destructor> call binding documents dom interfaces the nsidomdocumentxbl interface anonymous content introduction scoping and access using the dom content generation rules for generation attribute forwarding insertion points <children> handling dom changes event flow and targeting flow and targeting across scopes focus and blur events mouseover and mouseout events anonymous conten...
CheckboxStateChange - Archive of obsolete content
general info specification xul interface event bubbles yes cancelable yes target element default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree).
... type read only domstring the type of event.
RadioStateChange - Archive of obsolete content
general info specification xul interface event bubbles yes cancelable yes target element default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree).
... type read only domstring the type of event.
ValueChange - Archive of obsolete content
general info specification xul interface event bubbles yes cancelable yes target element default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree).
... type read only domstring the type of event.
broadcast - Archive of obsolete content
general info specification xul interface event bubbles no cancelable no target element default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree).
... type read only domstring the type of event.
close - Archive of obsolete content
properties property type description target read only eventtarget the event target (the topmost target in the dom tree).
... type read only domstring the type of event.
command - Archive of obsolete content
ArchiveMozillaXULEventscommand
general info specification xul interface xulcommandevent bubbles yes cancelable yes target element default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree).
... type read only domstring the type of event.
commandupdate - Archive of obsolete content
properties property type description target read only eventtarget the event target (the topmost target in the dom tree).
... type read only domstring the type of event.
popuphidden - Archive of obsolete content
general info specification xul interface popupevent bubbles yes cancelable yes target element default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree).
... type read only domstring the type of event.
popuphiding - Archive of obsolete content
general info specification xul interface popupevent bubbles yes cancelable yes target element default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree).
... type read only domstring the type of event.
popupshowing - Archive of obsolete content
general info specification xul interface popupevent bubbles yes cancelable yes target element default action a popup is displayed properties property type description target read only eventtarget the event target (the topmost target in the dom tree).
... type read only domstring the type of event.
popupshown - Archive of obsolete content
general info specification xul interface popupevent bubbles yes cancelable yes target element default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree).
... type read only domstring the type of event.
getElementsByAttribute - Archive of obsolete content
« xul reference home getelementsbyattribute( attrib, value ) return type: dom nodelist returns a nodelist of all the child elements of the element that have the attribute given by the first argument set to the value given by the second argument.
... note that this method is only available on xul elements; it is not part of the w3c dom.
getElementsByAttributeNS - Archive of obsolete content
« xul reference home getelementsbyattributens(ns, attrib, value ) return type: dom nodelist returns an array of all the child elements of the element that have the attribute namespace given by the first argument, the attribute name given by the second argument, and the value given by the third argument.
... note that this method is only available on xul elements and is not part of the dom.
Methods - Archive of obsolete content
movesession removetab removetabsprogresslistener 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.addeventlistener 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.getuserdat...
...a dom:element.hasattribute dom:element.hasattributens 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.removeeventlistener dom:element.replacechild dom:element.setattribute dom:element.setattributenode dom:element.setattributenodens dom:element.setattributens dom:element.setuserdata ...
contentView - Archive of obsolete content
this interface lets you retrieve the dom element corresponding to a given a row index and vice versa.
... for trees that are not built with a content builder, the functions of nsitreecontentview will not be available, since there are no dom nodes to retrieve.
Property - Archive of obsolete content
strings style subject suppressonselect tabcontainer tabindex tabs tabscrolling tabpanels tag textlength textvalue timeout title toolbarname toolbarset tooltip tooltiptext top treeboxobject type uri useraction value valuenumber view webbrowserefind webnavigation webprogress width wizardpages wraparound year yearleadingzero related dom element properties dom:element.attributes dom:element.baseuri dom:element.childelementcount dom:element.childnodes dom:element.children dom:element.clientheight dom:element.clientleft dom:element.clienttop dom:element.clientwidth dom:element.clonenode dom:element.firstchild dom:element.firstelementchild dom:element.lastchild dom:element.lastelementchild dom:element.
...localname dom:element.namespaceuri dom:element.nextelementsibling dom:element.nextsibling dom:element.nodename dom:element.nodetype dom:element.nodevalue dom:element.ownerdocument dom:element.parentnode dom:element.prefix dom:element.previouselementsibling dom:element.previoussibling dom:element.scrollheight dom:element.scrollleft dom:element.scrolltop dom:element.scrollwidth dom:element.tagname dom:element.textcontent ...
Building Trees - Archive of obsolete content
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.
Simple Query Syntax - Archive of obsolete content
in the simple syntax, the builder will use the default query shown above, although the variable names are randomly generated.
...is: (?1 = http://www.xulplanet.com/rdf/myphotos, ?2 = http://www.xulplanet.com/ndeakin/images/t/palace.jpg) (?1 = http://www.xulplanet.com/rdf/myphotos, ?2 = http://www.xulplanet.com/ndeakin/images/t/canal.jpg) (?1 = http://www.xulplanet.com/rdf/myphotos, ?2 = http://www.xulplanet.com/ndeakin/images/t/obselisk.jpg) the numbers are used here for the variable names, but they are really just randomly generated so you can't refer to them in any way.
textbox (Toolkit autocomplete) - Archive of obsolete content
mydomain new in thunderbird 3 requires seamonkey 2.0 the user's email domain is suggested.
... related interfaces nsiaccessibleprovider, nsiautocompleteinput, nsidomxulmenulistelement articles how to implement custom autocomplete search component ...
Textbox (XPFE autocomplete) - Archive of obsolete content
mydomain new in thunderbird 3 requires seamonkey 2.0 the user's email domain is suggested.
... related interfaces nsiaccessibleprovider, nsidomxulmenulistelement ...
Things I've tried to do with XUL - Archive of obsolete content
html elements have the non-standard clientwidth/clientheight properties (see http://www.mozilla.org/docs/dom/domr...entheight.html); no equivalent exists for xul.
...instead, you must build up your own listitem full of listcells, and then add that listitem to the listbox, using generic dom calls: var row = document.createelement('listitem'); // create and attach 1st cell var cell = document.createelement('listcell'); cell.setattribute('label', label ); cell.setattribute('value', value ); row.appendchild( cell ); // create and attach 2nd cell cell = document.createelement('listcell'); cell.setattribute('label', label2 ); cell.setattribute('value', value2 ); row.appendchild( cell );...
Adding Event Handlers - Archive of obsolete content
xul uses the same event mechanism as defined by dom events.
... dom event listeners the second way to add an event handler is to call an element's addeventlistener method.
Focus and Selection - Archive of obsolete content
you can also add event handlers dynamically using the dom function addeventlistener.
...you can do this anywhere you have a xul browser document by simply: document.commanddispatcher.advancefocus(); in fact, the commanddispatcher simply implements the nsidomxulcommanddispatcher interface.
Templates - Archive of obsolete content
if you were to use dom functions to traverse the tree, you will find these elements there and can query their properties.
... tree builder the tree builder, on the other hand, doesn't generate the dom elements for the rows.
Using Remote XUL - Archive of obsolete content
this also means you can't load xul using file:// urls unless you set the preference dom.allow_xul_xbl_for_file to true.
... prerequisites to understand this tutorial you should have experience with tag-based languages like html along with basic javascript, css, and the dom.
XML - Archive of obsolete content
using a combination of xul's ready-made widgets (e.g., menubar, scrollbar, progressmeter, and so on) and xul's incorporation of such standards as html4, dom1/2, and cascading stylesheets, you can design any interface that you can imagine, using any number of different features, tools, and methodologies.
...as the figure below indicates, xul is an amalgam of these different standards: css for styling or "skinning", dom for the object model and scriptable access, javascript for the linking and behavior, rdf for resources, xml for the structure, and html for the content and some little extras.
button - Archive of obsolete content
constants for the possible values for this attribute are in the nsidomxulbuttonelement interface.
...aultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related interfaces nsiaccessibleprovider, nsidomxulbuttonelement ...
label - Archive of obsolete content
ArchiveMozillaXULlabel
related elements description attributes label interfaces nsiaccessibleprovider, nsidomxullabelelement notes labels are not focusable note: starting in gecko 2.0, labels are properly not focusable.
... they used to incorrectly inherit from nsidomxulcontrolelement.
menu - Archive of obsolete content
ArchiveMozillaXULmenu
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.
... related elements menubar, menuitem, menulist, menupopup, menuseparator interfaces nsiaccessibleprovider, nsidomxulcontainerelement, nsidomxulcontaineritemelement, nsidomxulselectcontrolitemelement ...
toolbarbutton - Archive of obsolete content
constants for the possible values for this attribute are in the nsidomxulbuttonelement interface.
...oveattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements toolbar, toolbargrippy, toolbaritem, toolbarpalette, toolbarseparator, toolbarset, toolbarspacer, toolbarspring, toolbox interfaces nsiaccessibleprovider, nsidomxulbuttonelement ...
XULRunner Hall of Fame - Archive of obsolete content
pyjamas-desktop a python web widget toolkit (similar to pyqt4 and pygtk2) that uses xulrunner dom to implement the widgets and event handling.
... python-hulahop is required python-hulahop from the olpc sugarlabs a python gtk widget with xulrunner embedded, providing full access to nsi dom and all other xulrunner interfaces, in a gtk window.
JS-Engine FAQ - Archive of obsolete content
check the jsval macros at the top of js/src/jsapi.h can an embedded spidermonkey js engine use domparser extension of mozilla?
... domparser is not part of js but part of mozilla browser which makes it available to script in the browser using xpconnect.
NPN_GetValue - Archive of obsolete content
avascript is enabled; true=javascript enabled, false=not enabled npnvasdenabledbool: tells whether smartupdate (former name: asd) is enabled; true=smartupdate enabled, false=not enabled npnvisofflinebool: tells whether offline mode is enabled; true=offline mode enabled, false=not enabled npnvtoolkit: npnvsupportsxembedbool: npnvwindownpobject: returns the npobject * pointer for the dom window object; see getting the page url in npapi plugin for a rough example npnvpluginelementnpobject: npnvsupportswindowless: tells whether the browser supports windowless plugins.
... gecko 1.9.2 note starting with gecko 1.9.2 (firefox 3.6), the variables npnvservicemanager, npnvdomelement, and npnvdomwindow are no longer supported.
Table Reflow Internals - Archive of obsolete content
content is inserted, appended, or deleted through the dom.
...style changes through the dom - javascript, browser change font (ctrl+/-), a preference changes, etc.
Common Firefox theme issues and solutions - Archive of obsolete content
the following css rules also need to be copied 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-fav...
... about:permissions domain names don't line up in about:permissions the domains on the domain list of about:permissions do not line up properly due to missing placeholder icons for domains without favicons.
Using Web Standards in your Web Pages - Archive of obsolete content
the other sections address dom and dhtml coding practices which are at odds with the w3c web standards and suggest replacements.
... contents benefits of using web standards making your page using web standards - how to using the w3c dom developing cross browser and cross platform pages using xmlhttprequest summary of changes references original document information author(s): mike cowperthwaite, marcio galli, jim ley, ian oeschger, simon paquet, gérard talbot last updated date: may 29, 2008 copyright information: portions of this content are © 1998–2008 by individual mozilla.org contributors; content available un...
Introduction - Archive of obsolete content
var element3 = <foo baz="1"/>; manipulating elements the goal of e4x was to provide an easier way for javascript programmers to manipulate an xml document, without going through the dom interfaces.
... however, many of the same functions that you would use in the dom can be used in e4x.
Reference - Archive of obsolete content
danbeck 07:02, 22 september 2005 (pdt) afaict , base64-related functionality is not a part of the javascript engine, but a dom feature (probably non-standard).
...we should link to some dom vs.
XForms Custom Controls Examples - Archive of obsolete content
urn true; </body> </method> </implementation> </binding> output showing xhtml <binding id="output-xhtml" extends="chrome://xforms/content/xforms-xhtml.xml#xformswidget-output"> <content> <children includes="label"/> <xhtml:div class="xf-value" anonid="content"></xhtml:div> <children/> </content> <implementation implements="nsixformsuiwidget"> <field name="_domparser">null</field> <property name="domparser" readonly="true"> <getter> if (!this._domparser) this._domparser = new domparser(); return this._domparser; </getter> </property> <method name="refresh"> <body> // get new value, parse, and import it.
... var val = this.stringvalue; var newdom = this.domparser.parsefromstring(val, "text/xml"); var impnode = document.importnode(newdom.firstchild, true); // get content node, clean it, and update it var content = document.getanonymouselementbyattribute(this, "anonid", "content"); if (content.firstchild) { content.removechild(content.firstchild); } content.appendchild(impnode); return true; </body> </method> </implementation> </binding> ...
RFE to the Custom Controls - Archive of obsolete content
output that shows the dom if output contains cdata section or text node and its data is any mozilla known language like xhtml/xul/svg then output should parse and display it (see bug 316817).
... input that shows/modifies the dom like the request above for output.
XForms Repeat Element - Archive of obsolete content
</my:line> <my:line name="b"> <my:price>32.25</my:price> </my:line> </my:lines> </instance> </model> <repeat id="lineset" nodeset="/my:lines/my:line"> <input ref="my:price"> <label>line item</label> </input> <input ref="@name"> <label>name</label> </input> </repeat> <trigger> <label>insert a new item after the current one</label> <action ev:event="domactivate"> <insert nodeset="/my:lines/my:line" at="index('lineset')" position="after"/> <setvalue ref="/my:lines/my:line[index('lineset')]/@name"/> <setvalue ref="/my:lines/my:line[index('lineset')]/price">0.00</setvalue> </action> </trigger> <trigger> <label>remove current item</label> <delete ev:event="domactivate" nodeset="/my:lines/my:line" at="index('...
... <head> <xbl:bindings> <xbl:binding id="grid"> <xbl:content> <xf:repeat xbl:inherits="bind, model, nodeset" anonid="anonidgridrepeat"> <xf:trigger> <xf:label>r</xf:label> <xf:delete ev:event="domactivate" at="index('anonidgridrepeat')" xbl:inherits="model, bind, nodeset"/> </xf:trigger> </xf:repeat> </xbl:content> </xbl:binding> </xbl:bindings> <style> div.grid { -moz-binding: url('#grid'); } </style> <xf:model> <xf:instance> <data xmlns=""> <repeat> <item> <input>input1</inpu...
Using XForms and PHP - Archive of obsolete content
to get a dom document on php 4 i usually do something like this: $data = $http_raw_post_data; $dom = domxml_open_mem($data); $root = $dom->document_element(); ...
... $newnode = $dom->create_element("boo"); $root->append_child($newnode); ...
Windows Media in Netscape - Archive of obsolete content
this does not work in gecko because it requires ie dom functionality that has not been implemented.
...summary: cross browser use of windows media player in ie and netscape 7.1 don't use proprietary dom sniffs such as looking for document.all-- this will rule out netscape 7.1.
Building up a basic demo with Three.js - Game development
there are a few different renderers: webgl is the default, and others you can use are canvas, svg, css, and dom.
... var renderer = new three.webglrenderer({antialias:true}); renderer.setsize(width, height); renderer.setclearcolor(0xdddddd, 1); document.body.appendchild(renderer.domelement); we are creating a new webgl renderer, setting its size to fit the whole available space on the screen, and appending the dom structure to the page.
Prefetch - MDN Web Docs Glossary: Definitions of Web-related terms
dns prefetching domain lookups can be slow, especially with network latency on mobile phones.
... they are most relevant when there are a plethora of links to external websites that may be clicked on, like search engine results, dns prefetching resolves domain names in advance thereby speeding up load times by reducing the time associated with domain lookup at request time.
Site - MDN Web Docs Glossary: Definitions of Web-related terms
the site of a piece of web content is determined by the registrable domain of the host within the origin.
... examples of the same site https://developer.mozilla.org/docs/ https://support.mozilla.org/ same site because the registrable domain of mozilla.org is the same http://example.com:8080 https://example.com same site because scheme and port are not relevant examples of different site https://developer.mozilla.org/docs/ https://example.com not same site because the registrable domain of the two urls differs specifications specification status comment ...
Event - MDN Web Docs Glossary: Definitions of Web-related terms
events are assets generated by dom elements, which can be manipulated by a javascript code.
... learn more technical reference event documentation on mdn general knowledge official website dom events on wikipedia ...
Test your skills: WAI-ARIA - Learn web development
how can you give the search input a suitable label, without explicitly adding a visible text label to the dom?
... the problem we have now is that when the dom changes to show a new decription, screenreaders cannot see what has changed.
create fancy boxes - Learn web development
it's fun because it's all about turning a design idea into working code; it's challenging because of annoying constraints and crazy freedom in the use of css.
...most of the time, that leads to polluting the dom by adding extra html element for the unique purpose of style.
What is the difference between webpage, website, web server, and search engine? - Learn web development
to access a page, just type its address in your browser address bar: web site a website is a collection of linked web pages (plus their associated resources) that share a unique domain name.
... to access a website, type its domain name in your browser address bar, and the browser will display the website's main web page, or homepage (casually referred as "the home"): the ideas of a web page and a website are especially easy to confuse for a website that contains only one web page.
JavaScript basics - Learn web development
note: both of the features you used in this exercise are parts of the document object model (dom) api, which has the capability to manipulate documents.
... adding an image changer in this section, you will learn how to use javascript and dom api features to alternate the display of one of two images.
Tips for authoring fast-loading HTML pages - Learn web development
further reading: understanding cdns reduce domain lookups since each separate domain costs time in a dns lookup, the page load time will grow along with the number of separate domains appearing in css link(s) and javascript and image src(es).
... this may not always be practical; however, you should always take care to use only the minimum necessary number of different domains in your pages.
Using data attributes - Learn web development
data-* attributes allow us to store extra information on standard, semantic html elements without other hacks such as non-standard attributes, extra properties on dom, or node.setuserdata().
...you could use getattribute() with their full html name to read them, but the standard defines a simpler way: a domstringmap you can read out via a dataset property.
Debugging HTML - Learn web development
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.
...sometimes fixing an earlier error will also get rid of other error messages — several errors can often be caused by a single problem, in a domino effect.
From object to iframe — other embedding technologies - Learn web development
if there's any chance that certain content may be malicious (e.g., user-generated content), please serve it from a different domain to your main site.
... here's an example that uses the <embed> element to embed a flash movie (see this live on github, and check the source code too): <embed src="whoosh.swf" quality="medium" bgcolor="#ffffff" width="550" height="400" name="whoosh" align="middle" allowscriptaccess="samedomain" allowfullscreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"> pretty horrible, isn't it?
Choosing the right approach - Learn web development
ull support 24 full support 10prefixed prefixed implemented with the vendor prefix: webkitedge full support 12firefox full support 23notes full support 23notes notes callback parameter is a domhighrestimestamp.
... no support 11 — 42prefixed notes prefixed implemented with the vendor prefix: moznotes callback parameter is a domtimestamp.
Test your skills: Events - Learn web development
dom manipulation: considered useful some of the questions below require you to write some dom manipulation code to complete them — such as creating new html elements, setting their text contents to equal specific string values, and nesting them inside existing elements on the page — all via javascript.
... we haven't explicitly taught this yet in the course, but you'll have seen some examples that make use of it, and we'd like you to do some research into what dom apis you need to successfully answer the questions.
Test your skills: Loops - Learn web development
dom manipulation: considered useful some of the questions below require you to write some dom manipulation code to complete them — such as creating new html elements, setting their text contents to equal specific string values, and nesting them inside existing elements on the page — all via javascript.
... we haven't explicitly taught this yet in the course, but you'll have seen some examples that make use of it, and we'd like you to do some research into what dom apis you need to successfully answer the questions.
Third-party APIs - Learn web development
fix'); article.appendchild(heading); heading.appendchild(link); article.appendchild(img); article.appendchild(para1); article.appendchild(para2); article.appendchild(clearfix); section.appendchild(article); } } } there's a lot of code here; let's explain it step by step: the while loop is a common pattern used to delete all of the contents of a dom element, in this case, the <section> element.
...if so, we don't try to display any — we create a <p> containing the text "no results returned." and insert it into the.<section> if some articles are returned, we, first of all, create all the elements that we want to use to display each news story, insert the right contents into each one, and then insert them into the dom at the appropriate places.
Client-side web APIs - Learn web development
this is usually done by using the document object model (dom), a set of apis for controlling html and styling information that makes heavy use of the document object.
... in this article, we'll look at how to use the dom in detail, along with some other interesting apis that can alter your environment in interesting ways.
Arrays - Learn web development
for example: let sequence = [1, 1, 2, 3, 5, 8, 13]; let random = ['tree', 795, [0, 1, 2]]; before proceeding, create a few example arrays.
...for example, to access one of the items inside the array that is the third item inside the random array (see previous section), we could do something like this: random[2][2]; try making some more modifications to your array examples before moving on.
Solve common problems in your JavaScript code - Learn web development
what is the dom?
... web apis how do you manipulate the dom (e.g.
Aprender y obtener ayuda - Learn web development
you let your mind wander more widely, and seemingly make random connections between different things.
... how to get a domain, hosting, and use them to put a web site or application online.
CSS performance optimization - Learn web development
browsers follow a specific rendering path: paint only occurs after layout, which occurs after the render tree is created, which in turn requires both the dom and the cssom trees.
...this allows the browser to recalculate layout, style, paint, size, or any combination of them for a limited area of the dom and not the entire page.
Web performance resources - Learn web development
<style type="text/css"> // insert your css here </style> javascript avoid javascript blocking by using the async or defer attributes, or link javascript assets after the page's dom elements.
... javascript only block rendering for elements that appear after the script tag in the dom tree.
Introduction to the server side - Learn web development
web frameworks are collections of functions, objects, rules and other code constructs designed to solve common problems, speed up development, and simplify the different types of tasks faced in a particular domain.
... again, while both client and server-side code use frameworks, the domains are very different, and hence so are the frameworks.
Ember Interactivity: Footer functionality, conditional rendering - Learn web development
enter the following terminal command to do so: ember generate component-class footer next, go and find the newly-created todomvc/app/components/footer.js file and update it to the following: import component from '@glimmer/component'; import { inject as service } from '@ember/service'; export default class footercomponent extends component { @service('todo-data') todos; } now we need to go back to our todo-data.js file and add some functionality that will allow us to return the number of incomplete todos (use...
... creating a todo class run the following command in your terminal: ember generate component-class todo now go to the newly-created todomvc/app/components/todo.js file and update the contents to look like so, to give the todo component access to the service: import component from '@glimmer/component'; import { inject as service } from '@ember/service'; export default class todocomponent extends component { @service('todo-data') todos; } next, go back again to our todo-data.js service file and add the following action ju...
Componentizing our React app - Learn web development
in src/index.js, make a new const beneath the final import, but above reactdom.render(): const data = [ { id: "todo-0", name: "eat", completed: true }, { id: "todo-1", name: "sleep", completed: false }, { id: "todo-2", name: "repeat", completed: false } ]; next, we'll pass data to <app /> as a prop, called tasks.
... the final line of src/index.js should read like this: reactdom.render(<app tasks={data} />, document.getelementbyid("root")); this array is now available to the app component as props.tasks.
Deployment and next steps - Learn web development
to change the domain or build command, go to https://zeit.co/opensas/mdn-svelte-tutorial/settings accept all the defaults, and you'll be fine.
... we also saw some advanced concepts and techniques to interact with dom elements and to programmatically extend html element capabilities using the use directive.
Deploying our app - Learn web development
we can optionally change the name of the netlify project or specify to use our own domain name, which netlify offers some excellent documentation on.
...also see our cross browser testing module for a bunch of useful testing information remember also that tests are not limited to javascript; tests can be run against the rendered dom, user interactions, css, and even how a page looks.
Adding a new CSS property
then you need to change nscomputeddomstyle.cpp to implement the getcomputedstyle api.
... you'll need to add an entry in nscomputeddomstylepropertylist.h and then add a method (matching the method name in the css property list) to implement the api.
What to do and what not to do in Bugzilla
major major loss of function normal regular issue, some loss of functionality under specific circumstances minor minor loss of function, or other problem where easy workaround is present trivial cosmetic problem like misspelled words or misaligned text enhancement request for enhancement the blocker severity should be used very seldomly, because only a fraction of the hundreds of thousands bugs really block the development of mozilla and these are normally fixed very quickly.
...for example, don't move bugs into the js engine component unless you really know they are js engine bugs, and don't leave bugs in the js engine component if you know that the malfunction being described is a dom problem.
Inner and outer windows
the hierarchy would look something like this: in this diagram, objects you interact with directly in the dom (that is, window, document, and element objects) are blue.
... the grey circles represent the more abstract inner and outer windows, which are real objects that you don't directly interact with when working with the dom.
Cross Process Object Wrappers
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 addeventlistener("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.
... cpows and platform apis you can't pass cpows into platform apis that expect to receive dom objects.
Frame script loading and lifetime
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.
...the workaround is to randomize the frame script's url; for example, by appending "?" + math.random().
Message manager overview
its most important attributes and functions are: content : access the dom window hosted by the tab docshell : access the top-level docshell components : access privileged objects and apis addeventlistener() : listen to dom events addmessagelistener() : receive messages from the chrome process sendasyncmessage() : send asynchronous messages to the chrome process sendsyncmessage() : send synchronous messages to the chrome process ...
... interfaces nsidomeventtarget nsimessagelistenermanager nsimessagesender nsisyncmessagesender nsicontentframemessagemanager how to access the content frame message manager is the global object in frame scripts.
Performance
better: content-document-global-created notifications can be substituted with domwindowcreated events other observers and services should be registered in a process script or jsm instead load frame scripts on demand bad: // addon.js services.mm.loadframescript("framescript.js", /*delayed:*/ true) // stuff communicating with the framescript // framescript.js function onlyonceinabluemoon() { // we only need this during a total solar eclipse while goat blood rains f...
.../framescript.js"); services.ppmm.removedelayedprocessscript("resources://my-addon/processcript.js"); services.mm.broadcastasyncmessage("my-addon:unload"); services.ppmm.broadcastasyncmessage("my-addon:unload"); } in the frame/process scripts: remove all kinds of listeners remove observer notifications remove custom categories and services nuke sandboxes unload jsms restore content dom states where necessary, e.g.
Tracking Protection
in private browsing windows (tabs, in firefox for android), firefox will block content loaded from domains that track users across sites.
... content is blocked based on the domain from which it is to be loaded.
HTMLIFrameElement.getScreenshot()
it won't wait more than 2000ms (this delay is defined by the gecko dom.browserelement.maxscreenshotdelayms preference).
... syntax var instanceofdomrequest = instanceofhtmliframeelement.getscreenshot(maxwidth, maxheight, mimetype); returns a domrequest for handling the screenshot request.
mozbrowserclose
general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree).
... type read only domstring the type of event.
mozbrowserdocumentfirstpaint
general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree).
... type read only domstring the type of event.
mozbrowsererror
general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
... detail the detail property returns an anonymous javascript object with the following properties: type a domstring representing the type of error that occurred.
mozbrowserfindchange
general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
... details the details property returns an anonymous javascript object with the following properties: active a boolean indicating whether a search is currently active (true), or not (false.) searchstring a domstring representing the string that is currently being searched for.
mozbrowserfirstpaint
general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree).
... type read only domstring the type of event.
mozbrowserloadend
general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
... detail the detail property returns an anonymous javascript object with the following properties: backgroundcolor a domstring representing the main background color of the browser <iframe> content, expressed as an rgb value.
mozbrowserloadstart
general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree).
... type read only domstring the type of event.
mozbrowserlocationchange
general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
... detail the detail property returns an anonymous javascript object with the following properties: url a domstring representing the url of the new location.
mozbrowseropentab
as a result of the user issuing a command to open a link target in a new tab (for example ctrl/cmd + click.) general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
... details the details property returns an anonymous javascript object with the following properties: url a domstring representing the url of the new document loaded.
mozbrowserscrollviewchange
general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
... details the details property returns an anonymous javascript object with the following properties: state a domstring representing the current state of scrolling in the viewport — available values are started and stopped.
Browser API
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.
... browser 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).
MozScrolledAreaChanged
specification mozilla specific interface uievent bubbles yes cancelable yes target defaultview, document default action none properties property type description targetread only eventtarget the event target (the topmost target in the dom tree).
... typeread only domstring the type of event.
smartcard-insert
vent is fired when the insertion of a smart card has been detected specification mozilla specific interface event bubbles no cancelable no target document default action none properties property type description targetread only eventtarget the event target (the topmost target in the dom tree).
... typeread only domstring the type of event.
smartcard-remove
specification mozilla specific interface event bubbles no cancelable no target document default action none properties property type description targetread only eventtarget the event target (the topmost target in the dom tree).
... typeread only domstring the type of event.
Gecko Keypress Event
charcode of dom keypress event if a keypress event is fired without any modifier keys (ctrl/alt(option)/meta(win/command)), then the properties of the event are the same as they were in gecko1.8.1.
... gecko replaces the charcode of dom keypress events for accelerator key handling, but that is not enough.
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.
How to implement a custom autocomplete search component
any values that match the search string // are moved into temporary arrays and passed to the autocompleteresult if (searchparam.length > 0) { var nativejson = components.classes["@mozilla.org/dom/json;1"].createinstance(ci.nsijson); var searchresults = nativejson.decode(searchparam); // these 2 lines above are for thunderbird < v7 // since thunderbird 3, they can be replaced more efficiently by the following line: // var searchresults = json.parse(searchparam); var results = []; var comments = []; for (i=0; i<searchresults.length; i++) { ...
...,"comment":"cool dude"},{"value":"mary","comment":"nice lady"},{"value":"jimmy","comment":"very uncool guy"},{"value":"jimbo","comment":null}]' /> how to solve autocomplete panel focus problems in some situations there may be problems with the display of the autocomplete panel (this is the panel where the autocomplete results/suggestions are displayed): the autocomplete panel seems to appear seldom and very erratically.
Integrated Authentication
the preferences are: pref("network.negotiate-auth.trusted-uris", site-list); pref("network.negotiate-auth.delegation-uris", site-list); pref("network.automatic-ntlm-auth.trusted-uris", site-list); where, site-list is a comma-separated list of url prefixes or domains of the form: site-list = "mydomain.com, https://myotherdomain.com" network.negotiate-auth.trusted-uris lists the sites that are permitted to engage in spnego authentication with the browser, and network.negotiate-auth.delegation-uris lists the sites for which the browser may delegate user authorization to the server.
... if you wish to use non-fully-qualified entries of the form mydomain.com in the above preferences for ntlm and spnego authentication, you will also need to set the preferences network.automatic-ntlm-auth.allow-non-fqdn and network.negotiate-auth.allow-non-fqdn (respectively) to true.
AddonManager
callback) void installaddonsfromwebpage(in string mimetype, in nsidomwindow source, in nsiuri uri, in addoninstall installs[]) void addinstalllistener(in installlistener listener) void removeinstalllistener(in installlistener listener) promise?
... void installaddonsfromwebpage( in string mimetype, in nsidomwindow source, in nsiuri uri, in addoninstall installs[] ) parameters mimetype the mimetype of add-ons being installed source the nsidomwindow that started the installs uri the nsiuri that started the installs installs the array of addoninstalls to be installed addinstalllistener() adds a new installlistener if the listener is not already registered.
Widget Wrappers
for xul-provided widgets, this is always 'custom' provider the provider type of the widget, id est one of provider_api or provider_xul node reference to the corresponding dom node anchor the anchor on which to anchor panels opened from this node.
...node is overflowed, to the anchor for the panel menu if your widget is inside the panel menu, and to the node itself in all other cases overflowed boolean indicating whether the node is currently in the overflow panel of the toolbar isgroup false, will be true for the group widget label for api-provided widgets, convenience getter for the label attribute of the dom node tooltiptext for api-provided widgets, convenience getter for the tooltiptext attribute of the dom node disabled for api-provided widgets, convenience getter and setter for the disabled state of this single widget.
Interfacing with the Add-on Repository
this example will use the latter, in order to randomly select a recommended add-on and offer to install it.
... for example: searchsucceeded: function(addons, addoncount, totalresults) { var num = math.floor(math.random() * addoncount); this.shownotification("would you like to try the " + addons[num].name + " addon?", "install", addons[num].install); }, this routine randomly selects one of the returned add-ons, then calls the previously mentioned shownotification() routine, passing in as parameters a prompt including the name of the returned add-on, a label for the button to show in the notificati...
OS.File for the main thread
); img.onload = function() { var canvas = document.createelementns('http://www.w3.org/1999/xhtml', 'canvas'); canvas.width = img.naturalwidth; canvas.height = img.naturalheight; var ctx = canvas.getcontext('2d'); ctx.drawimage(img, 0, 0); (canvas.toblobhd || canvas.toblob).call(canvas, function(b) { var r = cc['@mozilla.org/files/filereader;1'].createinstance(ci.nsidomfilereader); //new filereader(); r.onloadend = function() { // r.result contains the arraybuffer.
...by default, generate a random hex number and use it to create a unique new file name.
Promise.jsm
this module was used before dom promises were made globally available in gecko 29.
... if you just need a promise, consider using a dom promise instead.
PromiseUtils.jsm
the promiseutils.jsm javascript code module offers some useful functions related to dom promise.
...and promiseutils.defer uses dom promise instead of promise.jsm's promise.
PromiseWorker.jsm
else { throw new error('you passed in a non-true value for shouldresolve argument and therefore this will reject the main thread promise'); } } main thread file bootstrap.js const { utils: cu } = components; const { basepromiseworker } = cu.import('resource://gre/modules/promiseworker.jsm', {}); var myworker = new basepromiseworker('chrome://path/to/content/myworker.js'); var promise_domyfunctrue = myworker.post('resolvetest', [true]); promise_domyfunctrue.then( function(aval) { console.log('fullfilled - promise_domyfunctrue - ', aval); }, function(areason) { console.error('rejected - promise_domyfunctrue - ', areason); } ).catch( function(acaught) { console.error('caught - promise_domyfunctrue - ', acaught); } ); var promise_domyf...
...uncfalse = myworker.post('resolvetest', [false]); promise_domyfuncfalse.then( function(aval) { console.log('fullfilled - promise_domyfuncfalse - ', aval); }, function(areason) { console.error('rejected - promise_domyfuncfalse - ', areason); } ).catch( function(acaught) { console.error('caught - promise_domyfuncfalse - ', acaught); } ); result running the code above will log the following information to the console: "fullfilled - promise_domyfunctrue - " "you sent to promiseworker argument of: `true`" bootstrap.js line 8 "rejected - promise_domyfuncfalse - " "you passed in a non-true value for shouldresolve argument and therefore this will reject the main thread promise" ...
Timer.jsm
the timer.jsm javascript code module contains pure-javascript implementations of settimeout, cleartimeout, setinterval, and clearinterval that are compatible with the dom window functions, but that can be used by code that does not have access to a dom window (for example, javascript code modules or content frame scripts).
... to use timer.jsm, first import it: components.utils.import("resource://gre/modules/timer.jsm"); then call settimeout and cleartimeout just as you would in a dom window, for example: let timeoutid = settimeout(function() { console.log("hello!"); }, 500); cleartimeout(timeoutid); similarly, you can use setinterval and clearinterval like so: let intervalid = setinterval(function() { console.log("happening every 500ms!"); }, 500); clearinterval(intervalid); ...
Webapps.jsm
the webapps.jsm modules exposes the domapplicationregistry, which is responsible for managing all of the open web apps.
... importing components.utils.import("resource://gre/modules/webapps.jsm"); // exported symbol is domapplicationregistry method overview init: function() loadcurrentregistry: function() notifyappsregistrystart: function notifyappsregistrystart() notifyappsregistryready: function notifyappsregistryready() sanitizeredirects: function sanitizeredirects(asource) _savewidgetsfullpath: function(amanifest, adestapp) appkind: function(aapp, amanifest) updatepermissionsforapp: function(aid, aispreinstalled) updateofflinecacheforapp: function(aid) installpreinstalledapp: function installpreinstalledapp(aid) removeifhttpsduplicate: function(aid) installsystemapps: function() loadandupdateapps: function() updatedatastore: function(aid, aorigin, amanifesturl, amanifest) _registersystemm...
Bootstrapping a new locale
mkdir -p ab-cd/browser/installer ab-cd/browser/profile/chrome ab-cd/browser/searchplugins ab-cd/browser/updater ab-cd/toolkit cp -r mozilla-1.9.x/browser/locales/ ab-cd/browser cp -r mozilla-1.9.x/dom/locales/ ab-cd/dom cp -r mozilla-1.9.x/editor/locales/ ab-cd/editor cp -r mozilla-1.9.x/extensions/reporter/locales/chrome ab-cd/extensions cp -r mozilla-1.9.x/netwerk/locales/ ab-cd/netwerk cp -r mozilla-1.9.x/other-licenses/branding/firefox/locales/ ab-cd/other-licenses cp -r mozilla-1.9.x/security/manager/locales/ ab-cd/security cp -r mozilla-1.9.x/toolkit/locales/ ab-cd/toolkit getting star...
... directories to localize if you're starting from scratch, you should have just downloaded: mozilla-1.9.x/browser/locales/ mozilla-1.9.x/dom/locales/ mozilla-1.9.x/netwerk/locales/ mozilla-1.9.x/other-licenses/branding/firefox/locales/en-us mozilla-1.9.x/security/manager/locales/ mozilla-1.9.x/toolkit/locales/ and then copied them so that the files for localization end up in the following directories: ab-cd/browser/ ab-cd/dom/ ab-cd/netwerk/ ab-cd/other-licenses/branding/firefox/ ab-cd/security/manager/ ab-cd/toolkit/ translating ...
Localizing with Mozilla Translator
getting started with mozillatranslator mt uses 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 means browser, extensions/reporter, dom, netwer, security, and toolkit.
Investigating leaks using DMD heap scan mode
known edges: 0x7f08975a24c0 [fragmentorelement (xhtml) head https://www.example.com] --[mattrsandchildren[i]]--> 0x7f0882fe3230 0x7f08967e7b20 [js object (htmlscriptelement)] --[unwrapdomobject(obj)]--> 0x7f0882fe3230 the first two lines mean that the script element 0x7f0882fe3230 contains a strong reference to the eventlistenermanager 0x7f0899b4e550.
... example analysis of block_analyzer.py results in one debugging session where i was investigating the leak from bug 1451985, i eventually reduced the list of entries until this was the most suspicious looking entry: 0x7f0892f29630 size = 392 bytes at byte offset 56 mozilla::dom::scriptloader::processexternalscript[...] [...] i went to that line of scriptloader::processexternalscript(), and it contained a call to scriptloader::createloadrequest().
Power profiling overview
power estimates the next best measurements come from recent (sandy bridge and later) intel processors that implement the rapl (running average power limit) interface that provides msrs containing energy consumption estimates for up to four power planes or domains of a machine, as seen in the diagram above.
...dram is independent of the other three domains.
browser.urlbar.formatting.enabled
the preference browser.urlbar.formatting.enabled controls whether the domain name including the top level domain is highlighted in the address bar by coloring it black and the other parts grey.
... type:boolean default value: true exists by default: yes application support:firefox 6.0 status: active; last updated 2012-04-03 introduction: pushed to nightly on 2011-05-03 bugs: bug 451833 values true (default) the domain name including the top level domain is highlighted in the address bar by coloring it black and the other parts grey.
NSPR's Position On Abrupt Thread Termination
threads are lightweight because they do not maintain the full protection domain provided by a process.
...in unix, with its complex definition of a protection domain, it happens to work (one might even say it's more efficient) to exit from anywhere.
An overview of NSS Internals
for example, while nss supports random calculation (creation) of a new public/private key pair, it's difficult to work with such a raw key pair.
...instead of simply verifying that the requester of a certificate is in control of an administrative email address at the desired web site's domain, it's required that the ca performs a verification of real world identity documents (such as a company registration document with the country's authority), and it's also required that a browser software performs a revocation check with the ca, prior to granting validity to the certificate.
Certificate functions
function name/documentation source code nss versions cert_addcerttolisttail mxr 3.2 and later cert_addextension mxr 3.5 and 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_certlistfromcert mxr 3.2 and later cert_certtimesvalid mxr 3.2 and later ...
...nd later cert_getclassicocspenabledhardfailurepolicy mxr 3.12 and later cert_getclassicocspenabledsoftfailurepolicy mxr 3.12 and later cert_getcommonname mxr 3.2 and later cert_getcountryname mxr 3.2 and later cert_getdbcontentversion mxr 3.2 and later cert_getdefaultcertdb mxr 3.2 and later cert_getdomaincomponentname mxr 3.2 and later cert_getfirstemailaddress mxr 3.7 and later cert_getlocalityname mxr 3.2 and later cert_getnextemailaddress mxr 3.7 and later cert_getnextgeneralname mxr 3.10 and later cert_getnextnameconstraint mxr 3.10 and later cert_getocspresponsestatus mxr 3.6 and later ...
Cryptography functions
ater pk11_generatefortezzaiv mxr 3.2 and later pk11_generatekeypair mxr 3.2 and later pk11_generatekeypairwithflags mxr 3.10.2 and later pk11_generatekeypairwithopflags mxr 3.12 and later pk11_generatenewparam mxr 3.2 and later pk11_generaterandom mxr 3.2 and later pk11_generaterandomonslot mxr 3.11 and later pk11_getalltokens mxr 3.2 and later pk11_getallslotsforcert mxr 3.12 and later pk11_getbestkeylength mxr 3.2 and later pk11_getbestslot mxr 3.2 and later pk11_getbestsl...
... 3.9.3 and later pk11_pubencryptraw mxr 3.2 and later pk11_pubunwrapsymkey mxr 3.2 and later pk11_pubunwrapsymkeywithflags mxr 3.6 and later pk11_pubunwrapsymkeywithflagsperm mxr 3.9 and later pk11_pubwrapsymkey mxr 3.2 and later pk11_randomupdate mxr 3.2 and later pk11_readrawattribute mxr 3.9.2 and later pk11_referencesymkey mxr 3.2 and later pk11_resettoken mxr 3.4 and later pk11_restorecontext mxr 3.2 and later pk11_savecontext mxr 3.2 and later pk11_savecontextall...
Encrypt Decrypt MAC Keys As Session Objects
* get their cka_ids * generate a random value to use as iv for aes cbc * open an input file and an output file, * write a header to the output that identifies the two keys by * their cka_ids, may include original file name and length.
...y cka_id */ rv = gathercka_id(mackey, &macckaid); if (rv != secsuccess) { pr_fprintf(pr_stderr, "can't get the mac key cka_id.\n"); goto cleanup; } if (noisefilename) { rv = seedfromnoisefile(noisefilename); if (rv != secsuccess) { port_seterror(pr_end_of_file_error); return secfailure; } rv = pk11_generaterandom(iv, blocksize); if (rv != secsuccess) { goto cleanup; } } else { /* generate a random value to use as iv for aes cbc */ generaterandom(iv, blocksize); } headerfile = pr_open(headerfilename, pr_create_file | pr_truncate | pr_rdwr, 00660); if (!headerfile) { pr_fprintf(pr_stderr, "unabl...
Encrypt and decrypt MAC using token
* get their cka_ids * generate a random value to use as iv for aes cbc * open an input file and an output file, * write a header to the output that identifies the two keys by * their cka_ids, may include original file name and length.
...y cka_id */ rv = gathercka_id(mackey, &macckaid); if (rv != secsuccess) { pr_fprintf(pr_stderr, "can't get the mac key cka_id.\n"); goto cleanup; } if (noisefilename) { rv = seedfromnoisefile(noisefilename); if (rv != secsuccess) { port_seterror(pr_end_of_file_error); return secfailure; } rv = pk11_generaterandom(iv, blocksize); if (rv != secsuccess) { goto cleanup; } } else { /* generate a random value to use as iv for aes cbc */ generaterandom(iv, blocksize); } headerfile = pr_open(headerfilename, pr_create_file | pr_truncate | pr_rdwr, 00660); if (!headerfile) { pr_fprintf(pr_stderr, "unabl...
NSS 3.31 release notes
corrected the encoding 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.
NSS API Guidelines
specifically, this library provides nss_init() for establishing default certificate, key, module databases, and initializing a default random number generator.
...the library supports base-64 encoding/decoding, reader-writer locks, the secitem data type, der encoding/decoding, error types and numbers, oid handling, and secure random number generation.
NSS Sample Code Sample_3_Basic Encryption and MACing
* get their cka_ids * generate a random value to use as iv for aes cbc * open an input file and an output file, * write a header to the output that identifies the two keys by * their cka_ids, may include original file name and length.
...y cka_id */ rv = gathercka_id(mackey, &macckaid); if (rv != secsuccess) { pr_fprintf(pr_stderr, "can't get the mac key cka_id.\n"); goto cleanup; } if (noisefilename) { rv = seedfromnoisefile(noisefilename); if (rv != secsuccess) { port_seterror(pr_end_of_file_error); return secfailure; } rv = pk11_generaterandom(iv, blocksize); if (rv != secsuccess) { goto cleanup; } } else { /* generate a random value to use as iv for aes cbc */ generaterandom(iv, blocksize); } headerfile = pr_open(headerfilename, pr_create_file | pr_truncate | pr_rdwr, 00660); if (!headerfile) { pr_fprintf(pr_stderr, "unabl...
EncDecMAC using token object - sample 3
* get their cka_ids * generate a random value to use as iv for aes cbc * open an input file and an output file, * write a header to the output that identifies the two keys by * their cka_ids, may include original file name and length.
...rintf(pr_stderr, "error while wrapping encrypt key\n"); goto cleanup; } /* get the mac key cka_id */ rv = gathercka_id(mackey, &macckaid); if (rv != secsuccess) { pr_fprintf(pr_stderr, "can't get the mac key cka_id.\n"); goto cleanup; } if (noisefilename) { rv = seedfromnoisefile(noisefilename); if (rv != secsuccess) { port_seterror(pr_end_of_file_error); return secfailure; } rv = pk11_generaterandom(iv, blocksize); if (rv != secsuccess) { goto cleanup; } } else { /* generate a random value to use as iv for aes cbc */ generaterandom(iv, blocksize); } headerfile = pr_open(headerfilename, pr_create_file | pr_truncate | pr_rdwr, 00660); if (!headerfile) { pr_fprintf(pr_stderr, "unable to open \"%s\" for writing.\n", headerfilename); return secfailure; } encfile = pr_open(encryptedfilename, pr_cr...
PKCS #11 Module Specs
random - this token should be used to generate random numbers when the application call 'pk11_generaterandom'.
... sample file: library= name="netscape internal crypto module" parameters="configdir=/u/relyea/.netscape certprefix= secmod=secmod.db" nss="flags=internal,pkcs11module trustorder=1 cipherorder=-1 ciphers= slotparams={0x1=[slotflags='rsa,dsa,dh,rc4,rc2,des,md2,md5,sha1,ssl,tls,publiccerts,random'] 0x2=[slotflags='rsa' askpw=only]}" library=dkck32.dll name="datakey signasure 3600" nss="trustorder=50 ciphers= " library=swft32.dll name="netscape software fortezza" parameters="keyfile=/u/relyea/keyfile" nss="trustorder=50 ciphers=fortezza slotparams=0x1=[slotflags='fortezza']" library=core32.dll name="litronic netsign" softoken specific parameters the internal nss pkcs #11 implementation ...
Python binding for NSS
the term pythonic means to follow accepted python paradigms and idoms in the python language and libraries.
... fix return value creation in sslsocket.get_security_status convert licensing to mpl tri-license the following were added: nss.io.socket.new_socket_pair() nss.io.socket.poll() nss.io.socket.import_tcp_socket() nss.nss.certificate.get_subject_common_name() nss.nss.generate_random() nss.ssl.sslsocket.import_tcp_socket() release 0.1.0 release date 2008-07-09 scm tag source download change log initial release ...
FIPS mode of operation
fc_verifyinit fc_verify fc_verifyupdate fc_verifyfinal fc_verifyrecoverinit fc_verifyrecover dual-function cryptographic functions fc_digestencryptupdate fc_decryptdigestupdate fc_signencryptupdate fc_decryptverifyupdate key management functions fc_generatekey: dsa domain parameters (pqg) fc_generatekeypair: dsa, rsa, and ecdsa.
... fc_wrapkey: rsa key wrapping fc_unwrapkey: rsa key wrapping fc_derivekey: diffie-hellman, ec diffie-hellman random number generation functions fc_seedrandom fc_generaterandom: performs continuous random number generator test.
NSS tools : ssltab
type = 22 (handshake) version = { 3,0 } length = 997 (0x3e5) handshake { 0: 02 00 00 46 |...f type = 2 (server_hello) length = 70 (0x000046) serverhello { server_version = {3, 0} random = {...} 0: 77 8c 6e 26 6c 0c ec c0 d9 58 4f 47 d3 2d 01 45 | wn&l.ì..xog.-.e 10: 5c 17 75 43 a7 4c 88 c7 88 64 3c 50 41 48 4f 7f | \.uc§l.Ç.d<paho.
...l3/rsa/3des192ede-cbc/sha (0x00ffe1) ssl3/rsa-fips/des64cbc/sha (0x000009) ssl3/rsa/des64cbc/sha (0x000003) ssl3/rsa/rc4-40/md5 } session-id = { } challenge = { 0x713c 0x9338 0x30e1 0xf8d6 0xb934 0x7351 0x200c 0x3fd0 } ] >-- [ sslrecord { type = 22 (handshake) version = { 3,0 } length = 997 (0x3e5) handshake { type = 2 (server_hello) length = 70 (0x000046) serverhello { server_version = {3, 0} random = {...} session id = { length = 32 contents = {..} } cipher_suite = (0x0003) ssl3/rsa/rc4-40/md5 } type = 11 (certificate) length = 709 (0x0002c5) certificatechain { chainlength = 706 (0x02c2) certificate { size = 703 (0x02bf) data = { saved in file 'cert.001' } } } type = 12 (server_key_exchange) length = 202 (0x0000ca) type = 14 (server_hello_done) length = 0 (0x000000) } } ] --> [ sslrecord { ...
NSS tools : ssltap
type = 22 (handshake) version = { 3,0 } length = 997 (0x3e5) handshake { 0: 02 00 00 46 |...f type = 2 (server_hello) length = 70 (0x000046) serverhello { server_version = {3, 0} random = {...} 0: 77 8c 6e 26 6c 0c ec c0 d9 58 4f 47 d3 2d 01 45 | wn&l.ì..xog.-.e 10: 5c 17 75 43 a7 4c 88 c7 88 64 3c 50 41 48 4f 7f | \.uc§l.Ç.d<paho.
...l3/rsa/3des192ede-cbc/sha (0x00ffe1) ssl3/rsa-fips/des64cbc/sha (0x000009) ssl3/rsa/des64cbc/sha (0x000003) ssl3/rsa/rc4-40/md5 } session-id = { } challenge = { 0x713c 0x9338 0x30e1 0xf8d6 0xb934 0x7351 0x200c 0x3fd0 } ] >-- [ sslrecord { type = 22 (handshake) version = { 3,0 } length = 997 (0x3e5) handshake { type = 2 (server_hello) length = 70 (0x000046) serverhello { server_version = {3, 0} random = {...} session id = { length = 32 contents = {..} } cipher_suite = (0x0003) ssl3/rsa/rc4-40/md5 } type = 11 (certificate) length = 709 (0x0002c5) certificatechain { chainlength = 706 (0x02c2) certificate { size = 703 (0x02bf) data = { saved in file 'cert.001' } } } type = 12 (server_key_exchange) length = 202 (0x0000ca) type = 14 (server_hello_done) length = 0 (0x000000) } } ] --> [ sslrecord { ...
NSS reference
encryption/decryption hashing key generation generate keys, key pairs, and domain parameters.
... random number generation this api consists of the two routines used for pseudorandom number generation -- pk11_generaterandomonslot and pk11_generaterandom -- and the two routines used for seeding pseudorandom number generation -- pk11_seedrandom and pk11_randomupdate.
sslcrt.html
returns the function returns one of these values: if the common name in the subject dn for the certificate matches the domain name passed in the hostname parameter, secsuccess.
... if the common name in the subject dn for the certificate is not identical to the domain name passed in the hostname parameter, secfailure.
NSS Tools ssltap
type = 22 (handshake) version = { 3,0 } length = 997 (0x3e5) handshake { 0: 02 00 00 46 |...f type = 2 (server_hello) length = 70 (0x000046) serverhello { server_version = {3, 0} random = {...} 0: 77 8c 6e 26 6c 0c ec c0 d9 58 4f 47 d3 2d 01 45 |wn&amp;l.ì..xog.-.e 10: 5c 17 75 43 a7 4c 88 c7 88 64 3c 50 41 48 4f 7f |\.uc§l.Ç.d&lt;paho.
...x000003) ssl3/rsa/rc4-40/md5 } session-id = { } challenge = { 0x713c 0x9338 0x30e1 0xf8d6 0xb934 0x7351 0x200c0x3fd0 }]<-- [sslrecord { type = 22 (handshake) version = { 3,0 } length = 997 (0x3e5) handshake { type = 2 (server_hello) length = 70 (0x000046) serverhello { server_version = {3, 0} random = {...} session id = { length = 32 contents = {..} } cipher_suite = (0x0003) ssl3/rsa/rc4-40/md5 } type = 11 (certificate) length = 709 (0x0002c5) certificatechain { chainlength = 706 (0x02c2) certificate { size = 703 (0x02bf) data ...
NSS tools : ssltap
MozillaProjectsNSStoolsssltap
type = 22 (handshake) version = { 3,0 } length = 997 (0x3e5) handshake { 0: 02 00 00 46 |...f type = 2 (server_hello) length = 70 (0x000046) serverhello { server_version = {3, 0} random = {...} 0: 77 8c 6e 26 6c 0c ec c0 d9 58 4f 47 d3 2d 01 45 | wn&l.ì..xog.-.e 10: 5c 17 75 43 a7 4c 88 c7 88 64 3c 50 41 48 4f 7f | \.uc§l.Ç.d<paho.
... } session-id = { } challenge = { 0x713c 0x9338 0x30e1 0xf8d6 0xb934 0x7351 0x200c 0x3fd0 } ] >-- [ sslrecord { type = 22 (handshake) version = { 3,0 } length = 997 (0x3e5) handshake { type = 2 (server_hello) length = 70 (0x000046) serverhello { server_version = {3, 0} random = {...} session id = { length = 32 contents = {..} } cipher_suite = (0x0003) ssl3/rsa/rc4-40/md5 } type = 11 (certificate) length = 709 (0x0002c5) certificatechain { chainlength = 706 (0x02c2) certificate { size = 703 (0x02bf...
Rhino downloads archive
in rhino 1.6r6 and later the e4x support has been rewritten to rely solely on the dom3 apis supported natively by java 1.5.
... (pre-java 1.5 users can use dom3 using java's endorsed standards override mechanism if they have a dom3-capable xml parser.) if neither xmlbeans nor dom3 are present, e4x is not available.
How to embed the JavaScript engine
*/ target = findeventtargetat(cx, global, x, y); event = neweventobject(cx, "click", x, y); argv[0].setobjectornull(event); /* to emulate the dom, you might want to try "onclick" too.
...*/ if (rval.isboolean() && !rval.toboolean()) cancelevent(event); again, i've elided error checking (such as testing for !ok after the call), and i've faked up some c event management routines that emulate the dom's convention of canceling an event if its handler returns false.
JIT Optimization Outcomes
hascommoninliningpath inlined dom monomorphic polymorphic inline cache outcomes outcomes describing inline cache stubs that were generated.
... icoptstub_genericsuccess icgetpropstub_readslot icgetpropstub_callgetter icgetpropstub_arraylength icgetpropstub_unboxedread icgetpropstub_unboxedreadexpando icgetpropstub_unboxedarraylength icgetpropstub_typedarraylength icgetpropstub_domproxyshadowed icgetpropstub_domproxyunshadowed icgetpropstub_genericproxy icgetpropstub_argumentslength icsetpropstub_slot icsetpropstub_genericproxy icsetpropstub_domproxyshadowed icsetpropstub_domproxyunshadowed icsetpropstub_callsetter icsetpropstub_addslot icsetpropstub_setunboxed icgetelemstub_readslot icgetelemstub_callgetter icgetelemstub_readunboxed icgetelemstub_dense icgetelemstub_densehole icgetelemstub_typedarray icgetelemstub_argselement icgetelemstub_argselementstrict icsetelemstub_dense icsetelemstub_typedarray i...
JIT Optimization Strategies
this optimization applies to shared getters on both pure js objects as well as dom objects.
... this optimization applies to shared setters on both pure js objects as well as dom objects.
JSAPI User Guide
the word javascript may bring to mind features such as event handlers (like onclick), dom objects, window.open, and xmlhttprequest.
...browsers expose dom objects.
JS_GetParent
applications that use spidermonkey's custom security features can use the parent during security checks, as a convenient way to determine the security domain of an object being accessed.
... the typical rule is that every object is in the same security domain as its parent.
Mozilla Projects
replaying processes preserve all the same js behavior, dom structures, graphical updates, and most other behaviors that occurred while recording.
... zest zest is an experimental specialized scripting language (also known as a domain-specific language) developed by the mozilla security team and is intended to be used in web oriented security tools.
Gecko object attributes
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.
... 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).
Implementation Details
supported features interfaces refer to specific pages to get information of supported interfaces for interested at api: core: gecko interfaces windows: msaa, ia2, ienumvariant and isimpledom* interfaces linux: at-spi roles refer to specific pages to get information of supported roles for interested at api: gecko msaa ia2 at-spi states refer to specific pages to get information of supported states for interested at api: gecko msaa ia2 at-spi relations refer to specific pages to get information of supported relations for interested at api: gecko msaa ia2 at-spi attributes object attributes refer to specific pages to get information of supported object attributes for interested at api: gecko msaa ia2 at-spi text at...
...instead, the same information is available via theisimpledomdocument interface.
XUL Accessibility
aggregating the text from element subtree if the child node is hidden then it's ignored excepting the case when the element used as label is hidden itself if the child node is text node then its rendered value is appended if the child node is element then if it implements nsidomxullabeledcontrolelement then the value of label property is appended otherwise if it's a label element then then value attribute is appended otherwise append tooltiptext attribute append the accessible value searching specific element in neighbour of the element search inside the element subtree go up through parents (max level is 5) and search inside theirs subtrees if the element is anon...
...name the following rules to generate accessible name are applied: check aria-labelledby attribute, name is generated from elements pointed by aria-labelledby attribute <description id="descr1">label1</description> <description id="descr2">label2</description> <textbox aria-labelledby="descr1 descr2" /> if the element implements nsidomxullabeledcontrolelement or nsidomxulselectcontrolitemelement interface then it is used label property if the element doesn't implement nsidomxulselectcontrolelement then label attribute is used if neighbour of the element has label element pointing to this element by the control attribute, if the label element is found then use value attribute or its content.
Embedded Dialog API
most if not all of these dialogs will need to be child/dependent/transient windows, so each method responsible for actually opening a window must take an nsidomwindow *aparent parameter, and use that window as the dialog's parent, if non-null.
...embedded dialog posing interface coding conventions the nsidomwindow *aparent parameter mentioned above should be the first parameter to each method in which it appears.
Using the Places history service
nsibrowserhistory.removepagesfromhost: called from the ui when the user deletes a group associated with a host or domain.
... this function allows you to delete pages from a specific host, or pages from all hosts in a given domain.
Generating GUIDs
don't have a domain name?
... do you have a blog on a subdomain?
How to build an XPCOM component in JavaScript
depth = @depth@ topsrcdir = @top_srcdir@ srcdir = @srcdir@ vpath = @srcdir@ include $(depth)/config/autoconf.mk # module specifies where header files from this makefile are installed # use dom if your component implements a dom api module = dom # name of the typelib xpidl_module = dom_apps # set to 1 if the module should be part of the gecko runtime common to all applications gre_module = 1 # the idl sources xpidlsrcs = \ helloworld.idl \ $(null) include $(topsrcdir)/config/rules.mk xpidl_flags += \ -i$(topsrcdir)/dom/interfaces/base \ -i$(topsrcdir)/dom/interfaces/events \ $...
...using the generateqi helper (remove argument if skipped steps above) queryinterface: xpcomutils.generateqi([components.interfaces.nsihelloworld]), // optional, but required if you want your component to be exposed to dom classinfo: xpcomutils.generateci({classid: components.id("{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}"), contractid: "@dietrich.ganx4.com/helloworld;1", interfaces: [ci.nsihelloworld], flags: ci.nsiclassinfo.dom_object}), // ...component implementation...
XPCOM changes in Gecko 2.0
global-constructor javascript global constructor prototype alias javascript-global-constructor-prototype-alias javascript global property javascript-global-property javascript global privileged property javascript-global-privileged-property javascript global static nameset javascript-global-static-nameset javascript global dynamic nameset javascript-global-dynamic-nameset javascript dom class javascript-dom-class javascript dom interface javascript-dom-interface xslt extension functions xslt-extension-functions but why?
...if, on the other hand, all you're doing with content is accessing dom methods and properties, you've never needed to be using xpcnativewrappers=no in the first place, and should simply remove it from your manifest.
Creating the Component Code
what we'll be working on the component we'll be working on in this book controls a special mode in your browser that prevents users from leaving the current domain or a set of safe domains.
...in weblock, this is the part that brings together various gecko services and prevents users from leaving the list of acceptable domains.
Finishing the Component
in the weblock component, the shouldload method looks like this: ns_imethodimp weblock::shouldload(print32 contenttype, nsiuri *contentlocation, nsisupports *ctxt, nsidomwindow *window, prbool *_retval) uniform resource locators the method passes in an interface pointer of type nsiuri, which is based on the uniform resource identifier, or uri.
... here is the complete implementation of the shouldload() method: ns_imethodimp weblock::shouldload(print32 contenttype, nsiuri *contentlocation, nsisupports *ctxt, nsidomwindow *window, prbool *_retval) { if (!contentlocation) return ns_error_failure; nsembedcstring scheme; contentlocation->getscheme(scheme); if (strcmp("http", scheme.get()) != 0 && strcmp("https", scheme.get()) != 0 && strcmp("ftp", scheme.get()) != 0) { // this isn't a type of uri that we deal with *_retval = pr_true; return ns_ok; ...
Components.utils.createObjectIn
for example, to create a new object in the compartment identified by contentwindow: var newobject = new contentwindow.object(); but it is really needeed from firefox 30 onwards when trying to manipulate the dom window.
... example to create a new object in the scope of a specified dom window, you can simply do: function genpropdesc(value) { return { enumerable: true, configurable: true, writable: true, value: value }; } var myobject = components.utils.createobjectin(mywindow); var proplist = { name: genpropdesc("name"), date: genpropdesc("date"), id: genpropdesc("id"), func: genpropdesc(function() { alert("called func!"); }) }; object.defineproperties(myobj...
Components.utils.evalInWindow
the result is structured cloned back to the original context, unless it is native (for example, if it returns a dom node, this is not structured cloned, because the original context will see that through an xraywrapper already), so it's guaranteed to behave predictably.
...if this is just native (for example, a dom node), then the function relies on xraywrappers to wrap the returned content, otherwise the result is structured-cloned.
Components.utils.exportFunction
exporting functions that take arguments until firefox 34, any arguments that the function takes are structured-cloned across the security boundary unless they are native objects such as dom nodes.
...less-privileged scope: for example, a page script var user = {name: "jim"}; var test = document.getelementbyid("test"); test.addeventlistener("click", function() { console.log(user.name); // "jim" window.changemyname(user); console.log(user.name); // "bill" }, false); note that this is subject to the normal rules of xrays: for example, an expando property added to a dom node will not be visible in the original object.
Components.utils.waiveXrays
for example, privileged code using an xray to a dom object sees only the original, native version of the dom object.
...however, in some cases it can be too restrictive: for example, if you need to see an expando property on a dom object.
XPConnect wrappers
for practical advice on dealing with wrappers, see safely accessing content dom from chrome.
...this includes all dom objects (including window) and chrome elements that are reflected into javascript.
Language bindings
the result is structured cloned back to the original context, unless it is native (for example, if it returns a dom node, this is not structured cloned, because the original context will see that through an xraywrapper already), so it's guaranteed to behave predictably.
...for example, privileged code using an xray to a dom object sees only the original, native version of the dom object.
nsAString
nsastring corresponds to the astring and domstring xpidl data types.
...that is, it may be used to store utf-16 characters, ucs-2 characters, or any random double-byte data.
amIWebInstallInfo
originatingwindow nsidomwindow the window that started the installs.
... note: prior to gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5), this was an nsidomwindowinternal.
amIWebInstallPrompt
1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) method overview void confirm(in nsidomwindow awindow, in nsiuri auri, [array, size_is(acount)] in nsivariant ainstalls, [optional] in pruint32 acount); prior to gecko 8.0, all references to nsidomwindow used in this interface were nsidomwindow.
...void confirm( in nsidomwindow awindow, in nsiuri auri, [array, size_is(acount)] in nsivariant ainstalls, in pruint32 acount optional ); parameters awindow the window that triggered the installs.
imgILoader
aobserver the observer (may be null) acx some random data.
...aobserver the observer (may be null) cx some random data.
nsIAbstractWorker
dom/interfaces/threads/nsidomworkers.idlscriptable this interface is an abstract interface used to implement the web workers architecture.
... 1.0 66 introduced gecko 1.9.1 inherits from: nsidomeventtarget last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) attributes attribute type description onerror nsidomeventlistener the error listener for the worker.
nsICookieManager
void remove( in autf8string ahost, in acstring aname, in autf8string apath, in boolean ablocked, in jsval aoriginattributes ); parameters ahost the host or domain for which the cookie was set.
...if the target cookie is a domain cookie, a leading dot must be present.
nsIEditorIMESupport
obsolete since gecko 2.0 void setcompositionstring(in domstring acompositionstring, in nsiprivatetextrangelistptr atextrange, in nstexteventreplyptr areply); native code only!
...void setcompositionstring( in domstring acompositionstring, in nsiprivatetextrangelistptr atextrange, in nstexteventreplyptr areply ); parameters acompositionstring atextrange areply ...
nsIFilePicker
to create an instance, use: var filepicker = components.classes["@mozilla.org/filepicker;1"] .createinstance(components.interfaces.nsifilepicker); method overview void appendfilter(in astring title, in astring filter); void appendfilters(in long filtermask); void init(in nsidomwindow parent, in astring title, in short mode); void open(in nsifilepickershowncallback afilepickershowncallback); short show(); obsolete since gecko 57.0 attributes attribute type description addtorecentdocs boolean if true, the file is added to the operating system's "recent documents" list (if the operating system has one; nothing happe...
... void init( in nsidomwindow parent, in astring title, in short mode ); parameters parent the nsidomwindow parent.
nsIGeolocationProvider
1.0 66 introduced gecko 1.9.1 inherits from: nsisupports last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) this must be called on the main thread interface provides location information to the nsgeolocator via the nsidomgeolocationcallback interface.
...see dom/src/geolocation/networkgeolocationprovider.js for an example of how to write a geolocation provider.
nsIGeolocationUpdate
method overview void update(in nsidomgeoposition position); methods update() notify the geolocation service that a new geolocation has been discovered.
...void update( in nsidomgeoposition position ); parameters position a nsidomgeoposition object describing the updated position information.
nsILoginManagerPrompter
to call this service, use: var loginmanagerprompter = components.classes["@mozilla.org/login-manager/prompter;1"] .getservice(components.interfaces.nsiloginmanagerprompter); method overview void init(in nsidomwindow awindow); void prompttochangepassword(in nsilogininfo aoldlogin, in nsilogininfo anewlogin); void prompttochangepasswordwithusernames([array, size_is(count)] in nsilogininfo logins, in pruint32 count, in nsilogininfo anewlogin); void prompttosavepassword(in nsilogininfo alogin); methods init() initialize the prompter.
... void init( in nsidomwindow awindow ); parameters awindow the in which the user is doing some login-related action that is resulting in a need to prompt them for something.
nsIMarkupDocumentViewer
inherits from: nsisupports last changed in gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4) method overview void scrolltonode(in nsidomnode node); void sizetocontent(); attributes attribute type description allowplugins boolean if true, plugins are allowed within the doc shell.
...void scrolltonode( in nsidomnode node ); parameters node the nsidomnode of the node to make visible.
nsIMenuBoxObject
inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) to get access to the box object for a given menu, use code like this: var boxobject = xulmenu.boxobject.queryinterface(components.interfaces.nsimenuboxobject); method overview boolean handlekeypress(in nsidomkeyevent keyevent); void openmenu(in boolean openflag); attributes attribute type description activechild nsidomelement the currently active menu or menuitem child of the menu box.
...methods handlekeypress() boolean handlekeypress( in nsidomkeyevent keyevent ); parameters keyevent the key event to handle for the menu.
nsIMessageListenerManager
dom/base/nsimessagemanager.idlscriptable this interface enables clients to listen for messages sent using the nsimessagebroadcaster, nsimessagesender, or nsisyncmessagesender interfaces.
... listenwhenclosed specify true to receive messages during the short period after a frame has been removed from the dom and before its frame script has finished unloading; this is false by default.
nsIMicrosummaryService
ruri); nsisimpleenumerator getbookmarks(); nsimicrosummarygenerator getgenerator(in nsiuri generatoruri); nsimicrosummaryset getmicrosummaries(in nsiuri pageuri, in long long bookmarkid); nsimicrosummary getmicrosummary(in long long bookmarkid); boolean hasmicrosummary(in long long bookmarkid); nsimicrosummarygenerator installgenerator(in nsidomdocument xmldefinition); boolean ismicrosummary(in long long bookmarkid, in nsimicrosummary microsummary); nsimicrosummary refreshmicrosummary(in long long bookmarkid); void removemicrosummary(in long long bookmarkid); void setmicrosummary(in long long bookmarkid, in nsimicrosummary microsummary); methods addgenerator() install the microsummary generator f...
...nsimicrosummarygenerator installgenerator( in nsidomdocument xmldefinition ); parameters xmldefinition an nsidomdocument xml document defining the generator.
nsIMsgWindow
you don't normally need to set this, instead set the domwindow property instead.
... domwindow nsidomwindow the message window's global chrome window object.
nsIPrompt
inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) note: this interface is identical to nsipromptservice but without the parent nsidomwindow parameter.
...if you are using this interface, you must remove the nsidomwindow arguments from those methods.
nsISelection3
method overview void modify(in domstring alter, in domstring direction, in domstring granularity); methods modify() modifies the selection.
... void modify( in domstring alter, in domstring direction, in domstring granularity ); parameters alter can be one of { "move", "extend" } "move" collapses the selection to the end of the selection and applies the movement direction/granularity to the collapsed selection.
nsITextInputProcessorNotification
dom/interfaces/base/nsitextinputprocessorcallback.idlscriptable this interface of a request or notification to ime 1.0 66 introduced gecko 38 inherits from: nsisupports last changed in gecko 38.0 (firefox 38.0 / thunderbird 38.0 / seamonkey 2.35) this interface tells details of a request or notification to ime.
... this is typically notified when the editor is being removed from the dom tree during composition.
nsITreeColumns
last changed in gecko 1.9 (firefox 3) inherits from: nsisupports method overview nsitreecolumn getcolumnat(in long index); nsitreecolumn getcolumnfor(in nsidomelement element); nsitreecolumn getfirstcolumn(); nsitreecolumn getkeycolumn(); nsitreecolumn getlastcolumn(); nsitreecolumn getnamedcolumn(in astring id); nsitreecolumn getprimarycolumn(); nsitreecolumn getsortedcolumn(); void invalidatecolumns(); void restorenaturalorder(); attributes attribute type description count long the number of columns.
...nsitreecolumn getcolumnfor( in nsidomelement element ); parameters element a dom element return value a nsitreecolumn for this element.
nsIUUIDGenerator
exceptions thrown ns_error_failure if a uuid cannot be generated (for example if an underlying source of randomness is not available) native code only!generateuuidinplace obtain a new uuid like the generateuuid() method, but place it in the provided nsid pointer instead of allocating a new nsid.
... exceptions thrown ns_error_failure if a uuid cannot be generated (for example if an underlying source of randomness is not available) example generating a uuid var uuidgenerator = components.classes["@mozilla.org/uuid-generator;1"] .getservice(components.interfaces.nsiuuidgenerator); var uuid = uuidgenerator.generateuuid(); var uuidstring = uuid.tostring(); ...
nsIUpdatePrompt
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(); void showupdateavailable(in nsiupdate update); void showupdatedownloaded(in nsiupdate update, [optional] in boolean background); void showupdateerror(in nsiupdate update); void showupdatehistory(in nsidomwindow parent); void showupdateinstalled(); methods checkforupdates() presents a user interface that checks for and displays the available updates.
...void showupdatehistory( in nsidomwindow parent ); parameters parent an nsidomwindow indicating the parent window to which to anchor the update list window.
nsIVariant
domstring getasdomstring(); native code only!
...native code only!getasdomstring domstring getasdomstring(); parameters none.
nsIWebBrowserFindInFrames
attributes attribute type description currentsearchframe nsidomwindow frame at which to start the search.
... rootsearchframe nsidomwindow frame within which to confine the search (normally the content area frame).
nsIWinTaskbar
.getservice(components.interfaces.nsiwintaskbar); method overview nsijumplistbuilder createjumplistbuilder(); nsitaskbartabpreview createtaskbartabpreview(in nsidocshell shell, in nsitaskbarpreviewcontroller controller); nsitaskbarprogress gettaskbarprogress(in nsidocshell shell); nsitaskbarwindowpreview gettaskbarwindowpreview(in nsidocshell shell); void setgroupidforwindow(in nsidomwindow aparent, in astring aidentifier); attributes attribute type description available boolean 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.
...void setgroupidforwindow( in nsidomwindow aparent, in astring aidentifier ); parameters aparent the parent nsidomwindow.
nsIWorkerGlobalScope
dom/interfaces/threads/nsidomworkers.idlscriptable this interface is an abstract interface representing the 'inside' of a worker.
... onerror nsidomeventlistener self nsiworkerglobalscope returns the global scope object itself.
nsIXSLTException
inherits from: nsiexception last changed in gecko 1.7 attributes attribute type description sourcenode nsidomnode the context node, may be null.
... stylenode nsidomnode the node in the stylesheet that triggered the exception.
nsIXULSortService
obsolete since gecko 1.9 void sort(in nsidomnode anode, in astring asortkey, in astring asorthints); constants constant value description sort_comparecase 0x0001 sort_integer 0x0100 methods native code only!insertcontainernode obsolete since gecko 1.9 (firefox 3)this feature is obsolete.
...void sort( in nsidomnode anode, in astring asortkey, in astring asorthints ); parameters anode a node in the xul widget whose children are to be sorted.
nsPIPromptService
method overview void dodialog(in nsidomwindow aparent, in nsidialogparamblock aparamblock, in string achromeurl); methods dodialog() opens a dialog.
... void dodialog( in nsidomwindow aparent, in nsidialogparamblock aparamblock, in string achromeurl ); parameters aparent the parent window of the dialog.
Using the clipboard
if (source instanceof ci.nsidomwindow) // note: in gecko versions >16, you can import the privatebrowsingutils.jsm module // and use privatebrowsingutils.privacycontextfromwindow(sourcewindow) instead source = source.queryinterface(ci.nsiinterfacerequestor) .getinterface(ci.nsiwebnavigation); res.init(source); } return res; } here, the string "tex...
...please note: the sourcewindow variable is a placeholder for whatever window owns the data being copied -- from any dom element you can obtain it via element.ownerdocument.defaultview.
XPIDL
string full unicode set permitted (translated to utf-8) acstring const nsacstring& nsacstring& string only chars in range \u0000-\u00ff permitted astring const nsastring& nsastring& string full unicode set permitted jsval const jsval& jsval* anything jsid jsid jsid* not allowed promise mozilla::dom::promise* mozilla::dom::promise** promise 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.
...webidl types will be passed as mozilla::dom::interfacename* when used as in-parameters, as mozilla::dom::interfacename** when used as out or inout-parameters, and as refptr<mozilla::dom::interfacename> when used as an array element.
Building a Thunderbird extension 5: XUL
we add widgets by inserting new xul dom elements into the application window and modify them using scripts and attaching event handlers.
...to view this xul file use the dom inspector extension (no longer supported) or look inside the omni.ja archive, which is located in the thunderbird program folder.
Building a Thunderbird extension 6: Adding JavaScript
the event listener then calls our startup function which gets our <statusbarpanel>-element with the id my-panel from the document's dom tree.
... 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.
Finding the code for a feature
the first is the dom inspector extension which i have routinely installed in all of my thunderbird installations.
...using dom inspector, i find the tag menu item, and i see that it uses command "cmd_tag".
Plug-in Basics - Plugins
with the plug-in api, you can create dynamically loaded plug-ins that can: register one or more mime types draw into a part of a browser window receive keyboard and mouse events obtain data from the network using urls post data to urls add hyperlinks or 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.
...if you are browsing a page that has several embedded realaudio clips, for example, the browser will create as many instances of the realplayer plug-in as are needed (though of course playing several realaudio files at the same time would seldom be a good idea).
Scripting plugins - Plugins
how the dom handles scripting the mozilla dom code now checks if a plugin supports this new scriptability api and if it exposes a scriptable object through this new mechanism.
...ew mechanism needs to return the appropriate npobject (which is created by calling npn_createobject) when the browser requests it by calling: npp_getvalue(npp, nppvpluginscriptablenpobject, ...); accessing browser objects from a plugin a plugin that wishes to access objects in the browser window that loaded the plugin can do this by getting the npobject for the browser's window object, or the dom element that loaded the plugin.
Gecko Plugin API Reference - Plugins
a paint message making a plug-in opaque making a plug-in transparent creating pop-up menus and dialog boxes event handling for windowless plug-ins streams receiving a stream telling the plug-in when a stream is created telling the plug-in when a stream is deleted finding out how much data the plug-in can accept writing the stream to the plug-in sending the stream in random-access mode sending the stream in file mode sending a stream creating a stream pushing data into the stream deleting the stream example of sending a stream urls getting urls getting the url and displaying the page posting urls posting data to an http server uploading files to an ftp server sending mail memory allocating and freeing memory mac o...
... scripting plugins how the dom handles scripting threading model security model what's in the plugin code?
Debugging service workers - Firefox Developer Tools
debugging your service worker in any case, when the service worker is successfully registered, you'll see information about it displayed in the application > service workers view (along with any other service workers registered on the same domain): this gives you a variety of information about your service worker: the url that the service worker is registered on.
... 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.
Monster example - Firefox Developer Tools
here's the code: var monster_count = 5000; var min_name_length = 2; var max_name_length = 48; function monster() { function randomint(min, max) { return math.floor(math.random() * (max - min + 1)) + min; } function randomname() { var chars = "abcdefghijklmnopqrstuvwxyz"; var namelength = randomint(min_name_length, max_name_length); var name = ""; for (var j = 0; j &lt; namelength; j++) { name += chars[randomint(0, chars.length-1)]; } return name; } this.name = randomname(); this.eyecount = randomint(0, 25); this.tentaclecount = rand...
... for each array, the code creates and appends 5000 randomly-initialized monsters.
Sorting algorithms comparison - Firefox Developer Tools
iteratively (200 iterations) generates a randomized array and calls sort().
... its call graph looks like this: sortall() // (generate random array, then call sort) x 200 -> sort() // sort with each algorithm, log the result -> bubblesort() -> swap() -> selectionsort() -> swap() -> quicksort() -> partition() the implementations of the sorting algorithms in the program are taken from https://github.com/nzakas/computer-science-in-javascript/ and are u...
Storage Inspector - Firefox Developer Tools
currently it can be used to inspect the following storage types: cache storage — any dom caches created using the cache api.
...for example, clicking on an origin which is a child of the cookies storage type will show all the cookies belonging to that domain.
Rich output - Firefox Developer Tools
in particular, it: provides extra information for certain types enables detailed examination of the object's properties provides richer information for dom elements, and enables you to select them in the inspector type-specific rich output the web console provides rich output for many object types, including the following: object array date promise regexp window document element event examining object properties when an object is logged to the console it has a right-pointing triangle next to it, indicating that it can be expanded.
...37 } ​ 1: object { status: "in progress", description: "refactor styles", datecreated: 1552404493169 } ​ 2: object { status: "to do", description: "create feedback form", datecreated: 1552404512630 } ​ 3: object { status: "to do", description: "normalize table", datecreated: 1552404533790 } ​ length: 4 ​ <prototype>: array [] debugger eval code:1:9 undefined highlighting and inspecting dom nodes if you hover the mouse over any dom element in the console output, it's highlighted on the page: in the screenshot above you'll also see a blue "target" icon next to the node in the console output: click it to switch to the inspector with that node selected.
about:debugging - Firefox Developer Tools
note: from firefox 79 onwards, you can access similar information on the service workers registered on a particular domain by going to the firefox devtools application panel.
... service workers can be unavailable if the dom.serviceworkers.enable preference is set to false in about:config.
AbortController.abort() - Web APIs
the abort() method of the abortcontroller interface aborts a dom request (e.g.
... specifications specification status comment domthe definition of 'abort()' in that specification.
AbortController.signal - Web APIs
the signal read-only property of the abortcontroller interface returns an abortsignal object instance, which can be used to communicate with/abort a dom request as desired.
... specifications specification status comment domthe definition of 'signal' in that specification.
AbortSignal.aborted - Web APIs
the aborted read-only property returns a boolean that indicates whether the dom request(s) the signal is communicating with is/are aborted (true) or not (false).
...console.log('request has been aborted') : console.log('request not aborted'); specifications specification status comment domthe definition of 'onabort' in that specification.
AbstractRange.endContainer - Web APIs
syntax var endnode = range.endcontainer value the dom node which contains the final character of the range.
... specifications specification status comment domthe definition of 'endcontainer' in that specification.
AbstractRange.startContainer - Web APIs
syntax var startnode = range.startcontainer value the dom node inside which the start position of the range is found.
... specifications specification status comment domthe definition of 'startcontainer ' in that specification.
AesCbcParams - Web APIs
properties name a domstring.
...must be 16 bytes, unpredictable, and preferably cryptographically random.
AesGcmParams - Web APIs
properties name a domstring.
...the aes-gcm specification recommends that the iv should be 96 bits long, and typically contains bits from a random number generator.
AnalyserNode.getByteFrequencyData() - Web APIs
syntax var audioctx = new audiocontext(); var analyser = audioctx.createanalyser(); var dataarray = new uint8array(analyser.frequencybincount); // uint8array should be the same length as the frequencybincount void analyser.getbytefrequencydata(dataarray); // fill the uint8array with data returned from getbytefrequencydata() parameters array the uint8array that the frequency domain data will be copied to.
..., 0, width, height); var barwidth = (width / bufferlength) * 2.5; var barheight; var x = 0; for(var i = 0; i < bufferlength; i++) { barheight = dataarray[i]; canvasctx.fillstyle = 'rgb(' + (barheight+100) + ',50,50)'; canvasctx.fillrect(x,height-barheight/2,barwidth,barheight/2); x += barwidth + 1; } }; draw(); parameters array the uint8array that the frequency domain data will be copied to.
AnimationEvent.initAnimationEvent() - Web APIs
syntax animationevent.initanimationevent(typearg, canbubblearg, cancelablearg, animationnamearg, elapsedtimearg); parameters typearg a domstring identifying the specific type of animation event that occurred.
... animationnamearg a domstring containing the value of the animation-name css property associated with the transition.
AnimationEvent - Web APIs
animationevent.animationname read only is a domstring containing the value of the animation-name that generated the animation.
... animationevent.pseudoelement read only is a domstring, starting with '::', containing the name of the pseudo-element the animation runs on.
AudioBuffer - Web APIs
example the following simple example shows how to create an audiobuffer and fill it with random white noise.
... var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); // create an empty three-second stereo buffer at the sample rate of the audiocontext var myarraybuffer = audioctx.createbuffer(2, audioctx.samplerate * 3, audioctx.samplerate); // fill the buffer with white noise; // just random values between -1.0 and 1.0 for (var channel = 0; channel < myarraybuffer.numberofchannels; channel++) { // this gives us the actual array that contains the data var nowbuffering = myarraybuffer.getchanneldata(channel); for (var i = 0; i < myarraybuffer.length; i++) { // math.random() is in [0; 1.0] // audio needs to be in [-1.0; 1.0] nowbuffering[i] = math.random() * 2 - 1; }...
AudioParamDescriptor - Web APIs
properties name the domstring which represents the name of the audioparam.
...r extends audioworkletprocessor { static get parameterdescriptors () { return [{ name: 'customgain', defaultvalue: 1, minvalue: 0, maxvalue: 1, automationrate: 'a-rate' }] } process (inputs, outputs, parameters) { const output = outputs[0] output.foreach(channel => { for (let i = 0; i < channel.length; i++) { channel[i] = (math.random() * 2 - 1) * (parameters['customgain'].length > 1 ?
AudioWorkletProcessor.parameterDescriptors (static getter) - Web APIs
the properties of these objects are as follows: name the domstring which represents the name of the audioparam.
...r extends audioworkletprocessor { static get parameterdescriptors () { return [{ name: 'customgain', defaultvalue: 1, minvalue: 0, maxvalue: 1, automationrate: 'a-rate' }] } process (inputs, outputs, parameters) { const output = outputs[0] output.foreach(channel => { for (let i = 0; i < channel.length; i++) { channel[i] = (math.random() * 2 - 1) * (parameters['customgain'].length > 1 ?
BaseAudioContext.createAnalyser() - Web APIs
example the following example shows basic usage of an audiocontext to create an analyser node, then use requestanimationframe() to collect time domain data repeatedly and draw an "oscilloscope style" output of the current audio input.
... analyser.fftsize = 2048; var bufferlength = analyser.frequencybincount; var dataarray = new uint8array(bufferlength); analyser.getbytetimedomaindata(dataarray); // draw an oscilloscope of the current audio source function draw() { drawvisual = requestanimationframe(draw); analyser.getbytetimedomaindata(dataarray); canvasctx.fillstyle = 'rgb(200, 200, 200)'; canvasctx.fillrect(0, 0, width, height); canvasctx.linewidth = 2; canvasctx.strokestyle = 'rgb(0, 0, 0)'; canvasctx.beginpath(); ...
BaseAudioContext.createPeriodicWave() - Web APIs
you can think of it as the result of a fourier transform, where you get frequency domain values from time domain value.
... here, with createperiodicwave(), you specify the frequencies, and the browser performs an inverse fourier transform to get a time domain buffer for the frequency of the oscillator.
BasicCardRequest.supportedTypes - Web APIs
the obsolete supportedtypes property of the basiccardrequest dictionary can optionally be provided to specify an array of domstrings representing the card types that the retailer supports (e.g.
... syntax basiccardrequest.supportedtypes = [cardtype1...cardtypen]; value an array containing one or more domstrings, which describe the card types the retailer supports.
BasicCardRequest - Web APIs
properties basiccardrequest.supportednetworks optional secure context an optional array of domstrings representing the card networks that the retailer supports (e.g.
... basiccardrequest.supportedtypes optional secure context this obsolete property was used to provide an optional array of domstrings representing the card types that the retailer supports (e.g.
BasicCardResponse.billingAddress - Web APIs
samsung internetbillingaddresschrome no support noedge no support ≤18 — 79firefox full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
...android no support nochrome android full support 57firefox android full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
Beacon API - Web APIs
the data argument is optional and its type may be an arraybufferview, blob, domstring, or formdata.
...the data argument is optional and its type may be an arraybufferview, blob, domstring, or formdata.
BeforeInstallPromptEvent - Web APIs
beforeinstallpromptevent.platforms read only returns an array of domstring items containing the platforms on which the event was dispatched.
... beforeinstallpromptevent.userchoice read only returns a promise that resolves to a domstring containing either "accepted" or "dismissed".
BlobEvent.timecode - Web APIs
the timecode readonlyinline property of the blobevent interface a domhighrestimestamp indicating the difference between the timestamp of the first chunk in data, and the timestamp of the first chunk in the first blobevent produced by this recorder.
... syntax var timecode = blobevent.timecode value a domhighrestimestamp.
id - Web APIs
the bluetoothdevice.id read-only property returns a domstring that uniquely identifies a device.
... syntax var id = instanceofbluetoothdevice.id returns a domstring.
BluetoothDevice.name - Web APIs
the bluetoothdevice.name read-only property returns a domstring that provides a human-readable name for the device.
... syntax var name = instanceofbluetoothdevice.name returns a domstring.
BluetoothRemoteGATTCharacteristic.uuid - Web APIs
the bluetoothremotegattcharacteristic.uuid read-only property returns domstring containing the uuid of the characteristic, for example '00002a37-0000-1000-8000-00805f9b34fb' for the heart rate measurement characteristic.
... syntax var uuid = bluetoothremotegattcharacteristic.uuid returns a domstring.
uuid - Web APIs
the bluetoothgattservice.uuid read-only property returns a domstring representing the uuid of this service.
... syntax var uuid = bluetoothgattservice.uuid returns a domstring.
CSSNamespaceRule.namespaceURI - Web APIs
the cssnamespacerule.namespaceuri read-only property returns a domstring containing the text of the uri of the given namespace.
... syntax var namespaceuri = cssnamespacerule.namespaceuri returns a domstring containing a uri.
CSSNamespaceRule.prefix - Web APIs
the cssnamespacerule.prefix read-only property returns a domstring with the name of the prefix associated to this namespace.
... syntax var prefix = cssnamespacerule.prefix returns a domstring containing the prefix associated to this namespace.
CSSPageRule - Web APIs
interface csspagerule : cssrule { attribute domstring selectortext; readonly attribute cssstyledeclaration style; }; properties as a cssrule, csspagerule also implements the properties of this interface.
... working draft no changes from document object model (dom) level 2 style specification document object model (dom) level 2 style specificationthe definition of 'csspagerule' in that specification.
CSSRule - Web APIs
WebAPICSSRule
(until the documentation is completed, see the interface definition in the mozilla source code: nsidomcssimportrule.) cssrule.media_rule 4 cssmediarule cssrule.font_face_rule 5 cssfontfacerule cssrule.page_rule 6 csspagerule cssrule.keyframes_rule 7 csskeyframesrule cssrule.keyframe_rule 8 csskeyframerule reserved for future use 9 should be used to define color profiles in the futu...
...(document_rule has been pushed to css conditional rules level 4) document object model (dom) level 2 style specificationthe definition of 'cssrule' in that specification.
CSSStyleDeclaration.getPropertyCSSValue() - Web APIs
syntax var value = style.getpropertycssvalue(property); parameters property is a domstring representing the property name to be retrieved.
... example the following javascript code gets an object containing the computed rgb values of the color css property: var style = window.getcomputedstyle(elem, null); var rgbobj = style.getpropertycssvalue('color').getrgbcolorvalue(); specifications specification status comment document object model (dom) level 2 style specificationthe definition of 'cssstyledeclaration' in that specification.
CSSStyleDeclaration.item() - Web APIs
return value propertyname is a domstring that is the name of the css property at the specified index.
... working draft document object model (dom) level 2 style specificationthe definition of 'cssstyledeclaration' in that specification.
CSSStyleSheet.addRule() - Web APIs
syntax var result = cssstylesheet.addrule(selector, styleblock, index); parameters selector a domstring specifying the selector portion of the css rule.
... styleblock a domstring indicating the style block to apply to elements matching the selector.
CSSStyleSheet - Web APIs
notes in some browsers, if a stylesheet is loaded from a different domain, accessing cssrules results in securityerror.
... working draft document object model (dom) level 2 style specificationthe definition of 'cssstylesheet' in that specification.
CSSValue.cssText - Web APIs
WebAPICSSValuecssText
syntax csstext = cssvalue.csstext; value a domstring representing the current css property value.
... example var styledeclaration = document.stylesheets[0].cssrules[0].style; var cssvalue = styledeclaration.getpropertycssvalue("color"); console.log(cssvalue.csstext); specifications specification status comment document object model (dom) level 2 style specificationthe definition of 'cssvalue.csstext' in that specification.
CSSValue - Web APIs
WebAPICSSValue
properties cssvalue.csstext a domstring representing the current value.
... specifications specification status comment document object model (dom) level 2 style specificationthe definition of 'cssvalue' in that specification.
CSS Object Model (CSSOM) - Web APIs
it is much like the dom, but for the css rather than the html.
... css device adaptation working draft css counter styles level 3 candidate recommendation document object model (dom) level 2 style specification obsolete initial definition.
Cache - Web APIs
WebAPICache
// all of the google web fonts are served off of a domain that supports cors, so that isn't an issue here.
... // it is something to keep in mind if you're attempting to cache other resources from a cross-origin // domain that doesn't support cors, though!
CanvasRenderingContext2D.currentTransform - Web APIs
the canvasrenderingcontext2d.currenttransform property of the canvas 2d api returns or sets a dommatrix (current specification) or svgmatrix (old specification) object for the current transformation matrix.
... syntax ctx.currenttransform [= value]; value a dommatrix or svgmatrix object to use as the current transformation matrix.
CanvasRenderingContext2D.drawWindow() - Web APIs
bgcolor a domstring that specifies the color the canvas is filled with before the window is rendered into it.
... example this method draws a snapshot of the contents of a dom window into the canvas.
Hit regions and accessibility - Web APIs
it's also very useful for assistive technology users (like screen readers) which can read and interpret the sub dom in it.
...it allows you to make hit detection easier and lets you route events to dom elements.
ChildNode.remove() - Web APIs
WebAPIChildNoderemove
with(node) { remove(); } // referenceerror: remove is not defined polyfill you can polyfill the remove() method in internet explorer 9 and higher with the following code: // from:https://github.com/jserz/js_piece/blob/master/dom/childnode/remove()/remove().md (function (arr) { arr.foreach(function (item) { if (item.hasownproperty('remove')) { return; } object.defineproperty(item, 'remove', { configurable: true, enumerable: true, writable: true, value: function remove() { this.parentnode.removechild(this); } }); }); })([element.prototype, characterdata.protot...
...ype, documenttype.prototype]); specifications specification status comment domthe definition of 'childnode.remove' in that specification.
CloseEvent() - Web APIs
syntax var event = new closeevent(typearg, closeeventinit); values typearg is a domstring representing the name of the event.
... "reason", optional and defaulting to '', of type domstring, that is a human-readable reason why the server closed the connection.
Comment() - Web APIs
WebAPICommentComment
the comment() constructor returns a newly created comment object with the optional domstring given in parameter as its textual content.
... syntax comment1 = new comment(); // create an empty comment comment2 = new comment("this is a comment"); example var comment = new comment("test"); specifications specification status comment domthe definition of 'comment: comment' in that specification.
CompositionEvent.CompositionEvent() - Web APIs
syntax const myevent = new compositionevent(typearg [, compositioneventinit]) values typearg is a domstring representing the name of the event.
... specifications specification status comment document object model (dom) level 3 events specificationthe definition of 'compositionevent()' in that specification.
CompositionEvent.data - Web APIs
syntax mydata = compositionevent.data value a domstring representing the event data: for compositionstart events, this is the currently selected text that will be replaced by the string being composed.
... specifications specification status comment document object model (dom) level 3 events specificationthe definition of 'data' in that specification.
CompositionEvent.locale - Web APIs
syntax mylocale = compositionevent.locale value a domstring representing the locale of current input method.
... specifications specification status comment document object model (dom) level 3 events specification obsolete no longer in the spec, but still supported.
CompositionEvent - Web APIs
the dom compositionevent represents events that occur due to the user indirectly entering text.
... working draft document object model (dom) level 3 events specificationthe definition of 'compositionevent' in that specification.
Credential.id - Web APIs
WebAPICredentialid
the id property of the credential interface returns a domstring containing the credential's identifier.
... syntax var id = credential.id; value a a domstring containing the credential's identifier.
Credential.name - Web APIs
WebAPICredentialname
the name property of the credential interface returns a domstring, containing the name associated with a credential.
... syntax var credname = credential.name; value a domstring containing the credential's given name.
Credential.type - Web APIs
WebAPICredentialtype
the type property of the credential interface returns a domstring containing the credential's type.
... syntax var credtype = credential.type; value a domstring contains a credential's given name.
Credential - Web APIs
properties credential.id read only returns a domstring containing the credential's identifier.
... credential.type read only returns a domstring containing the credential's type.
CustomElementRegistry.define() - Web APIs
t inside the info span var text = this.getattribute('text'); info.textcontent = text; // insert icon var imgurl; if(this.hasattribute('img')) { imgurl = this.getattribute('img'); } else { imgurl = 'img/default.png'; } var img = document.createelement('img'); img.src = imgurl; icon.appendchild(img); // create some css to apply to the shadow dom var style = document.createelement('style'); style.textcontent = '.wrapper {' + 'position: relative;' + '}' + '.info {' + 'font-size: 0.8rem;' + 'width: 200px;' + 'display: inline-block;' + 'border: 1p...
... 10px;' + 'z-index: 3;' + '}' + 'img {' + 'width: 1.2rem' + '}' + '.icon:hover + .info, .icon:focus + .info {' + 'opacity: 1;' + '}'; // attach the created elements to the shadow dom shadow.appendchild(style); shadow.appendchild(wrapper); wrapper.appendchild(icon); wrapper.appendchild(info); } } // define the new element customelements.define('popup-info', popupinfo); <popup-info img="img/alt.png" text="your card validation code (cvc) is an extra security feature — it is the last 3 or 4 ...
CustomEvent() - Web APIs
syntax event = new customevent(typearg, customeventinit); parameters typearg a domstring representing the name of the event.
... specifications specification status comment domthe definition of 'customevent()' in that specification.
DataTransfer.dropEffect - Web APIs
syntax datatransfer.dropeffect; values a domstring representing the drag operation effect.
...op handler will // know which element to add to its tree ev.datatransfer.setdata("text", ev.target.id); ev.datatransfer.effectallowed = "move"; } function drop_handler(ev) { console.log("drop: dropeffect = " + ev.datatransfer.dropeffect + " ; effectallowed = " + ev.datatransfer.effectallowed); ev.preventdefault(); // get the id of the target and add the moved element to the target's dom var data = ev.datatransfer.getdata("text"); ev.target.appendchild(document.getelementbyid(data)); } function dragover_handler(ev) { console.log("dragover: dropeffect = " + ev.datatransfer.dropeffect + " ; effectallowed = " + ev.datatransfer.effectallowed); ev.preventdefault(); // set the dropeffect to move ev.datatransfer.dropeffect = "move" } specifications specificati...
DataTransfer.effectAllowed - Web APIs
syntax datatransfer.effectallowed; values a domstring representing the drag operation that is allowed.
... the drop handler will // know which element to add to its tree ev.datatransfer.setdata("text", ev.target.id); ev.datatransfer.effectallowed = "move"; } function drop_handler(ev) { console.log("drop: dropeffect = " + ev.datatransfer.dropeffect + " ; effectallowed = " + ev.datatransfer.effectallowed); ev.preventdefault(); // get the id of the target and add the moved element to the target's dom var data = ev.datatransfer.getdata("text"); ev.target.appendchild(document.getelementbyid(data)); } function dragover_handler(ev) { console.log("dragover: dropeffect = " + ev.datatransfer.dropeffect + " ; effectallowed = " + ev.datatransfer.effectallowed); ev.preventdefault(); // set the dropeffect to move ev.datatransfer.dropeffect = "move" } </script> <body> <h1>examples <code>datatransf...
DataTransfer.setData() - Web APIs
syntax void datatransfer.setdata(format, data); arguments format a domstring representing the type of the drag data to add to the drag object.
... data a domstring representing the data to add to the drag object.
Document.URL - Web APIs
WebAPIDocumentURL
syntax const url = document.url example javascript document.getelementbyid("url").textcontent = document.url; html <p id="urltext"> url:<br/> <span id="url">url goes here</span> </p> result specifications specification status comment domthe definition of 'document.url' in that specification.
... living standard defines that the property is a usvstring instead of a domstring.
Document.adoptNode() - Web APIs
for more on the node.ownerdocument issues, see the w3c dom faq.
... specifications specification status comment domthe definition of 'document.adoptnode' in that specification.
Document.bgColor - Web APIs
WebAPIDocumentbgColor
document.bgcolor is deprecated in dom level 2 html.
... the recommended alternative is use of the css style background-color which can be accessed through the dom with document.body.style.backgroundcolor.
Document.createElement() - Web APIs
javascript document.body.onload = addelement; function addelement () { // create a new div element const newdiv = document.createelement("div"); // and give it some content const newcontent = document.createtextnode("hi there and greetings!"); // add the text node to the newly 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).
... specifications specification status comment domthe definition of 'document.createelement' in that specification.
Document.createEvent() - Web APIs
elem.dispatchevent(event); notes event type strings suitable for passing to createevent() are listed in the dom standard — see the table in step 2.
... event module standard event object gecko also supports text event module textevent textevents keyboard event module keyboardevent keyevents basic events module event events specifications specification status comment domthe definition of 'document.createevent' in that specification.
Document.createNodeIterator() - Web APIs
note: prior to gecko 12.0 (firefox 12.0 / thunderbird 12.0 / seamonkey 2.9), this method accepted an optional fourth parameter (entityreferenceexpansion) that is not part of the dom4 specification, and has therefore been removed.
...nodefilter.filter_accept : nodefilter.filter_reject; } } ); const pars = []; let currentnode; while (currentnode = nodeiterator.nextnode()) { pars.push(currentnode); } specifications specification status comment domthe definition of 'document.createnodeiterator' in that specification.
Document.createTreeWalker() - Web APIs
var treewalker = document.createtreewalker( document.body, nodefilter.show_element, { acceptnode: function(node) { return nodefilter.filter_accept; } }, false ); var nodelist = []; var currentnode = treewalker.currentnode; while(currentnode) { nodelist.push(currentnode); currentnode = treewalker.nextnode(); } specifications specification status comment domthe definition of 'document.createtreewalker' in that specification.
... document object model (dom) level 2 traversal and range specificationthe definition of 'document.createtreewalker' in that specification.
Document.execCommand() - Web APIs
parameters acommandname a domstring specifying the name of the command to execute.
... avalueargument for commands which require an input argument, is a domstring providing that information.
Document.write() - Web APIs
WebAPIDocumentwrite
for example: <script> document.write("<h1>main title</h1>") </script> note: document.write() and document.writeln do not work in xhtml documents (you'll get an "operation is not supported" [ns_error_dom_not_supported_err] error in the error console).
... living standard document object model (dom) level 2 html specificationthe definition of 'document.write(...)' in that specification.
Document.writeln() - Web APIs
WebAPIDocumentwriteln
note: document.writeln (like document.write) does not work in xhtml documents (you'll get a "operation is not supported" (ns_error_dom_not_supported_err) error on the error console).
... living standard document object model (dom) level 2 html specificationthe definition of 'document.writeln()' in that specification.
Document.xmlEncoding - Web APIs
warning: do not use this attribute; it has been removed from the dom level 4 specification and is no longer supported in gecko 10.0 (firefox 10.0 / thunderbird 10.0 / seamonkey 2.7).
... specification http://www.w3.org/tr/dom-level-3-cor...ment3-encoding this has been removed from dom core level 4wd ...
Document.xmlVersion - Web APIs
this attribute was never really useful, since it always returned 1.0, and has been removed in dom level 4.
...to detect this, you can create an element with its name in lower case, then check to see if it gets converted into all upper case (in which case the document is in the non-xml html mode): if (document.createelement("foo").tagname == "foo") { /* document is not xml */ } specifications http://www.w3.org/tr/dom-level-3-cor...ument3-version this has been removed from dom core level 4wd ...
DocumentFragment.querySelector() - Web APIs
if the selectors specified in parameter are invalid a domexception with a syntax_err value is raised.
... syntax element = documentfragment.queryselector(selectors); parameters selectors is a domstring containing one or more css selectors separated by commas.
DocumentFragment.querySelectorAll() - Web APIs
if the selectors specified in parameter are invalid a domexception with a syntax_err value is raised.
... syntax elementlist = documentfragment.queryselectorall(selectors); parameters selectors is a domstring containing one or more css selectors separated by commas.
DocumentOrShadowRoot.styleSheets - Web APIs
stylesheets retrieved from the dom are placed after, sorted in tree order.
... specifications specification status comment shadow domthe definition of 'documentorshadowroot' in that specification.
DragEvent - Web APIs
WebAPIDragEvent
the dragevent interface is a dom event that represents a drag and drop interaction.
... the user initiates a drag by placing a pointer device (such as a mouse) on the touch surface and then dragging the pointer to a new location (such as another dom element).
EcKeyGenParams - Web APIs
properties name a domstring.
... namedcurve a domstring representing the name of the elliptic curve to use.
EcKeyImportParams - Web APIs
properties name a domstring.
... namedcurve a domstring representing the name of the elliptic curve to use.
EcdsaParams - Web APIs
properties name a domstring.
... hash a domstring.
Element: click event - Web APIs
specifications specification status ui events working draft document object model (dom) level 3 events specificationthe definition of 'click' in that specification.
... obsolete document object model (dom) level 2 events specificationthe definition of 'click' in that specification.
Element.closest() - Web APIs
WebAPIElementclosest
syntax var closestelement = targetelement.closest(selectors); parameters selectors is a domstring containing a selector list.
...pe.closest) { element.prototype.closest = function(s) { var matches = (this.document || this.ownerdocument).queryselectorall(s), i, el = this; do { i = matches.length; while (--i >= 0 && matches.item(i) !== el) {}; } while ((i < 0) && (el = el.parentelement)); return el; }; } specifications specification status comment domthe definition of 'element.closest()' in that specification.
Element.currentStyle - Web APIs
/* any copyright is dedicated to the public domain.
... * http://creativecommons.org/publicdomain/zero/1.0/ */ if (!("currentstyle" in element.prototype)) { object.defineproperty(element.prototype, "currentstyle", { get: function() { return window.getcomputedstyle(this); } }); } specification not part of any specification.
Element.getAttributeNodeNS() - Web APIs
dom methods dealing with element's attributes: not namespace-aware, most commonly used methods namespace-aware variants (dom level 2) dom level 1 methods for dealing with attr nodes directly (seldom used) dom level 2 namespace-aware methods for dealing with attr nodes directly (seldom used) setattribute (dom 1) setattributens setattributenode setattributenodens getattribute (dom 1) getattrib...
...utens getattributenode getattributenodens hasattribute (dom 2) hasattributens - - removeattribute (dom 1) removeattributens removeattributenode - specifications specification status comment domthe definition of 'getattributenodens()' in that specification.
Element.hasAttributeNS() - Web APIs
example // check that the attribute exists before you set a value var d = document.getelementbyid("div1"); if (d.hasattributens( "http://www.mozilla.org/ns/specialspace/", "special-align")) { d.setattribute("align", "center"); } notes dom methods dealing with element's attributes: not namespace-aware, most commonly used methods namespace-aware variants (dom level 2) dom level 1 methods for dealing with attr nodes directly (seldom used) dom level 2 namespace-aware methods for dealing with attr nodes directly (seldom used) setattribute (dom 1) setattributens setattributenode setattributenodens getattribute (dom 1) getattrib...
...utens getattributenode getattributenodens hasattribute (dom 2) hasattributens - - removeattribute (dom 1) removeattributens removeattributenode - specifications specification status comment domthe definition of 'document.hasattributens' in that specification.
Element: mouseenter event - Web APIs
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.
... working draft document object model (dom) level 3 events specificationthe definition of 'mouseenter' in that specification.
Element: mouseleave event - Web APIs
one single mouseout 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.
... working draft document object model (dom) level 3 events specificationthe definition of 'mouseleave' in that specification.
Element: mousewheel event - Web APIs
bubbles yes cancelable yes interface mousewheelevent event handler property onmousewheel the detail property the value of the detail property is always zero, except in opera, which uses detail similarly to the firefox-only dommousescroll event's detail value, which indicates the scroll distance in terms of lines, with negative values indicating the scrolling movement is either toward the bottom or toward the right, and positive values indicating scrolling to the top or left.
...this means that the delta value sign is different from dom level 3 event's wheel.
Element.name - Web APIs
WebAPIElementname
name gets or sets the name property of an element in the dom.
..."> <input type="text" value="foo"> </form> <script type="text/javascript"> // get a reference to the first element in the form let formelement = document.forms['forma'].elements[0] // give it a name formelement.name = 'inputa' // show the value of the input alert(document.forms['forma'].elements['inputa'].value) </script> notes in internet explorer (ie), the name property of dom objects created using document.createelement() can't be set or modified.
Element.part - Web APIs
WebAPIElementpart
set using the part attribute), returned as a domtokenlist.
... these can be used to style parts of a shadow dom, via the ::part pseudo-element.
Element.prefix - Web APIs
WebAPIElementprefix
before dom4 this api was defined within the node interface.
... specifications specification status comment domthe definition of 'element: prefix' in that specification.
Element.removeAttributeNS() - Web APIs
example // given: // <div id="div1" xmlns:special="http://www.mozilla.org/ns/specialspace" // special:specialalign="utterleft" width="200px" /> d = document.getelementbyid("div1"); d.removeattributens("http://www.mozilla.org/ns/specialspace", "specialalign"); // now: <div id="div1" width="200px" /> notes dom methods dealing with element's attributes: not namespace-aware, most commonly used methods namespace-aware variants (dom level 2) dom level 1 methods for dealing with attr nodes directly (seldom used) dom level 2 namespace-aware methods for dealing with attr nodes directly (seldom used) setattribute (dom 1) setattributens setattributenode setattributenodens getattribute (dom 1) getattrib...
...utens getattributenode getattributenodens hasattribute (dom 2) hasattributens - - removeattribute (dom 1) removeattributens removeattributenode - specifications specification status comment domthe definition of 'element: removeattributens' in that specification.
Element.removeAttributeNode() - Web APIs
dom methods dealing with element's attributes: not namespace-aware, most commonly used methods namespace-aware variants (dom level 2) dom level 1 methods for dealing with attr nodes directly (seldom used) dom level 2 namespace-aware methods for dealing with attr nodes directly (seldom used) setattribute (dom 1) setattributens setattributenode setattributenodens getattribute (dom 1) getattrib...
...utens getattributenode getattributenodens hasattribute (dom 2) hasattributens - - removeattribute (dom 1) removeattributens removeattributenode - specifications specification status comment domthe definition of 'element: removeattributenode' in that specification.
Element.setAttributeNode() - Web APIs
this method is seldom used, with element.setattribute() usually being used to change element's attributes.
... dom methods dealing with element's attributes: not namespace-aware, most commonly used methods namespace-aware variants (dom level 2) dom level 1 methods for dealing with attr nodes directly (seldom used) dom level 2 namespace-aware methods for dealing with attr nodes directly (seldom used) setattribute (dom 1) setattributens setattributenode setattributenodens getattribute (dom 1) getattributens getattributenode getattributenodens hasattribute (dom 2) hasattributens - - removeattribute (dom 1) removeattributens removeattributenode - specifications specification status comment domthe definition of 'setattributenode()' in that specification.
Element.setAttributeNodeNS() - Web APIs
note that if you try to set without cloning the node, mozilla gives an ns_error_dom_inuse_attribute_err "attribute already in use" error, as the dom requires cloning for attr to be reused (unlike other nodes which can be moved).
... dom methods dealing with element's attributes: not namespace-aware, most commonly used methods namespace-aware variants (dom level 2) dom level 1 methods for dealing with attr nodes directly (seldom used) dom level 2 namespace-aware methods for dealing with attr nodes directly (seldom used) setattribute (dom 1) setattributens setattributenode setattributenodens getattribute (dom 1) getattributens getattributenode getattributenodens hasattribute (dom 2) hasattributens - - removeattribute (dom 1) removeattributens removeattributenode - specifications specification status comment domthe definition of 'document.setattributenodens' in that specification.
Element.shadowRoot - Web APIs
connectedcallback() { console.log('custom square element added to page.'); updatestyle(this); } attributechangedcallback(name, oldvalue, newvalue) { console.log('custom square element attributes changed.'); updatestyle(this); } in the updatestyle() function itself, we get a reference to the shadow dom using element.shadowroot.
... from here we use standard dom traversal techniques to find the <style> element inside the shadow dom and then update the css found inside it: function updatestyle(elem) { const shadow = elem.shadowroot; const childnodes = array.from(shadow.childnodes); childnodes.foreach(childnode => { if (childnode.nodename === 'style') { childnode.textcontent = ` div { width: ${elem.getattribute('l')}px; height: ${elem.getattribute('l')}px; background-color: ${elem.getattribute('c')}; } `; } }); } specifications specification status comment domthe definition of 'shadowroot' in that specification.
ErrorEvent - Web APIs
errorevent.message read only is a domstring containing a human-readable error message describing the problem.
... errorevent.filename read only is a domstring containing the name of the script file in which the error occurred.
Event() - Web APIs
WebAPIEventEvent
syntax new event(typearg[, eventinit]); values typearg this is a domstring representing the name of the event.
... example // create a look event that bubbles up and cannot be canceled const evt = new event("look", {"bubbles":true, "cancelable":false}); document.dispatchevent(evt); // event can be dispatched from any element, not only the document mydiv.dispatchevent(evt); specifications specification status comment domthe definition of 'event()' in that specification.
Event.cancelable - Web APIs
WebAPIEventcancelable
specifications specification status comment domthe definition of 'event.cancelable' in that specification.
... living standard document object model (dom) level 2 events specificationthe definition of 'event.cancelable' in that specification.
Event.composedPath() - Web APIs
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.
... specifications specification status comment domthe definition of 'composedpath()' in that specification.
Event.isTrusted - Web APIs
WebAPIEventisTrusted
syntax var eventistrusted = event.istrusted; value boolean example if (e.istrusted) { /* the event is trusted */ } else { /* the event is not trusted */ } specification specification status comment domthe definition of 'event.istrusted' in that specification.
... living standard document object model (dom) level 3 events specificationthe definition of 'trusted events' in that specification.
Event.preventDefault() - Web APIs
specifications specification status comment domthe definition of 'event.preventdefault()' in that specification.
... living standard document object model (dom) level 2 events specificationthe definition of 'event.preventdefault()' in that specification.
Event.srcElement - Web APIs
WebAPIEventsrcElement
initially implemented in internet explorer, event.srcelement is a now-standard alias (defined in the dom standard but flagged as "historical") for the event.target property.
... specifications specification status comment domthe definition of 'event.srcelement' in that specification.
EventListener.handleEvent() - Web APIs
specifications specification status comment domthe definition of 'eventlistener.handleevent()' in that specification.
... document object model (dom) level 2 events specificationthe definition of 'eventlistener.handleevent()' in that specification.
EventListener - Web APIs
buttonelement.addeventlistener('click', { handleevent: function (event) { alert('element clicked through handleevent property!'); } }); result see also: addeventlistener specifications specification status comment domthe definition of 'eventlistener' in that specification.
... document object model (dom) level 2 events specificationthe definition of 'eventlistener' in that specification.
EventSource.url - Web APIs
WebAPIEventSourceurl
the url read-only property of the eventsource interface returns a domstring representing the url of the source.
... syntax var myurl = eventsource.url; value a domstring representing the url of the source.
EventSource - Web APIs
this limit is per browser + domain, so that means that you can open 6 sse connections across all of the tabs to www.example1.com and another 6 sse connections to www.example2.com.
... eventsource.url read only a domstring representing the url of the source.
FederatedCredential.protocol - Web APIs
the protocol property of the federatedcredential interface returns a read-only domstring containing a credential's federated identity protocol.
... syntax var protocol = federatedcredential.protocol value a domstring containing a credential's federated identity protocol (e.g.
FileReader.error - Web APIs
WebAPIFileReadererror
syntax var error = instanceoffilereader.error value a domerror containing the relevant error.
... in chrome 48+/firefox 58+ this property returns a domexception because domerror has been removed from the dom standard.
FileReader - Web APIs
to read files by pathname in javascript, standard ajax solutions should be used to do server-side file reading, with cors permission if reading cross-domain.
... properties filereader.error read only a domexception representing the error that occurred while reading the file.
FileReaderSync.readAsArrayBuffer() - Web APIs
syntax arraybuffer readasarraybuffer( in blob blob ); parameters blob the dom file or blob to read into the file or arraybuffer.
... exceptions the following exceptions can be raised by this method: notfounderror is raised when the resource represented by the dom file or blob cannot be found, e.g.
FileRequest - Web APIs
summary the filerequest interface extends the domrequest interface to provide some extra properties necessary for the lockedfile objects.
... the filerequest interface also inherits from the domrequest interface.
FileSystem - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetfilesystemchrome full support 7alternate name full support 7alternate name alternate name uses the non-standard name: domfilesystemedge full support ≤18prefixed notes full support ≤18prefixed notes prefixed implemented with the vendor prefix: webkitnotes edge only supports this api in drag-and-drop scenarios using the the datatransferitem.webkitgetasentry() method.
... full support 15prefixed prefixed implemented with the vendor prefix: webkitsafari full support 11.1webview android full support ≤37alternate name full support ≤37alternate name alternate name uses the non-standard name: domfilesystemchrome android full support 18alternate name full support 18alternate name alternate name uses the non-standard name: domfilesystemfirefox android full support 50opera android full support 14prefixed ...
FileSystemDirectoryEntry.getDirectory() - Web APIs
era for androidsafari on iossamsung internetgetdirectory experimentalchrome full support 8edge full support 79firefox full support 50notes full support 50notes notes in firefox, the errorcallback's input parameter is a domexception rather than a fileerror object.ie no support noopera no support nosafari full support 11.1webview android full support ≤37chrome android full support 18firefox and...
...roid full support 50notes full support 50notes notes in firefox, the errorcallback's input parameter is a domexception rather than a fileerror object.opera android no support nosafari ios full support 11.3samsung internet android full support yeslegend full support full support no support no supportexperimental.
FileSystemDirectoryEntry.removeRecursively() - Web APIs
internetremoverecursively deprecatednon-standardchrome full support 8edge full support 79firefox no support 50 — 52notes no support 50 — 52notes notes while the removerecursively() method existed, it immediately called the error callback with ns_error_dom_security_err.ie no support noopera no support nosafari no support nowebview android full support ≤37chrome android full support 18firefox android no support ...
... 50 — 52notes no support 50 — 52notes notes while the removerecursively() method existed, it immediately called the error callback with ns_error_dom_security_err.opera android no support nosafari ios no support nosamsung internet android full support yeslegend full support full support no support no supportnon-standard.
FileSystemFileEntry.createWriter() - Web APIs
iossamsung internetcreatewriter deprecatednon-standardchrome full support 8edge full support 79firefox no support 50 — 52notes no support 50 — 52notes notes while the createwriter() method existed, it immediately called errorcallback with the ns_error_dom_security_err error.ie no support noopera no support nosafari no support nowebview android full support ≤37chrome android full support 18firefox android no sup...
...port 50 — 52notes no support 50 — 52notes notes while the createwriter() method existed, it immediately called errorcallback with the ns_error_dom_security_err error.opera android no support nosafari ios no support nosamsung internet android full support yeslegend full support full support no support no supportnon-standard.
FileSystemFileEntry - Web APIs
endor prefix: webkitcreatewriter deprecatednon-standardchrome full support 8edge full support 79firefox no support 50 — 52notes no support 50 — 52notes notes while the createwriter() method existed, it immediately called errorcallback with the ns_error_dom_security_err error.ie no support noopera no support nosafari no support nowebview android full support ≤37chrome android full support 18firefox android no sup...
...port 50 — 52notes no support 50 — 52notes notes while the createwriter() method existed, it immediately called errorcallback with the ns_error_dom_security_err error.opera android no support nosafari ios no support nosamsung internet android full support yesfilechrome full support 8edge full support 79firefox full support 50ie no support noopera no support nosafari full support ...
FocusEvent() - Web APIs
typearg is a domstring representing the name of the event.
... specifications specification status comment document object model (dom) level 3 events specificationthe definition of 'focusevent()' in that specification.
Frame Timing API - Web APIs
a frame represents the amount of work a browser does in one event loop iteration such as processing dom events, resizing, scrolling, rendering, css animations, etc.
... performanceentry.starttime set to the domhighrestimestamp when the frame was started.
Gamepad.timestamp - Web APIs
WebAPIGamepadtimestamp
the gamepad.timestamp property of the gamepad interface returns a domhighrestimestamp representing the last time the data for this gamepad was updated.
... syntax readonly attribute domhighrestimestamp timestamp; example var gp = navigator.getgamepads()[0]; console.log(gp.timestamp); value a domhighrestimestamp.
Gamepad - Web APIs
WebAPIGamepad
gamepad.id read only a domstring containing identifying information about the controller.
... gamepad.timestamp read only a domhighrestimestamp representing the last time the data for this gamepad was updated.
GeolocationPosition.timestamp - Web APIs
the geolocationposition.timestamp read-only property returns a domtimestamp object, represents the date and the time of the creation of the geolocationposition object it belongs to.
... syntax var timestamp = geolocationpositioninstance.timestamp value a domtimestamp object instance.
GeolocationPositionError.message - Web APIs
the geolocationpositionerror.message read-only property returns a human-readable domstring describing the details of the error.
... syntax let msg = geolocationpositionerrorinstance.message value a human-readable domstring describing the details of the error.
GeometryUtils - Web APIs
the geometryutils interface provides different utility function to retrieve geometry information about dom nodes.
... methods geometryutils.getboxquads() returns a list of domquad objects representing the css fragments of the node.
GlobalEventHandlers.onload - Web APIs
at this point, all of the objects in the document are in the dom, and all the images, scripts, links and sub-frames have finished loading.
... there are also dom events like domcontentloaded and domframecontentloaded (which can be handled using eventtarget.addeventlistener()) which are fired after the dom for the page has been constructed, but do not wait for other resources to finish loading.
HTMLAnchorElement.relList - Web APIs
it is a live domtokenlist 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 domtokenlist with another one, but its contents can still be changed.
HTMLAreaElement.relList - Web APIs
it is a live domtokenlist 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 domtokenlist by another one, but the content of the returned list can be changed.
HTMLBRElement - Web APIs
htmlbrelement.clear is a domstring indicating the flow of text around floating objects.
... recommendation no change from document object model (dom) level 2 html specification ...
HTMLCanvasElement.mozGetAsFile() - Web APIs
syntax canvas.mozgetasfile(name, type); parameters name a domstring indicating the file name to give the file representing the image file in memory.
... type optional a domstring which specifies the image file format to use when creating the new image file.
HTMLCanvasElement.toDataURL() - Web APIs
syntax canvas.todataurl(type, encoderoptions); parameters type optional a domstring indicating the image format.
... return value a domstring containing the requested data uri.
HTMLContentElement - Web APIs
the htmlcontentelement interface represents a <content> html element, which is used in shadow dom.
... htmlcontentelement.select is a domstring that reflects the select html attribute.
HTMLDataElement.value - Web APIs
the value property of the htmldataelement interface returns a domstring reflecting the value html attribute.
... syntax var avalue = htmldataelement.value htmldataelement.value = avalue value a domstring.
HTMLDialogElement.close() - Web APIs
an optional domstring may be passed as an argument, updating the returnvalue of the the dialog.
... syntax dialoginstance.close(returnvalue); parameters returnvalue optional a domstring representing an updated value for the htmldialogelement.returnvalue of the dialog.
HTMLDialogElement - Web APIs
htmldialogelement.returnvalue a domstring that sets or returns the return value for the dialog.
...an optional domstring may be passed as an argument, updating the returnvalue of the the dialog.
HTMLDocument - Web APIs
document object model (dom) level 2 html specificationthe definition of 'htmldocument' in that specification.
... obsolete supersedes dom 1 document object model (dom) level 1 specificationthe definition of 'htmldocument' in that specification.
HTMLElement: beforeinput event - Web APIs
the dom beforeinput event fires when the value of an <input>, <select>, or <textarea> element is about to be modified.
... bubbles yes cancelable yes interface inputevent event handler property none sync / async sync composed yes default action update the dom element examples this example logs current value of the element immediately before replacing that value with the new one applied to the <input> element.
HTMLImageElement.crossOrigin - Web APIs
syntax htmlimageelement.crossorigin = crossoriginmode; let crossoriginmode = htmlimageelement.crossorigin; value a domstring of a keyword specifying the cors mode to use when fetching the image resource.
... use-credentials requests by the htmlimageelement will use the cors mode and the include credentials mode; all image requests by the element will use cors, regardless of what domain the fetch is from.
HTMLImageElement.currentSrc - Web APIs
lchrome full support 45edge full support 13firefox full support 38 full support 38 no support 32 — 52disabled disabled from version 32 until version 52 (exclusive): this feature is behind the dom.image.srcset.enabled preference (needs to be set to true).
... full support 45chrome android full support 45firefox android full support 38 full support 38 no support 32 — 52disabled disabled from version 32 until version 52 (exclusive): this feature is behind the dom.image.srcset.enabled preference (needs to be set to true).
HTMLImageElement.sizes - Web APIs
lchrome full support 45edge full support 13firefox full support 38 full support 38 no support 33 — 52disabled disabled from version 33 until version 52 (exclusive): this feature is behind the dom.image.picture.enabled preference (needs to be set to true).
... full support 45chrome android full support 45firefox android full support 38 full support 38 no support 33 — 52disabled disabled from version 33 until version 52 (exclusive): this feature is behind the dom.image.picture.enabled preference (needs to be set to true).
HTMLImageElement.srcset - Web APIs
lchrome full support 34edge full support 12firefox full support 38 full support 38 no support 32 — 52disabled disabled from version 32 until version 52 (exclusive): this feature is behind the dom.image.srcset.enabled preference (needs to be set to true).
... full support 37chrome android full support 34firefox android full support 38 full support 38 no support 32 — 52disabled disabled from version 32 until version 52 (exclusive): this feature is behind the dom.image.srcset.enabled preference (needs to be set to true).
HTMLInputElement - Web APIs
document object model (dom) level 2 html specificationthe definition of 'htmlinputelement' in that specification.
... document object model (dom) level 1 specificationthe definition of 'htmlinputelement' in that specification.
HTMLLinkElement.as - Web APIs
the as property of the htmllinkelement interface returns a domstring representing the type of content being loaded by the html link, one of "script", "style", "image", "video", "audio", "track", "font", "fetch".
... syntax var as = htmllinkelement.as htmllinkelement.as = as value a domstring.
HTMLLinkElement.relList - Web APIs
it is a live domtokenlist 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 domtokenlist by another one, but the content of the returned list can be changed.
HTMLMediaElement.canPlayType() - Web APIs
syntax canplayresponse = audioorvideo.canplaytype(mediatype); parameters mediatype a domstring containing the mime type of the media.
... return value a domstring indicating how likely it is that the media can be played.
HTMLObjectElement.data - Web APIs
the data property of the htmlobjectelement interface returns a domstring that reflects the data html attribute, specifying the address of a resource's data.
... syntax var data = htmlobjectelement.data; htmlobjectelement.data; value a domstring.
HTMLObjectElement.height - Web APIs
the height property of the htmlobjectelement interface returns a domstring that reflects the height html attribute, specifying the displayed height of the resource in css pixels.
... syntax var string = htmlobjectelement.height; htmlobjectelement.height = string; value a domstring.
HTMLObjectElement.name - Web APIs
the name property of the htmlobjectelement interface returns a domstring that reflects the name html attribute, specifying the name of the browsing context.
... syntax var string = htmlobjectelement.name; htmlobjectelement.name = string; value a domstring.
HTMLObjectElement.type - Web APIs
the type property of the htmlobjectelement interface returns a domstring that reflects the type html attribute, specifying the mime type of the resource.
... syntax var string = htmlobjectelement.type htmlobjectelement.type = string; value a domstring.
HTMLObjectElement.useMap - Web APIs
the usemap property of the htmlobjectelement interface returns a domstring that reflects the usemap html attribute, specifying a <map> element to use.
... syntax var string = htmlobjectelement.usemap; htmlobjectelement.usemap = string; value a domstring.
HTMLObjectElement.validationMessage - Web APIs
the validationmessage read-only property of the htmlobjectelement interface returns a domstring representing a localized message that describes the validation constraints that the control does not satisfy (if any).
... syntax var string = htmlobjectelement.validationmessage; value a domstring.
HTMLObjectElement.width - Web APIs
the width property of the htmlobjectelement interface returns a domstring that reflects the width html attribute, specifying the displayed width of the resource in css pixels.
... syntax var string = htmlobjectelement.width; htmlobjectelement.width = string; value a domstring.
Option() - Web APIs
syntax var optionelementreference = new option(text, value, defaultselected, selected); parameters text optional a domstring representing the content of the element, i.e.
... value optional a domstring representing the value of the htmloptionelement, i.e.
HTMLScriptElement.referrerPolicy - Web APIs
syntax refstr = scriptelem.referrerpolicy; scriptelem.referrerpolicy = refstr; value a domstring; one of the following: no-referrer the referer header will be omitted entirely.
...one set on the whole document or domain.
HTMLSelectElement.remove() - Web APIs
document object model (dom) level 2 html specificationthe definition of 'htmlselectelement.remove()' in that specification.
... obsolete document object model (dom) level 1 specificationthe definition of 'htmlselectelement.remove()' in that specification.
HTMLSlotElement - Web APIs
the htmlslotelement interface of the shadow dom api enables access to the name and assigned nodes of an html <slot> element.
... properties htmlslotelement.name domstring: can be used to get and set the slot's name.
HTMLStyleElement.media - Web APIs
recommendation document object model (dom) level 2 html specificationthe definition of 'htmlstyleelement' in that specification.
... obsolete document object model (dom) level 1 specificationthe definition of 'htmlstyleelement' in that specification.
HTMLTableElement.bgColor - Web APIs
also available on dom tbody, row and cell objects.
... example // set table background colour to lightblue var t = document.getelementbyid('tablea'); t.bgcolor = 'lightblue'; specification dom level 2 html:htmltableelement .bgcolor ...
HTMLTableElement.caption - Web APIs
recommendation no change from document object model (dom) level 2 html specification document object model (dom) level 2 html specificationthe definition of 'htmltableelement.caption' in that specification.
... obsolete no change from document object model (dom) level 1 specification document object model (dom) level 1 specificationthe definition of 'htmltableelement.caption' in that specification.
HTMLTableElement.cellSpacing - Web APIs
syntax htmltableelement.cellspacing = spacing; var spacing = htmltableelement.cellspacing; value a domstring which is either a number of pixels (such as "10") or a percentage value (like "10%").
... var t = document.getelementbyid('tablea'); t.cellspacing = "10"; specification w3c dom 2 html specification htmltableelement .cellspacing.
HTMLTableElement.insertRow() - Web APIs
living standard document object model (dom) level 2 html specificationthe definition of 'htmltableelement.insertrow()' in that specification.
... document object model (dom) level 1 specificationthe definition of 'htmltableelement.insertrow()' in that specification.
HTMLTableElement.tFoot - Web APIs
recommendation no change from document object model (dom) level 2 html specification document object model (dom) level 2 html specificationthe definition of 'htmltableelement.tfoot' in that specification.
... obsolete no change from document object model (dom) level 1 specification document object model (dom) level 1 specificationthe definition of 'htmltableelement.tfoot' in that specification.
HTMLTableElement.tHead - Web APIs
recommendation no change from document object model (dom) level 2 html specification document object model (dom) level 2 html specificationthe definition of 'htmltableelement.thead' in that specification.
... obsolete no change from document object model (dom) level 1 specification document object model (dom) level 1 specificationthe definition of 'htmltableelement.thead' in that specification.
History - Web APIs
WebAPIHistory
the data is treated as opaque by the dom; you may specify any javascript object that can be serialized.
...the data is treated as opaque by the dom; you may specify any javascript object that can be serialized.
HmacImportParams - Web APIs
properties name a domstring.
... hash a domstring representing the name of the digest function to use.
HmacKeyGenParams - Web APIs
properties name a domstring.
... hash a domstring representing the name of the digest function to use.
IDBDatabase.name - Web APIs
WebAPIIDBDatabasename
the name read-only property of the idbdatabase interface is a domstring that contains the name of the connected database.
... syntax var dbname = idbdatabase.name; value a domstring containing the name of the connected database.
IDBDatabase.objectStoreNames - Web APIs
the objectstorenames read-only property of the idbdatabase interface is a domstringlist containing a list of the names of the object stores currently in the connected database.
... syntax var list[] = idbdatabase.objectstorenames; value a domstringlist containing a list of the names of the object stores currently in the connected database.
IDBDatabase.transaction() - Web APIs
you're storing critical data that cannot be recomputed later) you can force a transaction to flush to disk before delivering the complete event by creating a transaction using the experimental (non-standard) readwriteflush mode (see idbdatabase.transaction.) this is currently experimental, and can only be used if the dom.indexeddb.experimental pref is set to true in about:config.
... exceptions this method may raise a domexception of one of the following types: exception description invalidstateerror the close() method has previously been called on this idbdatabase instance.
IDBDatabase - Web APIs
p"><rect x="151" y="1" width="110" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="206" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">idbdatabase</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties idbdatabase.name read only a domstring that contains the name of the connected database.
... idbdatabase.objectstorenames read only a domstringlist that contains a list of the names of the object stores currently in the connected database.
IDBDatabaseException - Web APIs
obsolete: this interface was removed from the specification and was replaced by usage of domexception.
... message domstring error message describing the exception raised.
IDBFactorySync - Web APIs
method overview idbdatabasesync open (in domstring name, in domstring description, in optional boolean modifydatabase) raises (idbdatabaseexception); methods open() opens and returns a connection to a database.
... idbdatabasesync open ( in domstring name, in domstring description ) raises (idbdatabaseexception); parameters name the name for the database.
IDBIndex - Web APIs
WebAPIIDBIndex
full support 5.0getallkeyschrome full support 48edge full support ≤18firefox full support 44disabled full support 44disabled disabled from version 44: this feature is behind the dom.indexeddb.experimental preference.
...support 10.1webview android full support 48chrome android full support 48firefox android full support 44disabled full support 44disabled disabled from version 44: this feature is behind the dom.indexeddb.experimental preference.
IDBTransaction.objectStoreNames - Web APIs
the objectstorenames read-only property of the idbtransaction interface returns a domstringlist of names of idbobjectstore objects.
... syntax var mydatabase = transactionobj.objectstorenames; returns a domstringlist of names of idbobjectstore objects.
IDBTransaction - Web APIs
idbtransaction.error read only returns a domexception indicating the type of error that occured when there is an unsuccessful transaction.
... idbtransaction.objectstorenames read only returns a domstringlist of the names of idbobjectstore objects associated with the transaction.
IDBTransactionSync - Web APIs
method overview void abort() raises (idbdatabaseexception); void commit() raises (idbdatabaseexception); idbobjectstoresync objectstore(in domstring name) raises (idbdatabaseexception); attributes attribute type description db idbdatabasesync the database connection that this transaction is associated with.
... idbobjectstoresync objectstore( in domstring name ) raises (idbdatabaseexception); parameters name the name of the requested object store.
InputEvent() - Web APIs
syntax event = new inputevent(typearg, inputeventinit); values typearg is a domstring representing the name of the event.
... ranges: (optional) an array of static ranges that will be affected by a change to the dom if the input event is not canceled.
InputEvent.data - Web APIs
WebAPIInputEventdata
the data read-only property of the inputevent interface returns a domstring with the inserted characters.
... syntax var astring = inputevent.data; value a domstring.
InputEvent - Web APIs
inputevent.dataread only returns a domstring with the inserted characters.
... inputevent.gettargetranges() returns an array of static ranges that will be affected by a change to the dom if the input event is not canceled.
IntersectionObserverEntry.boundingClientRect - Web APIs
the intersectionobserverentry interface's read-only boundingclientrect property returns a domrectreadonly which in essence describes a rectangle describing the smallest rectangle that contains the entire target element.
... syntax var boundsrect = intersectionobserverentry.boundingclientrect; value a domrectreadonly which describes the smallest rectangle that contains every part of the target element whose intersection change is being described.
IntersectionObserverEntry.intersectionRect - Web APIs
the intersectionobserverentry interface's read-only intersectionrect property is a domrectreadonly object which describes the smallest rectangle that contains the entire portion of the target element which is currently visible within the intersection root.
... syntax var intersectionrect = intersectionobserverentry.intersectionrect; value a domrectreadonly which describes the part of the target element that's currently visible within the root's intersection rectangle.
IntersectionObserverEntry.rootBounds - Web APIs
the intersectionobserverentry interface's read-only rootbounds property is a domrectreadonly corresponding to the target's root intersection rectangle, offset by the intersectionobserver.rootmargin if one is specified.
... syntax var rootbounds = intersectionobserverentry.rootbounds; value a domrectreadonly which describes the root intersection rectangle.
IntersectionObserverEntry.time - Web APIs
the intersectionobserverentry interface's read-only time property is a domhighrestimestamp that indicates the time at which the intersection change occurred relative to the time at which the document was created.
... syntax var time = intersectionobserverentry.time; value a domhighrestimestamp which indicates the time at which the target element experienced the intersection change described by the intersectionobserverentry.
KeyboardEvent.getModifierState() - Web APIs
"accel" virtual modifier note: the "accel" virtual modifier has been effectively deprecated in current drafts of the dom3 events specification.
... specifications specification status comment document object model (dom) level 3 events specificationthe definition of 'getmodifierstate()' in that specification.
Key Values - Web APIs
vk_play_speed_up "randomtoggle" toggles random media (also known as "shuffle mode") on and off.
... vk_random_toggle gdk_key_audiorandomplay (0x1008ff99) "rclowbattery" a code sent when the remote control's battery is low.
KeyboardEvent.key - Web APIs
WebAPIKeyboardEventkey
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.
... working draft document object model (dom) level 3 events specificationthe definition of 'keyboardevent.key' in that specification.
LayoutShiftAttribution - Web APIs
layoutshiftattribution.previousrect returns a domrect representing the position of the element before the shift.
... layoutshiftattribution.currentrect returns a domrect representing the position of the element after the shift.
LocalFileSystem - Web APIs
window.requestfilesystem(window.persistent, 1024*1024,oninitfs,errorhandler); method overview void requestfilesystem (in unsigned short type, in unsigned long long size, in filesystemcallback successcallback, in optional errorcallback errorcallback); void resolvelocalfilesystemurl (in domstring url, in entrycallback successcallback, in optional errorcallback errorcallback); constants constant value description temporary 0 transient storage that can be be removed by the browser at its discretion.
... void resolvelocalfilesystemurl( in domstring url, in entrycallback successcallback, in optional errorcallback errorcallback ); parameters url the url of a local file in the file system.
LocalFileSystemSync - Web APIs
method overview filesystemsync requestfilesystemsync (in unsigned short type, in long long size) raises fileexception; entrysync resolvelocalfilesystemsyncurl (in domstring url) raises fileexception; constants constant value description temporary 0 transient storage that can be be removed by the browser at its discretion.
... void resolvelocalfilesystemurl( in domstring url ); parameter url the url of a local file in the file system.
Location - Web APIs
WebAPILocation
, function(e) { e.preventdefault(); e.stoppropagation(); window.location.hash = '#' + $(this).attr('id'); }); }); [].foreach.call(document.queryselectorall('[title]'), function (node) { node.addeventlistener("click", function(e) { e.preventdefault(); e.stoppropagation(); window.location.hash = ''; }); }); result properties location.ancestororigins is a static domstringlist containing, in reverse order, the origins of all ancestor browsing contexts of the document associated with the given location object.
... location.hostname is a usvstring containing the domain of the url.
MediaDeviceInfo.deviceId - Web APIs
the deviceid readonly property of the mediadeviceinfo interface returns a domstring that is an identifier for the represented device and is persisted across sessions.
... syntax var deviceid = mediadeviceinfo.deviceid value a domstring.
MediaDeviceInfo.groupId - Web APIs
the groupid readonly property of the mediadeviceinfo interface returns a domstring that is a group identifier.
... syntax var groupid = mediadeviceinfo.groupid; value a domstring which uniquely identifies the group of related devices to which this device belongs.
MediaDeviceInfo.label - Web APIs
the label readonlyinline property of the mediadeviceinfo interface returns a domstring, that is a label describing this device (for example "external usb webcam").
... syntax var label = mediadeviceinfo.label; value a domstring which describes the media device.
MediaDevices.getUserMedia() - Web APIs
exceptions rejections of the returned promise are made by passing a domexception error object to the promise's failure handler.
...browsers may offer a once-per-domain permission feature, but they must ask at least the first time, and the user must specifically grant ongoing permission if they choose to do so.
MediaError.message - Web APIs
the read-only property mediaerror.message returns a domstring which contains a human-readable string offering specific diagnostic details related to the error described by the mediaerror object, or an empty string ("") if no diagnostic information can be determined or provided.
... syntax var errormessage = mediaerror.message; value a domstring providing a detailed, specific explanation of what went wrong and possibly how it might be fixed.
MediaList.mediaText - Web APIs
the mediatext property of the medialist interface is a stringifier that returns a domstring representing the medialist as text, and also allows you to set a new medialist.
... syntax medialistinstance.mediatext; medialistinstance.mediatext = string; value a domstring representing the media queries of a stylesheet.
MediaQueryList.media - Web APIs
the media read-only property of the mediaquerylist interface is a domstring representing a serialized media query.
... syntax var media = mediaquerylist.media; value a domstring representing a serialized media query.
MediaQueryListEvent.media - Web APIs
the media read-only property of the mediaquerylistevent interface is a domstring representing a serialized media query.
... syntax var media = mediaquerylistevent.media; value a domstring representing a serialized media query.
MediaRecorder.start() - Web APIs
note: if the browser is unable to start recording or continue recording, it will raise a domerror event, followed by a mediarecorder.dataavailable event containing the blob it has gathered, followed by the mediarecorder.stop event.
... exceptions errors that can be detected immediately are thrown as dom exceptions.
MediaRecorderErrorEvent.error - Web APIs
the read-only error property in the mediarecordererrorevent interface is a domexception object providing details about the exception that was thrown by a mediarecorder instance.
... syntax error = mediarecordererrorevent.error; value a domexception describing the error represented by the event.
MediaRecorderErrorEvent - Web APIs
it is an event object that encapsulates a reference to a domexception describing the error that occurred.
... error read only a domexception containing information about the error that occurred.
MediaStreamTrack.kind - Web APIs
the mediastreamtrack.kind read-only property returns a domstring set to "audio" if the track is an audio track and to "video", if it is a video track.
... syntax const type = track.kind value the possible values are a domstring with on of the following values: "audio": the track is an audio track.
MediaTrackConstraints.cursor - Web APIs
the mediatrackconstraints dictionary's cursor property is a constraindomstring describing the requested or mandatory constraints placed upon the value of the cursor constrainable property, which is used to specify whether or not the cursor should be included in the captured video.
... syntax var constraintsobject = { cursor: constraint }; constraintsobject.cursor = constraint; value a constraindomstring which specifies whether or not the mouse cursor should be rendered into the video track in the mediastream returned by the call to getdisplaymedia().
MediaTrackConstraints.deviceId - Web APIs
the mediatrackconstraints dictionary's deviceid property is a constraindomstring describing the requested or mandatory constraints placed upon the value of the deviceid constrainable property.
... syntax var constraintsobject = { deviceid: constraint }; constraintsobject.deviceid = constraint; value an object based on constraindomstring specifying one or more acceptable, ideal, and/or exact (mandatory) device ids which are acceptable as the source of media content.
MediaTrackConstraints.displaySurface - Web APIs
the mediatrackconstraints dictionary's displaysurface property is a constraindomstring describing the requested or mandatory constraints placed upon the value of the displaysurface constrainable property.
... syntax var constraintsobject = { displaysurface: constraint }; constraintsobject.displaysurface = constraint; value a constraindomstring which specifies the type of display surface that's being captured.
MediaTrackConstraints.facingMode - Web APIs
the mediatrackconstraints dictionary's facingmode property is a constraindomstring describing the requested or mandatory constraints placed upon the value of the facingmode constrainable property.
... syntax var constraintsobject = { facingmode: constraint }; constraintsobject.facingmode = constraint; value an object based on constraindomstring specifying one or more acceptable, ideal, and/or exact (mandatory) facing modes are acceptable for a video track.
MediaTrackConstraints.groupId - Web APIs
the mediatrackconstraints dictionary's groupid property is a constraindomstring describing the requested or mandatory constraints placed upon the value of the groupid constrainable property.
... syntax var constraintsobject = { groupid: constraint }; constraintsobject.groupid = constraint; value an object based on constraindomstring specifying one or more acceptable, ideal, and/or exact (mandatory) group ids which are acceptable as the source of media content.
MediaTrackSettings.deviceId - Web APIs
the mediatracksettings dictionary's deviceid property is a domstring which uniquely identifies the source for the corresponding mediastreamtrack for the origin corresponding to the browsing session.
... syntax var deviceid = mediatracksettings.deviceid; value a domstring whose value is an origin-unique identifier for the track's source.
MediaTrackSettings.facingMode - Web APIs
the mediatracksettings dictionary's facingmode property is a domstring indicating the direction in which the camera producing the video track represented by the mediastreamtrack is currently facing.
... syntax var facingmode = mediatracksettings.facingmode; value a domstring whose value is one of the strings in videofacingmodeenum.
MediaTrackSettings.groupId - Web APIs
the mediatracksettings dictionary's groupid property is a browsing-session unique domstring which identifies the group of devices which includes the source for the mediastreamtrack.
... syntax var groupid = mediatracksettings.groupid; value a domstring whose value is a browsing-session unique identifier for a group of devices which includes the source of the track's contents.
MerchantValidationEvent() - Web APIs
syntax merchantvalidationevent = new merchantvalidationevent(type, options); parameters type a domstring which must be merchantvalidation, the only type of event which uses the merchantvalidationevent interface.
... options optional an optional dictionary which may contain zero or more of the following properties: methodname optional a domstring containing the payment method identifier for the payment handler being used.
MessageEvent.lastEventId - Web APIs
the lasteventid read-only property of the messageevent interface is a domstring representing a unique id for the event.
... syntax var myid = messageevent.lasteventid; value a domstring representing the id.
MouseScrollEvent - Web APIs
method overview void initmousescrollevent(in domstring typearg, in boolean canbubblearg, in boolean cancelablearg, in nsidomabstractview viewarg, in long detailarg, in long screenxarg, in long screenyarg, in long clientxarg, in long clientyarg, in boolean ctrlkeyarg, in boolean altkeyarg, in boolean shiftkeyarg, in boolean metakeyarg, in unsigned short buttonarg, in nsidomeventtarget relatedtargetarg, in long axis); attributes attribute type d...
... methods initmousescrollevent() see nsidommousescrollevent::initmousescrollevent().
MutationObserver.disconnect() - Web APIs
usage notes if the element being observed is removed from the dom, and then subsequently released by the browser's garbage collection mechanism, the mutationobserver is likewise deleted.
...*/ observer.disconnect(); specifications specification status comment domthe definition of 'mutationobserver.disconnect()' in that specification.
MutationObserverInit.attributeFilter - Web APIs
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.
... specifications specification status comment domthe definition of 'mutationobserverinit: attributefilter' in that specification.
MutationObserverInit.characterDataOldValue - Web APIs
the mutationobserverinit dictionary's optional characterdataoldvalue property is used to specify whether or not the mutationrecord.oldvalue property for dom mutations should be set to the previous value of text nodes which changed.
... example specifications specification status comment domthe definition of 'mutationobserverinit.characterdataoldvalue' in that specification.
MutationRecord - Web APIs
a mutationrecord represents an individual dom mutation.
... 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.
NDEFWriter.write() - Web APIs
WebAPINDEFWriterwrite
syntax var sessionpromise = ndefwriter.write(message, options); parameters message the message to be written, either domstring or buffersource or ndefmessageinit.
... exceptions this method doesn't throw true exceptions; instead, it rejects the returned promise, passing into it a domexception whose name is one of the following: aborterror the write operation was aborted with abortsignal passed in options.
Navigator.requestMediaKeySystemAccess() - Web APIs
syntax ​promise = navigator.requestmediakeysystemaccess(keysystem, supportedconfigurations); parameters keysystem a domstring identifying the key system.
...the fulfillment handler receives as input just one parameter: mediakeysystemaccess a mediakeysystemaccess object representing the media key system configuration described by keysystem and supportedconfigurations exceptions in case of an error, the returned promise is rejected with a domexception whose name indicates what kind of error occurred.
NavigatorLanguage - Web APIs
navigatorlanguage.language read only returns a domstring representing the preferred language of the user, usually the language of the browser ui.
... navigatorlanguage.languages read only returns an array of domstring representing the languages known to the user, by order of preference.
Node.baseURI - Web APIs
WebAPINodebaseURI
syntax var nodebaseuri = node.baseuri; value a domstring representing the base url of the specified node.
... specifications specification status comment domthe definition of 'node: baseuri' in that specification.
Node.compareDocumentPosition() - Web APIs
specifications specification status comment domthe definition of 'node.comparedocumentposition()' in that specification.
... living standard document object model (dom) level 3 core specificationthe definition of 'node.comparedocumentposition()' in that specification.
Node.getUserData() - Web APIs
WebAPINodegetUserData
the node.getuserdata() method returns any user domuserdata set previously on the given node by node.setuserdata().
... example var d = document.setuserdata('key', 15, null); console.log(document.getuserdata('key')); // 15 specifications specification status comment document object model (dom) level 3 core specificationthe definition of 'node.getuserdata()' in that specification.
Node.isSameNode() - Web APIs
WebAPINodeisSameNode
= document.getelementsbytagname("div"); output.innerhtml += "div 0 same as div 0: " + divlist[0].issamenode(divlist[0]) + "<br/>"; output.innerhtml += "div 0 same as div 1: " + divlist[0].issamenode(divlist[1]) + "<br/>"; output.innerhtml += "div 0 same as div 2: " + divlist[0].issamenode(divlist[2]) + "<br/>"; results specifications specification status comment domthe definition of 'node: issamenode' in that specification.
... document object model (dom) level 3 core specificationthe definition of 'node.issamenode()' in that specification.
Node.lookupNamespaceURI() - Web APIs
return value a domstring containing the the namespace uri.
... specifications specification status comment domthe definition of 'node: lookupnamespaceuri' in that specification.
Node.parentNode - Web APIs
WebAPINodeparentNode
the node.parentnode read-only property returns the parent of the specified node in the dom tree.
... specifications specification status comment domthe definition of 'node: parentnode' in that specification.
Node.replaceChild() - Web APIs
WebAPINodereplaceChild
if it already exists in the dom, it is first removed.
... // build a reference to the existing node to be replaced var sp2 = document.getelementbyid("childspan"); var parentdiv = sp2.parentnode; // replace existing node sp2 with the new span element sp1 parentdiv.replacechild(sp1, sp2); // result: // <div> // <span id="newspan">new replacement span element.</span> // </div> specifications specification status comment domthe definition of 'node: replacechild' in that specification.
Node.setUserData() - Web APIs
WebAPINodesetUserData
the node.setuserdata() method allows a user to attach (or remove) data to an element, without needing to modify the dom.
...(o+'::'+k+'::'+d+'::'+s+'::'+ds)}}); // 2::key::15::[object element]::[object element] console.log(d.documentelement.getuserdata('key')); // 15 var e = document.importnode(d.documentelement, true); // causes handler to be called console.log(e.getuserdata('key')); // null since user data is not copied specifications specification status comment document object model (dom) level 3 core specificationthe definition of 'node.setuserdata()' in that specification.
NodeFilter.acceptNode() - Web APIs
/^\s*$/.test(node.data) ) { return nodefilter.filter_accept; } } }, false ); // show the content of every non-empty text node that is a child of root var node; while ((node = iterator.nextnode())) { alert(node.data); } specifications specification status comment domthe definition of 'nodefilter.acceptnode()' in that specification.
... living standard no change from document object model (dom) level 2 traversal and range specification document object model (dom) level 2 traversal and range specificationthe definition of 'nodefilter.acceptnode()' in that specification.
NodeFilter - Web APIs
/^\s*$/.test(node.data) ) { return nodefilter.filter_accept } } }, false ); // show the content of every non-empty text node that is a child of root let node; while ((node = nodeiterator.nextnode())) { alert(node.data) } specifications specification status comment domthe definition of 'nodefilter' in that specification.
... living standard document object model (dom) level 2 traversal and range specificationthe definition of 'nodefilter' in that specification.
NodeIterator.detach() - Web APIs
deiterator.detach(); example var nodeiterator = document.createnodeiterator( document.body, nodefilter.show_element, { acceptnode: function(node) { return nodefilter.filter_accept; } }, false ); nodeiterator.detach(); // detaches the iterator nodeiterator.nextnode(); // throws an invalid_state_err exception specifications specification status comment domthe definition of 'nodeiterator.detach' in that specification.
... living standard transformed in a no-op document object model (dom) level 2 traversal and range specificationthe definition of 'nodeiterator.detach' in that specification.
NodeList.item() - Web APIs
WebAPINodeListitem
this is usually obtained from another dom property or method, such as childnodes.
... alternate syntax javascript also offers an array-like bracketed syntax for obtaining an item from a nodelist by index: nodeitem = nodelist[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 'nodelist: item' in that specification.
NodeList.length - Web APIs
WebAPINodeListlength
example the length property is often useful in dom programming.
... // 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 'nodelist: length' in that specification.
NonDocumentTypeChildNode.nextElementSibling - Web APIs
lementsibling" in document.documentelement)){ object.defineproperty(element.prototype, "nextelementsibling", { get: function(){ var e = this.nextsibling; while(e && 1 !== e.nodetype) e = e.nextsibling; return e; } }); } polyfill for internet explorer 9+ and safari // source: https://github.com/jserz/js_piece/blob/master/dom/nondocumenttypechildnode/nextelementsibling/nextelementsibling.md (function (arr) { arr.foreach(function (item) { if (item.hasownproperty('nextelementsibling')) { return; } object.defineproperty(item, 'nextelementsibling', { configurable: true, enumerable: true, get: function () { var el = this; while (el = el.nextsibling) { if (el.n...
...odetype === 1) { return el; } } return null; }, set: undefined }); }); })([element.prototype, characterdata.prototype]); specifications specification status comment domthe definition of 'childnodenextelementsibling' in that specification.
NonDocumentTypeChildNode.previousElementSibling - Web APIs
lements.js if(!("previouselementsibling" in document.documentelement)){ object.defineproperty(element.prototype, "previouselementsibling", { get: function(){ var e = this.previoussibling; while(e && 1 !== e.nodetype) e = e.previoussibling; return e; } }); } polyfill for internet explorer 9+ and safari // source: https://github.com/jserz/js_piece/blob/master/dom/nondocumenttypechildnode/previouselementsibling/previouselementsibling.md (function (arr) { arr.foreach(function (item) { if (item.hasownproperty('previouselementsibling')) { return; } object.defineproperty(item, 'previouselementsibling', { configurable: true, enumerable: true, get: function () { let el = this; while (el = el.previoussibling) ...
...{ if (el.nodetype === 1) { return el; } } return null; }, set: undefined }); }); })([element.prototype, characterdata.prototype]); specifications specification status comment domthe definition of 'nondocumenttypechildnode.previouselementsibling' in that specification.
Notification.lang - Web APIs
WebAPINotificationlang
the language itself is specified using a domstring representing a bcp 47 language tag.
... syntax var language = notification.lang; value a domstring specifying the language tag.
Notification.timestamp - Web APIs
the timestamp read-only property of the notification interface returns a domtimestamp, as specified in the timestamp option of the notification() constructor.
... syntax var timestamp = notification.timestamp; value a domtimestamp.
OscillatorNode.setPeriodicWave() - Web APIs
you can think of it as the result of a fourier transform, where you get frequency domain values from time domain value.
... here, with createperiodicwave(), you specify the frequencies, and the browser performs a an inverse fourier transform to get a time domain buffer for the frequency of the oscillator.
ParentNode.children - Web APIs
syntax let children = node.children; value an htmlcollection which is a live, ordered collection of the dom elements which are children of node.
...tor.prototype, 'children', { get: function() { let i = 0, node, nodes = this.childnodes, children = []; while (node = nodes[i++]) { if (node.nodetype === 1) { children.push(node); } } return children; } }); } })(window.node || window.element); specification specification status comment domthe definition of 'parentnode.children' in that specification.
Path2D.addPath() - Web APIs
WebAPIPath2DaddPath
transform optional a dommatrix to be used as the transformation matrix for the path that is added.
... (technically a dommatrixinit object).
PayerErrors - Web APIs
properties email optional if present, this domstring is a string describing the validation error from which the payer's email address—as given by paymentresponse.payeremail—currently suffers.
... name optional if this domstring is present in the object, the paymentresponse.payername property failed validation, and this string explains what needs to be corrected.
PaymentAddress.regionCode - Web APIs
the regioncode read-only attribute of the paymentaddress interface returns a one-, two-, or three-alphanumeric code (domstring) representing the region of the address (e.g., "ca" for california, or "11" for lisbon, portugal).
... syntax var regioncode = paymentaddress.regioncode; value a domstring indicating the one to three character alphanumeric code representing the region portion of the address.
PaymentAddress.toJSON() - Web APIs
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).
...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).
PaymentDetailsUpdate.error - Web APIs
the paymentdetailsupdate dictionary's error property is a human-readable domstring which provides an error message to be displayed if the specified information doesn't offer any valid shipping options.
... syntax errorstring = paymentdetailsupdate.error; paymentdetailsupdate.error = errorstring; value a domstring specifying the string to display to the user if the information specified in the paymentdetailsupdate doesn't provide any valid shipping options.
PaymentMethodChangeEvent - Web APIs
syntax paymentmethodchangeevent = new paymentmethodchangeevent(type, options); parameters type a domstring which must contain the string paymentmethodchange, the name of the only type of event which uses the paymentmethodchangeevent interface.
... options optional an optional paymentmethodchangeeventinit dictionary which may contain zero or more of the following properties: methodname optional a domstring containing the payment method identifier for the payment handler being used.
PaymentRequest.abort() - Web APIs
g internetabort()chrome full support 61edge full support 15firefox full support 55notes disabled full support 55notes disabled notes available only in nightly builds.disabled from version 55: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
...android no support nochrome android full support 53firefox android full support 55notes disabled full support 55notes disabled notes available only in nightly builds.disabled from version 55: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
PaymentRequest.onshippingaddresschange - Web APIs
pingaddresschangechrome full support 61edge full support 15firefox full support 55notes disabled full support 55notes disabled notes available only in nightly builds.disabled from version 55: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
...android no support nochrome android full support 53firefox android full support 55notes disabled full support 55notes disabled notes available only in nightly builds.disabled from version 55: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
PaymentRequest.onshippingoptionchange - Web APIs
ppingoptionchangechrome full support 61edge full support 15firefox full support 55notes disabled full support 55notes disabled notes available only in nightly builds.disabled from version 55: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
...android no support nochrome android full support 53firefox android full support 55notes disabled full support 55notes disabled notes available only in nightly builds.disabled from version 55: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
PaymentRequest.shippingOption - Web APIs
netshippingoptionchrome full support 61edge full support 15firefox full support 55notes disabled full support 55notes disabled notes available only in nightly builds.disabled from version 55: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
...android no support nochrome android full support 53firefox android full support 55notes disabled full support 55notes disabled notes available only in nightly builds.disabled from version 55: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
PaymentRequest.shippingType - Web APIs
ernetshippingtypechrome full support 61edge full support 15firefox full support 55notes disabled full support 55notes disabled notes available only in nightly builds.disabled from version 55: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
...android no support nochrome android full support 55firefox android full support 55notes disabled full support 55notes disabled notes available only in nightly builds.disabled from version 55: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
PaymentResponse.details - Web APIs
g internetdetailschrome full support 61edge full support 15firefox full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
...to change preferences in chrome, visit chrome://flags.firefox android full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
PaymentResponse.payerEmail - Web APIs
nternetpayeremailchrome full support 61edge full support 15firefox full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
...to change preferences in chrome, visit chrome://flags.firefox android full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
PaymentRequest.payerName - Web APIs
internetpayernamechrome full support 61edge full support 15firefox full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
...android no support nochrome android full support 58firefox android full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
PaymentResponse.shippingAddress - Web APIs
etshippingaddresschrome full support 61edge full support 15firefox full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
...to change preferences in chrome, visit chrome://flags.firefox android full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
PaymentResponse.shippingOption - Web APIs
netshippingoptionchrome full support 61edge full support 15firefox full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
...to change preferences in chrome, visit chrome://flags.firefox android full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
PerformanceMark - Web APIs
entries of this type are created by calling performance.mark() to add a named domhighrestimestamp (the mark) to the browser's performance timeline.
... performanceentry.starttime returns the domhighrestimestamp when performance.mark() was called.
PerformanceMeasure - Web APIs
entries of this type are created by calling performance.measure() to add a named domhighrestimestamp (the measure) between two marks to the browser's performance timeline.
... performanceentry.duration returns a domhighrestimestamp that is the duration of the measure (typically, the measure's end mark timestamp minus its start mark timestamp).
PerformanceObserverEntryList.getEntriesByName() - Web APIs
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".
PerformanceResourceTiming.connectEnd - Web APIs
syntax resource.connectend; return value a domhighrestimestamp representing the time after a connection is established.
...print_performanceentries() { // use getentriesbytype() to just get the "resource" events var p = performance.getentriesbytype("resource"); for (var i=0; i < p.length; i++) { print_start_and_end_properties(p[i]); } } function print_start_and_end_properties(perfentry) { // print timestamps of the *start and *end properties properties = ["connectstart", "connectend", "domainlookupstart", "domainlookupend", "fetchstart", "redirectstart", "redirectend", "requeststart", "responsestart", "responseend", "secureconnectionstart"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in perfentry; if (supported) { var value = per...
PerformanceResourceTiming.connectStart - Web APIs
syntax resource.connectstart; return value a domhighrestimestamp immediately before the browser starts to establish the connection to the server to retrieve the resource.
...entries() { // use getentriesbytype() to just get the "resource" events var p = performance.getentriesbytype("resource"); for (var i=0; i < p.length; i++) { print_start_and_end_properties(p[i]); } } function print_start_and_end_properties(perfentry) { // print timestamps of the performanceentry *start and *end properties properties = ["connectstart", "connectend", "domainlookupstart", "domainlookupend", "fetchstart", "redirectstart", "redirectend", "requeststart", "responsestart", "responseend", "secureconnectionstart"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in perfentry; if (supported) { var value = per...
PerformanceResourceTiming.fetchStart - Web APIs
syntax resource.fetchstart; return value a domhighrestimestamp immediately before the browser starts to fetch the resource.
...entries() { // use getentriesbytype() to just get the "resource" events var p = performance.getentriesbytype("resource"); for (var i=0; i < p.length; i++) { print_start_and_end_properties(p[i]); } } function print_start_and_end_properties(perfentry) { // print timestamps of the performanceentry *start and *end properties properties = ["connectstart", "connectend", "domainlookupstart", "domainlookupend", "fetchstart", "redirectstart", "redirectend", "requeststart", "responsestart", "responseend", "secureconnectionstart"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in perfentry; if (supported) { var value = per...
PerformanceResourceTiming.requestStart - Web APIs
syntax resource.requeststart; return value a domhighrestimestamp representing the time immediately before the browser starts requesting the resource from the server example in the following example, the value of the *start and *end properties of all "resource" type events are logged.
...entries() { // use getentriesbytype() to just get the "resource" events var p = performance.getentriesbytype("resource"); for (var i=0; i < p.length; i++) { print_start_and_end_properties(p[i]); } } function print_start_and_end_properties(perfentry) { // print timestamps of the performanceentry *start and *end properties properties = ["connectstart", "connectend", "domainlookupstart", "domainlookupend", "fetchstart", "redirectstart", "redirectend", "requeststart", "responsestart", "responseend", "secureconnectionstart"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in perfentry; if (supported) { var value = per...
PerformanceResourceTiming.responseEnd - Web APIs
syntax resource.responseend; return value a domhighrestimestamp immediately after the browser receives the last byte of the resource or immediately before the transport connection is closed, whichever comes first.
...entries() { // use getentriesbytype() to just get the "resource" events var p = performance.getentriesbytype("resource"); for (var i=0; i < p.length; i++) { print_start_and_end_properties(p[i]); } } function print_start_and_end_properties(perfentry) { // print timestamps of the performanceentry *start and *end properties properties = ["connectstart", "connectend", "domainlookupstart", "domainlookupend", "fetchstart", "redirectstart", "redirectend", "requeststart", "responsestart", "responseend", "secureconnectionstart"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in perfentry; if (supported) { var value = per...
PerformanceResourceTiming.responseStart - Web APIs
syntax resource.responsestart; return value a domhighrestimestamp immediately after the browser receives the first byte of the response from the server.
...entries() { // use getentriesbytype() to just get the "resource" events var p = performance.getentriesbytype("resource"); for (var i=0; i < p.length; i++) { print_start_and_end_properties(p[i]); } } function print_start_and_end_properties(perfentry) { // print timestamps of the performanceentry *start and *end properties properties = ["connectstart", "connectend", "domainlookupstart", "domainlookupend", "fetchstart", "redirectstart", "redirectend", "requeststart", "responsestart", "responseend", "secureconnectionstart"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in perfentry; if (supported) { var value = per...
PerformanceResourceTiming.secureConnectionStart - Web APIs
syntax resource.secureconnectionstart; return value if the resource is fetched over a secure connection, a domhighrestimestamp immediately before the browser starts the handshake process to secure the current connection.
...entries() { // use getentriesbytype() to just get the "resource" events var p = performance.getentriesbytype("resource"); for (var i=0; i < p.length; i++) { print_start_and_end_properties(p[i]); } } function print_start_and_end_properties(perfentry) { // print timestamps of the performanceentry *start and *end properties properties = ["connectstart", "connectend", "domainlookupstart", "domainlookupend", "fetchstart", "redirectstart", "redirectend", "requeststart", "responsestart", "responseend", "secureconnectionstart"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in perfentry; if (supported) { var value = per...
PerformanceServerTiming.toJSON - Web APIs
the tojson() method of the performanceservertiming interface returns a domstring that is the json representation of the performanceservertiming object.
... return value a domstring containing json.
PeriodicWave - Web APIs
you can think of it as the result of a fourier transform, where you get frequency domain values from time domain value.
... here, with createperiodicwave(), you specify the frequencies, and the browser performs an inverse fourier transform to get a time domain buffer for the frequency of the oscillator.
Permissions - Web APIs
port 5.0revoke experimentalnon-standardchrome full support 46edge full support 79firefox full support 51disabled full support 51disabled disabled from version 51: this feature is behind the dom.permissions.revoke.enable preference (needs to be set to true).
...o support nowebview android full support 46chrome android full support 46firefox android full support 51disabled full support 51disabled disabled from version 51: this feature is behind the dom.permissions.revoke.enable preference (needs to be set to true).
PointerEvent.PointerEvent() - Web APIs
syntax event = new pointerevent(type, pointereventinit); arguments type is a domstring representing the name of the event (see pointerevent event types).
... pointertype — optional and defaulting to "", of type domstring, that sets the value of the instance's pointerevent.pointertype.
PublicKeyCredential.id - Web APIs
the id read-only property of the publickeycredential interface is a domstring, inherited from credential, which represents the identifier of the current publickeycredential instance.
... syntax id = publickeycredential.id value a domstring being the base64url encoded version of publickeycredential.rawid.
PublicKeyCredentialCreationOptions.user - Web APIs
syntax useraccount = publickeycredentialcreationoptions.user properties displayname a domstring which is human readable and intended for display.
... name a domstring giving a human-readable name for the user's identifier (e.g.
PublicKeyCredentialRequestOptions - Web APIs
if this option is not provided, the client will use the current origin's domain.
... examples var options = { challenge: new uint8array([/* bytes sent from the server */]), rpid: "example.com", /* will only work if the current domain is something like foo.example.com */ userverification: "preferred", timeout: 60000, // wait for a minute allowcredentials: [ { transports: "usb", type: "public-key", id: new uint8array(26) // actually provided by the server }, { transports: "internal", type: "public-key", id: new uint8array(26) // actually provi...
PushManager.permissionState() - Web APIs
the permissionstate() method of the pushmanager interface returns a promise that resolves to a domstring indicating the permission state of the push manager.
... returns a promise that resolves to a domstring with a value of 'prompt', 'denied', or 'granted'.
PushSubscription.expirationTime - Web APIs
the expirationtime read-only property of the pushsubscription interface returns a domhighrestimestamp of the subscription expiration time associated with the push subscription, if there is one, or null otherwise.
... syntax var expirationtime = pushsubscription.expirationtime value a domhighrestimestamp.
PushSubscription - Web APIs
pushsubscription.expirationtime read only a domhighrestimestamp of the subscription expiration time associated with the push subscription, if there is one, or null otherwise.
... pushsubscription.subscriptionid read only a domstring containing the subscription id associated with the push subscription.
RTCDTMFToneChangeEvent.RTCDTMFToneChangeEvent() - Web APIs
syntax var event = new rtcdtmftonechangeevent(type, options); parameters type a domstring containing the name of the event.
... options a dictionary of type rtcdtmftonechangeeventinit, which may contain one or more of the following fields: tone a domstring containing a single dtmf tone character which has just begun to play, or an empty string ("") to indicate that the previous tone has stopped playing.
RTCDTMFToneChangeEvent - Web APIs
properties in addition to the properties of event, this interface offers the following: rtcdtmftonechangeevent.tone read only a domstring specifying the tone which has begun playing, or an empty string ("") if the previous tone has finished playing.
...it takes two parameters, the first being a domstring representing the type of the event (always "tonechange"); the second a dictionary containing the initial state of the properties of the event.
RTCDataChannel.binaryType - Web APIs
the property binarytype on the rtcdatachannel interface is a domstring which specifies the type of javascript object which should be used to represent binary data received on the rtcdatachannel.
... syntax var type = adatachannel.binarytype; adatachannel.binarytype = type; value a domstring that can have one of these values: "blob" received binary messages' contents will be contained in blob objects.
RTCError - Web APIs
WebAPIRTCError
it's based upon the standard domexception interface that describes general dom errors.
... properties in addition to the properties defined by the parent interface, domexception, rtcerror includes the following properties: errordetail read only a domstring specifying the webrtc-specific error code identifying the type of error that occurred.
RTCErrorEvent.error - Web APIs
since rtcerror is based upon domexception, it includes those properties.
... additional properties defined by rtcerror are: errordetail read only a domstring specifying the webrtc-specific error code identifying the type of error that occurred.
RTCIceCandidate.candidate - Web APIs
the read-only property candidate on the rtcicecandidate interface returns a domstring describing the candidate in detail.
... syntax var candidate = rtcicecandidate.candidate; value a domstring describing the properties of the candidate, taken directly from the sdp attribute "candidate".
RTCIceCandidate.sdpMid - Web APIs
the read-only property sdpmid on the rtcicecandidate interface returns a domstring specifying the media stream identification tag of the media component with which the candidate is associated.
... syntax var sdpmid = rtcicecandidate.sdpmid; value a domstring which uniquely identifies the source media component from which the candidate draws data, or null if no such association exists for the candidate.
RTCIceCandidateInit - Web APIs
usernamefragment optional a domstring containing a string which uniquely identifies the remote peer.
... this string is generated by webrtc at the beginning of the session, and at least 24 bits worth of the string contain random data.
RTCIceParameters - Web APIs
properties usernamefragment a domstring specifying the value of the ice session's username fragment field, ufrag.
... password a domstring specifying the session's password string.
RTCIceServer.url - Web APIs
WebAPIRTCIceServerurl
}; var serverurl = iceserver.url; iceserver.url = iceserverurl; the value of this property is a domstring containing the full url of a server to use during ice negotiation.
... mypeerconnection = new rtcpeerconnection({ iceservers: [ { url: "stun:stunserver.example.org" } ] }); unfortunately, the only way to tell ice that the server has a backup domain name of stunserver2.example.org is to add a new entry to the iceservers array for it.
RTCOutboundRtpStreamStats - Web APIs
lastpacketsenttimestamp a domhighrestimestamp indicating the time at which the last packet was sent for this ssrc.
... senderid the {domxref("rtcstats.id", "id")}} of the rtcaudiosenderstats or rtcvideosenderstats object containing statistics about this stream's rtcrtpsender.
RTCPeerConnection.addIceCandidate() - Web APIs
receives as input a domexception object describing why failure occurred.
... exceptions when an error occurs while attempting to add the ice candidate, the promise returned by this method is rejected, returning one of the errors below as the name attribute in the specified domexception object passed to the rejection handler.
RTCPeerConnection.getStats() - Web APIs
the callback receives as input the exception (a domexception object describing the error which occurred.
... example this example creates a periodic function using setinterval() that collects statistics for an rtcpeerconnection every second, generating an html-formatted report and inserting it into a specific element in the dom.
RTCRemoteOutboundRtpStreamStats - Web APIs
localid a domstring which is used to find the local rtcinboundrtpstreamstats object which shares the same synchronization source (ssrc).
... remotetimestamp a domhighrestimestamp specifying the timestamp (on the remote device) at which the statistics in the rtcremoteoutboundrtpstreamstats object were sent by the remote endpoint.
RTCRtpCodecCapability - Web APIs
mimetype a domstring indicating the codec's mime media type and subtype.
... sdpfmtpline optional a domstring giving the format specific parameters field from the a=fmtp line in the sdp which corresponds to the codec, if such a line exists.
RTCRtpCodecParameters - Web APIs
mimetype optional the codec's mime media type and subtype specified as a domstring of the form "type/subtype".
... sdpfmtpline optional a domstring containing the format-specific parameters field from the "a=fmtp" line in the codec's sdp, if one is present; see section 5.8 of the ietf specification for jsep.
RTCRtpContributingSource.timestamp - Web APIs
the read-only timestamp property of the rtcrtpcontributingsource interface returns a domhighrestimestamp indicating the most recent time of playout of an rtp packet from the source.
... syntax var domhighrestimestamp = rtcrtpcontributingsource.timestamp value a domhighrestimestamp which indicates the time at which the most recent rtp packet from the corresponding source was played out.
RTCSessionDescription.sdp - Web APIs
the property rtcsessiondescription.sdp is a read-only domstring containing the sdp which describes the session.
... syntax var value = sessiondescription.sdp; sessiondescription.sdp = value; value the value is a domstring containing an sdp message like this one: v=0 o=alice 2890844526 2890844526 in ip4 host.anywhere.com s= c=in ip4 host.anywhere.com t=0 0 m=audio 49170 rtp/avp 0 a=rtpmap:0 pcmu/8000 m=video 51372 rtp/avp 31 a=rtpmap:31 h261/90000 m=video 53000 rtp/avp 32 a=rtpmap:32 mpv/90000 example // the remote description has been set previously on pc, an rtcpeerconnection alert(pc.remotedescription.sdp); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcsessiondescription.sdp' in that specification.
RTCStats.timestamp - Web APIs
the timestamp property of the rtcstats dictionary is a domhighrestimestamp object specifying the time at which the data in the object was sampled.
... syntax var timestamp = rtcstats.timestamp; value a domhighrestimestamp value indicating the time at which the activity described by the statistics in this object was recorded, in milliseconds elapsed since the beginning of january 1, 1970, utc.
Range.cloneRange() - Web APIs
WebAPIRangecloneRange
syntax clone = range.clonerange(); example range = document.createrange(); range.selectnode(document.getelementsbytagname("div").item(0)); clone = range.clonerange(); specifications specification status comment domthe definition of 'range.clonerange()' in that specification.
... document object model (dom) level 2 traversal and range specificationthe definition of 'range.clonerange()' in that specification.
Range.commonAncestorContainer - Web APIs
i++) { const range = selection.getrangeat(i); playanimation(range.commonancestorcontainer); } } }); function playanimation(el) { if (el.nodetype === node.text_node) { el = el.parentnode; } el.classlist.remove('highlight'); settimeout(() => { el.classlist.add('highlight'); }, 0); } result specifications specification status comment domthe definition of 'range.commonancestorcontainer' in that specification.
... document object model (dom) level 2 traversal and range specificationthe definition of 'range.commonancestorcontainer' in that specification.
Range.deleteContents() - Web APIs
syntax range.deletecontents() example range = document.createrange(); range.selectnode(document.getelementsbytagname("div").item(0)); range.deletecontents(); specifications specification status comment domthe definition of 'range.deletecontents()' in that specification.
... document object model (dom) level 2 traversal and range specificationthe definition of 'range.deletecontents()' in that specification.
Range.detach() - Web APIs
WebAPIRangedetach
syntax range.detach(); example var range = document.createrange(); range.selectnode(document.getelementsbytagname("div").item(0)); range.detach(); specifications specification status comment domthe definition of 'range.detach()' in that specification.
... document object model (dom) level 2 traversal and range specificationthe definition of 'range.detach()' in that specification.
Range.endContainer - Web APIs
syntax endrangenode = range.endcontainer; example var range = document.createrange(); range.setstart(startnode,startoffset); range.setend(endnode,endoffset); endrangenode = range.endcontainer; specifications specification status comment domthe definition of 'range.endcontainer' in that specification.
... document object model (dom) level 2 traversal and range specificationthe definition of 'range.endcontainer' in that specification.
Range.endOffset - Web APIs
WebAPIRangeendOffset
syntax endrangeoffset = range.endoffset; example var range = document.createrange(); range.setstart(startnode,startoffset); range.setend(endnode,endoffset); endrangeoffset = range.endoffset; specifications specification status comment domthe definition of 'range.endoffset' in that specification.
... document object model (dom) level 2 traversal and range specificationthe definition of 'range.endoffset' in that specification.
Range.insertNode() - Web APIs
WebAPIRangeinsertNode
example range = document.createrange(); newnode = document.createelement("p"); newnode.appendchild(document.createtextnode("new node inserted here")); range.selectnode(document.getelementsbytagname("div").item(0)); range.insertnode(newnode); specifications specification status comment domthe definition of 'range.insertnode()' in that specification.
... living standard no change document object model (dom) level 2 traversal and range specificationthe definition of 'range.insertnode()' in that specification.
Range.selectNode() - Web APIs
WebAPIRangeselectNode
example let range = document.createrange(); let referencenode = document.getelementsbytagname('div').item(0); range.selectnode(referencenode); specifications specification status comment domthe definition of 'range.selectnode()' in that specification.
... document object model (dom) level 2 traversal and range specificationthe definition of 'range.selectnode()' in that specification.
Range.selectNodeContents() - Web APIs
selection = window.getselection(); selection.removeallranges(); // select paragraph const range = document.createrange(); range.selectnodecontents(p); selection.addrange(range); }); deselectbutton.addeventlistener('click', e => { const selection = window.getselection(); selection.removeallranges(); }); result specifications specification status comment domthe definition of 'range.selectnodecontents()' in that specification.
... document object model (dom) level 2 traversal and range specificationthe definition of 'range.selectnodecontents()' in that specification.
Range.setEndAfter() - Web APIs
WebAPIRangesetEndAfter
example var range = document.createrange(); var referencenode = document.getelementsbytagname('div').item(0); range.setendafter(referencenode); specifications specification status comment domthe definition of 'range.setendafter()' in that specification.
... document object model (dom) level 2 traversal and range specificationthe definition of 'range.setendafter()' in that specification.
Range.setEndBefore() - Web APIs
example var range = document.createrange(); var referencenode = document.getelementsbytagname("div").item(0); range.setendbefore(referencenode); specifications specification status comment domthe definition of 'range.setendbefore()' in that specification.
... document object model (dom) level 2 traversal and range specificationthe definition of 'range.setendbefore()' in that specification.
Range.setStart() - Web APIs
WebAPIRangesetStart
"log"></p> javascript const element = document.getelementbyid('content'); const textnode = element.childnodes[0]; const range = document.createrange(); range.setstart(textnode, 0); // start at first character range.setend(textnode, 5); // end at fifth character document.getelementbyid('log').textcontent = range; result specifications specification status comment domthe definition of 'range.setstart()' in that specification.
... document object model (dom) level 2 traversal and range specificationthe definition of 'range.setstart()' in that specification.
Range.setStartAfter() - Web APIs
example var range = document.createrange(); var referencenode = document.getelementsbytagname("div").item(0); range.setstartafter(referencenode); specifications specification status comment domthe definition of 'range.setstartafter()' in that specification.
... document object model (dom) level 2 traversal and range specificationthe definition of 'range.setstartafter()' in that specification.
Range.setStartBefore() - Web APIs
example var range = document.createrange(); var referencenode = document.getelementsbytagname("div").item(0); range.setstartbefore(referencenode); specifications specification status comment domthe definition of 'range.setstartbefore()' in that specification.
... document object model (dom) level 2 traversal and range specificationthe definition of 'range.setstartbefore()' in that specification.
Range.startContainer - Web APIs
syntax startrangenode = range.startcontainer; example range = document.createrange(); range.setstart(startnode,startoffset); range.setend(endnode,endoffset); startrangenode = range.startcontainer; specifications specification status comment domthe definition of 'range.endcontainer' in that specification.
... document object model (dom) level 2 traversal and range specificationthe definition of 'range.startcontainer' in that specification.
Range.startOffset - Web APIs
WebAPIRangestartOffset
syntax startrangeoffset = range.startoffset; example var range = document.createrange(); range.setstart(startnode,startoffset); range.setend(endnode,endoffset); var startrangeoffset = range.startoffset; specifications specification status comment domthe definition of 'range.startoffset' in that specification.
... document object model (dom) level 2 traversal and range specificationthe definition of 'range.startoffset' in that specification.
Range.surroundContents() - Web APIs
example html <span class="header-text">put this in a headline</span> javascript const range = document.createrange(); const newparent = document.createelement('h1'); range.selectnode(document.queryselector('.header-text')); range.surroundcontents(newparent); result specifications specification status comment domthe definition of 'range.surroundcontents()' in that specification.
... document object model (dom) level 2 traversal and range specificationthe definition of 'range.surroundcontents()' in that specification.
Range.toString() - Web APIs
WebAPIRangetoString
look at the output below.</p> <p id="log"></p> javascript const range = document.createrange(); range.setstartbefore(document.getelementsbytagname('b').item(0), 0); range.setendafter(document.getelementsbytagname('b').item(1), 0); document.getelementbyid('log').textcontent = range.tostring(); result specifications specification status comment domthe definition of 'range.tostring()' in that specification.
... document object model (dom) level 2 traversal and range specificationthe definition of 'range.tostring()' in that specification.
ReadableStream.getReader() - Web APIs
syntax var reader = readablestream.getreader({mode}); parameters {mode} optional an object containing a property mode, which takes as its value a domstring specifying the type of reader to create.
...(see our simple random stream example for the full code).
ReadableStreamDefaultReader.cancel() - Web APIs
syntax var promise = readablestreamdefaultreader.cancel(reason); parameters reason optional a domstring providing a human-readable reason for the cancellation.
...(this code is based on our simple random stream example).
Request.credentials - Web APIs
the credentials read-only property of the request interface indicates whether the user agent should send cookies from the other domain in the case of cross-origin requests.
... syntax var mycred = request.credentials; value a requestcredentials dictionary value indicating whether the user agent should send cookies from the other domain in the case of cross-origin requests.
ResizeObserverEntry.contentRect - Web APIs
the contentrect read-only property of the resizeobserverentry interface returns a domrectreadonly object containing the new size of the observed element when the callback is run.
... syntax var contentrect = resizeobserverentry.contentrect; value a domrectreadonly object containing the new size of the element indicated by the target property.
RsaHashedImportParams - Web APIs
properties name a domstring.
... hash a domstring representing the name of the digest function to use.
RsaHashedKeyGenParams - Web APIs
properties name a domstring.
... hash a domstring representing the name of the digest function to use.
RsaPssParams - Web APIs
properties name a domstring.
... saltlength a long integer representing the length of the random salt to use, in bytes.
SVGAnimationElement - Web APIs
if there is no current interval, then a domexception with code invalid_state_err is thrown.
...if the simple duration is undefined (e.g., the end time is indefinite), then a domexception with code not_supported_err is raised.
SVGCircleElement - Web APIs
it randomly increases or decreases the radius of the circle element.
... function clickcircle() { var circle = document.getelementbyid("circle"); // randomly determine if the circle radius will increase or decrease var change = math.random() > 0.5 ?
SVGColorProfileElement - Web APIs
properties svgcolorprofileelement.local a domstring corresponding to the local attribute of the given element.
... svgcolorprofileelement.name a domstring corresponding to the name attribute of the given element.
SVGElement: load event - Web APIs
in the dom in the case of an embedded <svg>.
... it is basically the same as the standard load dom event.
SVGEvent - Web APIs
WebAPISVGEvent
properties property type description target read only eventtarget the event target (the topmost target in the dom tree).
... type read only domstring the type of event.
SVGGeometryElement.getPointAtLength() - Web APIs
syntax dompoint someelement.getpointatlength(float distance); parameters distance a float referring to the distance along the path.
... return value a dompoint indicating the point at a given distance along the path.
SVGGeometryElement.isPointInFill() - Web APIs
syntax boolean someelement.ispointinfill(dompointinit point); parameters point a dompointinit interpreted as a point in the local coordiante system of the element.
...eight="150" xmlns="http://www.w3.org/2000/svg"> <circle id="circle" cx="50" cy="50" r="45" fill="white" stroke="black" stroke-width="10"/> <circle cx="10" cy="10" r="5" fill="seagreen"/> <circle cx="40" cy="30" r="5" fill="seagreen"/> </svg> javascript var circle = document.getelementbyid('circle'); // point not in circle console.log('point at 10,10:', circle.ispointinfill(new dompoint(10, 10))); // point in circle console.log('point at 40,30:', circle.ispointinfill(new dompoint(40, 30))); result specifications specification status comment scalable vector graphics (svg) 2the definition of 'svggeometryelement.ispointinfill()' in that specification.
SVGGeometryElement.isPointInStroke() - Web APIs
syntax boolean someelement.ispointinstroke(dompointinit point); parameters point a dompointinit interpreted as a point in the local coordinate system of the element.
... <circle id="circle" cx="50" cy="50" r="45" fill="white" stroke="black" stroke-width="10"/> <circle cx="10" cy="10" r="5" fill="seagreen"/> <circle cx="40" cy="30" r="5" fill="seagreen"/> <circle cx="83" cy="17" r="5" fill="seagreen"/> </svg> javascript var circle = document.getelementbyid('circle'); // point not in circle console.log('point at 10,10:', circle.ispointinstroke(new dompoint(10, 10))); // point in circle but not stroke console.log('point at 40,30:', circle.ispointinstroke(new dompoint(40, 30))); // point in circle stroke console.log('point at 83,17:', circle.ispointinstroke(new dompoint(83, 17))); result specifications specification status comment scalable vector graphics (svg) 2the definition of 'svggeometryelement.ispointinstroke...
SVGGlyphRefElement - Web APIs
svgglyphrefelement.glyphref a domstring corresponding to the glyphref attribute of the given element.
... svgglyphrefelement.format a domstring corresponding to the format attribute of the given element.
SVGImageElement - Web APIs
svgimageelement.crossorigin a domstring corresponding to the crossorigin attribute of the given <image> element.
... svgimageelement.decoding returns a domstring representing a hint given to the browser on how it should decode the image.
SVGMarkerElement - Web APIs
exceptions: a domexception with code no_modification_allowed_err is raised when the object itself is read only.
... exceptions: a domexception with code no_modification_allowed_err is raised when the object itself is read only.
SVGMatrix - Web APIs
WebAPISVGMatrix
warning: svg 2 replaced the svgmatrix interface by the more general dommatrix and dommatrixreadonly interfaces.
... exceptions a domexception with the code no_modification_allowed_err is raised when attempting updating a read-only attribute or when the object itself is read-only.
SVGPathSeg - Web APIs
interface overview also implement none methods none properties unsigned short pathsegtype domstring pathsegtypeasletter constants pathseg_unknown = 0 pathseg_closepath = 1 pathseg_moveto_abs = 2 pathseg_moveto_rel = 3 pathseg_lineto_abs = 4 pathseg_lineto_rel = 5 pathseg_curveto_cubic_abs = 6 pathseg_curveto_cubic_rel =...
... pathsegtypeasletter domstring the type of the path segment as specified by the corresponding one character command name.
SVGStylable - Web APIs
interface overview also implement none methods cssvalue getpresentationattribute(in domstring name) properties readonly svganimatedstring classname readonly cssstyledeclaration style normative document svg 1.1 (2nd edition) properties name type description classname svganimatedstring corresponds to attribute class on the given element.
... methods name & arguments return description getpresentationattribute(in domstring name) cssvalue returns the base (i.e., static) value of a given presentation attribute as an object of type cssvalue.
SVGViewElement - Web APIs
a list of domstring values which contain the names listed in the viewtarget attribute.
... each of the domstring values can be associated with the corresponding element using the getelementbyid() method call.
Using the Screen Capture API - Web APIs
to request that the screen be shared with included audio, the options passed into getdisplaymedia() might look like this: const gdmoptions = { video: true, audio: true } this allows the user total freedom to select whatever they want, within the limits of what the user agent supports.
...it stops the stream by getting its track list using mediastream.gettracks(), then calling each track's {domxref("mediastreamtrack.stop, "stop()")}} method.
Screen Capture API - Web APIs
mediatrackconstraints mediatrackconstraints.cursor a constraindomstring indicating whether or not the cursor should be included in the captured display surface's stream, and if it should always be visible or if it should only be visible while the mouse is in motion.
... mediatrackconstraints.displaysurface a constraindomstring indicating what type of display surface is to be captured.
SecurityPolicyViolationEvent.effectiveDirective - Web APIs
the effectivedirective read-only property of the securitypolicyviolationevent interface is a domstring representing the directive whose enforcement uncovered the violation.
... syntax let effdir = violationeventinstance.effectivedirective; value a domstring representing the directive whose enforcement uncovered the violation.
SecurityPolicyViolationEvent.originalPolicy - Web APIs
the originalpolicy read-only property of the securitypolicyviolationevent interface is a domstring containing the policy whose enforcement uncovered the violation.
... syntax let origpolicy = violationeventinstance.originalpolicy; value a domstring representing the policy whose enforcement uncovered the violation.
SecurityPolicyViolationEvent.sample - Web APIs
the sample read-only property of the securitypolicyviolationevent interface is a domstring representing a sample of the resource that caused the violation.
... syntax let sample = violationeventinstance.sample; value a domstring containing a sample of the resource that caused the violation, usually the first 40 characters.
SecurityPolicyViolationEvent.violatedDirective - Web APIs
the violateddirective read-only property of the securitypolicyviolationevent interface is a domstring representing the directive whose enforcement uncovered the violation.
... syntax let violateddir = violationeventinstance.violateddirective; value a domstring representing the directive whose enforcement uncovered the violation.
Selection.type - Web APIs
WebAPISelectiontype
the type read-only property of the selection interface returns a domstring describing the type of the current selection.
... syntax value = sel.type value a domstring describing the type of the current selection.
SensorErrorEvent.SensorErrorEvent() - Web APIs
syntax sensorerrorevent = new sensorerrorevent(type, {error: domexception}); parameters type will always be 'sensorerrorevent'.
... options optional currently only one option is supported: error: an instance of domexception.
SensorErrorEvent.error - Web APIs
the error read-only property of the sensorerrorevent interface returns the domexception object passed in the event's contructor.
... syntax var domexception = sensorerrorevent.error; value a domexception.
ShadowRoot.mode - Web APIs
WebAPIShadowRootmode
examples let customelem = document.queryselector('my-shadow-dom-element'); let shadow = customelem.shadowroot; // another way to check whether the shadow root is open; it will return null if not if(shadow) { // if it is open, close it to stop people stealing our secrets!
... shadow.mode = 'closed'; } specifications specification status comment domthe definition of 'shadowroot.mode' in that specification.
SpeechGrammarList.addFromString() - Web APIs
the addfromstring() method of the speechgrammarlist interface takes a grammar present in a specific domstring within the code base (e.g.
... parameters string a domstring representing the grammar to be added.
StaticRange.endContainer - Web APIs
syntax var node = staticnode.endcontainer staticnode.endcontainer = endcontainer value the dom node which contains the final character of the range.
... specifications specification status comment domthe definition of 'endcontainer' in that specification.
StaticRange.startContainer - Web APIs
syntax var node = staticnode.startcontainer value the dom node inside which the start position of the range is found.
... specifications specification status comment domthe definition of 'startcontainer ' in that specification.
Storage.getItem() - Web APIs
WebAPIStoragegetItem
syntax var avalue = storage.getitem(keyname); parameters keyname a domstring containing the name of the key you want to retrieve the value of.
... return value a domstring containing the value of the key.
Storage.removeItem() - Web APIs
the storage interface of the web storage api provides access to a particular domain's session or local storage.
... syntax storage.removeitem(keyname); parameters keyname a domstring containing the name of the key you want to remove.
Storage.setItem() - Web APIs
WebAPIStoragesetItem
syntax storage.setitem(keyname, keyvalue); parameters keyname a domstring containing the name of the key you want to create/update.
... keyvalue a domstring containing the value you want to give the key you are creating/updating.
Storage - Web APIs
WebAPIStorage
the storage interface of the web storage api provides access to a particular domain's session or local storage.
... to manipulate, for instance, the session storage for a domain, a call to window.sessionstorage is made; whereas for local storage the call is made to window.localstorage.
StyleSheet.disabled - Web APIs
working draft no change from document object model (dom) level 2 style specification.
... document object model (dom) level 2 style specificationthe definition of 'stylesheet.disabled' in that specification.
SubtleCrypto - Web APIs
even assuming you use the basic cryptographic functions correctly, secure key management and overall security system design are extremely hard to get right, and are generally the domain of specialist security experts.
... subtlecrypto.derivebits() returns a promise that fulfills with a newly generated buffer of pseudo-random bits derived from the master key and specific algorithm given as parameters.
Text() - Web APIs
WebAPITextText
the text() constructor returns a newly created text object with the optional domstring given in parameter as its textual content.
... syntax text1 = new text(); // create an empty text node text2 = new text("this is a text node"); example let text = new text("test"); specifications specification status comment domthe definition of 'text()' in that specification.
Text.replaceWholeText() - Web APIs
a domexception with the value no_modification_err is thrown if one of the text nodes being replaced is read only.
... specifications specification status comment document object model (dom) level 3 core specificationthe definition of 'text' in that specification.
TextDecoder - Web APIs
textdecoder.prototype.encodingread only is a domstring containing the name of the decoder, that is a string describing the method the textdecoder will use.
... textdecoder.prototype.decode() returns a domstring containing the text decoded with the method of the specific textdecoder object.
TextTrack.mode - Web APIs
WebAPITextTrackmode
syntax var mode = texttrack.mode; texttrack.mode = "disabled" | "hidden" | "showing"; value a domstring which indicates the track's current mode.
...while the track's presence is exposed in the dom, the user agent is otherwise ignoring it.
TrackEvent - Web APIs
the trackevent interface, 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.
... track read only the dom track object the event is in reference to.
TransitionEvent.initTransitionEvent() - Web APIs
do not use it anymore, use the standard constructor, transitionevent(), to create a synthetic transitionevent syntax transitionevent.inittransitionevent(typearg, canbubblearg, cancelablearg, transitionnamearg, elapsedtimearg); parameters typearg is a domstring identifying the specific type of transition event that occurred.
... transitionnamearg is a domstring containing the name of the css property associated with the transition.
TransitionEvent - Web APIs
transitionevent.propertyname read only is a domstring containing the name css property associated with the transition.
... transitionevent.pseudoelement read only is a domstring, starting with ::, containing the name of the pseudo-element the animation runs on.
TreeWalker.currentNode - Web APIs
specifications specification status comment domthe definition of 'treewalker.currrentnode' in that specification.
... living standard no change from document object model (dom) level 2 traversal and range specification document object model (dom) level 2 traversal and range specificationthe definition of 'treewalker.currentnode' in that specification.
TreeWalker.filter - Web APIs
WebAPITreeWalkerfilter
syntax nodefilter = treewalker.filter; example var treewalker = document.createtreewalker( document.body, nodefilter.show_element, { acceptnode: function(node) { return nodefilter.filter_accept; } }, false ); nodefilter = treewalker.filter; // document.body in this case specifications specification status comment domthe definition of 'treewalker.filter' in that specification.
... living standard no change from document object model (dom) level 2 traversal and range specification document object model (dom) level 2 traversal and range specificationthe definition of 'treewalker.filter' in that specification.
TreeWalker.firstChild() - Web APIs
syntax node = treewalker.firstchild; example var treewalker = document.createtreewalker( document.body, nodefilter.show_element, { acceptnode: function(node) { return nodefilter.filter_accept; } }, false ); var node = treewalker.firstchild(); // returns the first child of the root element, or null if none specifications specification status comment domthe definition of 'treewalker.firstchild' in that specification.
... living standard no change from document object model (dom) level 2 traversal and range specification document object model (dom) level 2 traversal and range specificationthe definition of 'treewalker.firstchild' in that specification.
TreeWalker.lastChild() - Web APIs
syntax node = treewalker.lastchild(); example var treewalker = document.createtreewalker( document.body, nodefilter.show_element, { acceptnode: function(node) { return nodefilter.filter_accept; } }, false ); var node = treewalker.lastchild(); // returns the last visible child of the root element specifications specification status comment domthe definition of 'treewalker.lastchild' in that specification.
... living standard no change from document object model (dom) level 2 traversal and range specification document object model (dom) level 2 traversal and range specificationthe definition of 'treewalker.lastchild' in that specification.
TreeWalker.nextNode() - Web APIs
de = treewalker.nextnode(); example var treewalker = document.createtreewalker( document.body, nodefilter.show_element, { acceptnode: function(node) { return nodefilter.filter_accept; } }, false ); var node = treewalker.nextnode(); // returns the first child of root, as it is the next node in document order specifications specification status comment domthe definition of 'treewalker.nextnode' in that specification.
... living standard no change from document object model (dom) level 2 traversal and range specification document object model (dom) level 2 traversal and range specificationthe definition of 'treewalker.nextnode' in that specification.
TreeWalker.nextSibling() - Web APIs
ing(); example var treewalker = document.createtreewalker( document.body, nodefilter.show_element, { acceptnode: function(node) { return nodefilter.filter_accept; } }, false ); treewalker.firstchild(); var node = treewalker.nextsibling(); // returns null if the first child of the root element has no sibling specifications specification status comment domthe definition of 'treewalker.nextsibling' in that specification.
... living standard no change from document object model (dom) level 2 traversal and range specification document object model (dom) level 2 traversal and range specificationthe definition of 'treewalker.nextsibling' in that specification.
TreeWalker.parentNode() - Web APIs
syntax node = treewalker.parentnode(); example var treewalker = document.createtreewalker( document.body, nodefilter.show_element, { acceptnode: function(node) { return nodefilter.filter_accept; } }, false ); var node = treewalker.parentnode(); // returns null as there is no parent specifications specification status comment domthe definition of 'treewalker.parentnode' in that specification.
... living standard no change from document object model (dom) level 2 traversal and range specification document object model (dom) level 2 traversal and range specificationthe definition of 'treewalker.parentnode' in that specification.
TreeWalker.previousNode() - Web APIs
syntax node = treewalker.previousnode(); example var treewalker = document.createtreewalker( document.body, nodefilter.show_element, { acceptnode: function(node) { return nodefilter.filter_accept; } }, false ); var node = treewalker.previousnode(); // returns null as there is no parent specifications specification status comment domthe definition of 'treewalker.previousnode' in that specification.
... living standard no change from document object model (dom) level 2 traversal and range specification document object model (dom) level 2 traversal and range specificationthe definition of 'treewalker.previousnode' in that specification.
TreeWalker.previousSibling() - Web APIs
syntax node = treewalker.previoussibling(); example var treewalker = document.createtreewalker( document.body, nodefilter.show_element, { acceptnode: function(node) { return nodefilter.filter_accept; } }, false ); var node = treewalker.previoussibling(); // returns null as there is no previous sibiling specifications specification status comment domthe definition of 'treewalker.previoussibling' in that specification.
... living standard no change from document object model (dom) level 2 traversal and range specification document object model (dom) level 2 traversal and range specificationthe definition of 'treewalker.previoussibling' in that specification.
TreeWalker.root - Web APIs
WebAPITreeWalkerroot
syntax root = treewalker.root; example var treewalker = document.createtreewalker( document.body, nodefilter.show_element, { acceptnode: function(node) { return nodefilter.filter_accept; } }, false ); root = treewalker.root; // document.body in this case specifications specification status comment domthe definition of 'treewalker.root' in that specification.
... living standard no change from document object model (dom) level 2 traversal and range specification document object model (dom) level 2 traversal and range specificationthe definition of 'treewalker.root' in that specification.
TreeWalker.whatToShow - Web APIs
how_element + nodefilter.show_comment + nodefilter.show_text, { acceptnode: function(node) { return nodefilter.filter_accept; } }, false ); if( (treewalker.whattoshow == nodefilter.show_all) || (treewalker.whattoshow % (nodefilter.show_comment*2)) >= nodefilter.show_comment) { // treewalker will show comments } specifications specification status comment domthe definition of 'treewalker.whattoshow' in that specification.
... living standard no change from document object model (dom) level 2 traversal and range specification document object model (dom) level 2 traversal and range specificationthe definition of 'treewalker.whattoshow' in that specification.
TreeWalker - Web APIs
specifications specification status comment domthe definition of 'treewalker' in that specification.
... document object model (dom) level 2 traversal and range specificationthe definition of 'treewalker' in that specification.
UIEvent() - Web APIs
WebAPIUIEventUIEvent
syntax event = new uievent(typearg [, uieventinit]) values typearg is a domstring representing the name of the event.
... document object model (dom) level 3 events specificationthe definition of 'uievent()' in that specification.
UIEvent.detail - Web APIs
WebAPIUIEventdetail
specifications specification status comment document object model (dom) level 3 events specificationthe definition of 'uievent.detail' in that specification.
... obsolete document object model (dom) level 2 events specificationthe definition of 'uievent.detail' in that specification.
UIEvent - Web APIs
WebAPIUIEvent
ui events working draft extend dom3 document object model (dom) level 3 events specificationthe definition of 'uievent' in that specification.
... document object model (dom) level 2 events specificationthe definition of 'uievent' in that specification.
URL.createObjectURL() - Web APIs
the url.createobjecturl() static method creates a domstring containing a url representing the object given in the parameter.
... return value a domstring containing an object url that can be used to reference the contents of the specified source object.
URL.hostname - Web APIs
WebAPIURLhostname
the hostname property of the url interface is a usvstring containing the domain name of the url.
... syntax const domain = url.hostname url.hostname = domain value a usvstring.
URL API - Web APIs
WebAPIURL API
the url standard also defines concepts such as domains, hosts, and ip addresses, and also attempts to describe in a standard way the legacy application/x-www-form-urlencoded mime type used to submit web forms' contents as a set of key/value pairs.
...also covered are definitions of various terms related to addressing of computers on a network, and the algorithms for parsing ip addresses and dom addresses are specified.
WebGL2RenderingContext.getActiveUniformBlockName() - Web APIs
syntax domstring gl.getactiveuniformblockname(program, uniformblockindex); parameters program a webglprogram containing the uniform block.
... return value a domstring indicating the active uniform block name.
WebGLRenderingContext.getParameter() - Web APIs
gl.renderer domstring gl.sample_buffers glint gl.sample_coverage_invert glboolean gl.sample_coverage_value glfloat gl.samples glint gl.scissor_box int32array (with 4 elements) gl.scissor_test glboolean gl.shading_language_version domstring gl.stencil_back_fail glenum gl.ste...
... gl.subpixel_bits glint gl.texture_binding_2d webgltexture or null gl.texture_binding_cube_map webgltexture or null gl.unpack_alignment glint gl.unpack_colorspace_conversion_webgl glenum gl.unpack_flip_y_webgl glboolean gl.unpack_premultiply_alpha_webgl glboolean gl.vendor domstring gl.version domstring gl.viewport int32array (with 4 elements) webgl 2 you can query the following pname parameters when using a webgl2renderingcontext.
Raining rectangles - Web APIs
var rect = this; // we get three random numbers and use them for new rectangle // size and position.
... var randnums = getrandomvector(); rect.size = [ 5 + 120 * randnums[0], 5 + 120 * randnums[1] ]; rect.position = [ randnums[2]*(gl.drawingbufferwidth - rect.size[0]), gl.drawingbufferheight ]; rect.velocity = 1.0 + 6.0*math.random(); rect.color = getrandomvector(); gl.clearcolor(rect.color[0], rect.color[1], rect.color[2], 1.0); function getrandomvector() { return [math.random(), math.random(), math.random()]; } } function getrenderingcontext() { var canvas = document.queryselector("canvas"); canvas.width = canvas.clientwidth; canvas.height = canvas.clientheight; var gl = canvas.getcontext("webgl") || c...
Matrix math for the web - Web APIs
manipulating the dom with a matrix a really easy way to start using a matrix is to use the css matrix3d() transform.
... // create the matrix3d style property from a matrix array function matrixarraytocssmatrix(array) { return 'matrix3d(' + array.join(',') + ')'; } // grab the dom element let moveme = document.getelementbyid('move-me'); // returns a result like: "matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 50, 100, 0, 1);" let matrix3drule = matrixarraytocssmatrix(translationmatrix); // set the transform moveme.style.transform = matrix3drule; view on jsfiddle scale matrix a scale matrix makes something larger or smaller in one or more of the three dimensions: widt...
Using the Web Animations API - Web APIs
we no longer need to rely on dom-heavy techniques such as writing css properties and scoping classes onto elements to control playback direction.
... the animate() method can be called on any dom element that could be animated with css.
Web Animations API - Web APIs
animation of dom elements.
... concepts and usage the web animations api provides a common language for browsers and developers to describe animations on dom elements.
Basic concepts behind Web Audio API - Web APIs
analysernode.getfloattimedomaindata() 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.
Web Workers API - Web APIs
for example, you can't directly manipulate the dom from inside a worker, or use some default methods and properties of the window object.
... in addition to dedicated workers, there are other types of worker: shared workers are workers that can be utilized by multiple scripts running in different windows, iframes, etc., as long as they are in the same domain as the worker.
window.cancelIdleCallback() - Web APIs
ack experimentalchrome full support 47edge full support 79firefox full support 55 full support 55 full support 53disabled disabled from version 53: this feature is behind the dom.requestidlecallback.enabled preference (needs to be set to true).
...roid full support 47chrome android full support 47firefox android full support 55 full support 55 full support 53disabled disabled from version 53: this feature is behind the dom.requestidlecallback.enabled preference (needs to be set to true).
Window: load event - Web APIs
WebAPIWindowload event
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.
...listener('click', () => { log.textcontent =''; window.settimeout(() => { window.location.reload(true); }, 200); }); window.addeventlistener('load', (event) => { log.textcontent = log.textcontent + 'load\n'; }); document.addeventlistener('readystatechange', (event) => { log.textcontent = log.textcontent + `readystate: ${document.readystate}\n`; }); document.addeventlistener('domcontentloaded', (event) => { log.textcontent = log.textcontent + `domcontentloaded\n`; }); result specifications specification status comment ui eventsthe definition of 'load' in that specification.
Window.localStorage - Web APIs
the keys and the values are always in the utf-16 domstring format, which uses two bytes per character.
... example the following snippet accesses the current domain's local storage object and adds a data item to it using storage.setitem().
Window.name - Web APIs
WebAPIWindowname
it has also been used in some frameworks for providing cross-domain messaging (e.g., sessionvars and dojo's dojox.io.windowname) as a more secure alternative to jsonp.
... modern web applications hosting sensitive data should, however, not rely on window.name for cross-domain messaging but instead utilize the postmessage api.
Privileged features - Web APIs
mozilla and firefox users can force new windows to always render the titlebar by setting dom.disable_window_open_feature.titlebar to true in about:config or in their user.js file.
... mozilla and firefox users can force new windows to always have a close button by setting dom.disable_window_open_feature.close to true in about:config or in their user.js file.
window.postMessage() - Web APIs
the value of the origin property of the dispatched event is not affected by the current value of document.domain in the calling window.
...web context scripts can use custom events to communicate with content scripts (with randomly generated event names, if needed, to prevent snooping from the guest page).
Window.requestAnimationFrame() - Web APIs
the callback method is passed a single argument, a domhighrestimestamp, which indicates the current time (based on the number of milliseconds since time origin).
...the callback function is passed one single argument, a domhighrestimestamp similar to the one returned by performance.now(), indicating the point in time when requestanimationframe() starts to execute callback functions.
WorkerGlobalScope.dump() - Web APIs
syntax dump('my message\n'); parameters a domstring containing the message you want to send.
...for example, on mac os x you'd run it using something like this (assuming you are inside the applications folder): ./firefox.app/contents/macos/firefox-bin -profile /tmp -no-remote now go into about:config and enable the browser.dom.window.dump.enabled pref.
WorkerNavigator - Web APIs
navigatorlanguage.languageread only returns a domstring representing the language version of the browser.
... navigatorlanguage.languagesread only returns an array of domstrings representing the languages known to the user, in order of preference.
XMLDocument.load() - Web APIs
WebAPIXMLDocumentload
document.load() is a part of an old version of the w3c dom level 3 load & save module.
...(to test this functionality, create the files on your local disk or on a webserver rather than loading the load.html file from the lxr-generated page, which will serve the text.xml file as html.) specifications old w3c working draft of the dom level 3 load & save module ...
XMLDocument - Web APIs
specifications specification status comment domthe definition of 'xmldocument' in that specification.
... dom4the definition of 'xmldocument' in that specification.
HTML in XMLHttpRequest - Web APIs
this feature allows web apps to obtain an html resource as a parsed dom using xmlhttprequest.
... usage retrieving an html resource as a dom using xmlhttprequest works just like retrieving an xml resource as a dom using xmlhttprequest, except you can't use the synchronous mode and you have to explicitly request a document by assigning the string "document" to the responsetype property of the xmlhttprequest object after calling open() but before calling send().
XMLHttpRequest.response - Web APIs
the xmlhttprequest response property returns the response's body content as an arraybuffer, blob, document, javascript object, or domstring, depending on the value of the request's responsetype property.
... text the response is a text in a domstring object.
XMLHttpRequest.sendAsBinary() - Web APIs
syntax xmlhttprequest.sendasbinary(binarystring); parameters binarystring a domstring which encodes the binary content to be sent.
... /*\ |*| |*| :: xmlhttprequest.prototype.sendasbinary() polyfill :: |*| |*| https://developer.mozilla.org/docs/dom/xmlhttprequest#sendasbinary() |*| \*/ if (!xmlhttprequest.prototype.sendasbinary) { xmlhttprequest.prototype.sendasbinary = function (sdata) { var nbytes = sdata.length, ui8data = new uint8array(nbytes); for (var nidx = 0; nidx < nbytes; nidx++) { ui8data[nidx] = sdata.charcodeat(nidx) & 0xff; } /* send as arraybufferview...: */ this.send(ui8data); /* ...or as arr...
XMLHttpRequest.withCredentials - Web APIs
xmlhttprequest from a different domain cannot set cookie values for their own domain unless withcredentials is set to true before making the request.
... note: xmlhttprequest responses from a different domain cannot set cookie values for their own domain unless withcredentials is set to true before making the request, regardless of access-control- header values.
XPathEvaluator - Web APIs
xpathevaluator.creatensresolver() adapts any dom node to resolve namespaces allowing the xpath expression to be evaluated relative to the context of the node where it appeared within the document.
.../output></div> javascript var xpath = "//div"; var evaluator = new xpathevaluator(); var expression = evaluator.createexpression("//div"); var result = expression.evaluate(document, xpathresult.ordered_node_snapshot_type); document.queryselector("output").textcontent = result.snapshotlength; result specifications specification status comment document object model (dom) level 3 xpath specificationthe definition of 'xpathevaluator' in that specification.
XPathException - Web APIs
in the dom xpath api the xpathexception interface represents exception conditions that can be encountered while performing xpath operations.
... specifications specification status comment document object model (dom) level 3 xpath specificationthe definition of 'xpathexception' in that specification.
XPathExpression - Web APIs
this interface is a compiled xpath expression that can be evaluated on a document or specific node to return information from its dom tree.
...></output></div> javascript var xpath = "//div"; var evaluator = new xpathevaluator(); var expression = evaluator.createexpression(xpath); var result = expression.evaluate(document, xpathresult.ordered_node_snapshot_type); document.queryselector("output").textcontent = result.snapshotlength; result specifications specification status comment document object model (dom) level 3 xpath specificationthe definition of 'xpathexpression' in that specification.
XRBoundedReferenceSpace.boundsGeometry - Web APIs
the read-only xrboundedreferencespace property boundsgeometry is an array of dompointreadonly objects which specifies the points making up a polygon inside which the viewer is allowed to move.
... syntax bounds = xrreferencespace.boundsgeometry; value the boundsgeometry property is an array of dompointreadonly objects, each of which defines one vertex in a polygon inside which the viewer is required to remain.
XRPermissionDescriptor.optionalFeatures - Web APIs
for devices with six degrees of freedom (6dof) tracking, the local reference space tries to keep the origin stable relative to the environment.
... xrreferencespace unbounded a tracking space which allows the user total freedom of movement, possibly over extremely long distances from their origin point.
XRPermissionDescriptor.requiredFeatures - Web APIs
for devices with six degrees of freedom (6dof) tracking, the local reference space tries to keep the origin stable relative to the environment.
... xrreferencespace unbounded a tracking space which allows the user total freedom of movement, possibly over extremely long distances from their origin point.
XRPose.emulatedPosition - Web APIs
a basic xr headset provides three degrees of freedom (3dof), tracking the pitch, yaw, and roll of the user's head.
... contrariwise, xr devices which can also track movement forward and backward as well as laterally—six degree of freedom (6dof) devices—don't require any information from other sources to determine the user's position, so the value of emulatedposition is false.
XRReferenceSpace - Web APIs
for devices with six degrees of freedom (6dof) tracking, the local reference space tries to keep the origin stable relative to the environment.
... xrreferencespace unbounded a tracking space which allows the user total freedom of movement, possibly over extremely long distances from their origin point.
XRReferenceSpaceType - Web APIs
for devices with six degrees of freedom (6dof) tracking, the local reference space tries to keep the origin stable relative to the environment.
... xrreferencespace unbounded a tracking space which allows the user total freedom of movement, possibly over extremely long distances from their origin point.
XRRigidTransform.orientation - Web APIs
the read-only xrrigidtransform property orientation is a dompointreadonly containing a normalized quaternion (also called a unit quaternion or versor) specifying the rotational component of the transform represented by the object.
... syntax let orientation = xrrigidtransform.orientation; value a dompointreadonly object which contains a unit quaternion providing the orientation component of the transform.
XRRigidTransform.position - Web APIs
the read-only xrrigidtransform property position is a dompointreadonly object which provides the 3d point, specified in meters, describing the translation component of the transform.
... syntax let pos = xrrigidtransform.position; value a read-only dompointreadonly indicating the 3d position component of the transform matrix.
XRRigidTransform - Web APIs
attributes xrrigidtransform.position read only a dompointreadonly specifying a 3-dimensional point, expressed in meters, describing the translation component of the transform.
... xrrigidtransform.orientation read only a dompointreadonly which contains a unit quaternion describing the rotational component of the transform.
XRSession.environmentBlendMode - Web APIs
the value is a domstring which contains one of the values defined by the xrenvironmentblendmode enumerated type.
... syntax blendmode = xrsession.environmentblendmode; value a domstring whose value is one of the strings found in the enumerated type xrenvironmentblendmode, defining if—and if so, how—virtual, rendered content is overlaid atop the image of the real world.
XRSession.onsqueeze - Web APIs
examples handling squeeze events for a specific hand this snippet of code adds a simple handler for the squeeze event, which responds only to events on the user's off-hand (that is, the hand that isn't their dominant hand).
... after checking that the event occurred on the user's dominant hand, the pose's target ray is obtained.
XRSystem: requestSession() - Web APIs
syntax var sessionpromise = xr.requestsession(sessionmode, sessioninit) parameters sessionmode a domstring whose value is one of those included in the xrsessionmode enum.
... exceptions this method doesn't throw true exceptions; instead, it rejects the returned promise, passing into it a domexception whose name is one of the following: invalidstateerror the requested session mode is immersive-vr but there is already an immersive vr session either currently active or in the process of being set up.
ARIA: table role - Accessibility
aria-colcount attribute this attribute is only required if the columns are not present in the dom all the time.
... aria-rowcount attribute this attribute is only required if the rows are not present in the dom all the time, such as scrollable tables that reuse rows to minimize the number of dom nodes.
Architecture - Accessibility
however in accessibility hierarchies such as atk and iaccessible2, text is not exposed in leaf nodes as it is in a w3c dom.
...this means that we have an exact mirror to the dom, but text lives in the parents instead of in the leaves, which now don't really provide additional useful information.
HTML To MSAA - Accessibility
presented n/a if @usemap attribute is used then image accessible has children for each map item input @type=button, submit, reset role_system_ pushbutton from @value attribute, @alt attribute, default label, @src attribute, @data attribute n/a state_system_ default if @type attribute has value "submit" n/a "press" n/a input @type=text, textarea role_system_ text n/a value property of input dom element state_system_ readonly if @readonly attribute is used n/a "activate" n/a input @type=password role_system_ text n/a n/a state_system_ readonly if @readonly attribute is used state_system_ protected n/a "activate" n/a input type="checkbox" role_system_ checkbutton n/a n/a state_system_ marqueed used as state checkable state_system_ mixed for html 5 if intermediate property of d...
...om element returns true state_system_ checked if checked property of dom element returns true n/a "check"/"uncheck"/"cycle" depending on state event_object_ statechange when state is changed input type="radio" role_system_ radiobutton 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...
Accessibility documentation index - Accessibility
addition of aria semantics only exposes extra information to a browser's accessibility api, and does not affect a page's dom.
... 93 keyboard-navigable javascript widgets accessibility, dom, needsupdate web applications often use javascript to mimic desktop widgets such as menus, tree views, rich text fields, and tab panels.
Keyboard-navigable JavaScript widgets - Accessibility
dom focus events are considered informational only: generated by the system after something is focused, but not actually used to set focus.
...there is no standard dom interface to get the current document focus.
:default - CSS: Cascading Style Sheets
WebCSS:default
what this selector matches is defined in html standard §4.16.3 pseudo-classes — it may match the <button>, <input type="checkbox">, <input type="radio">, and <option> elements: a default option element is the first one with the selected attribute, or the first enabled option in dom order.
... <button> matches if it is a <form>’s default submission button: the first <button> in dom order that belongs to the form.
:scope - CSS: Cascading Style Sheets
WebCSS:scope
when used from a dom api such as queryselector(), queryselectorall(), matches(), or element.closest(), :scope matches the element on which the method was called.
...to change preferences in firefox, visit about:config.opera android full support 15safari ios full support 7samsung internet android full support 1.5support in dom api such as in queryselector() and queryselectorall()chrome full support 27edge full support 79firefox full support 32ie no support noopera full support 15safari ...
CSS Grid Layout and Accessibility - CSS: Cascading Style Sheets
we can use grid-auto-flow: dense which will take items visually out of dom order.
...currently the only way to do this is to use display: contents to cause the box generated by the ul to disappear from the dom.
Cubic Bezier Generator - CSS: Cascading Style Sheets
// place needed to draw the rulers const rulers = 30.5; const margin = 10.5; const basic_scale_size = 5; // size of 0.1 tick on the rulers var scaling; //limitation: scaling is computed once: if canvas.height/canvas.width change it won't be recalculated var dragsm = 0; // drag state machine: 0 = nodrag, others = object being dragged function initcanvas() { // get the canvas element using the dom var canvas = document.getelementbyid('bezier'); // make sure we don't execute when canvas isn't supported if (canvas.getcontext) { // use getcontext to use the canvas for drawing var ctx = canvas.getcontext('2d'); scaling = math.min(canvas.height - rulers - margin, canvas.width - rulers - margin); canvas.onmousedown = mousedown; canvas.onmous...
...result + 0.5 : result; } function drawbeziercurve(x1, y1, x2, y2) { // get the canvas element using the dom var canvas = document.getelementbyid('bezier'); // make sure we don't execute when canvas isn't supported if (canvas.getcontext) { // use getcontext to use the canvas for drawing var ctx = canvas.getcontext('2d'); // clear canvas ctx.clearrect(0, 0, canvas.width, canvas.height); // draw the rulers ctx.beginpath(); ctx.strok...
contain - CSS: Cascading Style Sheets
WebCSScontain
this allows the browser to recalculate layout, style, paint, size, or any combination of them for a limited area of the dom and not the entire page, leading to obvious performance benefits.
...2>another heading of another article</h2> <img src="graphic.jpg" alt="photo"> <p>more content here.</p> </article> each <article> and <img> is given a border, and the images are floated: img { float: left; border: 3px solid black; } article { border: 1px solid black; } float interference if we were to insert another image at the bottom of the first article, a large portion of the dom tree may be re-laid out or repainted, and this would also interfere with the layout of the second article: <h1>my blog</h1> <article> <h2>heading of a nice article</h2> <p>content here.</p> <img src="i-just-showed-up.jpg" alt="social"> </article> <article> <h2>another heading of another article</h2> <img src="graphic.jpg" alt="photo"> <p>more content here.</p> </article> img { fl...
Ajax - Developer guides
WebGuideAJAX
asynchronous javascript and xml, while not a technology in itself, is a term coined in 2005 by jesse james garrett, that describes a "new" approach to using a number of existing technologies together, including html or xhtml, css, javascript, dom, xml, xslt, and most importantly the xmlhttprequest object.
...this feature allows web apps to obtain an html resource as a parsed dom using xmlhttprequest.
Audio and video manipulation - Developer guides
note: due to potential security issues if your video is on a different domain than your code, you'll need to enable cors (cross origin resource sharing) on your video server.
... function setfilter() { eval(textarea.value); } reset.addeventlistener('click', function() { textarea.value = code; setfilter(); }); edit.addeventlistener('click', function() { textarea.focus(); }) textarea.addeventlistener('input', setfilter); window.addeventlistener('load', setfilter); note: unless you have cors enabled, to avoid security issues your video should be on the same domain as your code.
Challenge solutions - Developer guides
how css works dom inspector challenge in domi, click on a strong node.
... use domi's right-hand pane to find out where the node's color is set to red, and where its appearance is made bolder than normal text.
Creating and triggering events - Developer guides
this article demonstrates how to create and dispatch dom events.
...optionally, we've also leveraged the "function expression" (instead of the "arrow function expression") so "this" will represent the element this.dispatchevent(new customevent('awesome', { bubbles: true, detail: { text: () => textarea.value } })) }); triggering built-in events this example demonstrates simulating a click (that is programmatically generating a click event) on a checkbox using dom methods.
HTML5 - Developer guides
WebGuideHTMLHTML5
html5-compliant parser the parser, which turns the bytes of an html document into a dom, has been extended and now precisely defines the behavior to use in all cases, even when faced with invalid html.
... whatwg client-side session and persistent storage (aka dom storage) client-side session and persistent storage allows web applications to store structured data on the client side.
Using HTML sections and outlines - Developer guides
html5 semantic elements don't need a special dom interface, but they will need a specific css styling in older browser that don't support them explicitly.
... next up, older ie versions do not allow styling of unsupported elements, unless you create an instance of them in the dom.
Writing forward-compatible websites - Developer guides
what this means is that any time you access a global variable in an event handler content attribute, including calling any function declared globally, you can end up with a name collision if a specification adds a new dom property to elements or documents which has the same name as your function or variable, and a browser implements it.
...don't assume that browsers with support for a given dom feature must also have some other, especially nonstandard, dom feature.
The HTML autocomplete attribute - HTML: Hypertext Markup Language
in the united kingdom, the post town.
... united kingdom address input forms in the uk should contain one address level and one, two or three address lines, depending on the address.
<h1>–<h6>: The HTML Section Heading elements - HTML: Hypertext Markup Language
implicit aria role heading permitted aria roles tab, presentation or none dom interface htmlheadingelement attributes these elements only include the global attributes.
...e hierarchy of the content: h1 beetles h2 etymology h2 distribution and diversity h2 evolution h3 late paleozoic h3 jurassic h3 cretaceous h3 cenozoic h2 external morphology h3 head h4 mouthparts h3 thorax h4 prothorax h4 pterothorax h3 legs h3 wings h3 abdomen when headings are nested, heading levels may be "skipped" when closing a subsection.
<address>: The Contact Address element - HTML: Hypertext Markup Language
WebHTMLElementaddress
implicit aria role no corresponding role permitted aria roles any dom interface htmlelement prior to gecko 2.0 (firefox 4), gecko implemented this element using the htmlspanelement interface attributes this element only includes the global attributes.
... <address> you can contact author at <a href="http://www.somedomain.com/contact"> www.somedomain.com</a>.<br> if you see any bugs, please <a href="mailto:webmaster@somedomain.com"> contact webmaster</a>.<br> you may also want to visit us:<br> mozilla foundation<br> 331 e evelyn ave<br> mountain view, ca 94041<br> usa </address> result although it renders text with the same default styling as the <i> or <em> elements, it i...
<canvas>: The Graphics Canvas element - HTML: Hypertext Markup Language
WebHTMLElementcanvas
implicit aria role no corresponding role permitted aria roles any dom interface htmlcanvaselement attributes this element's attributes include the global attributes.
...providing a useful fallback text or sub dom helps to make the the canvas more accessible.
<dl>: The Description List element - HTML: Hypertext Markup Language
WebHTMLElementdl
implicit aria role no corresponding role permitted aria roles group, list, none, presentation dom interface htmldlistelement attributes this element only includes the global attributes.
... </dd> <dd> the red panda also known as the lesser panda, wah, bear cat or firefox, is a mostly herbivorous mammal, slightly larger than a domestic cat (60 cm long).
<element>: The Custom Element element (Obsolete) - HTML: Hypertext Markup Language
WebHTMLElementelement
the obsolete html <element> element was part of the web components specification; it was intended to be used to define new custom dom elements.
... dom interface htmlelement attributes this element includes the global attributes.
<iframe>: The Inline Frame element - HTML: Hypertext Markup Language
WebHTMLElementiframe
implicit aria role no corresponding role permitted aria roles application, document, img, none, presentation dom interface htmliframeelement attributes this element includes the global attributes.
... with the dom htmliframeelement object, scripts can access the window object of the framed resource via the contentwindow property.
<input type="button"> - HTML: Hypertext Markup Language
WebHTMLElementinputbutton
value a domstring used as the button's label events click supported common attributes type, and value idl attributes value methods none value an <input type="button"> elements' value attribute contains a domstring that is used as the button's label.
...ddeventlistener('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 this refence in the variable button.
<input type="checkbox"> - HTML: Hypertext Markup Language
WebHTMLElementinputcheckbox
value a domstring representing the value of the checkbox.
... events change and input supported common attributes checked idl attributes checked, indeterminate and value methods select() value a domstring representing the value of the checkbox.
<input type="date"> - HTML: Hypertext Markup Language
WebHTMLElementinputdate
among browsers with custom interfaces for selecting dates are chrome and opera, whose data control looks like so: the edge date control looks like: and the firefox date control looks like this: value a domstring representing a date in yyyy-mm-dd format, or empty events change and input supported common attributes autocomplete, list, readonly, and step idl attributes list, value, valueasdate, valueasnumber.
... methods select(), stepdown(), stepup() value a domstring representing the date entered in the input.
<input type="datetime-local"> - HTML: Hypertext Markup Language
value a domstring representing a date and time (in the local time zone), or empty.
... methods select(), stepdown(), stepup() value a domstring representing the value of the date entered into the input.
<input type="file"> - HTML: Hypertext Markup Language
WebHTMLElementinputfile
value a domstring representing the path to the selected file.
... events change and input supported common attributes required additional attributes accept, capture, files, multiple 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).
<input type="hidden"> - HTML: Hypertext Markup Language
WebHTMLElementinputhidden
<input id="prodid" name="prodid" type="hidden" value="xm234jq"> value a domstring representing the value of the hidden data you want to pass back to the server.
... value the <input> element's value attribute holds a domstring that contains the hidden data you want to include when the form is submitted to the server.
<input type="month"> - HTML: Hypertext Markup Language
WebHTMLElementinputmonth
the microsoft edge month control looks like this: value a domstring representing a month and year, or empty.
... 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).
<input type="password"> - HTML: Hypertext Markup Language
WebHTMLElementinputpassword
value a domstring representing a password, or empty events change and input supported common attributes autocomplete, inputmode, maxlength, minlength, pattern, placeholder, readonly, required, and size idl attributes selectionstart, selectionend, selectiondirection, and value methods select(), setrangetext(), and setselectionrange() value the value attr...
...ibute contains a domstring whose value is the current contents of the text editing control being used to enter the password.
<input type="radio"> - HTML: Hypertext Markup Language
WebHTMLElementinputradio
value a domstring representing the value of the radio button.
... events change and input supported common attributes checked and value idl attributes checked and value methods select() value the value attribute is a domstring containing the radio button's value.
<input type="range"> - HTML: Hypertext Markup Language
WebHTMLElementinputrange
value a domstring containing the string representation of the selected numeric value; use valueasnumber to get the value as a number.
... value the value attribute contains a domstring which contains a string representation of the selected number.
<input type="tel"> - HTML: Hypertext Markup Language
WebHTMLElementinputtel
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 ("").
<input type="text"> - HTML: Hypertext Markup Language
WebHTMLElementinputtext
value a domstring representing the text contained in the text field.
... value the value attribute is a domstring that contains the current value of the text entered into the text field.
<input type="week"> - HTML: Hypertext Markup Language
WebHTMLElementinputweek
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.
<link>: The External Resource Link element - HTML: Hypertext Markup Language
WebHTMLElementlink
setting the disabled property in the dom causes the stylesheet to be removed from the document's document.stylesheets list.
... implicit aria role link with href attribute permitted aria roles no role permitted dom interface htmllinkelement specifications specification status comment html living standardthe definition of '<link>' in that specification.
<mark>: The Mark Text element - HTML: Hypertext Markup Language
WebHTMLElementmark
implicit aria role no corresponding role permitted aria roles any dom interface htmlelement attributes this element only includes the global attributes.
...although the death star has been destroyed, <mark class="match">imperial</mark> troops have driven the rebel forces from their hidden base and pursued them across the galaxy.</p> <p>evading the dreaded <mark class="match">imperial</mark> starfleet, a group of freedom fighters led by luke skywalker has established a new secret base on the remote ice world of hoth.</p> to help distinguish the use of <mark> for search results from other potential usage, this example applies the custom class "match" to each match.
<select>: The HTML Select element - HTML: Hypertext Markup Language
WebHTMLElementselect
autocomplete a domstring providing a hint for a user agent's autocomplete feature.
... implicit aria role combobox with no multiple attribute and no size attribute greater than 1, otherwise listbox permitted aria roles menu with no multiple attribute and no size attribute greater than 1, otherwise no role permitted dom interface htmlselectelement specifications specification status comments html living standardthe definition of '<select>' in that specification.
<shadow>: The obsolete Shadow Root element - HTML: Hypertext Markup Language
WebHTMLElementshadow
the html <shadow> element—an obsolete part of the web components technology suite—was intended to be used as a shadow dom insertion point.
... permitted aria roles none dom interface htmlshadowelement attributes this element includes the global attributes.
<span> - HTML: Hypertext Markup Language
WebHTMLElementspan
implicit aria role no corresponding role permitted aria roles any dom interface htmlspanelement (before html5, the interface was htmlelement) attributes this element only includes the global attributes.
... recommendation the dom interface is now htmlspanelement.
<style>: The Style Information element - HTML: Hypertext Markup Language
WebHTMLElementstyle
if you include multiple <style> and <link> elements in your document, they will be applied to the dom in the order they are included in the document — make sure you include them in the correct order, to avoid unexpected cascade issues.
... implicit aria role no corresponding role permitted aria roles no role permitted dom interface htmlstyleelement specifications specification status comment html living standardthe definition of 'style' in that specification.
<template>: The Content Template element - HTML: Hypertext Markup Language
WebHTMLElementtemplate
implicit aria role no corresponding role permitted aria roles no role permitted dom interface htmltemplateelement attributes this element only includes the global attributes.
... however, the htmltemplateelement has a content property, which is a read-only documentfragment containing the dom subtree which the template represents.
data-* - HTML: Hypertext Markup Language
the data-* global attributes form a class of attributes called custom data attributes, that allow proprietary information to be exchanged between the html and its dom representation by scripts.
... note that the htmlelement.dataset property is a domstringmap, and the name of the custom data attribute data-test-value will be accessible via htmlelement.dataset.testvalue (or by htmlelement.dataset["testvalue"]) as any dash (u+002d) is replaced by the capitalization of the next letter, converting the name to camelcase.
slot - HTML: Hypertext Markup Language
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 value matches that slot attribute's value.
... living standard domthe definition of 'slot attribute' in that specification.
Global attributes - HTML: Hypertext Markup Language
data-* forms a class of attributes, called custom data attributes, that allow proprietary information to be exchanged between the html and its dom representation that may be used by scripts.
... 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.
Evolution of HTTP - HTTP
thanks to the host header, the ability to host different domains at the same ip address now allows server colocation.
... during the same time, the need for an encrypted transport layer raised: the web left the relative trustiness of a mostly academic network, to a jungle where advertisers, random individuals or criminals compete to get as much private information about people, try to impersonate them or even to replace data transmitted by altered ones.
Reason: CORS header 'Access-Control-Allow-Origin' missing - HTTP
if the server is under your control, add the origin of the requesting site to the set of domains permitted access by adding it to the access-control-allow-origin header's value.
...private apis should never use *, and should instead have a specific domain or domains set.
CSP: child-src - HTTP
examples: http://*.example.com: matches all attempts to load from any subdomain of example.com using the http: url scheme.
... *.example.com: matches all attempts to load from any subdomain of example.com using the current protocol.
CSP: connect-src - HTTP
examples: http://*.example.com: matches all attempts to load from any subdomain of example.com using the http: url scheme.
... *.example.com: matches all attempts to load from any subdomain of example.com using the current protocol.
CSP: default-src - HTTP
examples: http://*.example.com: matches all attempts to load from any subdomain of example.com using the http: url scheme.
... *.example.com: matches all attempts to load from any subdomain of example.com using the current protocol.
CSP: font-src - HTTP
examples: http://*.example.com: matches all attempts to load from any subdomain of example.com using the http: url scheme.
... *.example.com: matches all attempts to load from any subdomain of example.com using the current protocol.
CSP: form-action - HTTP
examples: http://*.example.com: matches all attempts to load from any subdomain of example.com using the http: url scheme.
... *.example.com: matches all attempts to load from any subdomain of example.com using the current protocol.
CSP: frame-src - HTTP
examples: http://*.example.com: matches all attempts to load from any subdomain of example.com using the http: url scheme.
... *.example.com: matches all attempts to load from any subdomain of example.com using the current protocol.
CSP: img-src - HTTP
examples: http://*.example.com: matches all attempts to load from any subdomain of example.com using the http: url scheme.
... *.example.com: matches all attempts to load from any subdomain of example.com using the current protocol.
CSP: manifest-src - HTTP
examples: http://*.example.com: matches all attempts to load from any subdomain of example.com using the http: url scheme.
... *.example.com: matches all attempts to load from any subdomain of example.com using the current protocol.
CSP: media-src - HTTP
examples: http://*.example.com: matches all attempts to load from any subdomain of example.com using the http: url scheme.
... *.example.com: matches all attempts to load from any subdomain of example.com using the current protocol.
CSP: navigate-to - HTTP
examples: http://*.example.com: matches all attempts to load from any subdomain of example.com using the http: url scheme.
... *.example.com: matches all attempts to load from any subdomain of example.com using the current protocol.
CSP: object-src - HTTP
examples: http://*.example.com: matches all attempts to load from any subdomain of example.com using the http: url scheme.
... *.example.com: matches all attempts to load from any subdomain of example.com using the current protocol.
CSP: prefetch-src - HTTP
examples: http://*.example.com: matches all attempts to load from any subdomain of example.com using the http: url scheme.
... *.example.com: matches all attempts to load from any subdomain of example.com using the current protocol.
CSP: script-src-attr - HTTP
examples: http://*.example.com: matches all attempts to load from any subdomain of example.com using the http: url scheme.
... *.example.com: matches all attempts to load from any subdomain of example.com using the current protocol.
CSP: script-src-elem - HTTP
examples: http://*.example.com: matches all attempts to load from any subdomain of example.com using the http: url scheme.
... *.example.com: matches all attempts to load from any subdomain of example.com using the current protocol.
CSP: script-src - HTTP
examples: http://*.example.com: matches all attempts to load from any subdomain of example.com using the http: url scheme.
... *.example.com: matches all attempts to load from any subdomain of example.com using the current protocol.
CSP: style-src-elem - HTTP
examples: http://*.example.com: matches all attempts to load from any subdomain of example.com using the http: url scheme.
... *.example.com: matches all attempts to load from any subdomain of example.com using the current protocol.
CSP: style-src - HTTP
examples: http://*.example.com: matches all attempts to load from any subdomain of example.com using the http: url scheme.
... *.example.com: matches all attempts to load from any subdomain of example.com using the current protocol.
CSP: worker-src - HTTP
examples: http://*.example.com: matches all attempts to load from any subdomain of example.com using the http: url scheme.
... *.example.com: matches all attempts to load from any subdomain of example.com using the current protocol.
Set-Cookie2 - HTTP
header type response header forbidden header name no syntax set-cookie2: <cookie-name>=<cookie-value> set-cookie2: <cookie-name>=<cookie-value>; comment=<value> set-cookie2: <cookie-name>=<cookie-value>; commenturl=<http-url> set-cookie2: <cookie-name>=<cookie-value>; discard set-cookie2: <cookie-name>=<cookie-value>; domain=<domain-value> set-cookie2: <cookie-name>=<cookie-value>; max-age=<non-zero-digit> set-cookie2: <cookie-name>=<cookie-value>; path=<path-value> set-cookie2: <cookie-name>=<cookie-value>; port=<port-number> set-cookie2: <cookie-name>=<cookie-value>; secure set-cookie2: <cookie-name>=<cookie-value>; version=<version-number> // multiple directives are also possible, for example: set-cookie2: <co...
...okie-name>=<cookie-value>; domain=<domain-value>; secure // multiple cookies are seperated by a comma set-cookie2: <cookie-name>=<cookie-value>, <cookie-name>=<cookie-value>, ...
HTTP Messages - HTTP
WebHTTPMessages
the request target, usually a url, or the absolute path of the protocol, port, and domain are usually characterized by the request context.
... get http://developer.mozilla.org/docs/web/http/messages http/1.1 the authority component of a url, consisting of the domain name and optionally the port (prefixed by a ':'), is called the authority form.
Network Error Logging - HTTP
include_subdomains if true, the policy applies to all subdomains under the origin that the policy header is set.
... the reporting group should also be set to include subdomains, if this option is to be enabled.
An overview of HTTP - HTTP
WebHTTPOverview
though such constraint is a burden to the server, http headers can relax this strict separation on the server side, allowing a document to become a patchwork of information sourced from different domains; there could even be security-related reasons to do so.
... the path of the resource to fetch; the url of the resource stripped from elements that are obvious from the context, for example without the protocol (http://), the domain (here, developer.mozilla.org), or the tcp port (here, 80).
A typical HTTP session - HTTP
WebHTTPSession
the url of a page to fetch contains both the domain name, and the port number, though the latter can be omitted if it is 80.
...an absolute url without the protocol or domain name the http protocol version subsequent lines represent an http header, giving the server information about what type of data is appropriate (e.g., what language, what mime types), or other data altering its behavior (e.g., not sending an answer if it is already cached).
Control flow and error handling - JavaScript
while it is common to throw numbers or strings as errors, it is frequently more effective to use one of the exception types specifically created for this purpose: ecmascript exceptions domexception and domerror throw statement use the throw statement to throw an exception.
... the name property provides the general class of error (such as domexception or error), while message generally provides a more succinct message than one would get by converting the error object to a string.
Character classes - JavaScript
examples looking for a series of digits var randomdata = "015 354 8787 687351 3512 8735"; var regexpfourdigits = /\b\d{4}\b/g; // \b indicates a boundary (i.e.
...do not end matching in the middle of a word) console.table(randomdata.match(regexpfourdigits)); // ['8787', '3512', '8735'] looking for a word (from the latin alphabet) starting with a var aliceexcerpt = "i’m sure i’m not ada,’ she said, ‘for her hair goes in such long ringlets, and mine doesn’t go in ringlets at all."; var regexpwordstartingwitha = /\b[aa]\w+/g; // \b indicates a boundary (i.e.
Date - JavaScript
this date and time is the same as the unix epoch, which is the predominant base value for computer-recorded date and time values.
...(this time is historically known as greenwich mean time, as utc lies along the meridian that includes london—and nearby greenwich—in the united kingdom.) the user's device provides the local time.
Math - JavaScript
math.random() returns a pseudo-random number between 0 and 1.
... returning a random integer between two bounds this can be achieved with a combination of math.random() and math.floor(): function random(min, max) { const num = math.floor(math.random() * (max - min + 1)) + min; return num; } random(1, 10); specifications specification ecmascript (ecma-262)the definition of 'math' in that specification.
String.prototype.anchor() - JavaScript
use dom apis instead.
...use dom apis instead.
this - JavaScript
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 addeventlistener()).
... } // get a list of every element in the document var elements = document.getelementsbytagname('*'); // add bluify as a click listener so when the // element is clicked on, it turns blue for (var i = 0; i < elements.length; i++) { elements[i].addeventlistener('click', bluify, false); } in an inline event handler when the code is called from an inline on-event handler, its this is set to the dom element on which the listener is placed: <button onclick="alert(this.tagname.tolowercase());"> show this </button> the above alert shows button.
Web media technologies
today, there are a large number of apis available, as well as html elements, dom interfaces, and other features that make it possible to not only perform these tasks, but use media in tandem with other technologies to do truly remarkable things.
...<video> can also be used as a way to link media apis with other html and dom technologies, including <canvas> (for frame grabbing and manipulation), for example.
Progressive web app structure - Progressive web apps (PWAs)
viceworker' in navigator) { navigator.serviceworker.register('/pwa-examples/js13kpwa/sw.js'); }; the next code block requests permission for notifications when a button is clicked: var button = document.getelementbyid("notifications"); button.addeventlistener('click', function(e) { notification.requestpermission().then(function(result) { if(result === 'granted') { randomnotification(); } }); }); the last block creates notifications that display a randomly-selected item from the games list: function randomnotification() { var randomitem = math.floor(math.random()*games.length); var notiftitle = games[randomitem].name; var notifbody = 'created by '+games[randomitem].author+'.'; var notifimg = 'data/img/'+games[randomitem].slug+'.jpg'; ...
... var options = { body: notifbody, icon: notifimg } var notif = new notification(notiftitle, options); settimeout(randomnotification, 30000); } the service worker the last file we will quickly look at is the service worker: sw.js — it first imports data from the games.js file: self.importscripts('data/games.js'); next, it creates a list of all the files to be cached, both from the app shell and the content: var cachename = 'js13kpwa-v1'; var appshellfiles = [ '/pwa-examples/js13kpwa/', '/pwa-examples/js13kpwa/index.html', '/pwa-examples/js13kpwa/app.js', '/pwa-examples/js13kpwa/style.css', '/pwa-examples/js13kpwa/fonts/graduate.eot', '/pwa-examples/js13kpwa/fonts/graduate.ttf', '/pwa-examples/js13kpwa/fonts/graduate.woff', '/pwa-examples/js...
Introduction to progressive web apps - Progressive web apps (PWAs)
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.
... it's also easy for users to ensure that they're installing the right app, because its url will match your site's domain.
Structural overview of progressive web apps - Progressive web apps (PWAs)
+= entry; }; document.getelementbyid('content').innerhtml = content; then it registers a service worker: if ("serviceworker" in navigator) { navigator.serviceworker.register("/pwa-examples/js13kpwa/sw.js"); } after that, the app adds a handler for clicks on a button whose id is notifications; this handler requests permission to send notifications to the user, then generates and sends a random notification.
... var button = document.getelementbyid("notifications"); button.addeventlistener('click', function(e) { notification.requestpermission().then(function(result) { if (result === 'granted') { randomnotification(); } }); }); the randomnotification() function follows, rounding out the last of the code in the file: function randomnotification() { var randomitem = math.floor(math.random()*games.length); var notiftitle = games[randomitem].name; var notifbody = 'created by '+games[randomitem].author+'.'; var notifimg = 'data/img/'+games[randomitem].slug+'.jpg'; var options = { body: notifbody, icon: notifimg } var notif = new notification(notiftitle, options); settimeout(randomnotification, 30000); } the service worker the last file we'll briefly look ...
class - SVG: Scalable Vector Graphics
WebSVGAttributeclass
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 svglengthlist or svganimatedlengthlist object.
data-* - SVG: Scalable Vector Graphics
WebSVGAttributedata-*
they let svg markup and its resulting dom share information that standard attributes can't, usually for scripting purposes.
... the svgelement.dataset property is a domstringmap that provides the attribute data-test-value via svgelement.dataset.testvalue.
end - SVG: Scalable Vector Graphics
WebSVGAttributeend
each value can be one of the following: <offset-value> this value defines a clock-value that represents a point in time relative to the beginning of the svg document (usually the load or domcontentloaded event).
...all valid events (not necessarily supported by all elements) are defined by the dom and html specifications.
xml:space - SVG: Scalable Vector Graphics
this attribute influences how browsers parse text content and therefore changes the way the dom is built.
... therefore, changing this attributeʼs value through the dom api may have no effect.
SVG Attribute reference - SVG: Scalable Vector Graphics
WebSVGAttribute
utetype autoreverse azimuth b basefrequency baseline-shift baseprofile bbox begin bias by c calcmode cap-height class clip clippathunits clip-path clip-rule color color-interpolation color-interpolation-filters color-profile color-rendering contentscripttype contentstyletype cursor cx cy d d decelerate descent diffuseconstant direction display divisor dominant-baseline dur dx dy e edgemode elevation enable-background end exponent externalresourcesrequired f fill fill-opacity fill-rule filter filterres filterunits flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight format from fr fx fy g g1 g2 glyph-name glyph-orientation-horizontal glyph-ori...
... alignment-baseline, baseline-shift, clip, clip-path, clip-rule, color, color-interpolation, color-interpolation-filters, color-profile, color-rendering, cursor, direction, display, dominant-baseline, enable-background, fill, fill-opacity, fill-rule, filter, flood-color, flood-opacity, font-family, font-size, font-size-adjust, font-stretch, font-style, font-variant, font-weight, glyph-orientation-horizontal, glyph-orientation-vertical, image-rendering, kerning, letter-spacing, lighting-color, marker-end, marker-mid, marker-start, mask, opacity, overflow, pointer-events, shape-re...
<use> - SVG: Scalable Vector Graphics
WebSVGElementuse
--> </svg> the effect is the same as if the nodes were deeply cloned into a non-exposed dom, then pasted where the use element is, much like cloned template elements in html5.
...css properties are not guaranteed to be inherited by the cloned dom unless you explicitly request them using css inheritance.
Scripting - SVG: Scalable Vector Graphics
WebSVGScripting
setproperty has three parameters the function svgelement.style.setproperty("fill-opacity", "0.0") throws a domexception - syntax err in mozilla.
... this behaviour is specified by the w3c in the dom level 2 style specification.
Basic Example - XSLT: Extensible Stylesheet Language Transformations
figure 6 : example var xslstylesheet; var xsltprocessor = new xsltprocessor(); var mydom; var xmldoc; function init(){ // load the xslt file, example1.xsl var myxmlhttprequest = new xmlhttprequest(); myxmlhttprequest.open("get", "example1.xsl", false); myxmlhttprequest.send(null); xslstylesheet = myxmlhttprequest.responsexml; xsltprocessor.importstylesheet(xslstylesheet); // load the xml file, example1.xml myxmlhttprequest = new xmlhttprequest(); myxmlhttprequ...
...est.open("get", "example1.xml", false); myxmlhttprequest.send(null); xmldoc = myxmlhttprequest.responsexml; var fragment = xsltprocessor.transformtofragment(xmldoc, document); document.getelementbyid("example").innerhtml = ""; mydom = fragment; document.getelementbyid("example").appendchild(fragment); } ...
Understanding WebAssembly text format - WebAssembly
reference types the reference types proposal (supported in firefox 79) provides two main features: a new type, externref, which can hold any javascript value, for example strings, dom references, objects, etc.
...but this is very useful for allowing wasm modules to call javascript functions, dom apis, etc., and generally to pave the way for easier interoperability with the host environment.
2015 MDN Fellowship Program - Archive of obsolete content
who web and mobile developers with an established track record of contributions and expertise in a specific web technology, function or domain who wish to increase the effectiveness of their teaching and communications.
Builder - Archive of obsolete content
it was retired on april 1, 2014, and the "builder.addons.mozilla.org" domain now redirects to this page.
Reddit Example - Archive of obsolete content
event.stoppropagation(); event.preventdefault(); self.port.emit('click', t.tostring()); }); this script uses jquery to interact with the dom of the page and the self.port.emit function to pass urls back to the add-on script.
SDK and XUL Comparison - Archive of obsolete content
if you need more flexibility than the sdk's high-level apis provide, you can use its low-level apis to load xpcom objects directly or to manipulate the dom directly as in a traditional bootstrapped extension.
XUL Migration Guide - Archive of obsolete content
in this section we'll use low-level modules how to: modify the browser chrome using dynamic manipulation of the dom directly access the tabbrowser object modifying the browser chrome this example uses the action button api, which is only available from firefox 29 onwards.
context-menu - Archive of obsolete content
targetname the name of the dom element that the menu was invoked on, in lower-case.
request - Archive of obsolete content
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.
simple-storage - Archive of obsolete content
this module works similarly to dom storage on the web, except that it's only available for add-ons.
High-Level APIs - Archive of obsolete content
page-worker create a permanent, invisible page and access its dom.
content/loader - Archive of obsolete content
this may take one of the following values: "start": load content scripts immediately after the document element for the page is inserted into the dom, but before the dom content itself has been loaded "ready": load content scripts once dom content has been loaded, corresponding to the domcontentloaded event "end": load content scripts once all the content (dom, js, css, images) for the page has been loaded, at the time the window.onload event fires contentscriptoptions read-only value exposed to content scripts under self.options property...
core/promise - Archive of obsolete content
const { reject } = require('sdk/core/promise'); var boom = reject(error('boom!')); future(function() { return math.random() < 0.5 ?
ui/id - Archive of obsolete content
returns string : returns a uuid by default (or domain specific id based on a provided definition).
Release notes - Archive of obsolete content
firefox 31 highlights add-on debugger added the ability to convert between high-level browserwindow objects and dom windows, and between high-level tab objects and xul tabs.
Displaying annotations - Archive of obsolete content
when a page is loaded the matcher searches the dom for elements that match annotations.
Storing annotations - Archive of obsolete content
event.stoppropagation(); event.preventdefault(); self.postmessage(storedannotation.url); }); annotationhtml.find('.selection-text') .text(storedannotation.anchortext); annotationhtml.find('.annotation-text') .text(storedannotation.annotationtext); annotationlist.append(annotationhtml); }); }); it builds the dom for the panel from the array of annotations it is given.
Modifying Web Pages Based on URL - Archive of obsolete content
by default, content scripts are attached after all the content (dom, js, css, images) for the page has been loaded, at the time the window.onload event fires.
Localization - Archive of obsolete content
even within the same language, though, translators should have the freedom to define word order.
Examples and demos from articles - Archive of obsolete content
a shortcut to massively modify the dom this example shows how to create a framework able to modify many properties of dom objects at the same time.
IsDefaultNamespace - Archive of obsolete content
// http://www.w3.org/tr/dom-level-3-core/core.html#node3-isdefaultnamespace // http://www.w3.org/tr/dom-level-3-core/namespaces-algorithms.html#isdefaultnamespacealgo function isdefaultnamespace(node, namespaceuri) { if (node.isdefaultnamespace) { return node.isdefaultnamespace(namespaceuri); } switch (node.nodetype) { case 1: // element_node if (!node.prefix) { return (node.namespaceuri === namespaceuri); } ...
LookupNamespaceURI - Archive of obsolete content
c); addlookupnamespaceuri(element); function addlookupnamespaceuri (type) { if (!type.prototype.lookupnamespaceuri) { type.prototype.lookupnamespaceuri = lookupnamespaceuri; } function lookupnamespaceuri (prefix) { return lookupnamespaceurihelper(this, prefix); } function lookupnamespaceurihelper (node, prefix) { // adapted directly from http://www.w3.org/tr/dom-level-3-core/namespaces-algorithms.html#lookupnamespaceurialgo var i, att, htmlmode = document.contenttype, // mozilla only xmlnspattern = /^xmlns:(.*)$/; switch (node.nodetype) { case 1: // element_node (could also just test for node.element_node, etc., if supported in all browsers) if (node.namespaceuri != null && node.prefix ...
LookupPrefix - Archive of obsolete content
function lookupprefix (node, namespaceuri) { var htmlmode = document.contenttype; // mozilla only // depends on private function _lookupnamespaceprefix() below and on https://developer.mozilla.org/en/code_snippets/lookupnamespaceuri // http://www.w3.org/tr/dom-level-3-core/core.html#node3-lookupnamespaceprefix // http://www.w3.org/tr/dom-level-3-core/namespaces-algorithms.html#lookupnamespaceprefixalgo // (the above had a few apparent 'bugs' in the pseudo-code which were corrected here) if (node.lookupprefix && htmlmode !== 'text/html') { // shouldn't use this in text/html for mozilla as will return null return node.lookupprefix(namespaceuri); ...
SVG General - Archive of obsolete content
svg requires you to use setattributens to add attributes to a newly created svg dom element.
Sidebar - Archive of obsolete content
idth of the sidebar, use the following code: function setsidebarwidth(newwidth) { var mainwindow = window.queryinterface(components.interfaces.nsiinterfacerequestor) .getinterface(components.interfaces.nsiwebnavigation) .queryinterface(components.interfaces.nsidocshelltreeitem) .roottreeitem .queryinterface(components.interfaces.nsiinterfacerequestor) .getinterface(components.interfaces.nsidomwindow); mainwindow.document.getelementbyid("sidebar-box").width=newwidth; } or function setsidebarwidth(newwidth) { window.top.document.getelementbyid("sidebar-box").width=newwidth; } you can also disable the ability to resize it manually, using the mouse, by hiding the sidebar's splitter element.
xml:base support in old browsers - Archive of obsolete content
ng slash on xlink or trailing slash on xml:base, add one in between xmlbase += '/'; } else if (xmlbase.match(/\/$/) && xlink.match(/\/$/)) { xmlbase = xmlbase.substring(0, xmlbase.length-2); // strip off last slash to join with xlink path with slash } // alert(xmlbase + '::' + xlink); } var link = xmlbase + xlink; if (!link.match(scheme)) { // if there is no domain, we'll need to use the current domain var loc = window.location; if (link.indexof('/') === 0 ) { // if link is an absolute url, it should be from the host only link = loc.protocol + '//' + loc.host + link; } else { // if link is relative, it should be from full path, minus the file var dirpath = loc.pathname.substring(0, loc.pathname.lastindexof('/')-1); if (link.lastindexof('...
XML-related code snippets - Archive of obsolete content
how to create a dom tree using xmlhttprequest parsing and serializing xml using xpath jxon (lossless javascript xml object notation) xsl transforms xlink xinclude xml:id xml:base support in old browsers xpointer svg namespaces, or why http://www.mozilla.org/keymaster/gat...re.is.only.xul is at the top of every xul document.
Communication between HTML and your extension - Archive of obsolete content
there were only a handful of events that seemed relevant (load, change, dominsertnode, dominsertnodeintodocument, domactivate) and i tried them all in many different ways.
Creating custom Firefox extensions with the Mozilla build system - Archive of obsolete content
let freedom reign!
Displaying web content in an extension without security issues - Archive of obsolete content
it is much easier to use dom manipulation methods that won’t have unexpected side-effects.
Enhanced Extension Installation - Archive of obsolete content
this should prevent against random file deletions and allow developers to easily reset their state by deleting one of the required system files.
Inline options - Archive of obsolete content
for example: var observer = { observe: function(asubject, atopic, adata) { if (atopic == "addon-options-displayed" && adata == "my_addon@my_domain") { var doc = asubject; var control = doc.getelementbyid("myaddon-pref-control"); control.value = "test"; } } }; services.obs.addobserver(observer, "addon-options-displayed", false); // don't forget to remove your observer when your add-on is shut down.
Chapter 6: Firefox extensions and XUL applications - Archive of obsolete content
if you just start poking through the source code at random, you may not find much of anything.
Adding sidebars - Archive of obsolete content
even handling the construction of a tree using javascript and dom functions can become very convoluted, which is why trees are better used along with templates.
Getting Started with Firefox Extensions - Archive of obsolete content
the mozilla add-ons repository (amo) holds an extensive number of extensions with a wide variety of functions: content filtering (adblock plus, noscript), web application interaction (delicious bookmarks, ebay companion) and web development (dom inspector, firebug).
Handling Preferences - Archive of obsolete content
you can use the hidden dom window in non-chrome code.
Local Storage - Archive of obsolete content
« previousnext » note: you may rather be looking for dom storage (localstorage, etc.), unless you really are doing xul development.
XPCOM Objects - Archive of obsolete content
void addobserver(in string adomain, in nsiobserver aobserver, in boolean aholdweak); luckily, you don't have to do anything special if you want to register your js object as a preference observer.
XUL School Tutorial - Archive of obsolete content
andling preferences local storage advanced topics the box model xpcom objects observer notifications custom xul elements with xbl mozilla documentation roadmap useful mozilla community sites appendices appendix a: add-on performance appendix b: install and uninstall scripts appendix c: avoiding using eval in add-ons appendix d: loading scripts appendix e: dom building and html insertion appendix f: monitoring dom changes the xul school project was developed by appcoast (formerly glaxstar).
Performance best practices in extensions - Archive of obsolete content
avoid dom mutation event listeners dom mutation event listeners are extremely expensive and, once added to a document even briefly, significantly harm its performance.
Signing an XPI - Archive of obsolete content
i found mine in c:\documents and settings\tj\application data\mozilla\firefox\profiles\xxxxxxxx.default\ where xxxxxxxx is a random string of characters.
Firefox addons developer guide - Archive of obsolete content
the stuff about installing the dom inspector (https://developer.mozilla.org/en/firefox_addons_developer_guide/let%27s_build_a_firefox_extension#install_the_dom_inspector) is not accurate for firefox 3 or later, since it's no longer included in the firefox installer and must be downloaded from amo.
Updating addons broken by private browsing changes - Archive of obsolete content
if your code refers to any of the following interfaces: ff 15: nsidomstoragemanager ff 16: nsitransferable ff 18: imgicache moziasyncfavicons nsifaviconservice nsiwebbrowserpersist ff 19: nsicontentprefservice nsidownloadmanager nsidownload nsihttpauthmanager nsistricttransportsecurityservice ff 20: nsiprivatebrowsingservice nsirecentbadcertservice furthermore, if your code uses any of these common chrome apis: ff 19: saveurl saveinternal openlinkin ff 20: openbrowserwindow gprivatebrowsingui finally, if ...
Using the Stylesheet Service - Archive of obsolete content
the stylesheets registered with this api apply to all documents; firefox 18 extended nsidomwindowutils with loadadditionalstylesheet() and removeadditionalstylesheet() to manage stylesheets for a specific document (bug 737003).
Adding preferences to an extension - Archive of obsolete content
the last thing the startup() method does is to call the window.setinterval() dom method to set up a callback that will automatically run our refreshinformation() method every 10 minutes.
Creating reusable content with CSS and XBL - Archive of obsolete content
use the dom inspector tool to inspect the document, revealing the added content.
XML data - Archive of obsolete content
other technologies can modify the structure of the display—for example, xbl can add content, and javascript can modify the dom.
XUL user interfaces - Archive of obsolete content
challenge use the dom inspector tool to examine the date textbox.
CSS3 - Archive of obsolete content
it consists mainly in allowing nested at-rules inside @media and the adding of a new css at-rule, @supports, and a new dom method css.supports().
Case Sensitivity in class and id Names - Archive of obsolete content
in the authoring of both css and javascript/dom (otherwise known as dhtml) routines, it is a near-certainty that class and id names will be used to identify elements.
Creating a status bar extension - Archive of obsolete content
starting with firefox 1.5, however, you should use a string in the form extension-name@creator-domain.
cached - Archive of obsolete content
general info specification offline interface event bubbles no cancelable no target applicationcache default action none properties property type description target eventtarget (dom element) the event target (the topmost target in the dom tree).
checking - Archive of obsolete content
general info specification offline interface event bubbles no cancelable no target applicationcache default action none properties property type description target eventtarget (dom element) the event target (the topmost target in the dom tree).
downloading - Archive of obsolete content
general info specification offline interface event bubbles no cancelable no target applicationcache default action none properties property type description target eventtarget (dom element) the event target (the topmost target in the dom tree).
error - Archive of obsolete content
general info specification offline interface event bubbles no cancelable no target applicationcache default action none properties property type description target eventtarget (dom element) the event target (the topmost target in the dom tree).
noupdate - Archive of obsolete content
general info specification offline interface event bubbles no cancelable no target applicationcache default action none properties property type description target eventtarget (dom element) the event target (the topmost target in the dom tree).
obsolete - Archive of obsolete content
general info specification offline interface event bubbles no cancelable no target applicationcache default action none properties property type description target eventtarget (dom element) the event target (the topmost target in the dom tree).
progress - Archive of obsolete content
general info specification offline interface progressevent bubbles no cancelable no target applicationcache default action none properties property type description target eventtarget (dom element) the event target (the topmost target in the dom tree).
updateready - Archive of obsolete content
general info specification offline interface event bubbles no cancelable no target applicationcache default action none properties property type description target eventtarget (dom element) the event target (the topmost target in the dom tree).
Events - Archive of obsolete content
archived event pages domsubtreemodifiedmozaudioavailablemozbeforeresizemozorientationcachedchargingchangechargingtimechangecheckingdischargingtimechangedownloadingerrorlevelchangenoupdateobsoleteprogressupdateready ...
List of Former Mozilla-Based Applications - Archive of obsolete content
file delivery (email attachment replacement) site not updated since 2006 compuserve client internet software no longer available doczilla sgml/xml/html browser last release on site from july 2005 fabula language learning application inactive galeon browser last news item on site from september 2006 gencatrss rss reader domain switched over to domain parking service ghostzilla browser archived version of ghostzilla site from 2005 homebase desktop operating environment for internet computers no longer available hp printer assistant printer utility hall of fame page mentions that this used an embedded version of mozilla at some point but i can't find reference to current st...
cert_override.txt - Archive of obsolete content
domainname:port : port 443 for https (ssl) hash algorithm oid sha1-256: oid.2.16.840.1.101.3.4.2.1 (most used) sha-384: oid.2.16.840.1.101.3.4.2.2 sha-512: oid.2.16.840.1.101.3.4.2.3 certificate fingerprint using previous hash algorithm one or more characters for override type: m : allow mismatches in the hostname u : allow untrusted certs (whether it's self signed cert or a missing or invalid is...
Notes on HTML Reflow - Archive of obsolete content
incremental, when something in the frame tree changes; for example, when more content is read from the network, or some script manipulates the dom.
Same-origin policy for file: URIs - Archive of obsolete content
for cross-window dom access, each file is treated as a separate origin, with one exception: if a file is loaded from another file that would otherwise be able to load it following this same-origin policy, they are considered to have the same origin.
Autodial for Windows NT - Archive of obsolete content
essentially, if some address at domain.com is in the database, then any address at domain.com is considered to be in the database.
How Mozilla finds its configuration files - Archive of obsolete content
mozilla includes a profile manager, but unfortunately this always include a random part (salt) into the profile's filename, and thus cannot be used to point mozilla to a profile of the our chosing.
Blackwood - Archive of obsolete content
active subprojects webclient java dom api java pluglet api defunct subprojects blackconnect -- blackconnect was superseeded by javaxpcom ...
Bookmark Keywords - Archive of obsolete content
the quickest way to start is to simply look up any random bug in the bugzilla system-- the actual number doesn't matter.
Enabling the behavior - retrieving tinderbox status - Archive of obsolete content
although it is designed to retrieve xml content and parse it into a dom, it can retrieve (but not parse) other kinds of content as well.
Making it into a static overlay - Archive of obsolete content
when navigator.xul is rendering into the browser's application interface, this causes any attributes or child elements of the statusbar element in the overlay file to be added to the interface's dom and thus show up in the interface as if they were defined on the same element in navigator.xul.
Prerequisites - Archive of obsolete content
you should also understand tag-based languages like html as well as basic javascript, css, and the dom.
Getting Started - Archive of obsolete content
setup download the latest version of mozilla, install it (install the dom inspector as well), and select the classic skin.
Creating a Skin for Firefox/Getting Started - Archive of obsolete content
be sure to install the dom inspector extension as well.
Drag and Drop Example - Archive of obsolete content
xul doesn't handle it and just ignores it, but we can still retrieve it with the dom's getattribute function.
Drag and Drop - Archive of obsolete content
sourcenode the dom node where the drag started.
Embedding Mozilla in a Java Application using JavaXPCOM - Archive of obsolete content
iwindowcreator.ns_iwindowcreator_iid); // get the window watcher service nsiwindowwatcher windowwatcher = (nsiwindowwatcher)servicemanager.getservicebycontractid("@mozilla.org/embedcomp/window-watcher;1", nsiwindowwatcher.ns_iwindowwatcher_iid); // set the window creator (from step 6) windowwatcher.setwindowcreator(windowcreator); // create the root xul window: nsidomwindow win = windowwatcher.openwindow(null, "chrome://your-app/content/window.xul", "mywindow", "chrome,resizable,centerscreen", null); // set this as the active window windowwatcher.setactivewindow(win); // hand over the application to xpcom/xul, this will block: appstartup.run(); here is an example of a locationprovider that works : public class locationprovider i...
Code snippets - Archive of obsolete content
eryinterface(components.interfaces.nsiinterfacerequestor) .getinterface(components.interfaces.nsiwebnavigation) .queryinterface(components.interfaces.nsidocshelltreeitem) .roottreeitem .queryinterface(components.interfaces.nsiinterfacerequestor) .getinterface(components.interfaces.nsidomwindow); // obtain a reference to sync's tabs "engine." let tabsengine = weave.service.enginemanager.get("tabs"); // iterate over each client having data.
HTTP Class Overview - Archive of obsolete content
by a transaction strips chunked transfer encoding nshttprequesthead owns a nshttpheaderarray knows how to fill a request buffer nshttpresponsehead owns a nshttpheaderarray knows how to parse response lines performs common header manipulations/calculations nshttpheaderarray stores http "<header>:<value>" pairs nshttpauthcache stores authentication credentials for http auth domains nshttpbasicauth implements nsihttpauthenticator generates basic auth credentials from user:pass nshttpdigestauth implements nsihttpauthenticator generates digest auth credentials from user:pass original document information author(s): darin fisher last updated date: august 5, 2002 copyright information: portions of this content are © 1998–2007 by individual mozilla.org ...
Content - Archive of obsolete content
execute callbacks when certain pages are opened siteboost allows a jetpack to empower a domain with extended abilities beyond those native to web pages ...
Mozilla Application Framework - Archive of obsolete content
dom inspector a tool for inspecting and editing the structure and widgets of your user interface while your application is running.
Plugin Architecture - Archive of obsolete content
sequence of events in content a content node for a plugin dom element gets created in bindtotree (usually) or another function, it calls loadobject loadobject either notices directly that it is dealing with a plugin, or it starts a network request and notices this in onstartrequest when it realizes that, it tries to create a frame, if anotify is true and no frame exists yet if a frame exists now, it is asked to instantiate the plugin that was the norma...
Hacking wiki - Archive of obsolete content
random tips you can set the file to log by putting something like this in your localsettings.php: $wgdebuglogfile = 'c:\\123'; you can then use wfdebug() function to write to the log.
Remote XUL - Archive of obsolete content
this also means you can't load xul using file:// urls unless you set the preference dom.allow_xul_xbl_for_file to true.
Frequently Asked Questions - Archive of obsolete content
however, mozilla's implementation already supports some things that adobe's lacks, particularly parts of the xml and svg doms.
Same origin policy for XBL - Archive of obsolete content
for the nsidomdocumentxbl interface's nsidomdocumentxbl.addbinding() and nsidomdocumentxbl.loadbindingdocument() methods, the originating principal is the one of the script making the call, or the principal of the document the call is made on if there isn't a script.
Supporting per-window private browsing - Archive of obsolete content
detecting private browsing mode determining whether or not a given dom window is private is simple: import resource://gre/modules/privatebrowsingutils.jsm and use privatebrowsingutils.iswindowprivate(window).
Running Tamarin acceptance tests - Archive of obsolete content
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 finished --ascargs= : additional arguments to pass to asc.jar --vmargs= : additional arguments to pass to avmshell --random : run tests in random order --timeout : max time for testrun --verify : run a verify pass instead of running abcs --verifyonly : run a -dverifyonly pass: only checks test exitcode (only works with debugger vms) testing the android shell the instructions above apply to running tests on an android device as well, but with a few differences.
Running Tamarin performance tests - Archive of obsolete content
args to pass to vm --timeout max time to run all tests --testtimeout max time to let a test run, in sec (default -1 = never timeout) --html also create an html output file --notimecheck do not recompile .abc if timestamp is older than .as --java location of java executable (default=java) --javaargs arguments to pass to java --random run tests in random order --seed explicitly specify random seed for --random -s --avm2 second avmplus command to use --avmname nickname for avm to use as column header --avm2name nickname for avm2 to use as column header --detail display results in 'old-style' format --raw output all raw test values -i --iterations number...
The life of an HTML HTTP request - Archive of obsolete content
these element nodes implement the nsihtmlcontent interface as well as their respective dom interfaces.
URIScheme - Archive of obsolete content
and the size number by 1 to 127 mailto:emailaddress@domain.com about: chrome:// ...
Video presentations - Archive of obsolete content
how pages are built using the dom this presentation describes how documents are loaded and the dom tree is constructed.
Mozilla Web Developer Community - Archive of obsolete content
newsgroups, mailing lists, and forums by topic: css - mozilla.dev.tech.css dom - mozilla.dev.tech.dom html - mozilla.dev.tech.html plugins - mozilla.dev.tech.plugins xml - mozilla.dev.tech.xml documentation - see mdc:community more at http://www.mozilla.org/community/dev...er-forums.html mozillazine forums mozilla news and development help mozilla (testing and development) mozdev.org mozillazine planet mozilla spread firefox standards communities get involved in grass-roots web standards evangelism efforts through these groups: the web standards project, a grassroots coalition fighting for standards maccaws, making a commercial...
Binding Implementations - Archive of obsolete content
because bindings extend dom elements, they can override any built-in methods or properties on the dom element.
Example Sticky Notes - Archive of obsolete content
you add a binding file using -moz-binding style rule and you address a particular binding by its id: -moz-binding: url(notes.xml#default) this id is local within the binding file (not visible in the target document dom tree).
XBL - Archive of obsolete content
still living "shadow dom" related specs shadow dom (editor's draft) css scoping » shadow encapsulation see also introduction to xbl from the xul tutorial.
Using XPInstall to Install Plugins - Archive of obsolete content
often, the smartupdate download was triggered via the pluginurl attribute of the embed tag: <embed type="application/x-randomtype" src="myfile.typ" width="50" height="50" pluginurl="http://mytypecompany.xyz/jarpacks/mytypeplugin.jar"></embed> in the example above, the pluginurl attribute points to the signed jar file, which netscape communicator 4.x would then download (subject to the security dialog boxes) if the plugin was not located on the user's machine.
toString - Archive of obsolete content
to get the version number out of an installversion object in order to compare it with other versions, you can call tostring() and get back the version as a string in the format "maj.min.rev.bld." example var vi = new installversion(); vi.init("999.888.777.666"); //random string vistring = vi.tostring(); ...
XPJS Components Proposal - Archive of obsolete content
the standard (non-dom) js classes will be available.
Mozilla E4X - Archive of obsolete content
another e4x feature: the ability to bind a w3c dom document to a new xml object, reflecting the dom in e4x terms so that updates to either the dom or the e4x object hierarchy show up in the other.
XTech 2005 Presentations - Archive of obsolete content
another e4x feature: the ability to bind a w3c dom document to a new xml object, reflecting the dom in e4x terms so that updates to either the dom or the e4x object hierarchy show up in the other.
autocompletesearch - Archive of obsolete content
mydomain new in thunderbird 3 requires seamonkey 2.0 the user's email domain is suggested.
checkState - Archive of obsolete content
constants for the possible values for this attribute are in the nsidomxulbuttonelement interface.
currentset - Archive of obsolete content
it might not be equal the value of the currentset property which is computed from the actual dom ...
datasources - Archive of obsolete content
when the xul document is contained on a remote web site, the datasources may only be loaded from the same domain as the document.
flags - Archive of obsolete content
this results in a performance enhancement, but you will not be able to use the dom functions to retrieve the tree rows.
id - Archive of obsolete content
ArchiveMozillaXULAttributeid
you can use this as a parameter to getelementbyid() and other dom functions and to reference the element in style sheets.
menuactive - Archive of obsolete content
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.
onclick - Archive of obsolete content
example <image src="hello.png" onclick="alert('hi')"/> see also click dom element ...
setfocus - Archive of obsolete content
see also dom element focus ...
sizemode - Archive of obsolete content
listen to the sizemodechange event dispatched to the dom window to get notified when the window state changes.
How to implement a custom XUL query processor component - Archive of obsolete content
here is our sample javascript xpcom query processor: components.utils.import("resource://gre/modules/xpcomutils.jsm"); // basic wrapper for nsixultemplateresult function templateresult(adata) { this._data = adata; // just make a random number for the id this._id = math.random(100000).tostring(); } templateresult.prototype = { queryinterface: xpcomutils.generateqi([components.interfaces.nsixultemplateresult]), // private storage _data: null, // right now our results are flat lists, so no containing/recursion take place iscontainer: false, isempty: true, mayprocesschildren: false, resource: null, type: "sim...
List of commands - Archive of obsolete content
list of commands (grouped by type) nsdomwindowcontroller commands (generally legal when there is a selection): cmd_copy - copy a selection to the clipboard cmd_cut - cut a selection into the clipboard cmd_paste - paste a selection from the clipboard cmd_selectall cmd_selectnone cmd_copylink cmd_copyimagelocation cmd_copyimagecontents cmd_scrolltop cmd_scrollbottom cmd_scrollpageup cmd_scrollpagedown cmd_scrolllineup cmd_scrolllinedown cmd_scrollleft cmd_scrollright cmd_selectcharprevious cmd_selectcharnext cmd_wordprevious cmd_wordnext cmd_selectwordprevious cmd_selectwordnext cmd_beginline cmd_endline cmd_selectbeginline cmd_selectendline cmd_selectlinepr...
appendCustomToolbar - Archive of obsolete content
the method returns the dom element for the created toolbar.
insertItem - Archive of obsolete content
the method returns the dom element for the created item.
Other Resources - Archive of obsolete content
(zipped version) gecko dom reference ...
OpenClose - Archive of obsolete content
the openpopup method is defined as follows: void openpopup(in domelement anchorelement, in string position, in long x, in long y, in boolean iscontextmenu, in boolean attributesoverride); first an example: somepopup.openpopup(anchor, "after_start", 0, 0, false, false); this example will open a popup located just underneath another element referenced by 'anchor'.
anchorNode - Archive of obsolete content
« xul reference anchornode type: nsidomelement this read-only property holds the dom node that was specified as the anchor when opening the popup.
contentWindow - Archive of obsolete content
« xul reference contentwindow type: todo use the contentwindow.wrappedjsobject to obtain a dom(html) window object ...
preferenceElements - Archive of obsolete content
« xul reference preferenceelements type: dom nodelist holds a list of the ui elements in the pane that are attached to preferences.
preferencePanes - Archive of obsolete content
« xul reference preferencepanes type: dom nodelist holds a list of all the prefpane elements in the window.
prefpane.preferences - Archive of obsolete content
« xul reference preferences type: dom nodelist holds a list of the preference elements in the pane.
triggerNode - Archive of obsolete content
« xul reference triggernode type: nsidomnode this read-only property holds the dom node that generated the event triggering the opening of the popup.
wizardPages - Archive of obsolete content
« xul reference wizardpages type: dom nodelist of wizardpage elements this property holds the list of wizardpage elements in the wizard.
Sorting and filtering a custom tree view - Archive of obsolete content
this will not work for other types of trees, for example rdf-backed or ones created with dom methods.
Actions - Archive of obsolete content
after all the results have been examined, the dom tree will look like the following: <vbox datasources="http://www.xulplanet.com/ds/sample.rdf" ref="http://www.xulplanet.com/rdf/a"> <template> <query> <content uri="?start"/> <triple subject="?start" predicate="http://www.xulplanet.com/rdf/relateditem" object="?relateditem"/> </query> <action> <button uri="?relateditem" label="?
Attribute Substitution - Archive of obsolete content
however, the textnode element is not copied into the generated content, but instead a dom text node is created with the value of the value attribute as its contents.
Filtering - Archive of obsolete content
this can be done by modifying the dom nodes inside the query and rebuilding the template.
Template Builder Interface - Archive of obsolete content
the builder property is a property of the nsidomxulelement interface, so all xul elements will have this property, although, as mentioned earlier, is will be set to null for most elements.
Template Logging - Archive of obsolete content
for other datasources, this may be a somewhat random value.
XML Assignments - Archive of obsolete content
however, you cannot use a expression that returns a number in the query, as the query must return dom nodes as results.
The Joy of XUL - Archive of obsolete content
applications written in xul are based on additional w3c standard technologies featuring html 4.0; cascading style sheets (css) 1 and 2; document object model (dom) levels 1 and 2; javascript 1.5, including ecma-262 edition 3 (ecmascript); xml 1.0.
Toolbars - Archive of obsolete content
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) ...
Creating a Window - Archive of obsolete content
note: the local xul document can be opened in the browser as mentioned above only if |dom.allow_xul_xbl_for_file| preference in "about:config" has been set to |true| .
Groupboxes - Archive of obsolete content
this could be used to add extra elements within the structure, such as in the following example: example 3 : source view <radiogroup> <radio id="no" value="no" label="no number"/> <radio id="random" value="random" label="random number"/> <hbox> <radio id="specify" value="specify" label="specify number:"/> <textbox id="specificnumber"/> </hbox> </radiogroup> note that the radiogroup element does not draw a border around it.
Stack Positioning - Archive of obsolete content
you can use the dom functions to move the order of the elements around.
Stacks and Decks - Archive of obsolete content
more on this in the section on events and the dom.
Trees and Templates - Archive of obsolete content
you can see the difference by using mozilla's dom inspector on a tree with and without the flag.
XPCOM Interfaces - Archive of obsolete content
the syntax of a contract id is: @<internetdomain>/module[/submodule[...]];<version>[?<name>=<value>[&<name>=<value>[...]]] other components can be referred to in a similar way.
XUL Structure - Archive of obsolete content
document types: html xml xul css mozilla uses a distinctly different kind of document object (dom) for html and xul, although they share much of the same functionality.
XUL Changes for Firefox 1.5 - Archive of obsolete content
bfcache mozilla now caches the page's dom, so that navigating back and forward does not reload the page, making navigation much more efficient.
XUL accessibility tool - Archive of obsolete content
improve tool along the way add checking tool to dom inspector or other popular xul debugging tools.
browser - Archive of obsolete content
contentwindow type: todo use the contentwindow.wrappedjsobject to obtain a dom(html) window object currenturi type: nsiuri this read-only property contains the currently loaded url.
checkbox - Archive of obsolete content
aultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related interfaces nsiaccessibleprovider, nsidomxulcheckboxelement ...
colorpicker - Archive of obsolete content
, insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related interfaces nsidomxulcontrolelement bugs the onchange event only fires if attribute type is set to "button".
datepicker - Archive of obsolete content
, insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related interfaces nsidomxulcontrolelement ...
editor - Archive of obsolete content
contentwindow type: todo use the contentwindow.wrappedjsobject to obtain a dom(html) window object docshell type: nsidocshell this read-only property contains the nsidocshell object for the document.
iframe - Archive of obsolete content
contentwindow type: todo use the contentwindow.wrappedjsobject to obtain a dom(html) window object docshell type: nsidocshell this read-only property contains the nsidocshell object for the document.
image - Archive of obsolete content
ArchiveMozillaXULimage
interfaces nsiaccessibleprovider nsidomxulimageelement ...
listbox - Archive of obsolete content
related elements listcell, listcol, listcols, listhead, listheader, listitem interfaces nsiaccessibleprovider, nsidomxulmultiselectcontrolelement ...
listitem - Archive of obsolete content
related elements listbox, listcell, listcol, listcols, listhead, listheader interfaces nsiaccessibleprovider, nsidomxulselectcontrolitemelement ...
menuitem - Archive of obsolete content
related elements menu, menubar, menulist, menupopup, menuseparator interfaces nsiaccessibleprovider, nsidomxulcontaineritemelement, nsidomxulselectcontrolitemelement ...
menulist - Archive of obsolete content
related elements menu, menubar, menuitem, menupopup, menuseparator interfaces nsiaccessibleprovider, nsidomxulmenulistelement ...
menuseparator - Archive of obsolete content
okupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements menu, menubar, menuitem, menulist, menupopup interfaces nsiaccessibleprovider, nsidomxulcontaineritemelement, nsidomxulselectcontrolitemelement ...
panel - Archive of obsolete content
ArchiveMozillaXULpanel
related interfaces nsiaccessibleprovider, nsidomxulpopupelement ...
preferences - 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 void firechangedevent(in domelement preference); creates and dispatches a changed (non-bubbling) event to the specified preference element.
prefwindow - Archive of obsolete content
preferencepanes type: dom nodelist holds a list of all the prefpane elements in the window.
radio - Archive of obsolete content
ArchiveMozillaXULradio
enode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements radiogroup, checkbox interfaces nsiaccessibleprovider, nsidomxulselectcontrolitemelement, nsidomxullabeledcontrolelement ...
radiogroup - Archive of obsolete content
related interfaces nsiaccessibleprovider, nsidomxulselectcontrolelement ...
richlistbox - Archive of obsolete content
related interfaces nsiaccessibleprovider, nsidomxulmultiselectcontrolelement ...
richlistitem - Archive of obsolete content
aultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related interfaces nsiaccessibleprovider, nsidomxulselectcontrolitemelement ...
scale - Archive of obsolete content
ArchiveMozillaXULscale
related interfaces nsidomxulcontrolelement ...
tab - Archive of obsolete content
ArchiveMozillaXULtab
interfaces nsiaccessibleprovider, nsidomxulselectcontrolitemelement ...
tabbrowser - Archive of obsolete content
contentwindow type: todo use the contentwindow.wrappedjsobject to obtain a dom(html) window object currenturi type: nsiuri this read-only property contains the currently loaded url.
tabs - Archive of obsolete content
ArchiveMozillaXULtabs
interfaces nsiaccessibleprovider, nsidomxulselectcontrolelement ...
textbox - Archive of obsolete content
ine="true" rows="2" cols="70" onkeypress="return pncountnotechars(event);"/> the javascript: function pncountnotechars(evt) { //allow non character keys (delete, backspace and and etc.) if ((evt.charcode == 0) && (evt.keycode != 13)) return true; if (evt.target.value.length < 10) { return true; } else { return false; } } related interfaces nsiaccessibleprovider, nsidomxultextboxelement ...
timepicker - Archive of obsolete content
insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related interfaces nsidomxulcontrolelement ...
toolbar - Archive of obsolete content
the method returns the dom element for the created item.
toolbox - Archive of obsolete content
the method returns the dom element for the created toolbar.
tooltip - Archive of obsolete content
the tooltip text is set according to the dom element in the browser that the user hovered over.
wizard - Archive of obsolete content
wizardpages type: dom nodelist of wizardpage elements this property holds the list of wizardpage elements in the wizard.
XUL - Archive of obsolete content
#xul on irc.mozilla.org tools xul online live editor (copy & paste snippets from here and run them) xul explorer (a lightweight xul ide) xulexplorer (patched version of xul explorer) extension developer's extension (featuring a live xul editor) xulref sidebar firebug dom inspector spket ide, ide for xul/xbl ample sdk, (cross-browser xul renderer in javascript/html) view all...
Getting started with XULRunner - Archive of obsolete content
*/ pref("browser.dom.window.dump.enabled", true); pref("javascript.options.showinconsole", true); pref("javascript.options.strict", true); pref("nglayout.debug.disable_xul_cache", true); pref("nglayout.debug.disable_xul_fastload", true); xulrunner specific preferences include: toolkit.defaultchromeuri specifies the default window to open when the application is launched.
What XULRunner Provides - Archive of obsolete content
the following features are either already implemented or planned: gecko features xpcom networking gecko rendering engine dom editing and transaction support (no ui) cryptography xbl (xbl2 planned) xul svg xslt xml extras (xmlhttprequest, domparser, etc.) web services (soap) auto-update support (not yet complete) type ahead find toolbar history implementation (the places implementation in the 1.9 cycle) accessibility support ipc services for communication between gecko-based apps (not yet complete) storage/sqlite interfaces user interface features the following user interface is supplied by xu...
toolkit.defaultChromeFeatures - Archive of obsolete content
see also: xulrunner:specifying startup chrome window, dom:window.open, toolkit.defaultchromeuri, toolkit.singletonwindowtype.
xulauncher - Archive of obsolete content
">$xulappini # create chrome.manifest file ############################################################################## echo " content $xulname file:$xulname/ ">$xulmanifest # create prefs.js file ############################################################################## echo " pref(\"toolkit.defaultchromeuri\", \"chrome://$xulname/content/$xulfile\"); /* debugging prefs */ pref(\"browser.dom.window.dump.enabled\", true); pref(\"javascript.options.showinconsole\", true); pref(\"javascript.options.strict\", true); pref(\"nglayout.debug.disable_xul_cache\", true); pref(\"nglayout.debug.disable_xul_fastload\", true); ">$xulprefs # copy xul file to right location and run it ############################################################################## cp $xulfile $xuldir xulrunner $xulap...
XUL Explorer - Archive of obsolete content
support attribute value checking where appropriate (boolean and enumerated values) - xul checker support “best practice” checks such as: using of commands and keys, strings in dtds and so on - xul checker multi-tabbed editor support support wizards to generate common projects - extensions support extension testing using firefox extension test mode venkman support dom inspector support future: support more “best practice” checks such as: more a11y checks, strings in dtds and so on - xul checker allow users to add snippets on the fly add sidebars for more functionality - property sidebar and project sidebar support wizards to generate common projects - xul files, js xpcom, and xulrunner applications for more detailed information, see the xul_explo...
Mozilla release FAQ - Archive of obsolete content
mozilla has (at least) the following new features: xml support a highly configurable appearance (courtesy of xul) publicly available source code :) http compression exists on more platforms mathml support (somewhat limited at the moment) a significantly faster rendering engine better html support (css 1 and partial css 2, dom 1 and partial dom 2) plug-in jvm support tabbed browsing message filtering an irc client why is the animated icon different?
2006-11-10 - Archive of obsolete content
thunderbird doesn't seem to have an option to set the client domain name (elho/helo).
2006-11-17 - Archive of obsolete content
nickolay ponomarev lets us know that processing instructions are now added to xul document's dom this also means, you can no longer use document.firstchild in xul scripts to get the root element of a xul document and the xml-stylesheet and xul-overlay processing instructions outside the prolog no longer have any effect peter.sei...@gmail.com runs into some difficulties deploying xulrunner 1.8 on os x?
2006-10-27 - Archive of obsolete content
cross-domain testing - someone is suggesting that there needs to be some way of running cross-domain tests (security, web compat, etc), and is wondering if it's possible with the current test http server?
2006-10-06 - Archive of obsolete content
discussions protocol handlers boris zbarsky posed the question, should random webpages have access to the following protocols: feed, pcast, moz-bookmark, webcal, swebcal.
2006-09-29 - Archive of obsolete content
discussions discussion on how the firefox 1.5.0.7 dom generates xhtml inline elements using wordpress.
2006-10-27 - Archive of obsolete content
multiple presshells discussion on why current interfaces allow for multiple presshells and how the relationships work for the following objects: docshell, presshell, prescontext, document, domwindow, widget, docshell and contentviewer.
2006-11-17 - Archive of obsolete content
summary: mozilla.dev.tech.xul - nov 11-nov 17, 2006 return to mozilla-dev-tech-xul announcements processing instructions are now added to xul document's dom on november 12, 2006, nickolay ponomarev announces the results of the recently fixed bug 319654.
NPAPI plugin developer guide - Archive of obsolete content
a paint message making a plug-in opaque making a plug-in transparent creating pop-up menus and dialog boxes event handling for windowless plug-ins streams receiving a stream telling the plug-in when a stream is created telling the plug-in when a stream is deleted finding out how much data the plug-in can accept writing the stream to the plug-in sending the stream in random-access mode sending the stream in file mode sending a stream creating a stream pushing data into the stream deleting the stream example of sending a stream urls getting urls getting the url and displaying the page posting urls posting data to an http server uploading files to an ftp server sending mail memory allocating and freeing memory mac o...
NPN_GetAuthenticationInfo - Archive of obsolete content
this function allows the plugin to ask the browser for http authentication information for a domain.
NPN_RequestRead - Archive of obsolete content
if the stream is not inherently seekable, the stream must have been put in np_seek mode initially (since the browser must cache all the stream data on disk in order to access it randomly).
Adobe Flash - Archive of obsolete content
in general, to invoke a macromedia-defined method on a flash animation in netscape gecko browsers: use dom methods to get a handle to the html element that spawns the plugin.
Shipping a plugin as a Toolkit bundle - Archive of obsolete content
you should aim to use a domain-name that you own and then your own unique short-name for the plugin before the @.
.htaccess ( hypertext access ) - Archive of obsolete content
common application url redirects & rewrite: htaccess files are often used to redirect traffic to a web page to another or from traffic to a directory to another even between domains is possible.
TCP/IP Security - Archive of obsolete content
this layer sends and receives data for particular applications, such as domain name system (dns), hypertext transfer protocol (http), and simple mail transfer protocol (smtp).
Vulnerabilities - Archive of obsolete content
insecure direct object references - dom (document object model) 5.
Theme changes in Firefox 3 - Archive of obsolete content
changes in browser --- changes in global all platforms the yellow background for the location bar has been deprecated; instead, themes should style the new #identity-box element depending on its verifieddomain/verifiedidentity class.
-moz-binding - Archive of obsolete content
the -moz-binding css property is used by mozilla-based applications to attach an xbl binding to a dom element.
-ms-scroll-translation - Archive of obsolete content
if your javascript is listening for scroll wheel document object model (dom) events, the events that occur when the user scrolls vertically will always be vertical scroll events, not horizontal scroll events.
CSS - Archive of obsolete content
ArchiveWebCSS
obsolete css features -moz-bindingthe -moz-binding css property is used by mozilla-based applications to attach an xbl binding to a dom element.-moz-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.
Accessing XML children - Archive of obsolete content
use domparser/domserializer or a non-native jxon algorithm instead.
E4X Tutorial - Archive of obsolete content
use domparser/domserializer or a non-native jxon algorithm instead.
Date.prototype.toLocaleFormat() - Archive of obsolete content
extension and xulrunner developers should know that just loading the format string from a .dtd or .properties file using a chrome://somedomain/locale/somefile.ext uri should be avoided, as the .dtd/.properties file and the tolocaleformat() method does not not necessarily use the same locale, which could result in odd looking or even ambiguous or unreadable dates.
New in JavaScript 1.1 - Archive of obsolete content
math.random() now works on every platform.
Server-Side JavaScript - Archive of obsolete content
some, like aptana with the open source jaxer server actually embed the entire mozilla firefox browser engine (including spidermonkey) within a web server to enable server-side ajax and server-side dom access in addition to server-side execution of javascript.
Troubleshooting XForms Forms - Archive of obsolete content
if you are trying to submit to a different domain than the form is loaded from, make sure that you have allowed cross-domain submission for that specific "form domain".
Requests For Enhancement - Archive of obsolete content
ArchiveWebXFormsRFE
now we need to start teaching xforms to web newcomers before they are brainwashed into believing that the only way to build cool web apps is to do dom surgery with javascript!
XForms Message Element - Archive of obsolete content
example <xforms:trigger> <xforms:label>it's a button</xforms:label> <xforms:message level="modal" ev:event="domactivate">hello</xforms:message> </xforms:trigger> ...
XForms Submit Element - Archive of obsolete content
upon receiving a domactivate event, this form control dispatches a xforms-submit event to the submission element (see the spec) specified in its submission attibute.
XForms Switch Module - Archive of obsolete content
example <switch> <case id="in" selected="true"> <input ref="yourname"> <label>please tell me your name</label> <toggle ev:event="domactivate" case="out"/> </input> </case> <case id="out" selected="false"> <html:p>hello <output ref="yourname" /> <trigger id="editbutton"> <label>edit</label> <toggle ev:event="domactivate" case="in"/> </trigger> </html:p> </case> </switch> ...
Archived open Web documentation - Archive of obsolete content
the goal is to provide an alternative, simpler syntax for accessing xml documents than via dom interfaces.
Describing microformats in JavaScript - Archive of obsolete content
the adr microformat is defined as follows: var adr_definition = { mfversion: 0.8, mfobject: adr, classname: "adr", properties: { "type" : { plural: true, types: ["work", "home", "pref", "postal", "dom", "intl", "parcel"] }, "post-office-box" : { }, "street-address" : { plural: true }, "extended-address" : { }, "locality" : { }, "region" : { }, "postal-code" : { }, "country-name" : { } } }; the properties are quite simple here.
Popup Window Controls - Archive of obsolete content
you can also use either the advanced features in the document object model (dom) or innerhtml to create the appropriate html.
Using the Right Markup to Invoke Plugins - Archive of obsolete content
mozilla-based browsers will not allow you to access the named embed element via javascript dom 0 methods if the object element has the same name.
Web Standards - Archive of obsolete content
gecko demos css zen garden eric meyers's css/edge w3c dom demos related topics css, dhtml, html, web development, xhtml, xml the web standards project ...
Archive of obsolete content
getting the page url in npapi plugin sometimes, you want to restrict an npapi plugin to be loadable only from a certain url or domain or scheme.
Index - Game development
55 randomizing gameplay 2d, beginner, canvas, games, javascript, phaser, tutorial you've finished all the lessons — congratulations!
Game distribution - Game development
you can upload it to a remote server, grab a catchy domain name, and host it yourself.
Publishing games - Game development
html5 games have a huge advantage over native in terms of publishing and distribution — you have the freedom of distribution, promotion and monetization of your game on the web, rather than each version being locked into a single store controlled by one company.
GLSL Shaders - Game development
id="fragmentshader" type="x-shader/x-fragment"> void main() { gl_fragcolor = vec4(0.0, 0.58, 0.86, 1.0); } </script> javascript var width = window.innerwidth; var height = window.innerheight; var renderer = new three.webglrenderer({antialias:true}); renderer.setsize(width, height); renderer.setclearcolor(0xdddddd, 1); document.body.appendchild(renderer.domelement); var scene = new three.scene(); var camera = new three.perspectivecamera(70, width/height); camera.position.z = 50; scene.add(camera); var boxgeometry = new three.boxgeometry(10, 10, 10); var shadermaterial = new three.shadermaterial( { vertexshader: document.getelementbyid( 'vertexshader' ).textcontent, fragmentshader: document.getelementbyid( ...
Audio for Web games - Game development
it is worth noting that autoplay with sound is allowed if: the user has interacted with the domain.
Bounce off the walls - Game development
compare your code lets again check the finished code for this part against what you've got, and have a play: exercise: try changing the color of the ball to a random colour every time it hits the wall.
Buttons - Game development
compare your code you can check the finished code for this lesson in the live demo below, and play with it to understand better how it works: next steps the last thing we will do in this article series is make the gameplay even more interesting by adding some randomization to the way the ball bounces off the paddle.
2D breakout game using Phaser - Game development
lessons — and the different versions of the mdn breakout game we are building together — are available on github: initialize the framework scaling load the assets and print them on screen move the ball physics bounce off the walls player paddle and controls game over build the brickfield collision detection the score win the game extra lives animations and tweens buttons randomizing gameplay as a note on learning paths — starting with pure javascript is the best way to get a solid knowledge of web game development.
2D maze game with device orientation - Game development
var game = new phaser.game(320, 480, phaser.canvas, 'game'); the line above will initialize the phaser instance — the arguments are the width of the canvas, height of the canvas, rendering method (we're using canvas, but there are also webgl and auto options available) and the optional id of the dom container we want to put the canvas in.
Character sets supported by Gecko - Gecko Redirect 1
for encodings that have a compatibility name in the dom standard, except gbk, this is the compatibilty name.
Ajax - MDN Web Docs Glossary: Definitions of Web-related terms
ajax allows you to update parts of the dom of an html page instead without the need for a full page refresh.
ARPA - MDN Web Docs Glossary: Definitions of Web-related terms
.arpa (address and routing parameter area) is a top-level domain used for internet infrastructure purposes, especially reverse dns lookup (i.e., find the domain name for a given ip address).
Algorithm - MDN Web Docs Glossary: Definitions of Web-related terms
there are also machine learning algorithms such as linear regression, logistic regression, decision tree, random forest, support vector machine, recurrent neural network (rnn), long short term memory (lstm) neural network, convolutional neural network (cnn), deep convolutional neural network and so on.
Blink - MDN Web Docs Glossary: Definitions of Web-related terms
specifically, blink began as a fork of the webcore library in webkit, which handles layout, rendering, and dom, but now stands on its own as a separate rendering engine.
DHTML - MDN Web Docs Glossary: Definitions of Web-related terms
dhtml aggregates the combined functionality of html, css, the dom, and javascript.
Digest - MDN Web Docs Glossary: Definitions of Web-related terms
perform several tasks: in non-cryptographic applications (e.g., the index of hash tables, or a fingerprint used to detect duplicate data or to uniquely identify files) verify message integrity (a tampered message will have a different hash) store passwords so that they can't be retrieved, but can still be checked (to do this securely, you also need to salt the password.) generate pseudo-random numbers generate keys it is critical to choose the proper hash function for your use case to avoid collisions and predictability.
Element - MDN Web Docs Glossary: Definitions of Web-related terms
tags begin or end an element in source code, whereas elements are part of the dom, the document model for displaying the page in the browser.
Expando - MDN Web Docs Glossary: Definitions of Web-related terms
expando properties are properties added to dom nodes with javascript, where those properties are not part of the object's dom specification: window.document.foo = 5; // foo is an expando the term may also be applied to properties added to objects without respecting the object's original intent, such as non-numeric named properties added to an array.
First contentful paint - MDN Web Docs Glossary: Definitions of Web-related terms
first contentful paint (fcp) is when the browser renders the first bit of content from the dom, providing the first feedback to the user that the page is actually loading.
GPL - MDN Web Docs Glossary: Definitions of Web-related terms
users of a gpl-licensed program are granted the freedom to use it, read the source code, modify it and redistribute the changes they made, provided they redistribute the program (modified or unmodified) under the same license.
IANA - MDN Web Docs Glossary: Definitions of Web-related terms
iana (internet assigned numbers authority) is a subsidiary of icann charged with recording and/or assigning domain names, ip addresses, and other names and numbers used by internet protocols.
ICANN - MDN Web Docs Glossary: Definitions of Web-related terms
icann (internet corporation for assigned names and numbers) is an international nonprofit that maintains the domain name system and the record of ip addresses.
JavaScript - MDN Web Docs Glossary: Definitions of Web-related terms
javascript is primarily used in the browser, enabling developers to manipulate webpage content through the dom, manipulate data with ajax and indexeddb, draw graphics with canvas, interact with the device running the browser through various apis, and more.
Netscape Navigator - MDN Web Docs Glossary: Definitions of Web-related terms
despite netscape's technical advantages and initial dominance, by the late 1990s internet explorer swiftly overtook netscape in market share.
Node - MDN Web Docs Glossary: Definitions of Web-related terms
it may refer to: node (dom) in the context of the dom, a node is a single point in the node tree.
Parse - MDN Web Docs Glossary: Definitions of Web-related terms
the browser parses html into a dom tree.
Python - MDN Web Docs Glossary: Definitions of Web-related terms
it was created by guido van rossum as a successor to another language (called abc) between 1985 and 1990, and is currently used on a large array of domains like web development, desktop applications, data science, devops, and automation/productivity.
Quaternion - MDN Web Docs Glossary: Definitions of Web-related terms
as such, the type dompoint (or dompointreadonly) is used to store quaternions.
SIMD - MDN Web Docs Glossary: Definitions of Web-related terms
simd allows one same operation to be performed on multiple data points resulting in data level parallelism and thus performance gains — for example, for 3d graphics and video processing, physics simulations or cryptography, and other domains.
Semantics - MDN Web Docs Glossary: Definitions of Web-related terms
would you know what part of the dom is being selected with div > ul > li, or .fruits__item?
Session Hijacking - MDN Web Docs Glossary: Definitions of Web-related terms
protection against session hijacking create a secure communication channel with ssh (secure shell) pass authentication cookies over https connection implement logout functionality so the user can end the session generate the session id after successful login pass encrypted data between the users and the web server use a string or long random number as a session key learn more general knowledge session hijacking on wikipedia ...
URL - MDN Web Docs Glossary: Definitions of Web-related terms
your browser displays urls in its address bar, for example: https://developer.mozilla.org some browsers display only the part of a url after the "//", that is, the domain name.
WHATWG - MDN Web Docs Glossary: Definitions of Web-related terms
the whatwg (web hypertext application technology working group) is a community that maintains and develops web standards, including dom, fetch, and html.
Web standards - MDN Web Docs Glossary: Definitions of Web-related terms
this non-exhaustive list gives you an idea of which standards websites and network systems must conform to: ietf (internet engineering task force): internet standards (std), which among other things govern set-up and use of uris, http, and mime w3c: specifications for markup language (e.g., html), style definitions (i.e., css), dom, accessibility iana (internet assigned numbers authority): name and number registries ecma intl.: scripting standards, most prominently for javascript iso (international organization for standardization): standards governing a diverse array of aspects, including character encodings, website management, and user-interface design learn more general knowledge web standards on wikipedia ...
XLink - MDN Web Docs Glossary: Definitions of Web-related terms
specification xlink 1.0 xlink 1.1 (currently a working draft) see also xml in mozilla code snippets:getattributens - a wrapper for dealing with some browsers not supporting this dom method code snippets:xml:base function - a rough attempt to find a full xlink-based on an xlink:href attribute (or <xi:include href=>) and its or an ancestor's xml:base.
jQuery - MDN Web Docs Glossary: Definitions of Web-related terms
jquery is a javascript library that focuses on simplifying dom manipulation, ajax calls, and event handling.
Origin - MDN Web Docs Glossary: Definitions of Web-related terms
web content's origin is defined by the scheme (protocol), host (domain), and port of the url used to access it.
Mobile accessibility - Learn web development
long gone are the days when mobile devices ran completely different web technologies to desktop browsers, forcing developers to use browser sniffing and serve them completely separate sites (although quite a few companies still detect usage of mobile devices and serve them a separate mobile domain).
How CSS is structured - Learn web development
on large screen or window, we increase the font size for better readability */ body { font-size: 130%; } } h1 {font-size: 1.5em;} /* handle specific elements nested in the dom */ /* -------------------------------------------------------------------------------------------- */ div p, #id:first-line { background-color: red; border-radius: 3px; } div p { margin: 0; padding: 1em; } div p + p { padding-top: 0; } "commenting out" code is also useful for temporarily disabling sections of code for testing.
CSS FAQ - Learn web development
LearnCSSHowtoCSS FAQ
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.
Using CSS generated content - Learn web development
note: content specified in a stylesheet does not become part of the dom.
Use CSS to solve common problems - Learn web development
LearnCSSHowto
common use cases basics how to apply css to the dom how to use whitespace in css how to write comments in css how to select elements via element name, class or id how to select elements via attribute name and content how to use pseudo-classes how to use pseudo-elements how to apply multiple selectors to the same rule how to specify colors in css how to debug css in the browser css and text how to style text how to customize a list of elements how to style links how to add shadows to text boxes and layouts how to size css boxes how to control overflowing content how to control the part of a css box that the background is drawn under how do i define inline, block, and ...
How do you make sure your website works properly? - Learn web development
ping is a useful shell tool that tests the domain name you provide and tells you if the server's responding or not: $ ping mozilla.org ping mozilla.org (63.245.215.20): 56 data bytes 64 bytes from 63.245.215.20: icmp_seq=0 ttl=44 time=148.741 ms 64 bytes from 63.245.215.20: icmp_seq=1 ttl=44 time=148.541 ms 64 bytes from 63.245.215.20: icmp_seq=2 ttl=44 time=148.734 ms 64 bytes from 63.245.215.20: icmp_seq=3 ttl=44 time=147.857 ms ^c --- moz...
What is a web server? - Learn web development
an http server can be accessed through the domain names of the websites it stores, and it delivers the content of these hosted websites to the end user's device.
HTML forms in legacy browsers - Learn web development
just check the support of the elements (or dom interface) you want to use.
Sending form data - Learn web development
store them on a different server and allow access to the file only through a different subdomain or even better through a completely different domain.
Images in HTML - Learn web development
you have ample proof that the image is, in fact, in the public domain.
Introducing asynchronous JavaScript - Learn web development
rce): const btn = document.queryselector('button'); btn.addeventlistener('click', () => { alert('you clicked me!'); let pelem = document.createelement('p'); pelem.textcontent = 'this is a newly-added paragraph.'; document.body.appendchild(pelem); }); in this block, the lines are executed one after the other: we grab a reference to a <button> element that is already available in the dom.
Graceful asynchronous programming with Promises - Learn web development
then we create an <img> element, set its src attribute to equal the object url and append it to the dom, so the image will display on the page!
Video and Audio APIs - Learn web development
you'll see a number of features; the html is dominated by the video player and its controls: <div class="player"> <video controls> <source src="video/sintel-short.mp4" type="video/mp4"> <source src="video/sintel-short.webm" type="video/webm"> <!-- fallback content here --> </video> <div class="controls"> <button class="play" data-icon="p" aria-label="play pause toggle"></button> <button class="stop" data-icon="s" aria...
Useful string methods - Learn web development
nkeyup = function(){ // we only want to save the state when the user code is being shown, // not the solution, so that solution is not saved over the user code if(solution.value === 'show solution') { userentry = textarea.value; } else { solutionentry = textarea.value; } updatecode(); }; fixing capitalization in this exercise we have the names of cities in the united kingdom, but the capitalization is all messed up.
JavaScript First Steps - Learn web development
silly story generator in this assessment you'll be tasked with taking some of the knowledge you've picked up in this module's articles and applying it to creating a fun app that generates random silly stories.
Working with JSON - Learn web development
we are going to load it into our page, and use some nifty dom manipulation to display it, like this: obtaining the json to obtain the json, we use an api called xmlhttprequest (often called xhr).
Measuring performance - Learn web development
you can use the navigation timing api to measure client-side web performance; including the amount of time needed to unload the previous page, how long domain lookups take, the total time spent executing the window's load handler, and more.
Multimedia: Images - Learn web development
as of 2018, 24% of the united kingdom still use pay-as-you-go.
Perceived performance - Learn web development
relevant measurements include first meaningful paint (fmp), largest contentful paint (lcp), time to interactive (tti), render start, dom interactive, and speed index.
The "why" of web performance - Learn web development
a 22.6 mb site could take up to 83 seconds to load on a 3g network, with domcontentloaded (meaning the site's base html structure) at 31.86 seconds.
Web performance - Learn web development
by minimizing the number of dom nodes, making sure the best order and attributes are used for including content such as styles, scripts, media, and third-party scripts, you can drastically improve the user experience.
Server-side web frameworks - Learn web development
a full-stack http and websocket client/server implementation with ipv6, tls, sni, idna, http/socks5 proxy, unix domain socket, comet (long polling), keep-alive, connection pooling, timeout, cookie, multipart, and gzip compression support.
Website security - Learn web development
in other high-profile cases, millions of passwords, email addresses, and credit card details have been leaked into the public domain, exposing website users to both personal embarrassment and financial risk.
Ember resources and troubleshooting - Learn web development
while it is technically possible to use jsx, or any other form of dom creation, there has yet to be anything as robust as ember's templating system.
React interactivity: Events and state - Learn web development
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.
Using Vue computed properties - Learn web development
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.
Vue conditional rendering: editing existing todos - Learn web development
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.
Creating our first Vue component - Learn web development
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.
Getting started with Vue - Learn web development
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.
Adding a new todo form: Vue events, methods, and models - Learn web development
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.
Rendering a list of Vue components - Learn web development
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.
Vue resources - Learn web development
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.
Styling Vue components with CSS - Learn web development
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.
Handling common accessibility problems - Learn web development
here's an example: <p><span id="liveregion1" aria-live="polite" aria-atomic="false"></span></p> you can see an example in action at freedom scientific's aria (accessible rich internet applications) live regions example — the highlighted paragraph should update its content every 10 seconds, and a screenreader should read this out to the user.
Implementing feature detection - Learn web development
if you look at the dom inspector of your browser's developer tools, you'll see that modernizr has updated your <html> class value like so: <html class="js no-htmlimports sizes flash transferables applicationcache 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.
Introduction to cross browser testing - Learn web development
this situation is a lot less bad than it used to be; back when ie4 and netscape 4 were competing to be the dominant browser in the 1990s, browser companies deliberately implemented things differently to each other to try to gain competitive advantage, which made life hell for developers.
Handling common JavaScript problems - Learn web development
jquery for example provides its own fully-featured selectors and dom manipuation libraries, to allow css-selector type selecting of elements in javascript and easier dom building.
Setting up your own test automation environment - Learn web development
for example if you load a new page, you'll want to wait for the page's dom to finish loading before you try to interact with any of its elements, otherwise the test will likely fail.
Introducing a complete toolchain - Learn web development
parcel also installs the dependencies that we will use in our code, including react, react-dom, react-async-hook, date-fns, and format-number.
Learn web development
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.
Accessibility API cross-reference
command a supporting section of the document, designed to be complementary to the main content at a similar level in the dom hierarchy, but remains meaningful when separated from the main content.
Information for Assistive Technology Vendors
in addition, we provide some simple interfaces via which we expose a read-only dom (document object model).
Accessible Toolkit Checklist
since the individual widgets predominately come from the operating system, they already implement standard keyboard commands and follow the operating system's visual theme.
Obsolete
creating a skin for firefox uuid contents.rdf install.rdf theme changes in firefox 2 theme changes in firefox 3 theme changes in firefox 3.5 theme changes in firefox 4 building a theme common theme issues and their solutions making sure your theme works with rtl locales creating a skin for seamonkey 2 dom inspector inspectorwidget force rtl yet another theme tutorial ...
Application cache implementation overview
finished state is set when updated is 'finished' and is the last state the update transits to after invoking one of the final dom notifications (onnoupdate, onupdaterady or onerror.) ...
Browser chrome tests
function test() { waitforexplicitfinish(); settimeout(completetest, 1000); } function completetest() { ok(true, "timeout ran"); finish(); } if your test is randomly timing out and you think that's just due to it taking too long, you can extend the timeout.
Chrome registration
see safely accessing content dom from chrome for details.
Command line options
seamonkey -edit www.mozilla.org -inspector url start with the dom inspector, if installed, and inspect the given url (where url is optional).
Creating Sandboxed HTTP Connections
for example, this means that if the user was logged into an webmail account, another account on the same domain could be checked without changing the user's cookies.
Debugging JavaScript
to see anything, you need to set the pref browser.dom.window.dump.enabled to true, e.g.
Adding APIs to the navigator object
real-world example you can see an example of how this is used in firefox by taking a look at how the mozapps api is implemented: dom/apps/webapps.manifest dom/apps/webapps.js ...
Index
in private browsing windows (tabs, in firefox for android), firefox will block content loaded from domains that track users across sites.
Process scripts
however, you don't get access to web content or dom events from a process script.
Using the Browser API
MozillaGeckoChromeAPIBrowser APIUsing
note that promise versions of browser api dom request methods also exist, so you can use async promise style syntax if you so wish.
HTMLIFrameElement.download()
syntax var instanceofdomrequest = instanceofhtmliframeelement.download(url, options); returns a domrequest for handling the download request.
HTMLIFrameElement.executeScript()
syntax var mydomrequest = instanceofhtmliframeelement.executescript(script, options); return value a domrequest object that returns an onsuccess handler if the script is successfully executed against the loaded content, or an onerror handler if not.
HTMLIFrameElement.getContentDimensions()
syntax var instanceofdomrequest = instanceofhtmliframeelement.getcontentdimensions(); returns a domrequest for handling the dimensions request.
HTMLIFrameElement.getMuted()
}); returns callback version: a domrequest that represents the get muted request.
HTMLIFrameElement.getStructuredData()
syntax var instanceofdomrequest = instanceofhtmliframeelement.getstructureddata(); returns a domrequest to handle the getstructureddata() request's success and error cases.
HTMLIFrameElement.getVisible()
syntax instanceofdomrequest = instanceofhtmliframeelement.getvisible(); returns a domrequest object to handle the getvisible() request's success and error cases.
HTMLIFrameElement.getVolume()
}); returns callback version: a domrequest that represents the get volume request.
mozbrowseractivitydone
general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
mozbrowserasyncscroll
general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
mozbrowseraudioplaybackchange
general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
mozbrowsermanifestchange
general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
mozbrowserresize
general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
mozbrowserscroll
general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
mozbrowserscrollareachanged
this can occur on resize and when the page size changes (while loading for example.) general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
mozbrowserselectionstatechanged
general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
mozbrowsertitlechange
general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
mozbrowservisibilitychange
general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event.
HTMLIFrameElement.zoom()
MozillaGeckoChromeAPIBrowser APIzoom
syntax var instanceofdomrequest = instanceofhtmliframeelement.zoom(zoomfactor); returns void.
Embedding Mozilla
that means you can embed a web browser inside a third-party application, open channels and streams through the network backend, walk through the dom and so on.
Getting from Content to Layout
changes to a document originate in the content tree (from dom modification by scripting, insertion of elements from the parser, etc.) and are propogated to the layout tree through magic that primarily resides in //github.com/realityripple/uxp/blob/master/layout/base/nscssframeconstructor.cpp the frame constructor implements nsimutationobserver which allows it to "watch" the content tree.
How Mozilla determines MIME Types
this is done because the generic text/xml mime type does not work for xul files, and xhtml files get a different dom when interpreted as text/xml.
Creating a New Protocol
see dom/ipc/moz.build for an example.
JavaScript Tips
dom elements dom elements are just xpcom objects with some of the interfaces precached.
Addon
the guid is generated randomly and is made consistent across devices during sync.
Promise
to help with debugging, only when inspecting a promise object manually, you can see more information as special properties that are inaccessible from code (this, at present, is implemented by randomizing the property name, for the lack of more sophisticated language or debugger support).
Services.jsm
console nsiconsoleservice error console service contentprefs nsicontentprefservice content preferences service cookies nsicookiemanager2 cookie manager 2 service cpmm nsimessagesender child process message manager4 crashmanager crashmanager.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 nsieventlistenerservice event listener service etld nsieffectivetldservice effectivetld serv...
Sqlite.jsm
execute() is recommended for statements that will be executed seldomly or once.
Localizing with Mercurial
ectory you pulled your locale into)/.hg/hgrc (note, this is not your ~/.hgrc) to add these lines (replacing ab-cd with your locale code): [paths] default = https://hg.mozilla.org/l10n-central/ab-cd/ default-push = ssh://hg.mozilla.org/l10n-central/ab-cd/ you’ll also need to tell ssh which account to use for your pushes, too, by editing ~/.ssh/config and adding these lines, where user@host.domain is your account: host hg.mozilla.org user user@host.domain now you can push your work to the repository (and check the result on the dashboard) by entering this command from your local directory: hg push and tah dah!
Release phase
add the following lines to your ~/.ssh/config file, replacing user@host.domain with your mozilla ldap account name: host hg.mozilla.org user user@host.domain if you have already cloned the remote repository using the http protocol using this command: $ hg clone http://hg.mozilla.org/releases/l10n-central/x-testing then you will need to edit the .hg/hgrc file (inside the x-testing local clone) to tell mercurial to push using ssh.
Localization technical reviews
here is some of the criteria we use to perform technical reviews: revision attachment contains only relevant files we run into exports that contain .xpi langpacks and other random files.
Creating localizable web applications
avoid using it in a subdomain, as it can cause problems with certificates (this is wrong: http://en-us.example.com/foo/bar).
Creating localizable web content
sometimes you can leave some freedom of modification for a block of text so that the localizers link to relevant local resources.
Basics
you can also do other weird and risky things which are not portable, bongo warns, such as mixing mathml with other markups lizard + bongo = ∫ a b d x + mathml and javascript html content <p> and you can turn to javascript and the dom for dynamic operations.
Updates
mozilla 1.0 features full support for html 4.0, xml 1.0, resource description framework (rdf), cascading style sheets level 1 (css1), and the w3c document object model level 1 (dom1) [...] as well as support for display of mathematical equations using mathml." december 7, 2001 status report october 2000 the first international mathml conference april 14, 2000 status report february 12, 2000 mathml-enabled m13 builds for win32 september 21, 1999 mathml has landed.
Mozilla Port Blocking
in mozilla: port service 1 tcpmux 7 echo 9 discard 11 systat 13 daytime 15 netstat 17 qotd 19 chargen 20 ftp data 21 ftp control 22 ssh 23 telnet 25 smtp 37 time 42 name 43 nicname 53 domain 77 priv-rjs 79 finger 87 ttylink 95 supdup 101 hostriame 102 iso-tsap 103 gppitnp 104 acr-nema 109 pop2 110 pop3 111 sunrpc 113 auth 115 sftp 117 uucp-path 119 nntp 123 ntp 135 loc-srv / epmap...
Leak-hunting strategies and tips
tool finds platforms requires leak tools for large object graphs leak gauge windows, documents, and docshells only all platforms any build gc and cc logs js objects, dom objects, many other kinds of objects all platforms any build leak tools for medium-size object graphs bloatview, refcount tracing and balancing objects that implement nsisupports or use moz_count_{ctor,dtor} all tier 1 platforms debug build (or build opt with --enable-logrefcnt) leaksoup (part of tracemalloc) all objects?
Memory Profiler
however, it still relies on developers' wisdom, and sometimes chances, to dig out the problematical code snippet.
Scroll-linked effects
in the asynchronous scrolling model, the visual scroll position is updated in the compositor thread and is visible to the user before the scroll event is updated in the dom and fired on the main thread.
TraceMalloc
also, your javascript can call the following dom window methods: tracemallocdisable() - turn off tracing, first flushing any buffered log events for all log files.
Performance
memory profiling and leak detection tools the developer tools "memory" panel the memory panel in the devtools supports taking heap snapshots, diffing them, computing dominator trees to surface "heavy retainers", and recording allocation stacks.
Phishing: a short definition
this qr code is nothing more than a random, secret key, that is stored on the user’s phone.
Introduction to NSPR
nspr threads are scheduled in two separate domains: local threads are scheduled within a process only and are handled entirely by nspr, either by completely emulating threads on each host operating system (os) that doesn't support threads, or by using the threading facilities of each host os that does support threads to emulate a relatively large number of local threads by using a relatively small number of native threads.
PR_OpenTCPSocket
can be pr_af_inet (ipv4), pr_af_inet6 (ipv6), or pr_af_local (unix domain, supported on posix systems only).
PR OpenUDPSocket
can be pr_af_inet (ipv4), pr_af_inet6 (ipv6), or pr_af_local (unix domain, supported on posix systems only).
NSPR API Reference
_logflush pr_log_test pr_log pr_assert pr_assert pr_not_reached use example instrumentation counters named shared memory shared memory protocol named shared memory functions anonymous shared memory anonymous memory protocol anonymous shared memory functions ipc semaphores ipc semaphore functions thread pools thread pool types thread pool functions random number generator random number generator function hash tables hash tables and type constants hash table functions nspr error handling error type error functions error codes ...
Function_Name
avoid describing the return until the next section, for example: this function looks in the nsscryptocontext and the nsstrustdomain to find the certificate that matches the der-encoded certificate.
CERT_FindCertByDERCert
and the ?nsstrustdomain?
NSS_3.11.10_release_notes.html
bug 398680: assertion botch in ssl3_registerserverhelloextensionsender doing second handshake with ssl_forcehandshake bug 403240: threads hanging in nss_initlock bug 403888: memory leak in trustdomain.c bug 416067: certutil -l -h token doesn't report token authentication failure bug 417637: tstclnt crashes if -p option is not specified bug 421634: don't send an sni client hello extension bearing an ipv6 address bug 422918: add verisign class 3 public primary ca - g5 to nss bug 424152: add thawte primary root ca to nss bug 424169: add geotrust primary certification authority root...
NSS 3.12.4 release notes
bug 497217: the first random value ever generated by the rng should be discarded bug 498163: assert if profile path contains cyrillic chars.
NSS_3.12_release_notes.html
md/symkeyutil bug 385642: add additional cert usage(s) for certutil's -v -u option bug 175741: strict aliasing bugs in mozilla/dbm bug 210584: cert_asciitoname doesn't accept all valid values bug 298540: vfychain usage option should be improved and documented bug 323570: make dbck debug mode work with softoken bug 371470: vfychain needs option to verify for specific date bug 387621: certutil's random noise generator isn't very efficient bug 390185: signtool error message wrongly uses the term database bug 391651: need config.mk file for windows vista bug 396322: fix secutil's code and nss tools that print public keys bug 417641: miscellaneous minor nss bugs bug 334914: hopefully useless null check of out it in jar_find_next bug 95323: ckfw should support cipher operations.
NSS 3.15.1 release notes
bug 882829 - on windows, nss initialization fails if nss cannot call the rtlgenrandom function.
NSS 3.15.2 release notes
it is no longer necessary to call nss_setdomesticpolicy because all cipher suites are now allowed by default.
NSS 3.16 release notes
bug 903885: (cve-2014-1492) in a wildcard certificate, the wildcard character should not be embedded within the u-label of an internationalized domain name.
NSS 3.18.1 release notes
cn = e-guven kok elektronik sertifika hizmet saglayicisi sha1 fingerprint: dd:e1:d2:a9:01:80:2e:1d:87:5e:84:b3:80:7e: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.
NSS 3.20 release notes
each time this api is called for the first time in a process, a fresh set of weak dhe parameters will be randomly created, which may take a long amount of time.
NSS 3.22 release notes
pseudorandom functions based on hashes other than sha-1 are now supported with pbkdf (bug 554827).
NSS 3.23 release notes
new functions in ssl.h ssl_setdowngradecheckversion - set maximum version for new serverrandom anti-downgrade mechanism.
NSS 3.28.5 release notes
bug 1349705 - implemented domain name constraints for ca: tubitak kamu sm ssl kok sertifikasi - surum 1.
NSS 3.30.2 release notes
trust flags: websites technically constrained to: gov.tr, k12.tr, pol.tr, mil.tr, tsk.tr, kep.tr, bel.tr, edu.tr, org.tr the version number of the updated root ca list has been set to 2.14 (the version numbers 2.12 and 2.13 for the root ca list have been skipped.) bugs fixed in nss 3.30.2 bug 1350859 - march 2017 batch of root ca changes bug 1349705 - implemented domain name 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.
NSS 3.36.5 release notes
this is a patch release to fix cve-2018-12384 bugs fixed in nss 3.36.5 bug 1483128 - nss responded to an sslv2-compatible clienthello with a serverhello that had an all-zero random (cve-2018-12384) compatibility nss 3.36.5 shared libraries are backward compatible with all older nss 3.x shared libraries.
NSS 3.39 release notes
opentrust root ca g2 sha-256 fingerprint: 27995829fe6a7515c1bfe848f9c4761db16c225929257bf40d0894f29ea8baf2 cn = opentrust root ca g3 sha-256 fingerprint: b7c36231706e81078c367cb896198f1e3208dd926949dd8f5709a410f75b6292 bugs fixed in nss 3.39 bug 1483128 - nss responded to an sslv2-compatible clienthello with a serverhello that had an all-zero random (cve-2018-12384) this bugzilla query returns all the bugs fixed in nss 3.39: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&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.
NSS 3.46 release notes
alues bug 1572791 - read out-of-bounds in der_decodetimechoice_util from sslexp_delegatecredential bug 1560593 - cleanup.sh script does not set error exit code for tests that "failed with core" bug 1566601 - add wycheproof test vectors for aes-kw bug 1571316 - curve25519_32.c:280: undefined reference to `pr_assert' when building nss 3.45 on armhf-linux bug 1516593 - client to generate new random during renegotiation bug 1563258 - fips.sh fails due to non-existent "resp" directories bug 1561598 - remove -wmaybe-uninitialized warning in pqg.c bug 1560806 - increase softoken password max size to 500 characters bug 1568776 - output paths relative to repository in nss coverity bug 1453408 - modutil -changepw fails in fips mode if password is an empty string bug 1564727 - use a pss spki ...
NSS 3.48 release notes
st bug 1596450 - added a simplified and unified mac implementation for hmac and cmac behind pkcs#11 bug 1522203 - remove an old pentium pro performance workaround bug 1592557 - fix prng known-answer-test scripts bug 1586176 - encryptupdate should use maxout not block size (cve-2019-11745) bug 1593141 - add `notbefore` or similar "beginning-of-validity-period" parameter to mozilla::pkix::trustdomain::checkrevocation bug 1591363 - fix a pbkdf2 memory leak in nsc_generatekey if key length > max_key_len (256) bug 1592869 - use arm neon for ctr_xor bug 1566131 - ensure sha-1 fallback disabled in tls 1.2 bug 1577803 - mark pkcs#11 token as friendly if it implements ckp_public_certificates_token bug 1566126 - power ghash vector acceleration bug 1589073 - use of new pr_assert_arg in certdb...
NSS Developer Tutorial
opaque structs give us complete freedom to change them, but require applications to call nss functions, to allocate and free them.
Enc Dec MAC Using Key Wrap CertReq PKCS10 CSR
t char *noise, seckeypublickey **pubkeyp, const char *pqgfile, secupwdata *pwdata) { ck_mechanism_type mechanism; secoidtag algtag; pk11rsagenparams rsaparams; void *params; seckeyprivatekey *privkey = null; secstatus rv; unsigned char randbuf[blocksize + 1]; rv = generaterandom(randbuf, blocksize); if (rv != secsuccess) { fprintf(stderr, "error while generating the random numbers : %s\n", port_errortostring(rv)); goto cleanup; } pk11_randomupdate(randbuf, blocksize); switch (keytype) { case rsakey: rsaparams.keysizeinbits = size; rsaparams.pe = publicexponent; ...
sample2
private key */ seckeyprivatekey * generateprivatekey(keytype keytype, pk11slotinfo *slot, int size, int publicexponent, const char *noise, seckeypublickey **pubkeyp, const char *pqgfile, secupwdata *pwdata) { ck_mechanism_type mechanism; secoidtag algtag; pk11rsagenparams rsaparams; void *params; seckeyprivatekey *privkey = null; secstatus rv; unsigned char randbuf[blocksize + 1]; rv = generaterandom(randbuf, blocksize); if (rv != secsuccess) { fprintf(stderr, "error while generating the random numbers : %s\n", port_errortostring(rv)); goto cleanup; } pk11_randomupdate(randbuf, blocksize); switch (keytype) { case rsakey: rsaparams.keysizeinbits = size; rsaparams.pe = publicexponent; mechanism = ckm_rsa_pkcs_key_pair_gen; algtag = sec_oid_pkcs1_md5_with_rsa_encryption; params = &rsaparams; bre...
nss tech note4
ject) to the following functions char *cert_getcommonname(certname *name); char *cert_getcertemailaddress(certname *name); char *cert_getcountryname(certname *name); char *cert_getlocalityname(certname *name); char *cert_getstatename(certname *name); char *cert_getorgname(certname *name); char *cert_getorgunitname(certname *name); char *cert_getdomaincomponentname(certname *name); char *cert_getcertuid(certname *name); example code to illustrate access to the info is given below.
nss tech note7
answer: the version without the initial 00 says : "ps is a string of strong pseudo-random octets [random] [...] long enough that the value of the quantity being crypted is one octet shorter than the rsa modulus" the version with the initial 00 instead says to pad to the same length as the rsa modulus.
Notes on TLS - SSL 3.0 Intolerant Servers
) domino-go-webserver/4.6.2.6 (and perhaps some later versions) ibm_http_server/1.3.6.3 or earlier (* update to 1.3.6.4) ibm_http_server/1.3.12.1 or earlier (* update to 1.3.12.2) java web server 2 osu/3.2 - decthreads http server for openvm stronghold/2.2 webmail v.
Overview of NSS
fips 186-2 pseudorandom number generator.
NSS PKCS11 Functions
description secmod_unloadusermodule detaches a module from the nss trust domain and unloads it.
FC_GetTokenInfo
ckf_rng (0x00000001): this device has a random number generator ckf_write_protected (0x00000002): this device is read-only ckf_login_required (0x00000004): this device requires the user to log in to use some of its services ckf_user_pin_initialized (0x00000008): the user's password has been initialized ckf_dual_crypto_operations (0x00000200): a single session with the token can perform dual cryptographic operations ckf_token_initialized ...
FC_Initialize
ckr_device_error we failed to create the oid tables, random number generator, or internal locks.
OLD SSL Reference
ssl_cipherprefgetdefault ssl_clearsessioncache ssl_configserversessionidcache initializing multi-processing with a shared ssl server cache ssl_configmpserversidcache ssl_inheritmpserversidcache ssl export policy functions nss_setdomesticpolicy nss_setexportpolicy nss_setfrancepolicy ssl_cipherpolicyset ssl_cipherpolicyget ssl configuration functions ssl configuration ssl_importfd ssl_optionset ssl_optionget ...
sslintro.html
nss_setdomesticpolicy, nss_setexportpolicy, nss_setfrancepolicy, or ssl_cipherpolicyset.
SSL functions
function name/documentation source code nss versions nss_getclientauthdata mxr 3.2 and later nss_setdomesticpolicy mxr 3.2 and later nss_setexportpolicy mxr 3.2 and later nss_setfrancepolicy mxr 3.2 and later nssssl_versioncheck mxr 3.2.1 and later ssl_authcertificate mxr 3.2 and later ssl_authcertificatehook mxr 3.2 and later ssl_badcerthook mxr 3.2 and later ssl_certdbhandleset mxr 3.2 a...
Hacking Tips
break 'mozilla::dom::canvasrenderingcontext2d::drawwindow(nsglobalwindow&, double, double, double, double, nsastring_internal const&, unsigned int, mozilla::errorresult&)' cont break 'presshell::renderdocument(nsrect const&, unsigned int, unsigned int, gfxcontext*)' set print object on set $x = <your x value> set $y = <your y value> print &((cairo_image_surface_t*)athebescontext->mdt.mrawptr->msurface).data[$y...
64-bit Compatibility
what widths are the random typedefs everywhere?
SpiderMonkey Internals
the compiler consists of: a random-logic rather than table-driven lexical scanner, a recursive-descent parser that produces an ast, and a tree-walking code generator.
JS::Value
in short, every js::value must be rooted or your program will randomly crash.
JSObject
security-sensitive applications can use this relationship to make every object a member of some security domain.
JSObjectPrincipalsFinder
the callback returns a pointer to the principals associated with obj, possibly via the immutable parent chain leading from obj to a top-level container (such as a window object in the dom).
JSResolveOp
lazy properties are those reflected from some peer native property space (e.g., the dom attributes for a given node reflected as obj) on demand.
JS_THREADSAFE
this is because in single-threaded programs, a random call into the jsapi is actually pretty unlikely to trigger gc, especially if the calling thread has not been using up a lot of memory.
Property attributes
added in spidermonkey 17 mxr id search for jsfun_constructor jsprop_redefine_nonconfigurable if set, will allow redefining a non-configurable property, but only on a non-dom global.
JSAPI reference
y 17 js_psgs added in spidermonkey 17 js_self_hosted_get added in spidermonkey 31 js_self_hosted_getset added in spidermonkey 31 js_ps_end added in spidermonkey 17 jsfastnative added in spidermonkey 1.8 obsolete since javascript 1.8.5 the behavior of a jsclass can be customized using these flags: jsclass.flags jsclass_has_private jsclass_private_is_nsisupports jsclass_is_domjsclass added in spidermonkey 17 jsclass_implements_barriers added in spidermonkey 17 jsclass_emulates_undefined added in spidermonkey 24 jsclass_has_reserved_slots(n) jsclass_global_flags jsclass_new_enumerate obsolete since jsapi 37 jsclass_new_resolve obsolete since jsapi 36 jsclass_share_all_properties obsolete since javascript 1.8.5 jsclass_new_resolve_gets_start obsol...
SpiderMonkey 1.8.5
the scatter function has been removed, and a shell worker class (similar to html dom workers) has been added.
SpiderMonkey 1.8.7
the scatter function has been removed, and a shell worker class (similar to html dom workers) has been added.
Running Automated JavaScript Tests
developers will often want to use the -d option: jstests.py -d path_to_js_shell the -d option skips tests that are marked as randomly failing; random failures are usually just noise when being run for day-to-day developer testing.
Split object
to further complicate matters, a and b are in the same security domain, so security checks between them automatically succeed.
Zest
overview zest is an experimental specialized scripting language (also known as a domain-specific language) developed by the mozilla security team and is intended to be used in web oriented security tools.
Exploitable crashes
if you see a hex address such as 0x292c2830 rather than a function name such as nslistboxbodyframe::getrowcount at the top of the stack, a bug has caused the program to transfer control to a "random" part of memory that isn't part of the program.
History Service Design
each visit is associated with a favicon, to allow for better recognizability and groupable by common timeframes or domains.
Places Developer Guide
batch var donotify = false; browserhistory.removepages(uristodelete, uristodelete.length, donotify); // remove all visits within a given time period var enddate = date.now() * 1000; // now, in microseconds var startdate = enddate - (7 * 86400 * 1000 * 1000); // one week ago, in microseconds browserhistory.removepagesbytimeframe(startdate, enddate); // remove all pages for a given host var entiredomain = true; // will delete from all hosts from the given domain browserhistory.removepagesfromhost("mozilla.com", true); // remove all history visits browserhistory.removeallpages(); querying history the code sample below queries the browser history for the ten most visited urls in the browser history.
Toolkit API
-item extension packaging: specific information about multiple-item extension xpis xul application packaging: specific information about how to package xulrunner applications chrome registration printing in xul apps see also the following developer pages contain examples and discussions of particular topics: xul xul overlays developing extensions xulrunner developing themes dom rdf storage ...
Aggregating the In-Memory Datasource
if i'd just delegated to the in-memory datasource, assert() would've taken any old random garbage.
An Overview of XPCOM
this is the contract id for the ldap operation component: "@mozilla.org/network/ldap-operation;1" the format of the contract id is the domain of the component, the module, the component name, and the version number, separated by slashes.
Component Internals
there is a slight footprint penalty to linking directly, but this gives your component freedom to work in any recent environment.
Packaging WebLock
note: install-object-methods the methods are available on the main install object, which is implied in the script below in the same way that the window object is implied in javascript manipulation of the dom of a web page.
Making cross-thread calls using runnables
in the mozilla platform, most activities such as layout, dom operations, content javascript, and chrome javascript run on the main thread.
XPCOM Stream Guide
MozillaTechXPCOMGuideStreams
}); } parsing a dom document from an input stream ...
XPCOM guide
MozillaTechXPCOMGuide
the problem would not exist with java's interfaces).making cross-thread calls using runnablesin the mozilla platform, most activities such as layout, dom operations, content javascript, and chrome javascript run on the main thread.
Components.utils.forceGC
note: nsidomwindowutils.garbagecollect() offers similar functionality but will trigger the cycle collector in addition to the garbage collector in the javascript engine.
Components.utils.getWeakReference
you might have to check other aspects of the object (like node.parentnode() on a dom node) to verify the object is truly what you want.
Components.utils.isXrayWrapper
for example, privileged code using an xray to a dom object sees only the original, native version of the dom object.
Components.utils.unwaiveXrays
for example, if privileged code accesses a dom object belonging to web content, it will by default see it using xray vision, meaning that among other things expando properties added to the object by content are not visible.
PyXPCOM
related topics xpcom pydom: replace javascript with python python-spidermonkey ...
nsACString
that is, it may be used to store utf-8 characters, ascii characters, or any random binary data.
RefPtr
so for xpcom interfaces: nscomptr<nsisupports> a; nscomptr<nsifoo> foo; and for concrete classes: refptr<nsfoo> foo; // class that implements nsifoo; refptr<bar> bar; // some random class that i want ref-counted but has nothing to do with xpcom: // just implement addref() and release() and it will work with refptr it is important that nscomptr is not used to hold a pointer to a concrete class since this can cause compile time errors or runtime errors.
mozIColorAnalyzer
void findrepresentativecolor( in nsiuri imageuri, in mozirepresentativecolorcallback callback ); parameters imageuri a uri pointing to the image - ideally a data: uri, but any scheme that will load when setting the src attribute of a dom img element should work.
innerHTML
for the dom property, see element.innerhtml.
GetKeyBindings
nsidomdomstringlist getkeybindings( in pruint8 aactionindex ); parameters aactionindex[in] index of the given action.
nsIAccessible
the accessible tree is a subset of nodes in the dom tree -- such as documents, focusable elements and text.
nsIAccessibleRole
it is used by mathml, where there is a rich dom subtree for an equation.
nsIAccessibleText
this accessible get return the dom node and layout frame with the uniform attributes for this range of text.
nsIAccessibleTextChangeEvent
modifiedtext domstring the inserted or removed text.
nsIApplicationCache
see also offline resources in firefox nsiapplicationcachenamespace nsiapplicationcachecontainer nsiapplicationcachechannel nsiapplicationcacheservice nsidomofflineresourcelist ...
nsIApplicationCacheChannel
see also offline resources in firefox nsiapplicationcache nsiapplicationcachecontainer nsiapplicationcacheservice nsiapplicationcachenamespace nsidomofflineresourcelist ...
nsIApplicationCacheContainer
see also offline resources in firefox nsiapplicationcache nsiapplicationcachechannel nsiapplicationcacheservice nsiapplicationcachenamespace nsidomofflineresourcelist ...
nsIApplicationCacheNamespace
see also offline resources in firefox nsiapplicationcache nsiapplicationcachecontainer nsiapplicationcachechannel nsiapplicationcacheservice nsidomofflineresourcelist ...
nsIApplicationCacheService
see also offline resources in firefox nsiapplicationcache nsiapplicationcachecontainer nsiapplicationcachechannel nsiapplicationcachenamespace nsidomofflineresourcelist ...
nsIAuthPrompt2
implementations will commonly show a dialog with a username and password field, depending on flags also a domain field.
nsIChannelEventSink
by calling oldchannel->cancel() there is a certain freedom in implementing this method: if the return-value indicates success, a callback on callback is required.
nsIClassInfo
dom_object 1 << 3 the class is a dom object.
nsICommandLine
windowcontext nsidomwindow a window to be targeted by this command line.
nsIContentPref
nsicontentpref dom/interfaces/base/nsicontentprefservice2.idlscriptable a content preference 1.0 66 introduced gecko 20.0 inherits from: nsisupports last changed in gecko 20.0 (firefox 20.0 / thunderbird 20.0 / seamonkey 2.17) attributes attribute type description domain astring read only.
nsIContentPrefCallback2
dom/interfaces/base/nsicontentprefservice2.idlscriptable callback used by nsicontentprefservice2 methods 1.0 66 introduced gecko 20.0 inherits from: nsisupports last changed in gecko 20.0 (firefox 20.0 / thunderbird 20.0 / seamonkey 2.17) method overview void handlecompletion(in unsigned short reason); void handleerror(in nsresult error); void handleresult(in nsicontentpref pref); constants constant value description complete_ok 0 complete_error 1 methods handlecompletion() called when the method finishes.
nsIContentPrefObserver
dom/interfaces/base/nsicontentprefservice.idlscriptable this interface allows code to easily watch for changes to the values of content preferences.
nsIContentPrefService
dom/interfaces/base/nsicontentprefservice.idlscriptable please add a summary to this article.
nsIContentView
id nscontentviewid id that can be used in conjunction with nsidomwindowutils to change the actual document, instead of just how it is transformed; this is a 64-bit unsigned integer.
nsIControllers
ntrollercount(); nsicontroller getcontrollerforcommand(in string command); unsigned long getcontrollerid(in nsicontroller 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.
nsICookie
isdomain boolean true if the cookie is a domain cookie, false otherwise.
nsICookie2
rawhost autf8string the host (possibly fully qualified) of the cookie, without a leading dot to represent if it is a domain cookie.
nsIDNSService
netwerk/dns/nsidnsservice.idlscriptable provides domain name resolution service.
nsIDeviceMotionData
see also mozorientation nsidomorientationevent nsidevicemotionlistener nsidevicemotion ...
nsIDeviceMotionListener
see also mozorientation nsidomorientationevent nsidevicemotion nsidevicemotiondata ...
nsIDialogCreator
1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void opendialog(in unsigned long atype, in acstring aname, in acstring afeatures, in nsidialogparamblock aarguments, [optional] in nsidomelement aframeelement); constants constant value description unknown_dialog 0 generic_dialog 1 select_dialog 2 methods opendialog() void opendialog( in unsigned long atype, in acstring aname, in acstring afeatures, in nsidialogparamblock aarguments, in nsidomelement aframeelement optional ); parameters atype aname afeatures aarguments aframeelement optional ...
nsIDownloadProgressListener
in nsiwebprogress awebprogress, in nsirequest arequest, in unsigned long astateflags, in nsresult astatus, in nsidownload adownload); void onstatuschange(in nsiwebprogress awebprogress, in nsirequest arequest, in nsresult astatus, in wstring amessage, in nsidownload adownload); obsolete since gecko 1.9.1 attributes attribute type description document nsidomdocument document the document of the download manager frontend.
nsIEventListenerInfo
this approach is necessary because event listeners added with addeventlistener won't necessarily be nsieventlisteners; the dom code will fix up ordinary javascript functions to act as listeners.
nsIEventSource
content/base/public/nsieventsource.idlscriptable this is the interface for server-sent dom events 1.0 66 introduced gecko 6.0 inherits from: nsisupports last changed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) this implements the eventsource interface used for server-sent events.
nsIExternalHelperAppService
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.
nsIFrameLoaderOwner
exceptions thrown ns_error_dom_security_err if the swap is not allowed on security grounds.
nsIFrameMessageManager
set to oo if you want to receive messages during the short period after a frame has been removed from the dom and before its frame script has finished unloading.
nsIFrameScriptLoader
idl file: mozilla-central/source/dom/base/nsimessagemanager.idl inherits from: nsisupports this interface is used to load frame scripts.
nsIIDNService
netwerk/dns/nsiidnservice.idlscriptable this interface provides support for internationalized domain names, including methods for manipulating idn hostnames according to ietf specification.
nsIMessageBroadcaster
idl file: mozilla-central/source/dom/base/nsimessagemanager.idl inherits from: nsimessagelistenermanager message "broadcasters" don't have a single "other side" that they send messages to, but rather a set of subordinate message managers.
nsIMessageListener
idl file: mozilla-central/source/dom/base/nsimessagemanager.idl inherits from: nsisupports this interface is used to receive messages sent using the nsimessagebroadcaster, nsimessagesender, or nsisyncmessagesender interfaces.
nsIMessageSender
idl file: mozilla-central/source/dom/base/nsimessagemanager.idl inherits from: nsimessagelistenermanager message senders enable clients to send asynchronous messages to a single "other side".
nsIMsgCompFields
(bug 249530) newsgroups astring newshost char * newsposturl char * organization astring otherrandomheaders astring no longer exists - see https://groups.google.com/forum/#!topic/mozilla.dev.apps.thunderbird/s4ofmm8_b28 priority char * receiptheadertype print32 references char * replyto astring securityinfo nsisupports subject astring templatename astring temporar...
nsIMsgDatabase
ahdr, in boolean aadd); boolean hdrisincache(in string asearchfolderuri, in nsimsgdbhdr ahdr); attributes attribute type description dbfolderinfo nsidbfolderinfo readonly: firstnew nsmsgkey readonly: msgretentionsettings nsimsgretentionsettings msgdownloadsettings nsimsgdownloadsettings lowwaterarticlenum nsmsgkey readonly: highwaterarticlenum nsmsgkey readonly: nextpseudomsgkey nsmsgkey for undo-redo of move pop->imap.
nsIMsgIdentity
bccothers boolean bcclist astring dobcc boolean dobcclist astring draftfolder astring stationeryfolder astring showsavemsgdlg boolean directoryserver astring overrideglobalpref boolean autocompletetomydomain boolean if this is false, don't append the user's domain to an autocomplete address with no matches.
nsINavHistoryResultViewObserver
toolkit/components/places/public/nsinavhistoryservice.idlscriptable this interface is used by clients of the history results to define domain-specific handling of specific nsitreeview methods that the history result doesn't implement.
nsIPermissionManager
this requires an exact hostname match, subdomains are not a match.
nsIPluginHost
dom/plugins/base/nsipluginhost.idlscriptable please add a summary to this article.
nsIPrintingPrompt
inherits from: nsisupports last changed in gecko 1.7 this interface is identical to nsipintingpromptservice but without the parent nsidomwindow parameter.
nsIProcessScriptLoader
idl file: mozilla-central/source/dom/base/nsimessagemanager.idl inherits from: nsisupports this interface is used by parent process message managers to load scripts into a child process.
nsISHEntry
document nsidomdocument dom document.
nsIScriptError
categories the web console does not display "xpconnect javascript" "component javascript" "chrome javascript" "chrome registration" "xbl" "xbl prototype handler" "xbl content sink" "xbl javascript" "frameconstructor" categories the web console displays "hudconsole" "css parser" "css loader" "content javascript" "dom events" "dom:html" "dom window" "svg" "imagemap" "html" "canvas" "dom3 load" "dom" "malformed-xml" "dom worker javascript" "mixed content blocker" "csp" "invalid hsts headers" "insecure password field" see also using the web console error console nsiconsolemessage nsiscripterror2 ...
nsIStructuredCloneContainer
dom/interfaces/base/nsistructuredclonecontainer.idlscriptable this interface acts as a container for an object serialized using the structured clone algorithm.
nsISyncMessageSender
idl file: mozilla-central/source/dom/base/nsimessagemanager.idl inherits from: nsimessagelistenermanager message "senders" have a single "other side" to which messages are sent.
nsITaskbarPreview
tooltip domstring a string containing the text displayed in the tooltip above the preview when the user hovers over it.
nsITaskbarPreviewButton
tooltip domstring the string displayed in the button's tooltip.
nsITaskbarTabPreview
title domstring the title displayed above the thumbnail.
nsITextInputProcessorCallback
dom/interfaces/base/nsitextinputprocessor.idlscriptable a callback interface for nsitextinputprocessor user 1.0 66 introduced gecko 38 inherits from: nsisupports last changed in gecko 38.0 (firefox 38.0 / thunderbird 38.0 / seamonkey 2.35) nsitextinputprocessorcallback is defined for receiving requests and notifications to ime from gecko.
nsIThread
this can cause random crashes and other bugs that may be hard to find and fix.
nsITransferable
requestingnode nsidomnode the source dom node this transferable was created from.
nsITreeBoxObject
treebody nsidomelement readonly: obtain the treebody content node.
nsITreeColumn
element nsidomelement the treecol element.
nsIWebBrowserChrome2
if statustype is status_link, then this may be a dom node corresponding to the source of the link.
nsIWebNavigation
document nsidomdocument retrieves the current dom document for the frame, or lazily creates a blank document if there is none.
nsIXFormsNSInstanceElement
last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) interface code [scriptable, uuid(80669b92-8331-4f92-aaf8-06e80e6827b3)] interface nsixformsnsinstanceelement : nsisupports { nsidomdocument getinstancedocument(); }; methods getinstancedocument nsidomdocument getinstancedocument(); getinstancedocument returns a dom document that corresponds to the instance data associated with the instance element.
nsIXFormsNSModelElement
last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) interface code [scriptable, uuid(85fd60c7-1db7-40c0-ae8d-f723fdd1eea8)] interface nsixformsnsmodelelement : nsisupports { nsidomnodelist getinstancedocuments(); }; methods getinstancedocuments nsidomnodelist getinstancedocuments(); getinstancedocuments returns a nsidomnodelist containing all the instance documents for the model, making it possible to enumerate over instances in the model without knowing their names.
nsIXMLHttpRequestUpload
1.0 66 introduced gecko 1.9.1 inherits from: nsidomeventtarget last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) attributes attribute type description onabort nsidomeventlistener onerror nsidomeventlistener onload nsidomeventlistener onloadstart nsidomeventlistener onprogress nsidomeventlistener see also nsixmlhttprequest nsixmlhttprequesteventtarget xmlhttprequest using xmlhttprequest ...
nsIZipEntry
content/base/public/nsidomserializer.idlscriptable please add a summary to this article.
Storage
note: storage is not the same as the dom:storage feature which can be used by web pages to store persistent data or the session store api (an xpcom storage utility for use by extensions).
XPCOM
if you have a class that you think is involved in a cyclical-ownership leak, this page is for you.introduction to xpcom for the domwarning: this document has not yet been reviewed by the dom gurus, it might contain some errors.language bindingsan xpcom language binding is a bridge between a particular language and xpcom to provide access to xpcom objects from that language, and to let modules written in that language be used as xpcom objects by all other languages for which there are xpcom bindings.monitoring http activitygec...
XTF
MozillaTechXTF
tools dom inspector related topics dom, xbl ...
Events
some of these are standard events, such as those created by the dom.
Filelink Providers
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.
Thunderbird Configuration Files
on windows vista/xp/2000, the path is usually %appdata%\thunderbird\profiles\xxxxxxxx.default\, where xxxxxxxx is a random string of 8 characters.
Building a Thunderbird extension 3: install manifest
the first portion is the short name of the extension and must be in lowercase; the last portion is a two-part period-delimited value such as your first and last name or the top-level domain of your website.
Demo Addon
furthermore, it shows some messages in the inbox and lists a random attachment.
Styling the Folder Pane
this content covers features introduced in thunderbird 3 the folder pane in thunderbird is predominantly controlled by code in folderpane.js.
Using tab-modal prompts
thewindow = gbrowser.contentwindow; let prompt = components.classes["@mozilla.org/prompter;1"] .getservice(components.interfaces.nsipromptfactory) .getprompt(thewindow, components.interfaces.nsiprompt); let bag = prompt.queryinterface(components.interfaces.nsiwritablepropertybag2); bag.setpropertyasbool("allowtabmodal", true); the var "thewindow" is a reference to the dom window.
Flash Activation: Browser Comparison - Plugins
no no 'application/x-shockwave-flash' in navigator.mimetypes when user enables flash yes yes yes <object> with fallback content triggers ui yes, with exceptions no yes small/hidden flash triggers additional ui yes no no enabling flash automatically reloads the page no yes yes other features related to flash domain blocking plugin power saver peripheral content pause each of the browser vendors has a roadmap about the future of flash and changes to the user experience.
Plugins
plugin blocking by domain in order to improve security and performance for firefox users, firefox maintains a list of sites that are not able to use plugins.
3D view - Firefox Developer Tools
by clicking and dragging the view, you can rotate and re-orient the 3d presentation of the dom hierarchy of your page to see it from different angles, to better examine its structure.
How to - Firefox Developer Tools
access debugging in add-onsbreaking on exceptionsdebug eval sourcesdisable breakpointsexamine, modify, and watch variableshighlight and inspect dom nodesignore a sourceopen the debuggerpretty-print a minified filesearchset a breakpointset a conditional breakpointset watch expressionsstep through codeuse a source mapuse watchpoints ...
UI Tour - Firefox Developer Tools
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.
Debugger.Environment - Firefox Developer Tools
the global object and dom elements appear in the chain of environments via object environments.
Debugger.Memory - Firefox Developer Tools
own values include the following: “api” “eager_alloc_trigger” “destroy_runtime” “last_ditch” “too_much_malloc” “alloc_trigger” “debug_gc” “compartment_revived” “reset” “out_of_nursery” “evict_nursery” “full_store_buffer” “shared_memory_limit” “periodic_full_gc” “incremental_too_slow” “dom_window_utils” “component_utils” “mem_pressure” “cc_waiting” “cc_forced” “load_end” “page_hide” “nsjscontext_destroy” “set_new_document” “set_doc_shell” “dom_utils” “dom_ipc” “dom_worker” “inter_slice_gc” “refresh_frame” “full_gc_timer” “shutdown_cc” “user_inactive” noni...
Debugger.Object - Firefox Developer Tools
for example, in firefox, code in privileged compartments sees content dom element objects without redefinitions or extensions made to that object’s properties by content code.
Debugger.Script - Firefox Developer Tools
a dom event handler, whether embedded in html or attached to the element by other javascript code.
Tutorial: Show Allocations Per Call Path - Firefox Developer Tools
the (root) node's count includes objects allocated in the content page by the web browser, like dom events.
Debugger.Object - Firefox Developer Tools
for example, in firefox, code in privileged compartments sees content dom element objects without redefinitions or extensions made to that object's properties by content code.
The Firefox JavaScript Debugger - Firefox Developer Tools
there are multiple ways to tell the debugger how and when to pause: set a breakpoint set a conditional breakpoint set an xhr breakpoint set event listener breakpoints break on exceptions use watchpoints for property reads and writes break on dom mutation disable breakpoints control execution what can you do after execution pauses?
Deprecated tools - Firefox Developer Tools
not all of these have had wide adoption, and due to the cost of maintenance, seldom used panels are eventually removed.
Basic operations - Firefox Developer Tools
the tool then shows you the differences between the two snapshots: when you're looking at a comparison, you can't use the dominators view or the tree map view.
Examine Event Listeners - Firefox Developer Tools
firefox can display: standard dom events jquery events react events ...
Select an element - Firefox Developer Tools
click an element in the html pane to select it: you can also use the arrow keys to move around the dom with the keyboard.
Select and highlight elements - Firefox Developer Tools
click an element in the html pane to select it: you can also use the arrow keys to move around the dom with the keyboard.
Use the Inspector from the Web Console - Firefox Developer Tools
dom elements in the web console output get a target next to them.
Call Tree - Firefox Developer Tools
to do this, it generates some arrays filled with random integers and sorts them using each algorithm in turn.
Animating CSS properties - Firefox Developer Tools
the predominance of green is telling us that we're spending a lot of time painting.
Settings - Firefox Developer Tools
truncate dom attributes by default, the inspector truncates dom attributes that are more than 120 characters long.
Cache Storage - Firefox Developer Tools
under the cache storage type within the storage inspector you can see the contents of any dom caches created using the cache api.
about:debugging (before Firefox 68) - Firefox Developer Tools
if the dom.serviceworkers.enable preference is set to false in about:config.
Firefox Developer Tools
dom property viewer inspect the page's dom properties, functions, etc.
AbortController.AbortController() - Web APIs
specifications specification status comment domthe definition of 'abortcontroller()' in that specification.
AbortSignal: abort event - Web APIs
var controller = new abortcontroller(); var signal = controller.signal; signal.addeventlistener('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.
AbortSignal.onabort - Web APIs
var controller = new abortcontroller(); var signal = controller.signal; signal.onabort = function() { console.log('request aborted'); }; specifications specification status comment domthe definition of 'onabort' in that specification.
AbstractRange.collapsed - Web APIs
specifications specification status comment domthe definition of 'collapsed' in that specification.
AbstractRange.endOffset - Web APIs
specifications specification status comment domthe definition of 'endoffset' in that specification.
AbstractRange.startOffset - Web APIs
specifications specification status comment domthe definition of 'startoffset' in that specification.
AddressErrors.addressLine - Web APIs
syntax var addresslineerror = addresserrors.addressline; value if an error occurred during validation of the address due to one of the strings in the addressline array having an invalid value, this property is set to a domstring providing a human-readable error message explaining the validation error.
AddressErrors.city - Web APIs
syntax var cityerror = addresserrors.city; value if the value specified in the paymentaddress object's city property could not be validated, this property contains a domstring offering a human-readable explanation of the validation error and offers suggestions for correcting it.
AddressErrors.country - Web APIs
syntax var countryerror = addresserrors.country; value if an error occurred during validation of the address due to the country property having an invalid value, this property is set to a domstring providing a human-readable error message explaining the validation error.
AddressErrors.dependentLocality - Web APIs
syntax var localityerror = addresserrors.dependentlocality; value if the value specified in the paymentaddress object's dependentlocality property could not be validated, this property contains a domstring offering a human-readable explanation of the validation error and offers suggestions for correcting it.
AddressErrors.languageCode - Web APIs
syntax var languageerror = addresserrors.languagecode; value if the value specified in the paymentaddress object's languagecode property could not be validated, this property contains a domstring offering a human-readable explanation of the validation error and offers suggestions for correcting it.
AddressErrors.organization - Web APIs
syntax var organizationerror = addresserrors.organization; value if the value specified in the paymentaddress object's organization property could not be validated, this property contains a domstring offering a human-readable explanation of the validation error and offers suggestions for correcting it.
AddressErrors.phone - Web APIs
syntax var phoneerror = addresserrors.phone; value if the value specified in the paymentaddress object's phone property could not be validated, this property contains a domstring offering a human-readable explanation of the validation error and offers suggestions for correcting it.
AddressErrors.postalCode - Web APIs
syntax var postcodeerror = addresserrors.postcode; value if the value specified in the paymentaddress object's postalcode property could not be validated, this property contains a domstring offering a human-readable explanation of the validation error and offers suggestions for correcting it.
AddressErrors.recipient - Web APIs
syntax var recipienterror = addresserrors.recipient; value if the value specified in the paymentaddress object's recipient property could not be validated, this property contains a domstring offering a human-readable explanation of the validation error and offers suggestions for correcting it.
AddressErrors.region - Web APIs
syntax var regionerror = addresserrors.region; value if the value specified in the paymentaddress object's region property could not be validated, this property contains a domstring offering a human-readable explanation of the validation error and offers suggestions for correcting it.
AddressErrors.regionCode - Web APIs
syntax var regioncodeerror = addresserrors.regioncode; value if the value specified in the paymentaddress object's regioncode property could not be validated, this property contains a domstring offering a human-readable explanation of the validation error and offers suggestions for correcting it.
AddressErrors.sortingCode - Web APIs
syntax var sortingcodeerror = addresserrors.sortingcode; value if the value specified in the paymentaddress object's sortingcode property could not be validated, this property contains a domstring offering a human-readable explanation of the validation error and offers suggestions for correcting it.
AesCtrParams - Web APIs
properties name a domstring.
AesKeyGenParams - Web APIs
properties name a domstring.
AnalyserNode.AnalyserNode() - Web APIs
options optional fftsize: the desired initial size of the fft for frequency-domain analysis.
AnalyserNode.getFloatFrequencyData() - Web APIs
syntax var audioctx = new audiocontext(); var analyser = audioctx.createanalyser(); var dataarray = new float32array(analyser.frequencybincount); // float32array should be the same length as the frequencybincount void analyser.getfloatfrequencydata(dataarray); // fill the float32array with data returned from getfloatfrequencydata() parameters array the float32array that the frequency domain data will be copied to.
Animation.cancel() - Web APIs
WebAPIAnimationcancel
exceptions this method doesn't directly throw exceptions; however, if the animation's playstate is anything but "idle" when cancelled, the current finished promise is rejected with a domexception named aborterror.
Animation.finished - Web APIs
examples the following code waits until all animations running on the element elem have finished, then deletes the element from the dom tree: promise.all( elem.getanimations().map( function(animation) { return animation.finished } ) ).then( function() { return elem.remove(); } ); specifications specification status comment web animationsthe definition of 'animation.finished' in that specification.
Animation.id - Web APIs
WebAPIAnimationid
syntax var animationsid = animation.id; animation.id = newidstring; value a domstring which can be used to identify the animation, or null if the animation has no id.
Animation.playState - Web APIs
so they must be paused as soon as they are animated like so: // setting up the tear animations tears.foreach(function(el) { el.animate( tearsfalling, { delay: getrandommsrange(-1000, 1000), // randomized for each tear duration: getrandommsrange(2000, 6000), // randomized for each tear iterations: infinity, easing: 'cubic-bezier(0.6, 0.04, 0.98, 0.335)' }); el.pause(); }); // play the tears falling when the ending needs to be shown.
AnimationEvent.animationName - Web APIs
the animationevent.animationname read-only property is a domstring containing the value of the animation-name css property associated with the transition.
AnimationEvent.pseudoElement - Web APIs
summary the animationevent.pseudoelement read-only property is a domstring, starting with '::', containing the name of the pseudo-element the animation runs on.
AnimationPlaybackEvent.AnimationPlaybackEvent() - Web APIs
syntax var animationplaybackevent = new animationplaybackevent(type, eventinitdict); parameters type a domstring representing the name of the event.
AudioBuffer.duration - Web APIs
example // stereo var channels = 2; // create an empty two second stereo buffer at the // sample rate of the audiocontext var framecount = audioctx.samplerate * 2.0; var myarraybuffer = audioctx.createbuffer(2, framecount, audioctx.samplerate); button.onclick = function() { // fill the buffer with white noise; // just random values between -1.0 and 1.0 for (var channel = 0; channel < channels; channel++) { // this gives us the actual arraybuffer that contains the data var nowbuffering = myarraybuffer.getchanneldata(channel); for (var i = 0; i < framecount; i++) { // math.random() is in [0; 1.0] // audio needs to be in [-1.0; 1.0] nowbuffering[i] = math.random() * 2 - 1; } } co...
AudioBuffer.getChannelData() - Web APIs
cript = document.queryselector('script'); pre.innerhtml = myscript.innerhtml; // stereo var channels = 2; // create an empty two second stereo buffer at the // sample rate of the audiocontext var framecount = audioctx.samplerate * 2.0; var myarraybuffer = audioctx.createbuffer(2, framecount, audioctx.samplerate); button.onclick = function() { // fill the buffer with white noise; //just random values between -1.0 and 1.0 for (var channel = 0; channel < channels; channel++) { // this gives us the actual arraybuffer that contains the data var nowbuffering = myarraybuffer.getchanneldata(channel); for (var i = 0; i < framecount; i++) { // math.random() is in [0; 1.0] // audio needs to be in [-1.0; 1.0] nowbuffering[i] = math.random() * 2 - 1; } } // get an...
AudioBuffer.length - Web APIs
example // stereo var channels = 2; // create an empty two second stereo buffer at the // sample rate of the audiocontext var framecount = audioctx.samplerate * 2.0; var myarraybuffer = audioctx.createbuffer(2, framecount, audioctx.samplerate); button.onclick = function() { // fill the buffer with white noise; // just random values between -1.0 and 1.0 for (var channel = 0; channel < channels; channel++) { // this gives us the actual arraybuffer that contains the data var nowbuffering = myarraybuffer.getchanneldata(channel); for (var i = 0; i < framecount; i++) { // math.random() is in [0; 1.0] // audio needs to be in [-1.0; 1.0] nowbuffering[i] = math.random() * 2 - 1; } } co...
AudioBuffer.numberOfChannels - Web APIs
example // stereo var channels = 2; // create an empty two second stereo buffer at the // sample rate of the audiocontext var framecount = audioctx.samplerate * 2.0; var myarraybuffer = audioctx.createbuffer(2, framecount, audioctx.samplerate); button.onclick = function() { // fill the buffer with white noise; // just random values between -1.0 and 1.0 for (var channel = 0; channel < channels; channel++) { // this gives us the actual arraybuffer that contains the data var nowbuffering = myarraybuffer.getchanneldata(channel); for (var i = 0; i < framecount; i++) { // math.random() is in [0; 1.0] // audio needs to be in [-1.0; 1.0] nowbuffering[i] = math.random() * 2 - 1; } } co...
AudioBuffer.sampleRate - Web APIs
example // stereo var channels = 2; // create an empty two second stereo buffer at the // sample rate of the audiocontext var framecount = audioctx.samplerate * 2.0; var myarraybuffer = audioctx.createbuffer(2, framecount, audioctx.samplerate); button.onclick = function() { // fill the buffer with white noise; // just random values between -1.0 and 1.0 for (var channel = 0; channel < channels; channel++) { // this gives us the actual arraybuffer that contains the data var nowbuffering = myarraybuffer.getchanneldata(channel); for (var i = 0; i < framecount; i++) { // math.random() is in [0; 1.0] // audio needs to be in [-1.0; 1.0] nowbuffering[i] = math.random() * 2 - 1; } } co...
AudioBufferSourceNode.buffer - Web APIs
var myarraybuffer = audioctx.createbuffer(2, framecount, audioctx.samplerate); button.onclick = function() { // fill the buffer with white noise; //just random values between -1.0 and 1.0 for (var channel = 0; channel < channels; channel++) { // this gives us the actual arraybuffer that contains the data var nowbuffering = myarraybuffer.getchanneldata(channel); for (var i = 0; i < framecount; i++) { // math.random() is in [0; 1.0] // audio needs to be in [-1.0; 1.0] nowbuffering[i] = math.random() * 2 - 1; } } // get an...
AudioBufferSourceNode.detune - Web APIs
udioctx = new audiocontext(); const channelcount = 2; const framecount = audioctx.samplerate * 2.0; // 2 seconds const myarraybuffer = audioctx.createbuffer(channelcount, framecount, audioctx.samplerate); for (let channel = 0; channel < channelcount; channel++) { const nowbuffering = myarraybuffer.getchanneldata(channel); for (let i = 0; i < framecount; i++) { nowbuffering[i] = math.random() * 2 - 1; } } const source = audioctx.createbuffersource(); source.buffer = myarraybuffer; source.connect(audioctx.destination); source.detune.value = 100; // value in cents source.start(); specifications specification status comment web audio apithe definition of 'detune' in that specification.
AudioBufferSourceNode - Web APIs
var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); // create an empty three-second stereo buffer at the sample rate of the audiocontext var myarraybuffer = audioctx.createbuffer(2, audioctx.samplerate * 3, audioctx.samplerate); // fill the buffer with white noise; //just random values between -1.0 and 1.0 for (var channel = 0; channel < myarraybuffer.numberofchannels; channel++) { // this gives us the actual arraybuffer that contains the data var nowbuffering = myarraybuffer.getchanneldata(channel); for (var i = 0; i < myarraybuffer.length; i++) { // math.random() is in [0; 1.0] // audio needs to be in [-1.0; 1.0] nowbuffering[i] = math.random() * 2 - ...
AudioParamMap - Web APIs
the web audio api interface audioparammap represents a set of multiple audio parameters, each described as a mapping of a domstring identifying the parameter to the audioparam object representing its value.
AudioTrack.id - Web APIs
WebAPIAudioTrackid
syntax var trackid = audiotrack.id; value a domstring which identifies the track, suitable for use when calling gettrackbyid() on an audiotracklist such as the one specified by a media element's audiotracks property.
AudioTrack.kind - Web APIs
WebAPIAudioTrackkind
syntax var trackkind = audiotrack.kind; value a domstring specifying the type of content the media represents.
AudioTrack.label - Web APIs
WebAPIAudioTracklabel
syntax var audiotracklabel = audiotrack.label; value a domstring specifying the track's human-readable label, if one is available in the track metadata.
AudioTrack.language - Web APIs
syntax var audiotracklanguage = audiotrack.language; value a domstring specifying the bcp 47 (rfc 5646) format language tag of the primary language used in the audio track, or an empty string ("") if the language is not specified or known, or if the track doesn't contain speech.
AudioTrackList.getTrackById() - Web APIs
syntax var thetrack = audiotracklist.gettrackbyid(id); paramters id a domstring indicating the id of the track to locate within the track list.
AudioTrackList.length - Web APIs
example this snippet gets the number of audio tracks in the first <video> element found in the dom by queryselector().
AudioWorkletNode.parameters - Web APIs
r extends audioworkletprocessor { static get parameterdescriptors () { return [{ name: 'customgain', defaultvalue: 1, minvalue: 0, maxvalue: 1, automationrate: 'a-rate' }] } process (inputs, outputs, parameters) { const output = outputs[0] output.foreach(channel => { for (let i = 0; i < channel.length; i++) { channel[i] = (math.random() * 2 - 1) * (parameters['customgain'].length > 1 ?
AudioWorkletNode - Web APIs
// white-noise-processor.js class whitenoiseprocessor extends audioworkletprocessor { process (inputs, outputs, parameters) { const output = outputs[0] output.foreach(channel => { for (let i = 0; i < channel.length; i++) { channel[i] = math.random() * 2 - 1 } }) return true } } registerprocessor('white-noise-processor', whitenoiseprocessor) next, in our main script file we'll load the processor, create an instance of audioworkletnode passing it the name of the processor, and connect the node to an audio graph.
AudioWorkletProcessor.process - Web APIs
class whitenoiseprocessor extends audioworkletprocessor { process (inputs, outputs, parameters) { // take the first output const output = outputs[0] // fill each channel with random values multiplied by gain output.foreach(channel => { for (let i = 0; i < channel.length; i++) { // generate random value for each sample // math.random range is [0; 1); we need [-1; 1] // this won't include exact 1 but is fine for now for simplicity channel[i] = (math.random() * 2 - 1) * // the array can contain 1 or 128 values // dep...
AudioWorkletProcessor - Web APIs
// white-noise-processor.js class whitenoiseprocessor extends audioworkletprocessor { process (inputs, outputs, parameters) { const output = outputs[0] output.foreach(channel => { for (let i = 0; i < channel.length; i++) { channel[i] = math.random() * 2 - 1 } }) return true } } registerprocessor('white-noise-processor', whitenoiseprocessor) next, in our main script file we'll load the processor, create an instance of audioworkletnode, passing it the name of the processor, then connect the node to an audio graph.
AuthenticatorResponse.clientDataJSON - Web APIs
it has two properties: status: a string which is either "supported" which indicates the client support token binding but did not negotiate with the relying party or "present" when token binding was used already id: a domstring which is the base64url encoding of the token binding id which was used for the communication.
BaseAudioContext.createBuffer() - Web APIs
var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); // create an empty three-second stereo buffer at the sample rate of the audiocontext var myarraybuffer = audioctx.createbuffer(2, audioctx.samplerate * 3, audioctx.samplerate); // fill the buffer with white noise; // just random values between -1.0 and 1.0 for (var channel = 0; channel < myarraybuffer.numberofchannels; channel++) { // this gives us the actual arraybuffer that contains the data var nowbuffering = myarraybuffer.getchanneldata(channel); for (var i = 0; i < myarraybuffer.length; i++) { // math.random() is in [0; 1.0] // audio needs to be in [-1.0; 1.0] nowbuffering[i] = math.random() * 2 - ...
BaseAudioContext.createBufferSource() - Web APIs
cript = document.queryselector('script'); pre.innerhtml = myscript.innerhtml; // stereo var channels = 2; // create an empty two second stereo buffer at the // sample rate of the audiocontext var framecount = audioctx.samplerate * 2.0; var myarraybuffer = audioctx.createbuffer(2, framecount, audioctx.samplerate); button.onclick = function() { // fill the buffer with white noise; //just random values between -1.0 and 1.0 for (var channel = 0; channel < channels; channel++) { // this gives us the actual arraybuffer that contains the data var nowbuffering = myarraybuffer.getchanneldata(channel); for (var i = 0; i < framecount; i++) { // math.random() is in [0; 1.0] // audio needs to be in [-1.0; 1.0] nowbuffering[i] = math.random() * 2 - 1; } } // get an...
BaseAudioContext.createScriptProcessor() - Web APIs
{ var inputdata = inputbuffer.getchanneldata(channel); var outputdata = outputbuffer.getchanneldata(channel); // loop through the 4096 samples for (var sample = 0; sample < inputbuffer.length; sample++) { // make output equal to the same as the input outputdata[sample] = inputdata[sample]; // add noise to each output sample outputdata[sample] += ((math.random() * 2) - 1) * 0.2; } } } getdata(); // wire up play button playbutton.onclick = function() { source.connect(scriptnode); scriptnode.connect(audioctx.destination); source.start(); } // when the buffer source stops playing, disconnect everything source.onended = function() { source.disconnect(scriptnode); scriptnode.disconnect(audioctx.destination); } specificati...
BaseAudioContext.state - Web APIs
syntax baseaudiocontext.state; value a domstring.
BatteryManager - Web APIs
void seteventhandler(domstring type, eventhandler handler) eventhandler geteventhandler(domstring type) specifications specification status comment battery status api candidate recommendation initial definition ...
Using the Beacon API - Web APIs
the data argument is optional and its type may be an arraybufferview, blob, domstring, or formdata.
Blob() - Web APIs
WebAPIBlobBlob
example var afileparts = ['<a id="a"><b id="b">hey!</b></a>']; // an array consisting of a single domstring var omyblob = new blob(afileparts, {type : 'text/html'}); // the blob specification specification status comment file apithe definition of 'blob()' in that specification.
Blob.type - Web APIs
WebAPIBlobtype
syntax var mimetype = blob.type value a domstring containing the file's mime type, or an empty string if the type could not be determined.
BlobEvent.BlobEvent() - Web APIs
timecode optional a domhighrestimestamp to be used in initializing the blob event.
BlobEvent - Web APIs
WebAPIBlobEvent
blobevent.timecode read only a domhighrestimestamp indicating the difference between the timestamp of the first chunk in data and the timestamp of the first chunk in the first blobevent produced by this recorder.
BluetoothRemoteGATTCharacteristic - Web APIs
bluetoothremotegattcharacteristic.uuidread only returns a domstring containing the uuid of the characteristic, for example '00002a37-0000-1000-8000-00805f9b34fb' for the heart rate measurement characteristic.
BluetoothRemoteGATTService - Web APIs
bluetoothremotegattservice.uuidread only returns a domstring representing the uuid of this service.
BroadcastChannel() - Web APIs
syntax channel = new broadcastchannel(channel); values channel is a domstring representing the name of the channel; there is one single channel with this name for all browsing contexts with the same origin.
BroadcastChannel.name - Web APIs
the read-only broadcastchannel.name property returns a domstring, which uniquely identifies the given channel with its name.
BroadcastChannel - Web APIs
broadcastchannel.name read only returns a domstring, the name of the channel.
Broadcast Channel API - Web APIs
an example string message: // example of sending of a very simple message bc.postmessage('this is a test message.'); any kind of object can be sent, not just a domstring.
CSSConditionRule - Web APIs
interface cssconditionrule : cssgroupingrule { attribute domstring conditiontext; } properties the cssconditionrule derives from cssrule, cssgroupingrule and inherits all properties of these classes.
CSSGroupingRule - Web APIs
interface cssgroupingrule : cssrule { readonly attribute cssrulelist cssrules; unsigned long insertrule (domstring rule, unsigned long index); void deleterule (unsigned long index); } properties common to all cssgroupingrule instances the cssgroupingrule derives from cssrule and inherits all properties of this class.
CSSMediaRule - Web APIs
working draft no changes from document object model (dom) level 2 style specification document object model (dom) level 2 style specificationthe definition of 'cssmediarule' in that specification.
CSSPrimitiveValue.primitiveType - Web APIs
example var cs = window.getcomputedstyle(document.body); var cssvalue = cs.getpropertycssvalue("color"); console.log(cssvalue.primitivetype); specifications specification status comment document object model (dom) level 2 style specificationthe definition of 'cssprimitivevalue.primitivetype' in that specification.
CSSStyleDeclaration.length - Web APIs
working draft document object model (dom) level 2 style specificationthe definition of 'cssstyledeclaration' in that specification.
CSSStyleDeclaration.parentRule - Web APIs
working draft document object model (dom) level 2 style specificationthe definition of 'cssstyledeclaration' in that specification.
CSSStyleRule - Web APIs
working draft no changes document object model (dom) level 2 style specificationthe definition of 'cssrule' in that specification.
CSSValue.cssValueType - Web APIs
example var styledeclaration = document.stylesheets[0].cssrules[0].style; var cssvalue = styledeclaration.getpropertycssvalue("color"); console.log(cssvalue.cssvaluetype); specifications specification status comment document object model (dom) level 2 style specificationthe definition of 'cssvalue.cssvaluetype' in that specification.
CSSValueList.item() - Web APIs
WebAPICSSValueListitem
specifications specification status comment document object model (dom) level 2 style specificationthe definition of 'cssvaluelist.item' in that specification.
CSSValueList.length - Web APIs
specifications specification status comment document object model (dom) level 2 style specificationthe definition of 'cssvaluelist.length' in that specification.
CSSValueList - Web APIs
specifications specification status comment document object model (dom) level 2 style specificationthe definition of 'cssvalueslist' in that specification.
Using the CSS Painting API - Web APIs
using the paint worklet to use the paint worklet, we need to register it using addmodule() and include it in our css, ensuring the css selector matches a dom node in our html registering the worklet the setup and design of our paint worklet took place in the external script shown above.
Cache.delete() - Web APIs
WebAPICachedelete
cachename: a domstring that represents a specific cache to search within.
Cache.keys() - Web APIs
WebAPICachekeys
cachename: a domstring that represents a specific cache to search within.
CacheStorage.has() - Web APIs
WebAPICacheStoragehas
}); parameters cachename a domstring representing the name of the cache object you are looking for in the cachestorage.
CacheStorage.match() - Web APIs
cachename: a domstring that represents a specific cache to search within.
CanvasCaptureMediaStreamTrack.canvas - Web APIs
// obtain the canvas associated with the stream var canvas = stream.canvas; specifications specification status comment media capture from dom elementsthe definition of 'canvascapturemediastreamtrack.canvas' in that specification.
CanvasCaptureMediaStreamTrack.requestFrame() - Web APIs
example // find the canvas element to capture var canvaselt = document.getelementsbytagname("canvas")[0]; // get the stream var stream = canvaselt.capturestream(25); // 25 fps // send the current state of the canvas as a frame to the stream stream.getvideotracks()[0].requestframe(); specifications specification status comment media capture from dom elementsthe definition of 'canvascapturemediastream.requestframe()' in that specification.
CanvasCaptureMediaStreamTrack - Web APIs
specifications specification status comment media capture from dom elementsthe definition of 'canvascapturemediastreamtrack' in that specification.
CanvasPattern - Web APIs
canvaspattern.settransform() applies an svgmatrix or dommatrix representing a linear transform to the pattern.
CanvasRenderingContext2D.addHitRegion() - Web APIs
they let you route events to dom elements, and make it possible for users to explore the canvas without seeing it.
CanvasRenderingContext2D.createPattern() - Web APIs
it can be any of the following: htmlimageelement (<img>) svgimageelement (<image>) htmlvideoelement (<video>, by using the capture of the video) htmlcanvaselement (<canvas>) imagebitmap offscreencanvas repetition a domstring indicating how to repeat the pattern's image.
CanvasRenderingContext2D.fillStyle - Web APIs
syntax ctx.fillstyle = color; ctx.fillstyle = gradient; ctx.fillstyle = pattern; options color a domstring parsed as css <color> value.
CanvasRenderingContext2D.fillText() - Web APIs
syntax canvasrenderingcontext2d.filltext(text, x, y [, maxwidth]); parameters text a domstring specifying the text string to render into the context.
CanvasRenderingContext2D.filter - Web APIs
syntax ctx.filter = "<filter-function1> [<filter-function2>] [<filter-functionn>]"; ctx.filter = "none"; values the filter property accepts a value of "none" or one or more of the following filter functions in a domstring.
CanvasRenderingContext2D.font - Web APIs
syntax ctx.font = value; options value a domstring parsed as css font value.
CanvasRenderingContext2D.removeHitRegion() - Web APIs
syntax void ctx.removehitregion(id); parameters id a domstring representing the id of the region that is to be removed.
CanvasRenderingContext2D.shadowColor - Web APIs
syntax ctx.shadowcolor = color; color a domstring parsed as a css <color> value.
CanvasRenderingContext2D.strokeStyle - Web APIs
syntax ctx.strokestyle = color; ctx.strokestyle = gradient; ctx.strokestyle = pattern; options color a domstring parsed as css <color> value.
CanvasRenderingContext2D.strokeText() - Web APIs
syntax canvasrenderingcontext2d.stroketext(text, x, y [, maxwidth]); parameters text a domstring specifying the text string to render into the context.
Transformations - Web APIs
the translate() method also gives us the freedom to place the rectangle anywhere on the canvas without having to manually adjust coordinates in the fillrect() function.
Clients.get() - Web APIs
WebAPIClientsget
syntax self.clients.get(id).then(function(client) { // do something with your returned client }); parameters id a domstring representing the id of the client you want to get.
Clipboard.readText() - Web APIs
return value a promise that resolves with a domstring containing the textual contents of the clipboard.
Clipboard.writeText() - Web APIs
syntax var promise = navigator.clipboard.writetext(newcliptext) parameters newcliptext the domstring to be written to the clipboard.
Clipboard - Web APIs
WebAPIClipboard
readtext() requests text from the system clipboard; returns a promise which is resolved with a domstring containing the clipboard's text once it's available.
ClipboardItem.getType() - Web APIs
exceptions domexception the type does not match a known mime type.
CloseEvent.initCloseEvent() - Web APIs
reason a domstring describing the reason of the close in shuman-readable way.
CloseEvent - Web APIs
closeevent.reason read only returns a domstring indicating the reason the server closed the connection.
ContentIndexEvent() - Web APIs
syntax var contentindexevent = new contentindexevent(type, contentindexeventinit); parameters type a domstring indicating the event which occurred.
ContentIndexEvent.id - Web APIs
the contentindexevent is only available to the {domxref('serviceworkerglobalscope','global scope')}} of a serviceworker.
Credential Management API - Web APIs
subdomain-shared credentials later version of the spec allow credentials to be retrieved from a different subdomain.
CustomEvent.detail - Web APIs
ropriate event listener obj.addeventlistener("cat", function(e) { process(e.detail) }); // create and dispatch the event let event = new customevent("cat", { detail: { hazcheeseburger: true } }); obj.dispatchevent(event); // will return an object contaning the hazcheeseburger property let mydetail = event.detail; specifications specification status comment domthe definition of 'detail' in that specification.
DataTransfer.clearData() - Web APIs
</span> <span class="tweaked" id="target">drop zone</span> <div>status: <span id="status">drag to start</span></div> <div>data is: <span id="data">uninitialized</span></div> css span.tweaked { display: inline-block; margin: 1em 0; padding: 1em 2em; } #source { color: blue; border: 1px solid black; } #target { border: 1px solid black; } javascript window.addeventlistener('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.addeventlistener('dragstart', dragstarthandler); draggable.addeventlistener(...
DataTransfer.items - Web APIs
+ ev.target.id); // add this element's id to the drag payload so the drop handler will // know which element to add to its tree ev.datatransfer.setdata("text/plain", ev.target.id); ev.datatransfer.effectallowed = "move"; } function drop_handler(ev) { console.log("drop: target.id = " + ev.target.id); ev.preventdefault(); // get the id of the target and add the moved element to the target's dom var data = ev.datatransfer.getdata("text"); ev.target.appendchild(document.getelementbyid(data)); // print each format type if (ev.datatransfer.types != null) { for (var i=0; i < ev.datatransfer.types.length; i++) { console.log("...
DataTransfer.mozCursor - Web APIs
syntax datatransfer.mozcursor; return value a domstring representing one of the values listed above.
DataTransfer.types - Web APIs
+ ev.target.id); // add this element's id to the drag payload so the drop handler will // know which element to add to its tree ev.datatransfer.setdata("text/plain", ev.target.id); ev.datatransfer.effectallowed = "move"; } function drop_handler(ev) { console.log("drop: target.id = " + ev.target.id); ev.preventdefault(); // get the id of the target and add the moved element to the target's dom var data = ev.datatransfer.getdata("text"); ev.target.appendchild(document.getelementbyid(data)); // print each format type if (ev.datatransfer.types != null) { for (var i=0; i < ev.datatransfer.types.length; i++) { console.log("...
DataTransferItem.getAsString() - Web APIs
return value undefined callback the callback parameter is a callback function which accepts one parameter: domstring the drag data item's string data.
DataTransferItem.kind - Web APIs
syntax var itemkind = datatransferitem.kind; return value a domstring representing the drag data item's kind.
DataTransferItem.type - Web APIs
syntax dataitem.type; return value a domstring representing the drag data item's type.
DedicatedWorkerGlobalScope.name - Web APIs
syntax var nameobj = self.name; value a domstring.
Document() - Web APIs
WebAPIDocumentDocument
syntax new document(); specifications specification status comment domthe definition of 'document' in that specification.
Document.alinkColor - Web APIs
document.alinkcolor is deprecated in dom level 2 html.
Document.anchors - Web APIs
WebAPIDocumentanchors
document object model (dom) level 2 html specificationthe definition of 'document.anchors' in that specification.
Document: animationend event - Web APIs
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.
Document.applets - Web APIs
WebAPIDocumentapplets
document object model (dom) level 2 html specificationthe definition of 'document.applets' in that specification.
Document.characterSet - Web APIs
syntax var string = document.characterset; examples <button onclick="console.log(document.characterset);"> log character encoding </button> <!-- displays document's character encoding in the dev console, such as "iso-8859-1" or "utf-8" --> specifications specification status comment domthe definition of 'characterset' in that specification.
Document.close() - Web APIs
WebAPIDocumentclose
living standard document object model (dom) level 2 html specificationthe definition of 'document.close()' in that specification.
Document.compatMode - Web APIs
example if (document.compatmode == "backcompat") { // in quirks mode } specifications specification status comment domthe definition of 'compatmode' in that specification.
Document.contentType - Web APIs
specifications specification status comment domthe definition of 'document.contenttype' in that specification.
Document.createComment() - Web APIs
example var docu = new domparser().parsefromstring('<xml></xml>', 'application/xml'); var comment = docu.createcomment('this is a not-so-secret comment in your document'); docu.getelementsbytagname('xml')[0].appendchild(comment); alert(new xmlserializer().serializetostring(docu)); // displays: <xml><!--this is a not-so-secret comment in your document--></xml> specifications specification status comment domthe definition of 'document.createcomment' in that specification.
Document.createElementNS() - Web APIs
specifications specification status comment domthe definition of 'document.createelementns()' in that specification.
Document.createRange() - Web APIs
specifications specification status comment domthe definition of 'document.createrange' in that specification.
Document.createTextNode() - Web APIs
');">we can!</button> <hr /> <p id="p1">first line of paragraph.</p> </body> </html> specifications specification status comment domthe definition of 'document: createtextnode' in that specification.
Document.dir - Web APIs
WebAPIDocumentdir
the document.dir property is a domstring representing the directionality of the text of the document, whether left to right (default) or right to left.
Document.documentElement - Web APIs
specifications specification status comment domthe definition of 'document.documentelement' in that specification.
Document.documentURI - Web APIs
syntax const uri = document.documenturi example javascript document.getelementbyid("url").textcontent = document.documenturi; html <p id="urltext"> url:<br/> <span id="url">url goes here</span> </p> result specifications specification status comment domthe definition of 'documenturi' in that specification.
Document.evaluate() - Web APIs
WebAPIDocumentevaluate
specifications specification status comment document object model (dom) level 3 xpath specificationthe definition of 'document.evaluate' in that specification.
Document.fgColor - Web APIs
WebAPIDocumentfgColor
document.fgcolor is deprecated in dom level 2 html.
Document.forms - Web APIs
WebAPIDocumentforms
living standard document object model (dom) level 2 html specificationthe definition of 'document.forms' in that specification.
Document.getBoxObjectFor() - Web APIs
element is a domelement.
Document.getElementsByName() - Web APIs
living standard document object model (dom) level 2 html specificationthe definition of 'document.getelementsbyname()' in that specification.
Document.images - Web APIs
WebAPIDocumentimages
living standard document object model (dom) level 2 html specificationthe definition of 'document.images' in that specification.
Document: keypress event - Web APIs
interface keyboardevent bubbles yes cancelable yes default action varies: keypress event; launch text composition system; blur and focus events; domactivate event; other event examples addeventlistener keypress example this example logs the keyboardevent.code value whenever you press a key.
Document.linkColor - Web APIs
example document.linkcolor = 'blue'; specification html5 document.linkcolor is deprecated in dom level 2 html.
Document.links - Web APIs
WebAPIDocumentlinks
living standard document object model (dom) level 2 html specificationthe definition of 'document.links' in that specification.
Document.location - Web APIs
WebAPIDocumentlocation
though document.location is a read-only location object, you can also assign a domstring to it.
Document.open() - Web APIs
WebAPIDocumentopen
living standard document object model (dom) level 2 html specificationthe definition of 'document.open()' in that specification.
Document: readystatechange event - Web APIs
listener('click', () => { log.textcontent =''; window.settimeout(() => { window.location.reload(true); }, 200); }); window.addeventlistener('load', (event) => { log.textcontent = log.textcontent + 'load\n'; }); document.addeventlistener('readystatechange', (event) => { log.textcontent = log.textcontent + `readystate: ${document.readystate}\n`; }); document.addeventlistener('domcontentloaded', (event) => { log.textcontent = log.textcontent + `domcontentloaded\n`; }); result specifications specification status comment html living standardthe definition of 'readystatechange' in that specification.
Document.referrer - Web APIs
WebAPIDocumentreferrer
because this property returns only a string, it doesn't give you document object model (dom) access to the referring page.
Document: scroll event - Web APIs
examples scroll event throttling since scroll events can fire at a high rate, the event handler shouldn't execute computationally expensive operations such as dom modifications.
Document.title - Web APIs
WebAPIDocumenttitle
in the titlebar of the window or tab), and it also affects the dom of the document (e.g.
Document.tooltipNode - Web APIs
defined in nsidomxuldocument.idl.
Document.vlinkColor - Web APIs
document.vlinkcolor is deprecated in dom level 2 html.
DocumentFragment() - Web APIs
syntax fragment = new documentfragment() example let fragment = new documentfragment(); specification specification status comment domthe definition of 'documentfragment()' in that specification.
DocumentOrShadowRoot.activeElement - Web APIs
the activeelement read-only property of the document and shadowroot interfaces returns the element within the dom or shadow dom tree that currently has focus.
DocumentOrShadowRoot.caretPositionFromPoint() - Web APIs
the caretpositionfrompoint() property of the documentorshadowroot interface returns a caretposition object, containing the dom node, along with the caret and caret's character offset within that node.
DocumentOrShadowRoot.elementFromPoint() - Web APIs
result specifications specification status shadow domthe definition of 'elementsfrompoint()' in that specification.
DocumentOrShadowRoot.elementsFromPoint() - Web APIs
r (var i = 0; i < elements.length; i++) { output.textcontent += elements[i].localname; if (i < elements.length - 1) { output.textcontent += " < "; } } } else { output.innerhtml = "<span style=\"color: red;\">" + "browser does not support <code>document.elementsfrompoint()</code>" + "</span>"; } specifications specification status shadow domthe definition of 'elementsfrompoint()' in that specification.
DocumentOrShadowRoot.getSelection() - Web APIs
specifications specification status comment shadow domthe definition of 'documentorshadowroot' in that specification.
DragEvent() - Web APIs
syntax event = new dragevent(type, drageventinit); arguments type is a domstring representing the name of the event (see dragevent event types).
EcdhKeyDeriveParams - Web APIs
properties name a domstring.
EffectTiming.delay - Web APIs
examples in the pool of tears example, each tear is passed a random delay via its timing object: // randomizer function var getrandommsrange = function(min, max) { return math.random() * (max - min) + min; } // loop through each tear tears.foreach(function(el) { // animate each tear el.animate( tearsfalling, { delay: getrandommsrange(-1000, 1000), // randomized for each tear duration: getrandommsrange(2000, 6000), // randomized for...
EffectTiming.direction - Web APIs
syntax var timingproperties = { direction: "normal" | "reverse" | "alternate" | "alternate-reverse" }; timingproperties.direction = "normal" | "reverse" | "alternate" | "alternate-reverse"; value a domstring which specifies the direction in which the animation should play as well as what to do when the playback reaches the end of the animation sequence in the current direction.
EffectTiming.duration - Web APIs
examples in the pool of tears example, each tear is passed a random duration via its timing object: // randomizer function var getrandommsrange = function(min, max) { return math.random() * (max - min) + min; } // loop through each tear tears.foreach(function(el) { // animate each tear el.animate( tearsfalling, { delay: getrandommsrange(-1000, 1000), // randomized for each tear duration: getrandommsrange(2000, 6000), // randomized ...
EffectTiming.easing - Web APIs
accepts several pre-defined domstring values, a steps() timing function like steps(5, end), or a custom cubic-bezier value like cubic-bezier(0.42, 0, 0.58, 1).
EffectTiming.fill - Web APIs
WebAPIEffectTimingfill
syntax var timingproperties = { fill: "none" | "forwards" | "backwards" | "both" | "auto" } value a domstring indicating the fill type to use in order to properly render an affected element when outside the animation's active interval (that is, when it's not actively animating).
Element.accessKey - Web APIs
WebAPIElementaccessKey
the element.accesskey property is seldom used because of its multiple conflicts with already present key bindings in browsers.
Element.animate() - Web APIs
WebAPIElementanimate
options either an integer representing the animation's duration (in milliseconds), or an object containing one or more timing properties: id optional a property unique to animate(): a domstring with which to reference the animation.
Element: auxclick event - Web APIs
javascript let button = document.queryselector('button'); let html = document.queryselector('html'); function random(number) { return math.floor(math.random() * number); } function randomcolor() { return `rgb(${random(255)}, ${random(255)}, ${random(255)})`; } button.onclick = function() { button.style.backgroundcolor = randomcolor(); }; button.onauxclick = function(e) { e.preventdefault(); button.style.color = randomcolor(); } button.oncontextmenu = function(e) { e.preventdefault(); } notic...
Element: blur event - Web APIs
document object model (dom) level 3 events specification obsolete initial definition ...
Element: dblclick event - Web APIs
working draft document object model (dom) level 3 events specificationthe definition of 'dblclick' in that specification.
Element: focus event - Web APIs
document object model (dom) level 3 events specification obsolete initial definition ...
Element: focusin event - Web APIs
document object model (dom) level 3 events specification obsolete initial definition ...
Element: focusout event - Web APIs
document object model (dom) level 3 events specification obsolete initial definition ...
Element.getAttributeNames() - Web APIs
(element.prototype.getattributenames == undefined) { element.prototype.getattributenames = function () { var attributes = this.attributes; var length = attributes.length; var result = new array(length); for (var i = 0; i < length; i++) { result[i] = attributes[i].name; } return result; }; } specifications specification status comment domthe definition of 'element.getattributenames' in that specification.
Element: keypress event - Web APIs
interface keyboardevent bubbles yes cancelable yes default action varies: keypress event; launch text composition system; blur and focus events; domactivate event; other event examples addeventlistener keypress example this example logs the keyboardevent.code value whenever you press a key after focussing the <input> element.
Element.matches() - Web APIs
WebAPIElementmatches
if (!element.prototype.matches) { element.prototype.matches = element.prototype.msmatchesselector || element.prototype.webkitmatchesselector; } specification specification status comment domthe definition of 'element.prototype.matches' in that specification.
Element: mousedown event - Web APIs
working draft document object model (dom) level 3 events specificationthe definition of 'mousedown' in that specification.
Element: mousemove event - Web APIs
working draft document object model (dom) level 3 events specificationthe definition of 'mousemove' in that specification.
Element: mouseout event - Web APIs
working draft document object model (dom) level 3 events specificationthe definition of 'mouseout' in that specification.
Element: mouseover event - Web APIs
working draft document object model (dom) level 3 events specificationthe definition of 'mouseover' in that specification.
Element: mouseup event - Web APIs
working draft document object model (dom) level 3 events specificationthe definition of 'mouseup' in that specification.
Element.querySelector() - Web APIs
specifications specification status comment domthe definition of 'queryselector()' in that specification.
Element: scroll event - Web APIs
examples scroll event throttling since scroll events can fire at a high rate, the event handler shouldn't execute computationally expensive operations such as dom modifications.
ElementTraversal - Web APIs
specifications specification status comment domthe definition of 'childnode' in that specification.
Event.cancelBubble - Web APIs
example elem.onclick = function(event) { // do cool things here event.cancelbubble = true; } specifications specification status comment domthe definition of 'cancelbubble' in that specification.
Event.defaultPrevented - Web APIs
ltprevented) { log.innertext = 'sorry, but you cannot visit this link!\n' + log.innertext; } else { log.innertext = 'visiting link...\n' + log.innertext; } } } const a = document.getelementbyid('link2'); a.addeventlistener('click', stoplink); document.addeventlistener('click', logclick); result specifications specification status comment domthe definition of 'event.defaultprevented()' in that specification.
Event.explicitOriginalTarget - Web APIs
defined in /dom/public/idl/events/nsidomnsevent.idl this event property is not defined in the w3.org dom level 2 events ...
Event.msConvertURL() - Web APIs
targettype [in] type: domstring one of the following values indicating the desired conversion type: "specified", "base64", or "unchanged".
Event.originalTarget - Web APIs
defined in /dom/public/idl/events/nsidomnsevent.idl this event property is not defined in the w3.org dom level 2 events ...
Event.stopImmediatePropagation() - Web APIs
syntax event.stopimmediatepropagation(); specifications specification status comment domthe definition of 'event.stopimmediatepropagation()' in that specification.
EventTarget() - Web APIs
{ return this._secret; } }; let myeventtarget = new myeventtarget(5); let value = myeventtarget.secret; // == 5 myeventtarget.addeventlistener("foo", function(e) { this._secret = e.detail; }); let event = new customevent("foo", { detail: 7 }); myeventtarget.dispatchevent(event); let newvalue = myeventtarget.secret; // == 7 specifications specification status comment domthe definition of 'eventtarget() constructor' in that specification.
ExtendableMessageEvent.lastEventId - Web APIs
syntax var mylasteventid = extendablemessageevent.lasteventid; value a domstring.
FederatedCredential - Web APIs
federatedcredential.protocol read only returns a domstring containing a credential's federated identity protocol.
FetchEvent.clientId - Web APIs
syntax var myclientid = fetchevent.clientid; value a domstring that represents the client id.
FetchEvent.replacesClientId - Web APIs
syntax var myreplacedclientid = fetchevent.replacesclientid; value a domstring.
FetchEvent.resultingClientId - Web APIs
syntax var myresultingclientid = fetchevent.resultingclientid; value a domstring.
File.File() - Web APIs
WebAPIFileFile
available options are as follows: type: a domstring representing the mime type of the content that will be put into the file.
FileError - Web APIs
WebAPIFileError
use the new dom4 domerror interface instead.
FileReader.abort() - Web APIs
WebAPIFileReaderabort
syntax instanceoffilereader.abort(); exceptions dom_file_abort_err thrown when abort is called while no read operation is in progress (that is, the state isn't loading).
FileSystemEntry.toURL() - Web APIs
return value a domstring containing a url that can then be used as a document reference in html content, or an empty string if the url can't be generated (such as if the file system implementation doesn't support tourl()).
FileSystemSync - Web APIs
attributes attribute type description name readonly domstring name of the file system.
FileHandle API - Web APIs
such an object is basically a domrequest with an extra power: it allows to monitor the progress of an operation.
Introduction to the File and Directory Entries API - Web APIs
the file and directory entries api adheres to the same-origin policy the file and directory entries api does not let you create and rename executable files the file system is sandboxed you cannot run your app from file:// the file and directory entries api adheres to the same-origin policy an origin is the domain, application layer protocol, and port of a url of the document where the script is being executed.
FocusEvent.relatedTarget - Web APIs
working draft document object model (dom) level 3 events specificationthe definition of 'focusevent.relatedtarget' in that specification.
FocusEvent - Web APIs
working draft document object model (dom) level 3 events specificationthe definition of 'focusevent' in that specification.
FontFace.family - Web APIs
WebAPIFontFacefamily
syntax instanceoffontface.family = 'font family name'; var fontface = instanceoffontface.family; // "font family name" value a domstring.
Using FormData Objects - Web APIs
object let data = e.formdata; for (var value of data.values()) { console.log(value); } // submit the data via xhr let request = new xmlhttprequest(); request.open("post", "/formhandler"); request.send(data); }); note: the formdata event and formdataevent object are available in chrome from version 77 (and other equivalent chromiums), and firefox 72 (first available behind the dom.formdata.event.enabled pref in firefox 71).
FormDataEvent() - Web APIs
syntax new formdataevent(type[, formeventinit]); values type a domstring representing the name of the event.
Using the Frame Timing API - Web APIs
a frame represents the amount of work a browser does in one event loop iteration such as processing dom events, resizing, scrolling, rendering, css animations, etc.
Fullscreen API - Web APIs
documentorshadowroot.fullscreenelement the fullscreenelement property tells you the element that's currently being displayed in full-screen mode on the dom (or shadow dom).
Gamepad.id - Web APIs
WebAPIGamepadid
syntax readonly attribute domstring id; example window.addeventlistener("gamepadconnected", function() { var gp = navigator.getgamepads()[0]; gamepadinfo.innerhtml = "gamepad connected at index " + gp.index + ": " + gp.id + "."; }); value a string.
Gamepad.mapping - Web APIs
WebAPIGamepadmapping
syntax readonly attribute domstring mapping; example var gp = navigator.getgamepads()[0]; console.log(gp.mapping); value a string.
GamepadEvent() - Web APIs
syntax var gamepadevent = new gamepadevent(typearg, options) parameters typearg a domstring that must be one of gamepadconnected or gamepaddisconnected.
Using the Gamepad API - Web APIs
timestamp: this returns a domhighrestimestamp representing the last time the data for this gamepad was updated, allowing developers to determine if the axes and button data have been updated from the hardware.
GeolocationCoordinates.longitude - Web APIs
together with a domtimestamp indicating a time of measurement, the geolocationcoordinates object is part of the geolocationposition interface, which is the object type returned by geolocation api functions that obtain and return a geographical position.
GeolocationPosition - Web APIs
geolocationposition.timestamp read only secure context returns a domtimestamp representing the time at which the location was retrieved.
GeolocationPositionError - Web APIs
geolocationpositionerror.message read only secure context returns a human-readable domstring describing the details of the error.
Using the Geolocation API - Web APIs
the geolocationposition instance contains only two things, a coords property that contains the geolocationcoordinates instance, and a timestamp property that contains a domtimestamp instance representing the time at which the position data was retrieved.
GlobalEventHandlers.onloadstart - Web APIs
notes see the dom event handlers page for information on working with on...
GlobalEventHandlers.onauxclick - Web APIs
var button = document.queryselector('button'); var html = document.queryselector('html'); function random(number) { return math.floor(math.random() * number); } button.onclick = function() { var rndcol = 'rgb(' + random(255) + ',' + random(255) + ',' + random(255) + ')'; button.style.backgroundcolor = rndcol; }; button.onauxclick = function() { var rndcol = 'rgb(' + random(255) + ',' + random(255) + ',' + random(255) + ')'; button.style.color = rndcol; } note: if you are using a three-b...
GlobalEventHandlers.onemptied - Web APIs
notes see the dom event handlers page for information on working with on...
GlobalEventHandlers.onmousewheel - Web APIs
notes see the dom event handlers page for information on working with on...
GlobalEventHandlers.onscroll - Web APIs
living standard document object model (dom) level 3 events specificationthe definition of 'onscroll' in that specification.
HTMLAnchorElement.download - Web APIs
the htmlanchorelement.download property is a domstring indicating that the linked resource is intended to be downloaded rather than displayed in the browser.
HTMLAreaElement.rel - Web APIs
it is a domstring containing a space-separated list of link types indicating the relationship between the resource represented by the <area> element and the current document.
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.
HTMLButtonElement.labels - Web APIs
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.addeventlistener("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.
HTMLCanvasElement.captureStream() - Web APIs
send it to another computer using an rtcpeerconnection // pc is an rtcpeerconnection created elsewhere pc.addstream(stream); specifications specification status comment media capture from dom elementsthe definition of 'htmlcanvaselement.capturestream()' in that specification.
HTMLCanvasElement.getContext() - Web APIs
syntax var ctx = canvas.getcontext(contexttype); var ctx = canvas.getcontext(contexttype, contextattributes); parameters contexttype is a domstring containing the context identifier defining the drawing context associated to the canvas.
HTMLCanvasElement.mozFetchAsStream() - Web APIs
type optional a domstring indicating the image format.
HTMLCanvasElement.toBlob() - Web APIs
mimetype optional a domstring indicating the image format.
HTMLCanvasElement - Web APIs
media capture from dom elementsthe definition of 'htmlcanvaselement' in that specification.
HTMLCollection.item - Web APIs
note: because the contents of an htmlcollection are live, changes to the underlying dom can and will cause the position of individual nodes in the collection to change, so the index value will not necessarily remain constant for a given node.
HTMLContentElement.select - Web APIs
it is a domstring containing a space-separated list of css selectors that select the content to insert in place of the <content> element.
HTMLDataElement - Web APIs
htmldataelement.value is a domstring reflecting the value html attribute, containing a machine-readable form of the element's value.
HTMLDialogElement.returnValue - Web APIs
syntax dialoginstance.returnvalue = 'myreturnvalue'; var myreturnvalue = dialoginstance.returnvalue; value a domstring representing the returnvalue of the dialog.
HTMLElement: animationend event - Web APIs
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.
HTMLElement.click() - Web APIs
WebAPIHTMLElementclick
html <form> <input type="checkbox" id="mycheck" onmouseover="myfunction()" onclick="alert('click event occured')"> </form> javascript // on mouse-over, execute myfunction function myfunction() { document.getelementbyid("mycheck").click(); } specification specification status comment html living standard living standard document object model (dom) level 2 html specification obsolete initial definition.
HTMLElement.innerText - Web APIs
syntax const renderedtext = htmlelement.innertext htmlelement.innertext = string value a domstring representing the rendered text content of an element.
HTMLElement: input event - Web APIs
living standard document object model (dom) level 3 events specificationthe definition of 'input event' in that specification.
HTMLElement.lang - Web APIs
WebAPIHTMLElementlang
example // this snippet compares the base language and // redirects to another url based on language if (document.documentelement.lang === "en") { window.location.href = "some_document.html.en"; } else if (document.documentelement.lang === "ru") { window.location.href = "some_document.html.ru"; } specification specification status comment document object model (dom) level 2 html specificationthe definition of 'lang' in that specification.
HTMLElement.onpaste - Web APIs
note that there is currently no dom-only way to obtain the text being pasted; you'll have to use an nsiclipboard to get that information.
HTMLFontElement.color - Web APIs
the obsolete htmlfontelement.color property is a domstring that reflects the color html attribute, containing either a named color or a color specified in the hexadecimal #rrggbb format.
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.
HTMLFontElement.size - Web APIs
the obsolete htmlfontelement.size property is a domstring that reflects the size html attribute.
HTMLFormControlsCollection.namedItem() - Web APIs
syntax var item = collection.nameditem(str); var item = collection[str]; parameters str is a domstring return value item is a radionodelist , element, or null.
HTMLFormElement.elements - Web APIs
living standard document object model (dom) level 2 html specificationthe definition of 'htmlformelement.elements' in that specification.
HTMLFormElement.encoding - Web APIs
the htmlformelement.encoding property is an alternative name for the enctype element on the dom htmlformelement object.
HTMLHyperlinkElementUtils.hostname - Web APIs
the htmlhyperlinkelementutils.hostname property is a usvstring containing the domain of the url.
HTMLHyperlinkElementUtils.origin - Web APIs
the htmlhyperlinkelementutils.origin read-only property is a usvstring containing the unicode serialization of the origin of the represented url; that is: for url using the http or https, the scheme followed by '://', followed by the domain, followed by ':', followed by the port (the default port, 80 and 443 respectively, if explicitely specified); for url using file: scheme, the value is browser dependant; for url using the blob: scheme, the origin of the url following blob:.
HTMLHyperlinkElementUtils.password - Web APIs
the htmlhyperlinkelementutils.password property is a usvstring containing the password specified before the domain name.
HTMLHyperlinkElementUtils.username - Web APIs
the htmlhyperlinkelementutils.username property is a usvstring containing the username specified before the domain name.
HTMLIFrameElement.contentWindow - Web APIs
you can use this window object to access the iframe's document and its internal dom.
HTMLImageElement.align - Web APIs
syntax htmlimageelement.align = alignmode; alignmode = htmlimageelement.align; value a domstring specifying one of the following strings which set the alignment mode for the image.
HTMLImageElement.alt - Web APIs
syntax htmlimageelement.alt = alttext; let alttext = htmlimageelement.alt; value a domstring which contains the alternate text to display when the image is not loaded or for use by assistive devices.
HTMLImageElement.border - Web APIs
syntax htmlimageelement.border = thickness; let thickness = htmlimageelement.border; value a domstring containing an integer value specifying the thickness of the border that should surround the image, in css pixels.
HTMLImageElement.decoding - Web APIs
syntax refstr = imgelem.decoding; imgelem.decoding = refstr; values a domstring representing the decoding hint.
HTMLImageElement.loading - Web APIs
syntax let imageloadscheduling = htmlimageelement.loading; htmlimageelement.loading = eagerorlazy; value a domstring providing a hint to the user agent as to how to best schedule the loading of the image to optimize page performance.
HTMLImageElement.longDesc - Web APIs
syntax descurl = htmlimageelement.longdesc; htmlimageelement.longdesc = descurl; value a domstring which may be either an empty string (indicating that no long description is available) or the url of a file containing a long form description of the image's contents.
HTMLImageElement.lowSrc - Web APIs
syntax htmlimageelement.lowsrc = imageurl; imageurl = htmlimageelement.lowsrc; value a domstring specifying the url of a version of the image specified by src which has been modified in some fashion so that it loads significantly more quickly than the primary image.
HTMLImageElement.name - Web APIs
syntax htmlimageelement.name = namestring; namestring = htmlimageelement.name; value a domstring providing a name by which the image can be referenced.
HTMLImageElement.referrerPolicy - Web APIs
syntax refstr = imgelt.referrerpolicy; imgelt.referrerpolicy = refstr; values a domstring representing the referrer policy.
HTMLInputElement.labels - Web APIs
example html <label id="label1" for="test">label 1</label> <input id="test"/> <label id="label2" for="test">label 2</label> javascript window.addeventlistener("domcontentloaded", function() { const input = document.getelementbyid("test"); for(var i = 0; i < input.labels.length; i++) { console.log(input.labels[i].textcontent); // "label 1" and "label 2" } }); specifications specification status comment html living standardthe definition of 'labels' in that specification.
HTMLLabelElement.htmlFor - Web APIs
syntax controlid = htmllabelelement.htmlfor htmllabelelement.htmlfor = newid value a domstring which contains the id string of the element which is associated with the control.
HTMLLinkElement.referrerPolicy - Web APIs
syntax domstring htmllinkelement.referrerpolicy example var links = document.getelementsbytagname("link"); links[0].referrerpolicy; // "no-referrer" specifications specification status comment referrer policythe definition of 'referrerpolicy attribute' in that specification.
HTMLMediaElement.captureStream() - Web APIs
specifications specification status comment media capture from dom elementsthe definition of 'capturestream()' in that specification.
HTMLMediaElement.currentSrc - Web APIs
syntax var mediaurl = audioobject.currentsrc; value a domstring object containing the absolute url of the chosen media source; this may be an empty string if networkstate is empty; otherwise, it will be one of the resources listed by the htmlsourceelement contained within the media element, or the value or src if no <source> element is provided.
HTMLMediaElement.load() - Web APIs
pending play promises are aborted with an "aborterror" domexception.
HTMLMediaElement.mediaGroup - Web APIs
value a domstring.
HTMLMediaElement.msInsertAudioEffect() - Web APIs
syntax htmlmediaelement.msinsertaudioeffect(activatableclassid: domstring, effectrequired: boolean, config); parameters activatableclassid a domstring defining the audio effects class.
HTMLMediaElement.setSinkId() - Web APIs
exceptions exception explanation domexception no permission to use the requested device examples const devices = await navigator.mediadevices.enumeratedevices(); const audiodevices = devices.filter(device => device.kind === 'audiooutput'); const audio = document.createelement('audio'); await audio.setsinkid(audiodevices[0].deviceid); console.log('audio is being played on ' + audio.sinkid); specifications speci...
HTMLMediaElement.sinkId - Web APIs
the htmlmediaelement.sinkid read-only property returns a domstring that is the unique id of the audio device delivering output.
HTMLMeterElement.labels - Web APIs
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.addeventlistener("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.
HTMLOptionsCollection - Web APIs
mozilla allows this, while other implementations could potentially throw a domexception.
HTMLElement.blur() - Web APIs
recommendation document object model (dom) level 2 html specificationthe definition of 'blur' in that specification.
HTMLOutputElement.labels - Web APIs
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.addeventlistener("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.
HTMLProgressElement.labels - Web APIs
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.addeventlistener("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.
HTMLSelectElement.labels - Web APIs
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.addeventlistener("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.
HTMLSelectElement.namedItem() - Web APIs
syntax var item = collection.nameditem(str); var item = collection[str]; parameters str is a domstring.
HTMLSelectElement.options - Web APIs
example html <label for="test">label</label> <select id="test"> <option value="1">option 1</option> <option value="2">option 2</option> </select> javascript window.addeventlistener("domcontentloaded", function() { const select = document.getelementbyid("test"); for(var i = 0; i < select.options.length; i++) { console.log(select.options[i].label); // "option 1" and "option 2" } }); specifications specification status comment html living standardthe definition of 'options' in that specification.
HTMLSelectElement.setCustomValidity() - Web APIs
syntax selectelt.setcustomvalidity(string); parameters string is the domstring containing the error message.
HTMLShadowElement - Web APIs
the htmlshadowelement interface represents a <shadow> html element, which is used in shadow dom.
HTMLSlotElement: slotchange event - Web APIs
specifications specification status comment domthe definition of '"mutation observers" and slotchange event' in that specification.
HTMLTableElement.align - Web APIs
syntax htmltableelement.align = alignment; var alignment = htmltableelement.align; parameters alignment domstring with one of the following values: left center right example // set the alignmnet of a table var t = document.getelementbyid('tablea'); t.align = 'center'; specification w3c dom 2 html specification htmltableelement .align.
HTMLTableElement.border - Web APIs
example // set the width of a table border to 2 pixels var t = document.getelementbyid('tablea'); t.border = '2'; specification w3c dom 2 html specification htmltableelement .border.
HTMLTableElement.cellPadding - Web APIs
example // set cell padding to 10 pixels let t = document.getelementbyid('tablea'); t.cellpadding = '10'; specification w3c dom 2 html specification htmltableelement .cellpadding.
HTMLTableElement.frame - Web APIs
"above" top side "below" bottom side "hsides" top and bottom only "vsides" right and left sides only "lhs" left-hand side only "rhs" right-hand side only "box" all four sides "border" all four sides example // set the frame of tablea to 'border' var t = document.getelementbyid('tablea'); t.frame = "border"; t.border = "2px"; specification w3c dom 2 html specification ...
HTMLTableElement.rules - Web APIs
element.rules = rules; var rules = htmltableelement.rules; parameters rules is a string with one of the following values: none no rules groups lines between groups only rows lines between rows cols lines between cols all lines between all cells example // turn on all the internal borders of a table var t = document.getelementbyid("tableid"); t.rules = "all"; specification w3c dom 2 html specification ...
HTMLTableElement.summary - Web APIs
syntax htmltableelement.summary = string; varstring = htmltableelement.summary; example htmltableelement.summary = "usage statistics"; specification w3c dom 2 html specification ...
HTMLTableElement.tBodies - Web APIs
for example: <table> <tr> <td>cell one</td> </tr> </table> the html dom generated from the above html will have a <tbody> element even though the tags are not included in the source html.
HTMLTableRowElement.insertCell() - Web APIs
living standard document object model (dom) level 2 html specificationthe definition of 'htmltablerowelement.insertcell()' in that specification.
HTMLTemplateElement - Web APIs
content read only a read-only documentfragment which contains the dom subtree representing the <template> element's template contents.
HTMLTextAreaElement.labels - Web APIs
example html <label id="label1" for="test">label 1</label> <textarea id="test">some text</textarea> <label id="label2" for="test">label 2</label> javascript window.addeventlistener("domcontentloaded", function() { const textarea = document.getelementbyid("test"); for(var i = 0; i < textarea.labels.length; i++) { console.log(textarea.labels[i].textcontent); // "label 1" and "label 2" } }); specifications specification status comment html living standardthe definition of 'labels' in that specification.
HTMLTimeElement.dateTime - Web APIs
the htmltimeelement.datetime property is a domstring that reflects the datetime html attribute, containing a machine-readable form of the element's date and time value.
HTMLTimeElement - Web APIs
htmltimeelement.datetime is a domstring that reflects the datetime html attribute, containing a machine-readable form of the element's date and time value.
HTMLTrackElement.src - Web APIs
syntax var texttrackurl = htmltrackelement.src; value a domstring object containing the url of the text track data.
HTMLVideoElement.msInsertVideoEffect() - Web APIs
syntax str = htmlmediaelement.msinsertvideoeffect(activatableclassid: domstring, effectrequired: boolean, config); parameters activatableclassid a domstring defining the video effects class.
HTMLVideoElement.msIsLayoutOptimalForPlayback - Web APIs
syntax htmlvideoelement.msislayoutoptimalforplayback: domstring; value boolean value set to true indicates that video is being rendered optimally (better performance and using less battery power).
Drag Operations - Web APIs
the drag data's types property returns a list of mime-type like domstrings, such as text/plain or image/jpeg.
HashChangeEvent.newURL - Web APIs
syntax let neweventurl = event.newurl; value a domstring.
HashChangeEvent.oldURL - Web APIs
syntax let oldeventurl = event.oldurl; value a domstring.
Ajax navigation example - Web APIs
511: "network authentication required" }; var oreq, bisloading = false, bupdateurl = false; oloadingbox.id = "ajax-loader"; ocover.onclick = abortreq; oloadingimg.src = "data:image/gif;base64,r0lgodlheaaqapiaap///waaamlcwkjcqgaaagjiyokcgpkskih/c05fvfndqvbfmi4waweaaaah/hpdcmvhdgvkihdpdgggywphegxvywquaw5mbwah+qqjcgaaacwaaaaaeaaqaaadmwi63p4wyklre2mioggznadomgyjrbexwroumcg2lmdewnhqlvsyod2mbzkydadka+diaaah+qqjcgaaacwaaaaaeaaqaaadnai63p5ojcegg4qmu7dmikrxqlfuydezigbmrvsaqhwctxxf7weyb4ag1xjihkmzsiukkhiaifkecqoaaaasaaaaabaaeaaaazyiujijk8pbyjdmlfyvbovjha70gu7xsujhmktwhpakzlo9hmaokwjz7rf8aypddzkpzbqfvwqaifkecqoaaaasaaaaabaaeaaaazmiumilk8oyhphsnfzfhyumcyuhdaqxridhhbgqrokw0r8dyljd8z0fmdgsgo/iphi5taaaifkecqoaaaasaaaaabaaeaaaaziiunink0rnzbtwgpnmgqwmdsngxgjuliweu...
History API - Web APIs
the dom window object provides access to the browser's session history (not to be confused for webextensions history) through the history object.
IDBCursor.advance() - Web APIs
WebAPIIDBCursoradvance
exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbcursor's transaction is inactive.
IDBCursor.continue() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbcursor's transaction is inactive.
IDBCursor.continuePrimaryKey() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbcursor's transaction is inactive.
IDBCursor.delete() - Web APIs
WebAPIIDBCursordelete
exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbcursor's transaction is inactive.
IDBCursor.direction - Web APIs
the direction read-only property of the idbcursor interface is a domstring that returns the direction of traversal of the cursor (set using idbobjectstore.opencursor for example).
IDBCursor.source - Web APIs
WebAPIIDBCursorsource
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: domstringlist, keypath: "albumtitle", name: "rushalbumlist"…} the cursor does not require us to select the data based on a key; we can just grab all of it.
IDBCursor.update() - Web APIs
WebAPIIDBCursorupdate
exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbcursor's transaction is inactive.
IDBDatabase.createObjectStore() - Web APIs
exceptions this method may raise a domexception with a domerror of one of the following types: exception description invalidstateerror occurs if the method was not called from a versionchange transaction callback.
IDBDatabase.deleteObjectStore() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description invalidstateerror occurs if the method was not called from a versionchange transaction callback.
IDBFactory.cmp() - Web APIs
WebAPIIDBFactorycmp
return value an integer that indicates the result of the comparison; the table below lists the possible values and their meanings: returned value description -1 1st key is less than the 2nd key 0 1st key is equal to the 2nd key 1 1st key is greater than the 2nd key exceptions this method may raise a domexception of the following types: attribute description dataerror one of the supplied keys was not a valid key.
databases - Web APIs
exceptions this method may raise a domexception of the following types: attribute description securityerror the method is called from an opaque origin.
IDBFactory.open() - Web APIs
WebAPIIDBFactoryopen
exceptions this method may raise a domexception of the following types: exception description typeerror the value of version is zero or a negative number or not a number.
IDBIndex.count() - Web APIs
WebAPIIDBIndexcount
exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbindex's transaction is inactive.
IDBIndex.get() - Web APIs
WebAPIIDBIndexget
exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbindex's transaction is inactive.
IDBIndex.getAll() - Web APIs
WebAPIIDBIndexgetAll
exceptions this method may raise a domexception of the following types: exception description transactioninactiveerror this idbindex's transaction is inactive.
IDBIndex.getAllKeys() - Web APIs
exceptions this method may raise a domexception of the following types: exception description transactioninactiveerror this idbindex's transaction is inactive.
IDBIndex.getKey() - Web APIs
WebAPIIDBIndexgetKey
exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbindex's transaction is inactive.
IDBIndex.locale - Web APIs
WebAPIIDBIndexlocale
syntax var myindex = objectstore.index('index'); console.log(myindex.locale); value a domstring.
IDBIndex.name - Web APIs
WebAPIIDBIndexname
syntax var indexname = idbindex.name; idbindex.name = indexname; value a domstring specifying a name for the index.
IDBIndex.objectStore - Web APIs
the current object store is logged to the console: it should be returned something like this: idbobjectstore { name: "contactslist", keypath: "id", indexnames: domstringlist[7], transaction: idbtransaction, autoincrement: false } finally, we iterate through each record, and insert the data into an html table.
IDBIndex.openCursor() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbindex's transaction is inactive.
IDBIndex.openKeyCursor() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbindex's transaction is inactive.
IDBKeyRange.bound() - Web APIs
WebAPIIDBKeyRangebound
exceptions this method may raise a domexception of the following type: exception description dataerror the following conditions raise an exception: the lower or upper parameters were not passed a valid key.
IDBKeyRange.includes() - Web APIs
exceptions this method may raise a domexception of the following type: attribute description dataerror the supplied key was not a valid key.
IDBKeyRange.lowerBound() - Web APIs
exceptions this method may raise a domexception of the following type: exception description dataerror the value parameter passed was not a valid key.
IDBKeyRange.only() - Web APIs
WebAPIIDBKeyRangeonly
exceptions this method may raise a domexception of the following types: exception description dataerror the value parameter passed was not a valid key.
IDBKeyRange.upperBound() - Web APIs
exceptions this method may raise a domexception of the following type: exception description dataerror the value parameter passed was not a valid key.
FileHandle.getFile() - Web APIs
syntax var request = instanceoffilehandle.getfile(); return a domrequest object.
IDBMutableFile - Web APIs
mutablefile.getfile() returns a domrequest object.
IDBObjectStore.add() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description readonlyerror the transaction associated with this operation is in read-only mode.
IDBObjectStore.clear() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description readonlyerror the transaction associated with this operation is in read-only mode.
IDBObjectStore.count() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description invalidstateerror this idbobjectstore has been deleted.
IDBObjectStore.createIndex() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description constrainterror occurs if an index with the same name already exists in the database.
IDBObjectStore.delete() - Web APIs
exceptions this method may raise a domexception of the following types: exception description transactioninactiveerror this object store's transaction is inactive.
IDBObjectStore.deleteIndex() - Web APIs
return value undefined exceptions this method may raise a domexception of one of the following types: exception description invalidstateerror occurs if the method was not called from a versionchange transaction mode callback.
IDBObjectStore.get() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbobjectstore's transaction is inactive.
IDBObjectStore.getAll() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbobjectstore's transaction is inactive.
IDBObjectStore.getAllKeys() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbobjectstore's transaction is inactive.
IDBObjectStore.getKey() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbobjectstore's transaction is inactive.
IDBObjectStore.index() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description invalidstateerror the source object store has been deleted, or the transaction for the object store has finished.
IDBObjectStore.indexNames - Web APIs
syntax var myindexnames = objectstore.indexnames; value a domstringlist.
IDBObjectStore.name - Web APIs
syntax idbobjectstore.name = mynewname; var myobjectstorename = idbobjectstore.name; value a domstring containing the object store's name.
IDBObjectStore.openCursor() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description invalidstateerror this idbobjectstore or idbindex has been deleted.
IDBObjectStore.openKeyCursor() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description invalidstateerror this idbobjectstore or idbindex has been deleted.
IDBObjectStore.put() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description readonlyerror the transaction associated with this operation is in read-only mode.
IDBObjectStore - Web APIs
24 no support 23 — 57prefixed prefixed implemented with the vendor prefix: webkitedge full support 12firefox full support 44disabled full support 44disabled disabled from version 44: this feature is behind the dom.indexeddb.experimental preference.
IDBRequest - Web APIs
idbrequest.error read only returns a domexception in the event of an unsuccessful request, indicating what went wrong.
IDBTransaction.abort() - Web APIs
syntax transaction.abort(); exceptions this method may raise a domexception of the following type: exception description invalidstateerror the transaction has already been committed or aborted.
IDBTransaction.commit() - Web APIs
if it is called on a transaction that is not active, it throws an invalidstateerror domexception.
IDBTransaction.objectStore() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description notfounderror the requested object store is not in this transaction's scope.
IDBTransaction.oncomplete - Web APIs
you're storing critical data that cannot be recomputed later) you can force a transaction to flush to disk before delivering the complete event by creating a transaction using the experimental (non-standard) readwriteflush mode (see idbdatabase.transaction.) this is currently experimental, and can only be used if the dom.indexeddb.experimental pref is set to true in about:config.
IDBVersionChangeRequest.setVersion() - Web APIs
syntax idbversionchangerequest setversion ([treatnullas=emptystring] in domstring version); example tbd parameters version the version to store in the database.
IdleDeadline.timeRemaining() - Web APIs
syntax timeremaining = idledeadline.timeremaining(); return value a domhighrestimestamp value (which is a floating-point number) representing the number of milliseconds the user agent estimates are left in the current idle period.
IdleDeadline - Web APIs
methods idledeadline.timeremaining() returns a domhighrestimestamp, which is a floating-point value providing an estimate of the number of milliseconds remaining in the current idle period.
Browser storage limits and eviction criteria - Web APIs
there's one group for each etld+1 domain.
IndexedDB API - Web APIs
so while you can access stored data within a domain, you cannot access data across different domains.
InputDeviceCapabilities API - Web APIs
input device capabilities concepts and usage because dom events abstract device input, they provide no way to learn what device or type of device fired an event.
InputEvent.getTargetRanges() - Web APIs
the gettargetranges() property of the inputevent interface returns an array of static ranges that will be affected by a change to the dom if the input event is not canceled.
InputEvent.inputType - Web APIs
syntax var astring = inputevent.inputtype; value a domstring containing the type of input that was made.
InputEvent.isComposing - Web APIs
syntax var bool = event.iscomposing; example var inputevent = new inputevent('syntheticinput', false); console.log(inputevent.iscomposing); // return false specifications specification status comment document object model (dom) level 3 events specificationthe definition of 'inputevent.iscomposing' in that specification.
KeyboardEvent.altKey - Web APIs
</p> </body> </html> specifications specification status comment document object model (dom) level 3 events specificationthe definition of 'keyboardevent.altkey' in that specification.
KeyboardEvent.charCode - Web APIs
specifications specification status comment document object model (dom) level 3 events specificationthe definition of 'keyboardevent.charcode' in that specification.
KeyboardEvent.ctrlKey - Web APIs
ert( "key pressed: " + e.key + "\n" + "ctrl key pressed: " + e.ctrlkey + "\n" ); } </script> </head> <body onkeypress="showchar(event);"> <p>press any character key, with or without holding down the ctrl key.<br /> you can also use the shift key together with the ctrl key.</p> </body> </html> specifications specification status comment document object model (dom) level 3 events specificationthe definition of 'keyboardevent.ctrlkey' in that specification.
KeyboardEvent.initKeyboardEvent() - Web APIs
this method was introduced in draft of dom level 3 events, but deprecated in newer draft.
KeyboardEvent.isComposing - Web APIs
working draft document object model (dom) level 3 events specificationthe definition of 'keyboardevent.prototype.iscomposing' in that specification.
KeyboardEvent.keyCode - Web APIs
} if (handled) { // suppress "double action" if event handled event.preventdefault(); } }, true); specifications specification status comment document object model (dom) level 3 events specificationthe definition of 'keyboardevent.keycode' in that specification.
KeyboardEvent.keyIdentifier - Web APIs
this property was part of an old draft of the dom level 3 events specification, but it was removed in later drafts in favor of keyboardevent.key.
KeyboardEvent.metaKey - Web APIs
syntax var metakeypressed = instanceofkeyboardevent.metakey return value a boolean example function ismetakey(e) { alert("metakey = " + e.metakey); } <button onclick="ismetakey(event)">click me with the meta key</button> specifications specification status comment document object model (dom) level 3 events specificationthe definition of 'keyboardevent.metakey' in that specification.
KeyboardEvent.repeat - Web APIs
syntax var repeat = event.repeat; return value boolean specifications specification status comment document object model (dom) level 3 events specificationthe definition of 'keyboardevent.repeat' in that specification.
KeyboardEvent.shiftKey - Web APIs
shift key pressed: " + e.shiftkey + "\n" + "alt key pressed: " + e.altkey + "\n" ); } </script> </head> <body onkeypress="showchar(event);"> <p>press any character key, with or without holding down the shift key.<br /> you can also use the shift key together with the alt key.</p> </body> </html> specifications specification status comment document object model (dom) level 3 events specificationthe definition of 'keyboardevent.shiftkey' in that specification.
KeyboardEvent.which - Web APIs
function keydown(evt) { alert("onkeydown handler: \n" + "keycode property: " + evt.keycode + "\n" + "which property: " + evt.which + "\n" ); } </script> </head> <body onkeypress="showkeypress(event);" onkeydown="keydown(event);" > <p>please press any key.</p> </body> </html> specifications specification status comment document object model (dom) level 3 events specificationthe definition of 'keyboardevent.which' in that specification.
KeyframeEffect.KeyframeEffect() - Web APIs
its parameters are: element the dom element to be animated, or null.
LinkStyle - Web APIs
WebAPILinkStyle
working draft linkstyle.sheet returns more specialized cssstylesheet instead of stylesheet document object model (dom) level 2 style specificationthe definition of 'linkstyle' in that specification.
Location: ancestorOrigins - Web APIs
the ancestororigins read-only property of the location interface is a static domstringlist containing, in reverse order, the origins of all ancestor browsing contexts of the document associated with the given location object.
Location: hostname - Web APIs
WebAPILocationhostname
the hostname property of the location interface is a usvstring containing the domain of the url.
Location: origin - Web APIs
WebAPILocationorigin
the origin read-only property of the location interface is a usvstring containing the unicode serialization of the origin of the represented url; that is: for url using the http or https, the scheme followed by '://', followed by the domain, followed by ':', followed by the port (the default port, 80 and 443 respectively, if explicitely specified); for url using file: scheme, the value is browser dependant; for url using the blob: scheme, the origin of the url following blob:.
Location: password - Web APIs
WebAPILocationpassword
the password property of the location interface is a usvstring containing the password specified before the domain name.
Location: reload() - Web APIs
WebAPILocationreload
the reload may be blocked and a security_error domexception thrown.
Location: username - Web APIs
WebAPILocationusername
the username property of the location interface is a usvstring containing the username specified before the domain name.
Locks.name - Web APIs
WebAPILockname
syntax var name = lock.name value a domstring.
MIDIMessageEvent - Web APIs
note: even though the web midi api specifies a receivedtime property that returns a domhighrestimestamp, chrome (the only implementation at the time of writing) does not support that property since the basic event.timestamp property already returns a domhighrestimestamp in chrome.
MSManipulationEvent.initMSManipulationEvent() - Web APIs
syntax msmanipulationevent.initmsmanipulationevent(typearg, canbubblearg, cancelablearg, viewarg, detailarg, laststate, currentstate); parameters typearg [in] type: domstring the type of the event being created.
MSSiteModeEvent - Web APIs
dom information inheritance hierarchy event mssitemodeevent methods method description initevent initializes a new generic event that the createevent method created.
MediaDeviceInfo.kind - Web APIs
syntax var kind = mediadeviceinfo.kind value a domstring.
MediaDevices.getDisplayMedia() - Web APIs
exceptions rejections of the returned promise are made by passing a domexception error object to the promise's failure handler.
MediaError - Web APIs
mediaerror.message a domstring object containing a human-readable string which provides specific diagnostic information to help the reader understand the error condition which occurred; specifically, it isn't simply a summary of what the error code means, but actual diagnostic information to help in understanding what exactly went wrong.
MediaKeyMessageEvent() - Web APIs
syntax var mediakeymessageevent = new mediakeymessageevent(typearg, options) parameters typearg a domstring containing one of may be one of license-request, license-renewal, license-renewal, or individualization-request.
keySystem - Web APIs
the mediakeysystemaccess.keysystem read-only property returns a domstring identifying the key system being used.
MediaKeySystemAccess - Web APIs
properties mediakeysystemaccess.keysystem read only returns a domstring identifying the key system being used.
MediaList - Web APIs
WebAPIMediaList
properties medialist.mediatext a stringifier that returns a domstring representing the medialist as text, and also allows you to set a new medialist.
MediaQueryList - Web APIs
mediaread only a domstring representing a serialized media query.
MediaQueryListEvent.MediaQueryListEvent() - Web APIs
the available properties are: media: a domstring representing a serialized media query.
MediaQueryListEvent - Web APIs
mediaquerylistevent.mediaread only a domstring representing a serialized media query.
MediaRecorder.mimeType - Web APIs
syntax var mimetype = mediarecorder.mimetype value the mime media type which describes the format of the recorded media, as a domstring.
MediaRecorder.onerror - Web APIs
the error object is of type mediarecordererrorevent, and its error property contains a domexception object that describes the error that occurred.
MediaRecorder.pause() - Web APIs
when a mediarecorder object’s pause()method is called, the browser queues a task that runs the below steps: if mediarecorder.state is "inactive", raise a dom invalidstate error and terminate these steps.
MediaRecorder.requestData() - Web APIs
when the requestdata() method is invoked, the browser queues a task that runs the following steps: if mediarecorder.state is not "recording", raise a dom invalidstate error and terminate these steps.
MediaRecorder.resume() - Web APIs
when the resume() method is invoked, the browser queues a task that runs the following steps: if mediarecorder.state is "inactive", raise a dom invalidstate error and terminate these steps.
MediaRecorder.stop() - Web APIs
when the stop() method is invoked, the ua queues a task that runs the following steps: if mediarecorder.state is "inactive", raise a dom invalidstate error and terminate these steps.
MediaRecorder - Web APIs
the received event is based on the mediarecordererrorevent interface, whose error property contains a domexception that describes the actual error that occurred.
MediaRecorderErrorEvent() - Web APIs
error a domexception that describes the error that occurred.
MediaSession.playbackState - Web APIs
syntax let playbackstate = mediasession.playbackstate; mediasession.playbackstate = playbackstate; value a domstring indicating the current playback state of the media session.
MediaSession.setActionHandler() - Web APIs
syntax navigator.mediasession.setactionhandler(type, callback) parameters type a domstring representing an action type to listen for.
MediaSessionActionDetails.action - Web APIs
syntax let mediasessionactiondetails = { action: actiontype }; let actiontype = mediasessionactiondetails.action; value a domstring specifying which of the action types the callback is being invoked for: nexttrack advances playback to the next track.
MediaSource.addSourceBuffer() - Web APIs
syntax var sourcebuffer = mediasource.addsourcebuffer(mimetype); parameters mimetype a domstring specifying the mime type of the sourcebuffer to create and add to the mediasource.
MediaSource.endOfStream() - Web APIs
syntax mediasource.endofstream(endofstreamerror); parameters endofstreamerror optional a domstring representing an error to throw when the end of the stream is reached.
MediaSource.readyState - Web APIs
syntax var myreadystate = mediasource.readystate; value a domstring.
MediaStream.getTrackById() - Web APIs
syntax var track = mediastream.gettrackbyid(id); parameters id a domstring which identifies the track to be returned.
MediaStream.id - Web APIs
WebAPIMediaStreamid
the mediastream.id() read-only property is a domstring containing 36 characters denoting a unique identifier (guid) for the object.
MediaStream - Web APIs
mediastream.id read only a domstring containing 36 characters denoting a universally unique identifier (uuid) for the object.
MediaStreamConstraints - Web APIs
security peeridentity a domstring identifying the peer who has sole access to the stream.
MediaStreamEvent() - Web APIs
syntax var event = new mediastreamevent(type, mediastreameventinit); values type is a domstring containing the name of the event, like addstream or removestream.
MediaStreamEvent - Web APIs
it takes two parameters, the first being a domstring representing the type of the event; the second a dictionary containing the mediastream it refers to.
MediaStreamTrack.id - Web APIs
the mediastreamtrack.id read-only property returns a domstring containing a unique identifier (guid) for the track, which is generated by the user agent.
MediaStreamTrack.label - Web APIs
the mediastreamtrack.label read-only property returns a domstring containing a user agent-assigned label that identifies the track source, as in "internal microphone".
MediaStreamTrackEvent() - Web APIs
type a domstring representing the name of the type of the mediastreamtrackevent.
MediaStream Image Capture API - Web APIs
though a mediastream holds several types of tracks and provides multiple methods for retrieving them, the imagecapture constructor will throw a domexception of type notsupportederror if mediastreamtrack.kind is not "video".
MediaStream Recording API - Web APIs
its error property is a domexception that specifies that error occurred.
MediaTrackConstraints.logicalSurface - Web APIs
the mediatrackconstraints dictionary's logicalsurface property is a constraindomstring describing the requested or mandatory constraints placed upon the value of the logicalsurface constrainable property.
MediaTrackSettings.cursor - Web APIs
syntax cursorsetting = mediatracksettings.cursor; value the value of cursor comes from the cursorcaptureconstraint enumerated string type, and may have one of the following values: always the mouse should always be visible in the video content of the {domxref("mediastream"), unless the mouse has moved outside the area of the content.
Media Source API - Web APIs
streaming media has up until recently been the domain of flash, with technologies like flash media server serving video streams using the rtmp protocol.
MerchantValidationEvent.methodName - Web APIs
syntax methodid = merchantvalidationevent.methodname; value a read-only domstring which uniquely identifies the payment handler which is requesting merchant validation.
MerchantValidationEvent - Web APIs
properties merchantvalidationevent.methodname secure context a domstring providing a unique payment method identifier for the payment handler that's requiring validation.
MessageEvent.MessageEvent() - Web APIs
lasteventid: a domstring representing a unique id for the event.
MessageEvent - Web APIs
messageevent.lasteventid read only a domstring representing a unique id for the event.
Microsoft API extensions - Web APIs
microsoft browsers (internet explorer, and in a few cases, microsoft edge) support a number of special microsoft extensions to the otherwise standard dom apis.
MouseEvent.buttons - Web APIs
log.data = `${e.buttons} (${e.type})`; // log.nodevalue= `${e.buttons} (${e.type})`; } document.addeventlistener('mouseup', logbuttons); document.addeventlistener('mousedown', logbuttons); // document.addeventlistener('mousemove', logbuttons); document.queryselector('#log').appendchild(log) result specifications specification status comment document object model (dom) level 3 events specificationthe definition of 'mouseevent.buttons' in that specification.
MouseEvent.getModifierState() - Web APIs
specifications specification status comment document object model (dom) level 3 events specificationthe definition of 'getmodifierstate()' in that specification.
MouseEvent.region - Web APIs
WebAPIMouseEventregion
syntax var hitregion = instanceofmouseevent.region return value a domstring representing the id of the hit region.
msPlayToPrimary - Web APIs
example // microsoft extensions interface htmlimageelement : htmlelement { attribute boolean msplaytodisabled; attribute boolean msplaytoprimary; attribute domstring msplaytopreferredsourceuri; }; see also htmlmediaelement ...
MutationObserverInit.attributeOldValue - Web APIs
specifications specification status comment domthe definition of 'mutationobserverinit.attributeoldvalue' in that specification.
MutationObserverInit.attributes - Web APIs
specifications specification status comment domthe definition of 'mutationobserverinit.attributes' in that specification.
MutationObserverInit.characterData - Web APIs
example specifications specification status comment domthe definition of 'mutationobserverinit.characterdata' in that specification.
MutationObserverInit.subtree - Web APIs
to monitor the entire subtree for attribute changes, simply set subtree to true: var options = { attributes: true, subtree: true }; example specifications specification status comment domthe definition of 'mutationobserverinit.subtree' in that specification.
MutationObserverInit - Web APIs
specifications specification status comment domthe definition of 'mutationobserverinit' in that specification.
NDEFReader.scan() - Web APIs
WebAPINDEFReaderscan
exceptions this method doesn't throw true exceptions; instead, it rejects the returned promise, passing into it a domexception whose name is one of the following: aborterror the scan operation was aborted with abortsignal passed in options.
Navigator.getBattery() - Web APIs
exceptions this method doesn't throw true exceptions; instead, it rejects the returned promise, passing into it a domexception whose name is one of the following: securityerror the user agent does not expose battery information to insecure contexts and this method was called from insecure context.
Navigator.getUserMedia() - Web APIs
}; } errorcallback when the call fails, the function specified in the errorcallback is invokedwith a mediastreamerror object as its sole argument; this object is is modeled on domexception.
Navigator.msLaunchUri() - Web APIs
syntax navigator.mslaunchuri(uri, successcallback, nohandlercallback); parameters uri a domstring specifying the url containing including the protocol of the document or resource to be displayed.
Navigator.oscpu - Web APIs
WebAPINavigatoroscpu
syntax oscpuinfo = navigator.oscpu value a domstring providing a string which identifies the operating system on which the browser is running.
Web-based protocol handlers - Web APIs
firefox displays a prompt in the notification bar area: note:the url template supplied when registering must be of the same domain as the webpage attempting to perform the registration or the registration will fail.
Navigator.sendBeacon() - Web APIs
data a arraybuffer, arraybufferview, blob, domstring, formdata, or urlsearchparams object containing the data to send.
NavigatorID.platform - Web APIs
syntax platform = navigator.platform value a domstring identifying the platform on which the browser is running, or an empty string if the browser declines to (or is unable to) identify the platform.
NavigatorID.userAgent - Web APIs
syntax var ua = navigator.useragent; value a domstring specifying the complete user agent string the browser provides both in http headers and in response to this and other related methods on the navigator object.
NavigatorLanguage.language - Web APIs
syntax const lang = navigator.language value a domstring.
NavigatorLanguage.languages - Web APIs
the navigatorlanguage.languages read-only property returns an array of domstrings representing the user's preferred languages.
Node.contains() - Web APIs
WebAPINodecontains
false : document.body.contains(node); } specifications specification status comment domthe definition of 'node.contains()' in that specification.
Node.hasChildNodes() - Web APIs
nodes = prototype.haschildnodes || function() { return !!this.firstchild; } })(node.prototype); there are various ways to determine whether the node has a child node: node.haschildnodes() node.firstchild != null (or just node.firstchild) node.childnodes && node.childnodes.length (or node.childnodes.length > 0) specifications specification status comment domthe definition of 'node: haschildnodes' in that specification.
Node.isDefaultNamespace() - Web APIs
example var xulns = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; var el = document.getelementsbytagnamens(xulns, 'textbox')[0]; alert(el.isdefaultnamespace(xulns)); // true specifications specification status comment domthe definition of 'node: isdefaultnamespace' in that specification.
Node.isEqualNode() - Web APIs
WebAPINodeisEqualNode
= document.getelementsbytagname("div"); output.innerhtml += "div 0 equals div 0: " + divlist[0].isequalnode(divlist[0]) + "<br/>"; output.innerhtml += "div 0 equals div 1: " + divlist[0].isequalnode(divlist[1]) + "<br/>"; output.innerhtml += "div 0 equals div 2: " + divlist[0].isequalnode(divlist[2]) + "<br/>"; results specifications specification status comment domthe definition of 'node.isequalnode' in that specification.
Node.lookupPrefix() - Web APIs
WebAPINodelookupPrefix
the node.lookupprefix() method returns a domstring containing the prefix for a given namespace uri, if present, and null if not.
Node.nodeValue - Web APIs
WebAPINodenodeValue
specifications specification status comment domthe definition of 'node: nodevalue' in that specification.
Node.normalize() - Web APIs
WebAPINodenormalize
.appendchild( document.createtextnode("part 2 ") ); // at this point, wrapper.childnodes.length === 2 // wrapper.childnodes[0].textcontent === "part 1 " // wrapper.childnodes[1].textcontent === "part 2 " wrapper.normalize(); // now, wrapper.childnodes.length === 1 // wrapper.childnodes[0].textcontent === "part 1 part 2 " specifications specification status comment domthe definition of 'node: normalize' in that specification.
Node.ownerDocument - Web APIs
example // given a node "p", get the top-level html // child of the document object var d = p.ownerdocument; var html = d.documentelement; specifications specification status comment domthe definition of 'node: ownerdocument' in that specification.
Node.rootNode - Web APIs
WebAPINoderootNode
see whitespace in the dom and w3c dom 3 faq: why are some text nodes empty?
Node.textContent - Web APIs
WebAPINodetextContent
or set the element's text content: document.getelementbyid('diva').textcontent = 'this text is different!'; // the html for diva is now: // <div id="diva">this text is different!</div> specifications specification status comment domthe definition of 'node.textcontent' in that specification.
NodeIterator.expandEntityReferences - Web APIs
syntax expand = nodeiterator.expandentityreferences; example var nodeiterator = document.createnodeiterator( document.body, nodefilter.show_element, { acceptnode: function(node) { return nodefilter.filter_accept; } }, false ); expand = nodeiterator.expandentityreferences; specifications specification status comment document object model (dom) level 2 traversal and range specificationthe definition of 'nodeiterator.expandentityreferences' in that specification.
NodeIterator.pointerBeforeReferenceNode - Web APIs
syntax flag = nodeiterator.pointerbeforereferencenode; example var nodeiterator = document.createnodeiterator( document.body, nodefilter.show_element, { acceptnode: function(node) { return nodefilter.filter_accept; } }, false ); flag = nodeiterator.pointerbeforereferencenode; specifications specification status comment domthe definition of 'nodeiterator.pointerbeforereferencenode' in that specification.
NodeIterator.referenceNode - Web APIs
syntax node = nodeiterator.referencenode; example var nodeiterator = document.createnodeiterator( document.body, nodefilter.show_element, { acceptnode: function(node) { return nodefilter.filter_accept; } }, false ); node = nodeiterator.referencenode; specifications specification status comment domthe definition of 'nodeiterator.referencenode' in that specification.
NonDocumentTypeChildNode - Web APIs
specifications specification status comment domthe definition of 'nondocumenttypechildnode' in that specification.
Notification.body - Web APIs
WebAPINotificationbody
syntax var body = notification.body; value a domstring.
Notification.dir - Web APIs
WebAPINotificationdir
syntax var direction = notification.dir; value a domstring specifying the text direction.
Notification.permission - Web APIs
syntax var permission = notification.permission; value a domstring representing the current permission.
Notification.requestPermission() - Web APIs
returns a promise that resolves to a domstring with the permission picked by the user.
Notification.tag - Web APIs
WebAPINotificationtag
syntax var tag = notification.tag; value a domstring.
Notification.title - Web APIs
syntax var title = notification.title; value a domstring.
NotificationEvent.action - Web APIs
returns a domstring object.
OfflineAudioCompletionEvent.OfflineAudioCompletionEvent() - Web APIs
syntax var offlineaudiocompletionevent = new offlineaudiocompletionevent(type, init) parameters type optional a domstring representing the type of object to create.
OffscreenCanvas.convertToBlob() - Web APIs
syntax promise<blob> offscreencanvas.converttoblob(options); parameters optionsoptional you can specify several options when converting your offscreencanvas object into a blob object, for example: const blob = offscreencanvas.converttoblob({ type: "image/jpeg", quality: 0.95 }); options: type: a domstring indicating the image format.
OffscreenCanvas.convertToBlob() - Web APIs
syntax promise<blob> offscreencanvas.converttoblob(options); parameters optionsoptional you can specify several options when converting your offscreencanvas object into a blob object, for example: const blob = offscreencanvas.converttoblob({ type: "image/jpeg", quality: 0.95 }); options: type: a domstring indicating the image format.
OffscreenCanvas.getContext() - Web APIs
syntax offscreen.getcontext(contexttype, contextattributes); parameters contexttype is a domstring containing the context identifier defining the drawing context associated to the canvas.
OffscreenCanvas.convertToBlob() - Web APIs
syntax promise<blob> offscreencanvas.converttoblob(options); parameters options optional you can specify several options when converting your offscreencanvas object into a blob object, for example: const blob = offscreencanvas.converttoblob({ type: "image/jpeg", quality: 0.95 }); options: type: a domstring indicating the image format.
OscillatorNode.type - Web APIs
syntax oscillatornode.type = type; value a domstring specifying the shape of oscillator wave.
OverconstrainedError.message - Web APIs
syntax var message = overconstrainederror.message; value a domstring.
OverconstrainedError.name - Web APIs
syntax var name = overconstrainederror.name; value a domstring.
Page Visibility API - Web APIs
document.visibilitystate read only a domstring indicating the document's current visibility state.
ParentNode.childElementCount - Web APIs
ll) { object.defineproperty(constructor.prototype, 'childelementcount', { get: function() { var i = 0, count = 0, node, nodes = this.childnodes; while (node = nodes[i++]) { if (node.nodetype === 1) count++; } return count; } }); } })(window.node || window.element); specification specification status comment domthe definition of 'parentnode.childelementcount' in that specification.
ParentNode.firstElementChild - Web APIs
ion() { var node, nodes = this.childnodes, i = 0; while (node = nodes[i++]) { if (node.nodetype === 1) { return node; } } return null; } }); } })(window.node || window.element); specification specification status comment domthe definition of 'parentnode.firstelementchild' in that specification.
ParentNode.lastElementChild - Web APIs
y(constructor.prototype, 'lastelementchild', { get: function() { var node, nodes = this.childnodes, i = nodes.length - 1; while(node = nodes[i--]) { if(node.nodetype === 1) { return node; } } return null; } }); } })(window.node || window.element); specification specification status comment domthe definition of 'parentnode.lastelementchild' in that specification.
PayerErrors.email - Web APIs
WebAPIPayerErrorsemail
syntax payeremail = payererrors.email; value if validation of the payer's email address (paymentresponse.payeremail) found problems, this property should be set to a domstring that explains the validation problem and how to correct it.
PayerErrors.name - Web APIs
WebAPIPayerErrorsname
syntax payername = payererrors.name; value if this property is present in the payererrors object, the payer's name couldn't be successfully validated, and the name property's value is a domstring explaining the error.
PayerErrors.phone - Web APIs
WebAPIPayerErrorsphone
syntax payerphone = payererrors.phone; value if this property is present in the payererrors object, the payer's phone number couldn't be successfully validated, and the phone property's value is a domstring explaining the error.
PaymentAddress.city - Web APIs
syntax var paymentcity = paymentaddress.city; value a domstring indicating the city or town portion of the address described by the paymentaddress object.
PaymentAddress.country - Web APIs
syntax var paymentcountry = paymentaddress.country; value a domstring which contains the iso3166-1 alpha-2 code identifying the country in which the address is located, or an empty string if no country is available, which frequently can be assumed to mean "same country as the site owner." usage notes if the payment handler validates the address and determines that the value of country is invalid, a call to paymentrequestupdateevent.updatewith() will be made with a details object containing a shippingaddresserrors field.
PaymentAddress.languageCode - Web APIs
syntax var paymentlanguagecode = paymentaddress.languagecode; value a domstring providing the bcp-47 format language code indicating the language the address was written in, such as "en-us", "pt-br", or "ja-jp".
PaymentAddress.organization - Web APIs
syntax var paymentorganization = paymentaddress.organization; value a domstring whose value is the name of the organization or company located at the address described by the paymentaddress object.
PaymentAddress.phone - Web APIs
syntax var paymentphone = paymentaddress.phone; value a domstring containing the telephone number for the recipient of the shipment or of the responsible party for payment.
PaymentAddress.postalCode - Web APIs
syntax var paymentpostalcode = paymentaddress.postalcode; value a domstring which contains the postal code portion of the address.
PaymentAddress.recipient - Web APIs
syntax var paymentrecipient = paymentaddress.recipient; value a domstring giving the name of the person receiving or paying for the purchase, or the name of a contact person in other contexts.
PaymentAddress.region - Web APIs
syntax var paymentregion = paymentaddress.region; value a domstring specifying the top-level administrative subdivision within the country in which the address is located.
PaymentAddress.sortingCode - Web APIs
syntax var sortingcode = paymentaddress.sortingcode; value a domstring containing the sorting code portion of the address.
PaymentCurrencyAmount.currency - Web APIs
syntax currency = paymentcurrencyamount.currency; value a domstring specifying the canonical, three-character currency identification code defined by the iso 4217 standard.
PaymentCurrencyAmount.currencySystem - Web APIs
syntax currencysystem = paymentcurrencyamount.currencysystem; value a domstring which specifies the currency standard used to specify the currency in which the payment value is represented.
PaymentCurrencyAmount.value - Web APIs
syntax value = paymentcurrencyamount.value; value a domstring indicating the numeric value of the payment.
PaymentDetailsUpdate.shippingAddressErrors - Web APIs
syntax var addresserrors = paymentdetailsupdate.shippingaddresserrors; value an addresserrors object, which contains domstrings describing errors in the properties of a paymentaddress.
PaymentDetailsUpdate - Web APIs
error optional a domstring specifying an error message to present to the user.
PaymentMethodChangeEvent.methodName - Web APIs
syntax var methodname = paymentmethodchangeevent.methodname; value a domstring which uniquely identifies the currently-selected payment handler.
PaymentMethodChangeEvent - Web APIs
methodname read only secure context a domstring containing the payment method identifier, a string which uniquely identifies a particular payment method.
PaymentRequest.PaymentRequest() - Web APIs
starting with more recent browsers, this parameter is more generic than credit cards, it is a single domstring, and the meaning of the data parameter changes with the supportedmethods.
paymentRequestId - Web APIs
syntax var id = paymentrequestevent.paymentrequestid value a domstring contains the id.
PaymentRequestUpdateEvent.updateWith() - Web APIs
error optional a domstring specifying an error message to present to the user.
PaymentResponse.methodName - Web APIs
syntax var methodname = paymentresponse.methodname; value a domstring uniquely identifying the payment handler being used to process the payment.
PaymentResponse.onpayerdetailchange - Web APIs
)) ); // 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/", { method: "post", body: response.json() }); response.complete("success"); } }; await response.retry({ payer: { email: "invalid domain.", phone: "invalid number.", }, }); specifications specification status comment payment request apithe definition of 'onpayerdetailchange' in that specification.
PaymentResponse: payerdetailchange event - Web APIs
)) ); // 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/", { method: "post", body: response.json() }); response.complete("success"); } }; await response.retry({ payer: { email: "invalid domain.", phone: "invalid number.", }, }); addeventlistener equivalent you could also set up the event handler using the addeventlistener() method: response.addeventlistener("payerdetailchange", async ev => { ...
PaymentResponse.retry() - Web APIs
etails, options); try { let payresponse = await payrequest.show(); while (payresponse has errors) { /* let the user edit the payment information, wait until they submit */ await response.retry(); } await payresponse.complete("success"); } catch(err) { /* handle the exception */ } } examples try { await paymentrequest.retry(errorfields); } catch (domexception err) { ...
Using the Payment Request API - Web APIs
for this demo, simulate immediate success: paymentresponse.complete('success') .then(function() { // for demo purposes: intropanel.style.display = 'none'; successpanel.style.display = 'block'; }); }).catch(function(error) { if (error.code == domexception.not_supported_err) { window.location.href = 'https://bobpay.xyz/#download'; } else { // other kinds of errors; cancelled or failed payment.
performance.clearMarks() - Web APIs
syntax performance.clearmarks(); performance.clearmarks(name); arguments name optional a domstring representing the name of the timestamp.
performance.clearMeasures() - Web APIs
syntax performance.clearmeasures(); performance.clearmeasures(name); arguments name optional a domstring representing the name of the timestamp.
performance.mark() - Web APIs
WebAPIPerformancemark
syntax performance.mark(name); arguments name a domstring representing the name of the mark.
performance.now() - Web APIs
WebAPIPerformancenow
the performance.now() method returns a domhighrestimestamp, measured in milliseconds.
Performance - Web APIs
performance.now() returns a domhighrestimestamp representing the number of milliseconds elapsed since a reference instant.
PerformanceEntry.duration - Web APIs
syntax entry.duration; return value a domhighrestimestamp representing the duration of the performance entry.
PerformanceEntry.startTime - Web APIs
syntax entry.starttime; return value a domhighrestimestamp representing the first timestamp when the performance entry was created.
PerformanceFrameTiming - Web APIs
a frame represents the amount of work a browser does in one event loop such as processing dom events, resizing, scrolling, rendering, css animations, etc..
PerformanceNavigationTiming.loadEventEnd - Web APIs
function print_nav_timing_data() { // use getentriesbytype() to just get the "navigation" events var perfentries = performance.getentriesbytype("navigation"); for (var i=0; i < perfentries.length; i++) { console.log("= navigation entry[" + i + "]"); var p = perfentries[i]; // dom properties console.log("dom content loaded = " + (p.domcontentloadedeventend - p.domcontentloadedeventstart)); console.log("dom complete = " + p.domcomplete); console.log("dom interactive = " + p.dominteractive); // document load and unload time console.log("document load = " + (p.loadeventend - p.loadeventstart)); console.log("document unload = " + (p.unloadeventend - p.
PerformanceNavigationTiming.loadEventStart - Web APIs
function print_nav_timing_data() { // use getentriesbytype() to just get the "navigation" events var perfentries = performance.getentriesbytype("navigation"); for (var i=0; i < perfentries.length; i++) { console.log("= navigation entry[" + i + "]"); var p = perfentries[i]; // dom properties console.log("dom content loaded = " + (p.domcontentloadedeventend - p.domcontentloadedeventstart)); console.log("dom complete = " + p.domcomplete); console.log("dom interactive = " + p.interactive); // document load and unload time console.log("document load = " + (p.loadeventend - p.loadeventstart)); console.log("document unload = " + (p.unloadeventend - p.unl...
PerformanceNavigationTiming.redirectCount - Web APIs
function print_nav_timing_data() { // use getentriesbytype() to just get the "navigation" events var perfentries = performance.getentriesbytype("navigation"); for (var i=0; i < perfentries.length; i++) { console.log("= navigation entry[" + i + "]"); var p = perfentries[i]; // dom properties console.log("dom content loaded = " + (p.domcontentloadedeventend - p.domcontentloadedeventstart)); console.log("dom complete = " + p.domcomplete); console.log("dom interactive = " + p.interactive); // document load and unload time console.log("document load = " + (p.loadeventend - p.loadeventstart)); console.log("document unload = " + (p.unloadeventend - p.unl...
PerformanceNavigationTiming.type - Web APIs
function print_nav_timing_data() { // use getentriesbytype() to just get the "navigation" events var perfentries = performance.getentriesbytype("navigation"); for (var i=0; i < perfentries.length; i++) { console.log("= navigation entry[" + i + "]"); var p = perfentries[i]; // dom properties console.log("dom content loaded = " + (p.domcontentloadedeventend - p.domcontentloadedeventstart)); console.log("dom complete = " + p.domcomplete); console.log("dom interactive = " + p.interactive); // document load and unload time console.log("document load = " + (p.loadeventend - p.loadeventstart)); console.log("document unload = " + (p.unloadeventend - p.unl...
PerformanceNavigationTiming.unloadEventEnd - Web APIs
function print_nav_timing_data() { // use getentriesbytype() to just get the "navigation" events var perfentries = performance.getentriesbytype("navigation"); for (var i=0; i < perfentries.length; i++) { console.log("= navigation entry[" + i + "]"); var p = perfentries[i]; // dom properties console.log("dom content loaded = " + (p.domcontentloadedeventend - p.domcontentloadedeventstart)); console.log("dom complete = " + p.domcomplete); console.log("dom interactive = " + p.interactive); // document load and unload time console.log("document load = " + (p.loadeventend - p.loadeventstart)); console.log("document unload = " + (p.unloadeventend - p.unl...
PerformanceNavigationTiming.unloadEventStart - Web APIs
function print_nav_timing_data() { // use getentriesbytype() to just get the "navigation" events var perfentries = performance.getentriesbytype("navigation"); for (var i=0; i < perfentries.length; i++) { console.log("= navigation entry[" + i + "]"); var p = perfentries[i]; // dom properties console.log("dom content loaded = " + (p.domcontentloadedeventend - p.domcontentloadedeventstart)); console.log("dom complete = " + p.domcomplete); console.log("dom interactive = " + p.interactive); // document load and unload time console.log("document load = " + (p.loadeventend - p.loadeventstart)); console.log("document unload = " + (p.unloadeventend - p.unl...
PerformanceResourceTiming.redirectEnd - Web APIs
entries() { // use getentriesbytype() to just get the "resource" events var p = performance.getentriesbytype("resource"); for (var i=0; i < p.length; i++) { print_start_and_end_properties(p[i]); } } function print_start_and_end_properties(perfentry) { // print timestamps of the performanceentry *start and *end properties properties = ["connectstart", "connectend", "domainlookupstart", "domainlookupend", "fetchstart", "redirectstart", "redirectend", "requeststart", "responsestart", "responseend", "secureconnectionstart"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in perfentry; if (supported) { var value = per...
PerformanceResourceTiming.redirectStart - Web APIs
entries() { // use getentriesbytype() to just get the "resource" events var p = performance.getentriesbytype("resource"); for (var i=0; i < p.length; i++) { print_start_and_end_properties(p[i]); } } function print_start_and_end_properties(perfentry) { // print timestamps of the performanceentry *start and *end properties properties = ["connectstart", "connectend", "domainlookupstart", "domainlookupend", "fetchstart", "redirectstart", "redirectend", "requeststart", "responsestart", "responseend", "secureconnectionstart"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in perfentry; if (supported) { var value = per...
PerformanceServerTiming.description - Web APIs
the description read-only property returns a domstring value of the server-specified metric description, or an empty string.
PerformanceServerTiming.name - Web APIs
the name read-only property returns a domstring value of the server-specified metric name.
Using Performance Timeline - Web APIs
function log(s) { var o = document.getelementsbytagname("output")[0]; o.innerhtml += s + " <br>"; } function do_work (n) { for (var i=0 ; i < n; i++) { var m = math.random(); } } function print_perf_entry(pe) { log("..name: " + pe.name + "; entrytype: " + pe.entrytype + "; starttime: " + pe.starttime + "; duration: " + pe.duration); } function print_performanceentries() { if (performance.mark === undefined) { log("...
Using the Permissions API - Web APIs
it can be re-enabled by setting the preference dom.permissions.revoke.enable to true.
Point - Web APIs
WebAPIPoint
although it is not directly related to this defunct interface, you are probably looking for dompoint, which is part of the geometry interfaces module level 1 specification.
PointerEvent.getCoalescedEvents() - Web APIs
45safari no support nowebview android full support 58chrome android full support 58firefox android partial support 59disabled partial support 59disabled disabled from version 59: this feature is behind the dom.w3c_pointer_events.enabled preference (needs to be set to true).
PointerEvent.pointerId - Web APIs
since the value may be randomly generated, it is not guaranteed to convey any particular meaning.
PointerEvent - Web APIs
the pointerevent interface represents the state of a dom event produced by a pointer such as the geometry of the contact point, the device type that generated the event, the amount of pressure that was applied on the contact surface, etc.
Pointer Lock API - Web APIs
requestpointerlock() the pointer lock api, similar to the fullscreen api, extends dom elements by adding a new method, requestpointerlock().
Multi-touch interaction - Web APIs
pointer events extend dom input events to support various pointing input devices such as pen/stylus and touch screens as well as mouse.
ProcessingInstruction - Web APIs
ion" target="_top"><rect x="436" y="1" width="210" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="541" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">processinginstruction</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties target (domstring) read only a name identifying the application to which the instruction is targeted, specification specification status comment domthe definition of 'processinginstruction' in that specification.
ProgressEvent() - Web APIs
type is a domstring representing the name of the type of the progressevent.
ProgressEvent.initProgressEvent() - Web APIs
do not use it anymore, use the standard constructor, progressevent(), to create a synthetic progressevent syntax progress.initprogressevent(typearg, canbubblearg, cancelablearg, lengthcomputable, loaded, total); parameters typearg is a domstring identifying the specific type of animation event that occurred.
PromiseRejectionEvent() - Web APIs
this can be anything from a numeric error code to an error domstring to an object which contains detailed information describing the situation resulting in the promise being rejected.
PublicKeyCredentialCreationOptions.challenge - Web APIs
this is randomly generated then sent from the relying party's server.
PublicKeyCredentialCreationOptions.excludeCredentials - Web APIs
if the authenticator already contains one of such a public key credential, the client will throw a domexception or asks the user if they want to create a new credential.
PublicKeyCredentialRequestOptions.allowCredentials - Web APIs
if the authenticator does not contain any of these public key credentials, the client will throw a domexception "notallowederror".
PublicKeyCredentialRequestOptions.challenge - Web APIs
this is randomly generated then sent from the relying party's server.
PushEvent.PushEvent() - Web APIs
syntax var mypushevent = new pushevent(type, eventinitdict); parameters type a domstring defining the type of pushevent.
PushManager.register() - Web APIs
syntax var request = navigator.push.register(); return a domrequest object to handle the success or failure of the method call.
PushManager.registrations() - Web APIs
syntax var request = navigator.push.registrations(); return a domrequest object to handle the success or failure of the method call.
PushManager.subscribe() - Web APIs
applicationserverkey: a base64-encoded domstring or arraybuffer containing an ecdsa p-256 public key that the push server will use to authenticate your application server.
PushManager.unregister() - Web APIs
return a domrequest object to handle the success or failure of the method call.
PushSubscription.getKey() - Web APIs
syntax ​var key = subscription.getkey(name); parameters name a domstring representing the encryption method used to generate a client key.
PushSubscription.subscriptionId - Web APIs
the endpoint read-only property of the pushsubscription interface returns a domstring containing the subscription id associated with the push subscription.
Web Push API Notifications best practices - Web APIs
[1] in the case of firefox, see bug 1524619, in which we find that firefox 68 implements this, disabled by default, behind the preference dom.webnotifications.requireuserinteraction.
RTCConfiguration.bundlePolicy - Web APIs
syntax let rtcconfiguration = { bundlepolicy: policy }; rtcconfiguration.bundlepolicy = policy; value a domstring identifying the sdp bundling policy to use for the rtp streams used by the rtcpeerconnection.
RTCConfiguration.iceTransportPolicy - Web APIs
syntax let rtcconfiguration = { icetransportpolicy: policy }; rtcconfiguration.icetransportpolicy = policy; let policy = rtcconfiguration.icetransportpolicy; value a domstring which indicates what ice candidate policy the ice agent should use during the negotiation process, per the jsep standard.
RTCConfiguration - Web APIs
peeridentity optional a domstring which specifies the target peer identity for the rtcpeerconnection.
RTCDTMFSender.insertDTMF() - Web APIs
syntax rtcdtmfsender.insertdtmf(tones[, duration[, intertonegap]]); parameters tones a domstring containing the dtmf codes to be transmitted to the recipient.
RTCDTMFSender.toneBuffer - Web APIs
syntax var tonebuffer = rtcdtmfsender.tonebuffer; value a domstring listing the tones to be played.
RTCDTMFSender - Web APIs
x="151" y="1" width="130" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="216" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">rtcdtmfsender</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties rtcdtmfsender.tonebuffer read only a domstring which contains the list of dtmf tones currently in the queue to be transmitted (tones which have already been played are no longer included in the string).
RTCDataChannel: error event - Web APIs
t) { console.error(" sent dlts failure alert: ", err.receivedalert); } break; } // add source file name and line information console.error(" error in file ", err.filename, " at line ", err.linenumber, ", column ", err.columnnumber); }, false); the received event provides details in an rtcerror object called error; rtcerror is an extension of the domexception interface.
RTCDataChannel.label - Web APIs
the read-only rtcdatachannel property label returns a domstring containing a name describing the data channel.
RTCDataChannel.protocol - Web APIs
the read-only rtcdatachannel property protocol returns a domstring containing the name of the subprotocol in use.
RTCDataChannelEvent() - Web APIs
syntax var event = new rtcdatachannelevent(type, rtcdatachanneleventinit); parameters type a domstring which specifies the name of the event.
RTCIceCandidate.address - Web APIs
syntax var address = rtcicecandidate.address; value a domstring providing the ip address from which the candidate comes.
RTCIceCandidate.component - Web APIs
syntax var component = rtcicecandidate.component; value a domstring which is "rtp" for rtp (or rtp and rtcp multiplexed together) candidates or "rtcp" for rtcp candidates.
RTCIceCandidate.foundation - Web APIs
as such, the foundation can be used to correlate candidates that are present on multiple rtcicetransport objects syntax var foundation = rtcicecandidate.foundation; value a domstring which uniquely identifies the candidate across all rtcicetransports on which it is available.
RTCIceCandidate.protocol - Web APIs
syntax var protocol = rtcicecandidate.protocol; value a domstring which indicates what network protocol the candidate uses, udp or tcp.
RTCIceCandidate.relatedAddress - Web APIs
syntax var reladdress = rtcicecandidate.relatedaddress; value a domstring which contains the candidate's related address.
RTCIceCandidate.tcpType - Web APIs
syntax var tcptype = rtcicecandidate.tcptype; value a domstring whose value is one of those defined by the rtcicetcpcandidatetype enumerated type.
RTCIceCandidate.type - Web APIs
syntax var type = rtcicecandidate.type; value a domstring whose value is one of those defined by the rtcicecandidatetype enumerated type.
RTCIceCandidateInit.candidate - Web APIs
value a domstring describing the properties of the candidate, taken directly from the sdp attribute "candidate".
RTCIceCandidateInit.sdpMid - Web APIs
value a domstring which uniquely identifies the source media component from which the candidate draws data, or null if no such association exists for the candidate.
RTCIceCandidatePairStats.consentExpiredTimestamp - Web APIs
syntax consentexpiration = rtcicecandidatepairstats.consentexpiredtimestamp; value a domhighrestimestamp object that indicates the time at which the stun binding that allows the two peers described by this rtcicecandidatepair to communicate will expire (or the time at which the binding did expire, if the time has passed).
RTCIceCandidatePairStats.firstRequestTimestamp - Web APIs
syntax firstrequesttimestamp = rtcicecandidatepairstats.firstrequesttimestamp; value a domhighrestimestamp object indicating the timestamp at which the first stun request was sent on the connection described by the described pair of candidates.
RTCIceCandidatePairStats.lastPacketReceivedTimestamp - Web APIs
syntax lastpacketreceivedtimestamp = rtcicecandidatepairstats.lastpacketreceivedtimestamp; value a domhighrestimestamp object indicating the timestamp at which the connection described by pair of candidates last received a packet, stun packets excluded.
RTCIceCandidateStats.lastPacketSentTimestamp - Web APIs
syntax lastpacketsenttimestamp = rtcicecandidatepairstats.lastpacketsenttimestamp; value a domhighrestimestamp object indicating the timestamp at which the connection described by pair of candidates last sent a packet, stun packets excluded.
RTCIceCandidatePairStats.lastRequestTimestamp - Web APIs
syntax lastrequesttimestamp = rtcicecandidatepairstats.lastrequesttimestamp; value a domhighrestimestamp object indicating the timestamp at which the last (most recent) stun request was sent on the connection indicated by the described pair of candidates.
RTCIceCandidateStats.lastResponseTimestamp - Web APIs
syntax lastresponsetimestamp = rtcicecandidatepairstats.lastresponsetimestamp; value a domhighrestimestamp object indicating the timestamp at which the most recent stun response was received on the connection defined by the described pair of candidates.
RTCIceCandidateStats.localCandidateId - Web APIs
syntax localcandidateid = rtcicecandidatepairstats.localcandidateid; value a domstring giving a unique identifier for the local rtcicecandidate for the connection described by this rtcicecandidatepairstats object.
RTCIceCandidatePairStats.remoteCandidateId - Web APIs
syntax remotecandidateid = rtcicecandidatepairstats.remotecandidateid; value a domstring uniquely identifies the remote ice candidate—that is, the candidate describing a configuration for the remote peer—which is represented by the remote end of these statistics.
RTCIceCandidatePairStats.state - Web APIs
syntax state = rtcicecandidatepairstats.state; value a domstring whose value is one of those found in the rtcstatsicecandidatepairstate enumerated type.
RTCIceCandidatePairStats.transportId - Web APIs
syntax transportid = rtcicecandidatepairstats.transportid; value a domstring which uniquely identifies the rtcicetransport object from which the transport-related data was obtained for the statistics contained in this rtcicecandidatepairstats object.
RTCIceCandidateStats.candidateType - Web APIs
syntax candidatetype = rtcicecandidatestats.candidatetype; value a domstring whose value is one of the strings found in the rtcicecandidatetype enumerated type:host the candidate is a host candidate, whose ip address as specified in the rtcicecandidate.ip property is in fact the true address of the remote peer.
RTCIceCandidateStats.networkType - Web APIs
syntax networktype = rtcicecandidatestats.networktype; value a domstring whose value is taken from the rtcnetworktype enumerated type.
RTCIceCandidateStats.relayProtocol - Web APIs
syntax relayprotocol = rtcicecandidatestats.relayprotocol; value a domstring identifying the protocol being used by the endpoint to communicate with the turn server.
RTCIceCandidateStats.transportId - Web APIs
syntax transportid = rtcicecandidatestats.transportid; value a domstring whose value uniquely identifies the transport from which any transport-related information accumulated in the rtcicecandidatestats was taken.
RTCIceCandidateStats.url - Web APIs
syntax url = rtcicecandidatestats.url; value a domstring specifying the url of the ice server from which the candidate described by the rtcicecandidatestats was obtained.
RTCIceCandidateStats - Web APIs
this value may be an ipv4 address, an ipv6 address, or a fully-qualified domain name.
RTCIceCandidateType - Web APIs
the webrtc api's rtcicecandidatetype enumerated type provides a set of domstring values representing the types of ice candidate that can arrive.
RTCIceComponent - Web APIs
the webrtc api's rtcicecomponent enumerated type contains domstring values that each identify a specific ice component; these are "rtp" and "rtcp".
RTCIceParameters.password - Web APIs
syntax password = rtciceparameters.password; value a domstring containing the password that corresponds to the transport's usernamefragment string specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtciceparameters.password' in that specification.
RTCIceParameters.usernameFragment - Web APIs
syntax ufrag = rtciceparameters.usernamefragment; value a domstring containing the username fragment that, in tandem with the password, uniquely identify the ice session being used by the transport.
RTCIceProtocol - Web APIs
the webrtc api's rtciceprotocol enumerated type provides a set of domstring values representing the names of the transport protocols ice candidates can use.
RTCIceServer - Web APIs
urls this required property is either a single domstring or an array of domstrings, each specifying a url which can be used to connect to the server.
RTCIceTcpCandidateType - Web APIs
the webrtc api's rtcicetcpcandidatetype enumerated type provides a set of domstring values representing the types of tcp candidates.
RTCIceTransport.component - Web APIs
syntax icecomponent = rtcicetransport.component; value a domstring whose value comes from the enumerated type rtcicecomponent: "rtp" identifies an ice transport which is being used for the real-time transport protocol (rtp), or for rtp multiplexed with the rtp control protocol (rtcp).
RTCIceTransport.gatheringState - Web APIs
the read-only rtcicetransport property gatheringstate returns a domstring from the enumerated type rtcicegathererstate that indicates what gathering state the ice agent is currently in: "new", "gathering", or "complete".
RTCIceTransport.role - Web APIs
syntax icerole = rtcicetransport.role; value a domstring specifying whether the rtcicetransport represents the controlling agent or the controlled agent.
RTCIceTransport.state - Web APIs
syntax icestate = icetransport.state; value a domstring, whose value is one of those found in the enumerated type rtcicetransportstate, which indicates the stage of ice gathering that's currently underway.
RTCIdentityErrorEvent.idp - Web APIs
the read-only property rtcidentityerrorevent.idp returns the domstring describing the domain name of the identity provider (idp) generating the error response event.
RTCIdentityErrorEvent.loginUrl - Web APIs
the read-only property rtcidentityerrorevent.loginurl is a domstring giving the url where the user can complete the authentication.
RTCIdentityErrorEvent.protocol - Web APIs
the read-only property rtcidentityerrorevent.protocol is a domstring describing the idp protocol in use.
RTCIdentityEvent.assertion - Web APIs
the read-only property rtcidentityevent.assertion returns the domstring containing a blob being the coded assertion associated with the event.
RTCIdentityEvent - Web APIs
rtcidentityevent.assertion read only returns the domstring containing a blob being the assertion generated.
RTCInboundRtpStreamStats.lastPacketReceivedTimestamp - Web APIs
syntax var lastpackettimestamp = rtcinboundrtpstreamstats.lastpacketreceivedtimestamp; value a domhighrestimestamp which specifies the time at which the most recently received packet arrived on this rtp stream.
RTCInboundRtpStreamStats.receiverId - Web APIs
syntax var receiverstatsid = rtcinboundrtpstreamstats.receiverid; value a domstring which contains the id of the rtcaudioreceiverstats or rtcvideoreceiverstats object which provides information about the rtcrtpreceiver which is receiving the streamed media.
RTCInboundRtpStreamStats.remoteId - Web APIs
syntax var remotestatsid = rtcinboundrtpstreamstats.remoteid; value a domstring containing the id of the rtcremoteoutboundrtpstreamstats object that represents the remote peer's rtcrtpsender for the synchronization source represented by this stats object.
RTCInboundRtpStreamStats.trackId - Web APIs
syntax var trackstatsid = rtcinboundrtpstreamstats.trackid; value a domstring containing the id of the rtcreceiveraudiotrackattachmentstats or rtcreceivervideotrackattachmentstats object representing the track which is receiving the media from this rtp session.
RTCInboundRtpStreamStats - Web APIs
lastpacketreceivedtimestamp a domhighrestimestamp indicating the time at which the last packet was received for this source.
RTCOutboundRtpStreamStats.lastPacketSentTimestamp - Web APIs
syntax var lastpackettimestamp = rtcoutboundrtpstreamstats.lastpacketsenttimestamp; value a domhighrestimestamp which specifies the time at which the most recently received packet arrived on this rtp stream.
RTCOutboundRtpStreamStats.qualityLimitationReason - Web APIs
syntax var qualitylimitationreason = rtcoutboundrtpstreamstats.qualitylimitationreason; value a map whose keys are domstrings whose values come from the rtcqualitylimitationreason enumerated type, and whose values are the duration of the media, in seconds, whose quality was reduced for that reason.
RTCOutboundRtpStreamStats.remoteId - Web APIs
syntax var remotestatsid = rtcoutboundrtpstreamstats.remoteid; value a domstring containing the id of the rtcremoteinboundrtpstreamstats object that represents the remote peer's rtcrtpreceiver for the synchronization source represented by this stats object.
RTCOutboundRtpStreamStats.trackId - Web APIs
syntax var trackstatsid = rtcoutboundrtpstreamstats.trackid; value a domstring containing the id of the rtcsenderaudiotrackattachmentstats or rtcsendervideotrackattachmentstats object representing the track which is the source of the media being sent on this stream.
RTCPeerConnection() - Web APIs
peeridentity optional a domstring which specifies the target peer identity for the rtcpeerconnection.
RTCPeerConnection.addTransceiver() - Web APIs
syntax rtptransceiver = rtcpeerconnection.addtransceiver(trackorkind, init); parameters trackorkind a mediastreamtrack to associate with the transceiver, or a domstring which is used as the kind of the receiver's track, and by extension of the rtcrtpreceiver itself.
RTCPeerConnection.createAnswer() - Web APIs
failurecallback an rtcpeerconnectionerrorcallback which will be passed a single domexception object explaining why the request to create an answer failed.
RTCPeerConnection.createOffer() - Web APIs
errorcallback an rtcpeerconnectionerrorcallback which will be passed a single domexception object explaining why the request to create an offer failed.
RTCPeerConnection.generateCertificate() - Web APIs
syntax var cert = rtcpeerconnection.generatecertificate(keygenalgorithm) parameters keygenalgorithm a domstring identifying the algorithm to use in creating the key.
RTCPeerConnection.getStreamById() - Web APIs
syntax var mediastream = pc.getstream(id); parameters id is a domstring corresponding to the stream to return.
RTCPeerConnection.peerIdentity - Web APIs
the read-only rtcpeerconnection property peeridentity returns a javascript promise that resolves to an rtcidentityassertion which contains a domstring identifying the remote peer.
RTCPeerConnection.setLocalDescription() - Web APIs
it is passed a single domexception object explaining why the request failed.
RTCPeerConnection.setRemoteDescription() - Web APIs
it is passed a single domexception object explaining why the request failed.
RTCPeerConnection - Web APIs
if it has not yet been set, this is null.peeridentity read only the read-only rtcpeerconnection property peeridentity returns a javascript promise that resolves to an rtcidentityassertion which contains a domstring identifying the remote peer.pendinglocaldescription read only the read-only property rtcpeerconnection.pendinglocaldescription returns an rtcsessiondescription object describing a pending configuration change for the local end of the connection.
RTCPeerConnectionIceErrorEvent.address - Web APIs
syntax let address = rtcpeerconnectioniceerrorevent.address; value a domstring which specifies the local ip address of the network connection to the ice server with which negotiations were occurring when the error occurred.
RTCPeerConnectionIceEvent() - Web APIs
syntax var event = new rtcpeerconnectioniceevent(type, options); parameters type is a domstring containing the name of the event, like "icecandidate".
RTCPeerConnectionIceEvent - Web APIs
it takes two parameters, the first being a domstring representing the type of the event; the second a dictionary containing the rtcicecandidate it refers to.
RTCRemoteOutboundRtpStreamStats.localId - Web APIs
syntax let localid = rtcremoteoutboundrtpstreamstats.localid; value a domstring which can be compared to the value of an rtcinboundrtpstreamstats object's remoteid property to see if the two represent statistics for each of the two sides of the same set of data received by the local peer.
RTCRemoteOutboundRtpStreamStats.remoteTimestamp - Web APIs
syntax let remotetimestamp = rtcremoteoutboundrtpstreamstats.remotetimestamp; value a domhighrestimestamp value indicating the timestamp on the remote peer at which it sent these statistics.
RTCRtpCapabilities - Web APIs
each object contains a single domstring, uri, specifying the uri of the header extension, as described in rfc 5285.
RTCRtpContributingSource.rtpTimestamp - Web APIs
the read-only rtptimestamp property of the rtcrtpcontributingsource interface returns a domhighrestimestamp indicating the source-generated time at which the media contained int he packet was first sampled or obtained.
RTCRtpContributingSource - Web APIs
timestamp optional a domhighrestimestamp indicating the most recent time at which a frame originating from this source was delivered to the receiver's mediastreamtrack specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcrtpcontributingsource' in that specification.
RTCRtpEncodingParameters - Web APIs
rid a domstring which, if set, specifies an rtp stream id (rid) to be sent using the rid header extension.
RTCRtpReceiver.getCapabilities() static function - Web APIs
syntax let rtpcapabilities = rtcrtpreceiver.getcapabilities(kind); parameters kind a domstring indicating the type of media for which you wish to get the device's capability to receive.
RTCRtpSendParameters.encodings - Web APIs
rid a domstring which, if set, specifies an rtp stream id (rid) to be sent using the rid header extension.
RTCRtpSender.getCapabilities() static function - Web APIs
syntax let rtpcapabilities = rtcrtpsender.getcapabilities(kind); parameters kind a domstring indicating the type of media for which you wish to get the sender's capability to receive.
RTCRtpStreamStats.codecId - Web APIs
syntax var codecid = rtcrtpstreamstats.codecid; value a domstring which uniquely identifies the object from which the contents of the stream's rtccodecstats are derived.
RTCRtpStreamStats.kind - Web APIs
syntax mediakind = rtcrtpstreamstats.kind; value a domstring whose value is "audio" if the track whose statistics are given by the rtcrtpstreamstats object contains audio, or "video" if the track contains video media.
RTCRtpStreamStats.ssrc - Web APIs
while not part of the standard, exactly, it is a good mechanism that may be used by some browsers; others may use other methods, such as random number generators.
RTCRtpStreamStats.trackId - Web APIs
syntax var trackid = rtcrtpstreamstats.trackid; value a domstring which uniquely identifies the rtcmediastreamtrackstats object that provides statistics for the track for which statistics are being collected by this rtcstatsreport.
RTCRtpStreamStats.transportId - Web APIs
syntax var transportid = rtcrtpstreamstats.transportid; value a domstring uniquely identifying the source of the statistics contained the rtctransportstats properties in the rtcstatsreport.
RTCRtpTransceiver.currentDirection - Web APIs
syntax var direction = rtcrtptransceiver.currentdirection value a domstring whose value is one of the strings which are a member of the rtcrtptransceiverdirection enumerated type.
RTCRtpTransceiver.direction - Web APIs
syntax var direction = rtcrtptransceiver.direction value a domstring whose value is one of the strings which are a member of the rtcrtptransceiverdirection enumerated type, indicating the transceiver's preferred direction.
RTCRtpTransceiver.mid - Web APIs
syntax var mediaid = rtcrtptransceiver.mid; value a domstring which uniquely identifies the pairing of source and destination of the transceiver's stream.
RTCSctpTransport - Web APIs
rtcsctptransport.stateread only a domstring enumerated value indicating the state of the sctp transport.
RTCSessionDescription.toJSON() - Web APIs
"sdp", containing a domstring, or null, with the sdp message corresponding to rtcsessiondescription.sdp property.
RTCSessionDescription - Web APIs
rtcsessiondescription.sdp read only a domstring containing the sdp describing the session.
RTCStats.id - Web APIs
WebAPIRTCStatsid
syntax var id = rtcstats.id; value a domstring which uniquely identifies the object for which this rtcstats-based object provides statistics.
RTCStats.type - Web APIs
WebAPIRTCStatstype
syntax var type = rtcstats.type; value a domstring which specifies which type of statistic is represented by the object.
Range() - Web APIs
WebAPIRangeRange
'p'); // create new range const range = new range(); // start range at second paragraph range.setstartbefore(paragraphs[1]); // end range at third paragraph range.setendafter(paragraphs[2]); // get window selection const selection = window.getselection(); // add range to window selection selection.addrange(range); result specification specification status comment domthe definition of 'range.range()' in that specification.
Range.compareNode() - Web APIs
WebAPIRangecompareNode
example range = document.createrange(); range.selectnode(document.getelementsbytagname("div").item(0)); returnvalue = range.comparenode(document.getelementsbytagname("p").item(0)); notes this method is obsolete; you should use the w3c dom range.compareboundarypoints() method.
Range.comparePoint() - Web APIs
example range = document.createrange(); range.selectnode(document.getelementsbytagname('div').item(0)); returnvalue = range.comparepoint(document.getelementsbytagname('p').item(0), 1); specification specification status comment domthe definition of 'range.comparepoint()' in that specification.
Range.createContextualFragment() - Web APIs
agstring = "<div>i am a div node</div>"; var range = document.createrange(); // make the parent of the first div in the document becomes the context node range.selectnode(document.getelementsbytagname("div").item(0)); var documentfragment = range.createcontextualfragment(tagstring); document.body.appendchild(documentfragment); specification specification status comment dom parsing and serializationthe definition of 'range.createcontextualfragment()' in that specification.
Range.getBoundingClientRect() - Web APIs
the range.getboundingclientrect() method returns a domrect object that bounds the contents of the range; this is a rectangle enclosing the union of the bounding rectangles for all the elements in the range.
Range.getClientRects() - Web APIs
the range.getclientrects() method returns a list of domrect objects representing the area of the screen occupied by the range.
Range.intersectsNode() - Web APIs
example var range = document.createrange(); range.selectnode(document.getelementsbytagname("div").item(0)); var bool = range.intersectsnode(document.getelementsbytagname("p").item(0)); specification specification status comment domthe definition of 'range.intersectnode()' in that specification.
Range.isPointInRange() - Web APIs
example range = document.createrange(); range.selectnode(document.getelementsbytagname("div").item(0)); bool = range.ispointinrange(document.getelementsbytagname("p").item(0),1); specification specification status comment domthe definition of 'range.ispointinrange()' in that specification.
ReadableStream.cancel() - Web APIs
syntax var promise = readablestream.cancel(reason); parameters reason a domstring providing a human-readable reason for the cancellation.
ReadableStreamBYOBReader.cancel() - Web APIs
syntax var promise = readablestreambyobreader.cancel(reason); parameters reason a domstring providing a human-readable reason for the cancellation.
ReadableStreamDefaultReader.ReadableStreamDefaultReader() - Web APIs
(see our simple random stream example for the full code).
ReadableStreamDefaultReader.read() - Web APIs
(see our simple random stream example for the full code).
Request.cache - Web APIs
WebAPIRequestcache
return res }) .then(function(response) { /* consume the (possibly stale) response */ }) .catch(error => { /* can be an aborterror/domerror or a typeerror */ }); specifications specification status comment fetchthe definition of 'cache' in that specification.
Request.mode - Web APIs
WebAPIRequestmode
this ensures that serviceworkers do not affect the semantics of the web and prevents security and privacy issues arising from leaking data across domains.
Request.referrer - Web APIs
WebAPIRequestreferrer
syntax var myreferrer = request.referrer; value a domstring representing the request's referrer.
Request.referrerPolicy - Web APIs
syntax var myreferrerpolicy = request.referrerpolicy; value a domstring representing the request's referrerpolicy.
ResizeObserver - Web APIs
it does this by only processing elements deeper in the dom in subsequent frames.
ResizeObserverEntry - Web APIs
resizeobserverentry.contentrect read only a domrectreadonly object containing the new size of the observed element when the callback is run.
RsaOaepParams - Web APIs
properties name a domstring.
format - Web APIs
the svgaltglyphelement.format property is a domstring that defines the format of the given font.
SVGAltGlyphElement.glyphRef - Web APIs
the svgaltglyphelement.glyphref property is a domstring representing a glyph identifier.
SVGAnimatedPoints - Web APIs
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.
SVGAnimatedString.baseVal - Web APIs
setter throws domexception.
SVGAnimationElement: beginEvent event - Web APIs
scheduled or interactive) timeline play, as well as in the case that the element was begun with a dom method.
SVGAnimationElement: endEvent event - Web APIs
scheduled or interactive) timeline play, as well as in the case that the element was ended with a dom method.
SVGElement: abort event - Web APIs
this basically implements the standard abort dom event.
SVGElement: error event - Web APIs
this basically implements the standard error dom event.
SVGElement: resize event - Web APIs
this basically implements the standard resize dom event.
SVGElement: scroll event - Web APIs
this basically implements the standard scroll dom event.
SVGElement: unload event - Web APIs
the unload event is fired when the dom implementation removes an svg document from a window or frame.
SVGExternalResourcesRequired - Web APIs
note: the svg dom defines the attribute externalresourcesrequired as being of type svganimatedboolean, whereas the svg language definition says that the attribute is not animated.
SVGFilterPrimitiveStandardAttributes - Web APIs
the svgfilterprimitivestandardattributes interface defines the set of dom attributes that are common across the filter primitive interfaces.
SVGFontElement - Web APIs
object-oriented access to the attributes of the <font> element via the svg dom is not possible.
SVGFontFaceElement - Web APIs
object-oriented access to the attributes of the <font-face> element via the svg dom is not possible.
SVGFontFaceFormatElement - Web APIs
object-oriented access to the attributes of the <font-face-format> element via the svg dom is not possible.
SVGFontFaceNameElement - Web APIs
object-oriented access to the attributes of the <font-face-name> element via the svg dom is not possible.
SVGFontFaceSrcElement - Web APIs
object-oriented access to the attributes of the <font-face-src> element via the svg dom is not possible.
SVGFontFaceUriElement - Web APIs
object-oriented access to the attributes of the <font-face-uri> element via the svg dom is not possible.
SVGGlyphElement - Web APIs
object-oriented access to the attributes of the <glyph> element via the svg dom is not possible.
SVGHKernElement - Web APIs
object-oriented access to the attributes of the <hkern> element via the svg dom is not possible.
SVGImageElement.decode - Web APIs
return value a promise which resolves once the image data is ready to be used, such as by appending it to the dom, replacing an existing image, and so forth.
SVGImageElement.decoding - Web APIs
syntax var refstr = svgimageelement.decoding svgimageelement.decoding = refstr; values a domstring representing the decoding hint.
SVGMissingGlyphElement - Web APIs
object-oriented access to the attributes of the <missing-glyph> element via the svg dom is not possible.
SVGNumber - Web APIs
WebAPISVGNumber
note: if the svgnumber is read-only, a domexception with the code no_modification_allowed_err is raised on an attempt to change the value.
SVGPreserveAspectRatio - Web APIs
exceptions on setting: a domexception with code no_modification_allowed_err is raised on an attempt to change the value of an attribute on a read only object.
SVGRectElement - Web APIs
w.w3.org/2000/svg" version="1.1"> <rect width="300" height="100" id="myrect" onclick="dorectclick()" style="fill:rgb(0,0,255);stroke-width:1;stroke:rgb(0,0,0)" /> <text x="60" y="40" fill="white" font-size="40" onclick="dorectclick();">click me</text> </svg> javascript content function dorectclick(){ var myrect = document.getelementbyid('myrect'); var r = math.floor(math.random() * 255); var g = math.floor(math.random() * 255); var b = math.floor(math.random() * 255); myrect.style.fill = 'rgb(' + r + ', ' + g + ' , ' + b + ')'; } click the rect.
SVGTRefElement - Web APIs
object-oriented access to the attributes of the <tref> element via the svg dom is not possible.
SVGUseElement - Web APIs
svg use dom interface the svguseelement interface corresponds to the <use> element.
SVGVKernElement - Web APIs
object-oriented access to the attributes of the <vkern> element via the svg dom is not possible.
Screen.lockOrientation() - Web APIs
examples usage with a domstring argument screen.lockorientationuniversal = screen.lockorientation || screen.mozlockorientation || screen.mslockorientation; if (screen.lockorientationuniversal("landscape-primary")) { // orientation was locked } else { // orientation lock failed } usage with an array argument screen.lockorientationuniversal = screen.lockorientation || screen.mozlockorientation || screen.mslockorien...
Screen.orientation - Web APIs
note that older, prefixed versions returned a domstring equivalent to screenorientation.type.
Screen - Web APIs
WebAPIScreen
void seteventhandler(domstring type, eventhandler handler) eventhandler geteventhandler(domstring type) example if (screen.pixeldepth < 8) { // use low-color version of page } else { // use regular, colorful page } specification specification status comment css object model (cssom) view modulethe definition of 'screen' in that specification.
ScriptProcessorNode: audioprocess event - Web APIs
{ var inputdata = inputbuffer.getchanneldata(channel); var outputdata = outputbuffer.getchanneldata(channel); // loop through the 4096 samples for (var sample = 0; sample < inputbuffer.length; sample++) { // make output equal to the same as the input outputdata[sample] = inputdata[sample]; // add noise to each output sample outputdata[sample] += ((math.random() * 2) - 1) * 0.2; } } }) you could also set up the event handler using the scriptprocessornode.onaudioprocess property: scriptnode.onaudioprocess = function(audioprocessingevent) { ...
ScriptProcessorNode.bufferSize - Web APIs
{ var inputdata = inputbuffer.getchanneldata(channel); var outputdata = outputbuffer.getchanneldata(channel); // loop through the 4096 samples for (var sample = 0; sample < inputbuffer.length; sample++) { // make output equal to the same as the input outputdata[sample] = inputdata[sample]; // add noise to each output sample outputdata[sample] += ((math.random() * 2) - 1) * 0.2; } } } getdata(); // wire up play button playbutton.onclick = function() { source.connect(scriptnode); scriptnode.connect(audioctx.destination); source.start(); } // when the buffer source stops playing, disconnect everything source.onended = function() { source.disconnect(scriptnode); scriptnode.disconnect(audioctx.destination); } specifications s...
ScriptProcessorNode.onaudioprocess - Web APIs
{ var inputdata = inputbuffer.getchanneldata(channel); var outputdata = outputbuffer.getchanneldata(channel); // loop through the 4096 samples for (var sample = 0; sample < inputbuffer.length; sample++) { // make output equal to the same as the input outputdata[sample] = inputdata[sample]; // add noise to each output sample outputdata[sample] += ((math.random() * 2) - 1) * 0.2; } } } getdata(); // wire up play button playbutton.onclick = function() { source.connect(scriptnode); scriptnode.connect(audioctx.destination); source.start(); } // when the buffer source stops playing, disconnect everything source.onended = function() { source.disconnect(scriptnode); scriptnode.disconnect(audioctx.destination); } specificati...
ScriptProcessorNode - Web APIs
{ var inputdata = inputbuffer.getchanneldata(channel); var outputdata = outputbuffer.getchanneldata(channel); // loop through the 4096 samples for (var sample = 0; sample < inputbuffer.length; sample++) { // make output equal to the same as the input outputdata[sample] = inputdata[sample]; // add noise to each output sample outputdata[sample] += ((math.random() * 2) - 1) * 0.2; } } } getdata(); // wire up play button playbutton.onclick = function() { source.connect(scriptnode); scriptnode.connect(audioctx.destination); source.start(); } // when the buffer source stops playing, disconnect everything source.onended = function() { source.disconnect(scriptnode); scriptnode.disconnect(audioctx.destination); } specifications s...
SecurityPolicyViolationEvent.SecurityPolicyViolationEvent() - Web APIs
syntax let spvevt = new securitypolicyviolationevent(type, eventinitdict); properties type a domstring representing the type of security policy violation that occurred.
Selection.deleteFromDocument() - Web APIs
the deletefromdocument() method of the selection interface deletes the selected text from the document's dom.
Selection.setBaseAndExtent() - Web APIs
the setbaseandextent() method of the selection interface sets the selection to be a range including all or parts of two specified dom nodes, and any content located between them.
Selection API - Web APIs
once your selection is in a variable, you perform a variety of operations on it, for example copying the selection to a text string using selection.tostring(), adding a range (as represented by a standard range object) to the selection (or removing one) with selection.addrange()/selection.removerange(), or changing the selection to be the entire contents of a dom node using selection.selectallchildren().
Sensor.timestamp - Web APIs
WebAPISensortimestamp
value a domhighrestimestamp.
SensorErrorEvent - Web APIs
properties sensorerrorevent.error read only returns the domexception object passed in the event's contructor.
ServiceWorkerContainer.startMessages() - Web APIs
after the domcontentloaded event fires).
ServiceWorkerMessageEvent.lastEventId - Web APIs
syntax var mylasteventid = serviceworkermessageeventinstance.lasteventid; value a domstring.
ServiceWorkerMessageEvent.origin - Web APIs
syntax var myorigin = serviceworkermessageeventinstance.origin; value a domstring.
ServiceWorkerRegistration.getNotifications() - Web APIs
the available options are: tag: a domstring representing a notification tag.
Service Worker API - Web APIs
a service worker is run in a worker context: it therefore has no dom access, and runs on a different thread to the main javascript that powers your app, so it is non-blocking.
ShadowRoot.delegatesFocus - Web APIs
examples let customelem = document.queryselector('my-shadow-dom-element'); let shadow = customelem.shadowroot; ...
SharedWorkerGlobalScope.name - Web APIs
syntax var nameobj = self.name; value a domstring.
SourceBuffer.changeType() - Web APIs
syntax sourcebuffer.changetype(type); parameters type a domstring specifying the mime type that future buffers will conform to.
SourceBuffer.mode - Web APIs
WebAPISourceBuffermode
syntax var mymode = sourcebuffer.mode; sourcebuffer.mode = 'sequence'; value a domstring.
SpeechGrammar.src - Web APIs
WebAPISpeechGrammarsrc
syntax var mygrammar = speechgrammarinstance.src; value a domstring representing the grammar.
SpeechGrammarList.addFromURI() - Web APIs
parameters src a domstring representing the uri of the grammar to be added.
SpeechGrammarList - Web APIs
speechgrammarlist.addfromstring() takes a grammar present in a specific domstring within the code base (e.g.
SpeechRecognition.lang - Web APIs
syntax var mylang = myspeechrecognition.lang; myspeechrecognition.lang = 'en-us'; value a domstring representing the bcp 47 language tag for the current speechrecognition.
SpeechRecognition.serviceURI - Web APIs
syntax var myserviceuri = myspeechrecognition.serviceuri; myspeechrecognition.serviceuri = 'path/to/my/service/'; value a domstring representing the uri of the speech recognition service.
SpeechRecognitionAlternative.transcript - Web APIs
syntax var mytranscript = speechrecognitionalternativeinstance.transcript; returns a domstring.
SpeechRecognitionError.error - Web APIs
syntax var myerror = event.error; value a domstring naming the type of error.
SpeechRecognitionError.message - Web APIs
syntax var myerrormsg = event.message; value a domstring containing more details about the error that was raised.
SpeechRecognitionErrorEvent.error - Web APIs
syntax var myerror = event.error; value a domstring naming the type of error.
SpeechRecognitionErrorEvent.message - Web APIs
syntax var myerrormsg = event.message; value a domstring containing more details about the error that was raised.
SpeechSynthesisErrorEvent.error - Web APIs
syntax myerror = event.error; value a domstring containing an error code.
SpeechSynthesisEvent.name - Web APIs
syntax event.name; value a domstring.
SpeechSynthesisUtterance.SpeechSynthesisUtterance() - Web APIs
syntax var utterthis = new speechsynthesisutterance(text); parameters text a domstring containing the text that will be synthesized when the utterance is spoken..
SpeechSynthesisUtterance.lang - Web APIs
syntax var mylang = speechsynthesisutteranceinstance.lang; speechsynthesisutteranceinstance.lang = 'en-us'; value a domstring representing a bcp 47 language tag.
SpeechSynthesisUtterance.text - Web APIs
syntax var mytext = speechsynthesisutteranceinstance.text; speechsynthesisutteranceinstance.text = 'hello i am speaking'; value a domstring representing the text to the synthesised.
SpeechSynthesisVoice.lang - Web APIs
syntax var mylang = speechsynthesisvoiceinstance.lang; value a domstring representing the language of the device.
SpeechSynthesisVoice.name - Web APIs
syntax var voicename = speechsynthesisvoiceinstance.name; value a domstring representing the name of the voice.
SpeechSynthesisVoice.voiceURI - Web APIs
syntax var myvoiceuri = speechsynthesisvoiceinstance.voiceuri; value a domstring representing the uri of the voice.
StaticRange.collapsed - Web APIs
specifications specification status comment domthe definition of 'collapsed' in that specification.
StaticRange.endOffset - Web APIs
specifications specification status comment domthe definition of 'endoffset' in that specification.
StaticRange.startOffset - Web APIs
specifications specification status comment domthe definition of 'startoffset' in that specification.
Storage.key() - Web APIs
WebAPIStoragekey
return value a domstring containing the name of the key.
Storage.length - Web APIs
WebAPIStoragelength
example the following function adds three data items to the local storage for the current domain, then returns the number of items in the storage: function populatestorage() { localstorage.setitem('bgcolor', 'yellow'); localstorage.setitem('font', 'helvetica'); localstorage.setitem('image', 'cats.png'); return localstorage.length; // should return 3 } note: for a real world example, see our web storage demo.
Storage Access API - Web APIs
this includes access to apis such as web storage, indexeddb, dom cache, and so on.
Streams API concepts - Web APIs
readable streams a readable stream is a data source represented in javascript by a readablestream object that flows from an underlying source — this is a resource somewhere on the network or elsewhere on your domain that you want to get data from.
Using writable streams - Web APIs
introducing an example in our dom-examples/streams repo you’ll find a simple writer example (see it live also).
SubmitEvent() - Web APIs
syntax let submitevent = new submitevent(type,eventinitdict); parameters type a domstring indicating the event which occurred.
SubtleCrypto.deriveBits() - Web APIs
*/ async function getderivedbits() { const keymaterial = await getkeymaterial(); salt = window.crypto.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.classlist.add("fade-...
SubtleCrypto.digest() - Web APIs
syntax const digest = crypto.subtle.digest(algorithm, data); parameters algorithm is a domstring defining the hash function to use.
SubtleCrypto.importKey() - Web APIs
const rawkey = window.crypto.getrandomvalues(new uint8array(16)); /* import an aes secret key from an arraybuffer containing the raw bytes.
SubtleCrypto.sign() - Web APIs
WebAPISubtleCryptosign
it's different from rsassa-pkcs1-v1_5 in that it incorporates a random salt in the signature operation, so the same message signed with the same key will not result in the same signature each time.
SubtleCrypto.verify() - Web APIs
syntax const result = crypto.subtle.verify(algorithm, key, signature, data); parameters algorithm is a domstring or object defining the algorithm to use, and for some algorithm choices, some extra parameters.
SyncManager.getTags() - Web APIs
}) returns a promise that resolves to an array of domstrings containing developer-defined identifiers for syncmanager registrations.
TaskAttributionTiming.containerId - Web APIs
syntax var containerid = taskattributiontiming.containerid; value a domstring containing the containers id attribute.
TaskAttributionTiming.containerName - Web APIs
syntax var containername = taskattributiontiming.containername; value a domstring containing the container's name attribute.
TaskAttributionTiming.containerSrc - Web APIs
syntax var containersrc = taskattributiontiming.containersrc; value a domstring containing the container's src attribute.
TaskAttributionTiming.containerType - Web APIs
syntax var containertype = taskattributiontiming.containertype; value a domstring containing the container's type, one of iframe, embed, or object.
HTMLSlotElement.assignedSlot - Web APIs
WebAPITextassignedSlot
specifications specification status comment domthe definition of 'assignedslot' in that specification.
TextDecoder.prototype.decode() - Web APIs
the textdecoder.prototype.decode() method returns a domstring containing the text, given in parameters, decoded with the specific method for that textdecoder object.
TextDecoder.prototype.encoding - Web APIs
the textdecoder.prototype.encoding read-only property returns a domstring containing the name of the decoding algorithm used by the specific decoder.
TextEncoder.encoding - Web APIs
the textencoder.encoding read-only property returns a domstring containing the name of the encoding algorithm used by the specific encoder.
TextEncoder - Web APIs
0b10*/<<6) | (point&0x3f/*0b00111111*/); } } if (typeof uint8array !== "undefined") return resarr.subarray(0, respos + 1); // else // ie 6-9 resarr.length = respos + 1; // trim off extra weight return resarr; }; textencoder.prototype.tostring = function(){return "[object textencoder]"}; try { // object.defineproperty only works on dom prototypes in ie8 object.defineproperty(textencoder.prototype,"encoding",{ get:function(){if(textencoder.prototype.isprototypeof(this)) return"utf-8"; else throw typeerror("illegal invocation");} }); } catch(e) { /*ie6-8 fallback*/ textencoder.prototype.encoding = "utf-8"; } if(typeof symbol!=="undefined")textencoder.prototype[symbol.
TextRange - Web APIs
WebAPITextRange
textrange.querycommandvalue() returns the domstring indicating the current value of the specified command.
TextTrackCue - Web APIs
texttrackcue.id a domstring that identifies the cue.
getTrackById() - Web APIs
syntax var thetrack = texttracklist.gettrackbyid(id); paramters id a domstring indicating the id of the track to locate within the track list.
TextTrackList.length - Web APIs
example this snippet gets the number of text tracks in the first media element found in the dom by queryselector().
TimeEvent - Web APIs
WebAPITimeEvent
methods inittimeevent(domstring typearg, abstractview viewarg, long detailarg) the inittimeevent method is used to initialize the value of a timeevent created through the documentevent interface.
TimeRanges.end() - Web APIs
WebAPITimeRangesend
exceptions index_size_err a domexception thrown if the specified index doesn't correspond to an existing range.
TimeRanges.start() - Web APIs
WebAPITimeRangesstart
exceptions index_size_err a domexception thrown if the specified index doesn't correspond to an existing range.
TouchEvent() - Web APIs
syntax event = new touchevent(typearg, toucheventinit); values typearg is a domstring representing the name of the event.
TouchEvent - Web APIs
globaleventhandlers the globaleventhandlers mixin defines these events as global events that are available on any element in the dom that the user can interact with.
Multi-touch interaction - Web APIs
however, the interfaces can be a bit tricky for programmers to use because touch events are very different from other dom input events, such as mouse events.
Using Touch Events - Web APIs
targettouches - a list of the touch points on the target dom element.
Touch events - Web APIs
function startup() { var el = document.getelementbyid("canvas"); el.addeventlistener("touchstart", handlestart, false); el.addeventlistener("touchend", handleend, false); el.addeventlistener("touchcancel", handlecancel, false); el.addeventlistener("touchmove", handlemove, false); } document.addeventlistener("domcontentloaded", startup); this simply sets up all the event listeners for our <canvas> element so we can handle the touch events as they occur.
TrackDefault.byteStreamTrackID - Web APIs
syntax var myid = trackdefault.bytestreamtrackid; value a domstring.
TrackDefault.kinds - Web APIs
syntax var mykinds = trackdefault.kinds; value an array of domstrings.
TrackDefault.label - Web APIs
syntax var mylabel = trackdefault.label; value a domstring.
TrackDefault.language - Web APIs
syntax var mylanguage = trackdefault.language; value a domstring.
TrackDefault.type - Web APIs
WebAPITrackDefaulttype
audio, video, or text track.) syntax var mytype = trackdefault.type; value a domstring — one of audio, video or text.
TransitionEvent.transitionName - Web APIs
the transitionevent.transitionname read-only property is a domstring containing the name of the css property associated with the transition.
TransitionEvent.pseudoElement - Web APIs
the transitionevent.pseudoelement read-only property is a domstring, starting with '::', containing the name of the pseudo-element the animation runs on.
TreeWalker.expandEntityReferences - Web APIs
syntax expand = treewalker.expandentityreferences; example var treewalker = document.createtreewalker( document.body, nodefilter.show_element, { acceptnode: function(node) { return nodefilter.filter_accept; } }, false ); expand = treewalker.expandentityreferences; specifications document object model (dom) level 2 traversal and range specificationthe definition of 'treewalker.expandentityreferences' in that specification.
URL.origin - Web APIs
WebAPIURLorigin
the exact structure varies depending on the type of url: for http or https urls, the scheme followed by '://', followed by the domain, followed by ':', followed by the port (the default port, 80 and 443 respectively, if explicitely specified).
URL.password - Web APIs
WebAPIURLpassword
the password property of the url interface is a usvstring containing the password specified before the domain name.
URL.port - Web APIs
WebAPIURLport
examples const url = new url('https://mydomain.com:80/svn/repos/'); console.log(url.port); // logs '80' specifications specification status comment urlthe definition of 'url.port' in that specification.
URL.revokeObjectURL() - Web APIs
syntax url.revokeobjecturl(objecturl) parameters objecturl a domstring representing a object url that was previously created by calling createobjecturl().
URL.username - Web APIs
WebAPIURLusername
the username property of the url interface is a usvstring containing the username specified before the domain name.
URLSearchParams.toString() - Web APIs
return value a domstring, without the question mark.
URLUtilsReadOnly.hash - Web APIs
the urlutilsreadonly.hash read-only property returns a domstring containing a '#' followed by the fragment identifier of the url.
URLUtilsReadOnly.host - Web APIs
the urlutilsreadonly.host read-only property returns a domstring containing the host, that is the hostname, a ':', and the port of the url.
URLUtilsReadOnly.hostname - Web APIs
the urlutilsreadonly.hostname read-only property returns a domstring containing the domain of the url.
URLUtilsReadOnly.href - Web APIs
the urlutilsreadonly.href read-only property is a stringifier that returns a domstring containing the whole url.
URLUtilsReadOnly.origin - Web APIs
the urlutilsreadonly.origin read-only property is a domstring containing the unicode serialization of the origin of the represented url, that is, for http and https, the scheme followed by '://', followed by the domain, followed by ':', followed by the port (the default port, 80 and 443 respectively, if explicitely specified).
URLUtilsReadOnly.pathname - Web APIs
the urlutilsreadonly.pathname read-only property returns a domstring containing an initial '/' followed by the path of the url.
URLUtilsReadOnly.port - Web APIs
the urlutilsreadonly.port read-only property returns a domstring containing the port number of the url.
URLUtilsReadOnly.protocol - Web APIs
the urlutilsreadonly.protocol read-only property returns a domstring containing the protocol scheme of the url, including the final ':'.
URLUtilsReadOnly.search - Web APIs
the urlutilsreadonly.search read-only property returns a domstring containing a '?' followed by the parameters of the url.
URLUtilsReadOnly.toString() - Web APIs
the urlutilsreadonly.tostring() stringifier method returns a domstring containing the whole url.
USBDevice.manufacturerName - Web APIs
syntax var serialnumber = usbdevice.manufacturername value a domstring.
USVString - Web APIs
WebAPIUSVString
usvstring is equivalent to domstring except for not allowing unpaired surrogate codepoints.
User Timing API - Web APIs
duration - set to a domhighrestimestamp that is the duration of the measure (typically, the end mark timestamp minus the start mark timestamp).
VTTCue() - Web APIs
WebAPIVTTCueVTTCue
text a domstring providing the text that will be shown during the time span indicated by starttime and endtime.
VTTCue - Web APIs
WebAPIVTTCue
vttcue.text returns a domstring with the contents of the cue.
VTTRegion - Web APIs
WebAPIVTTRegion
properties vttregion.id a domstring that identifies the region.
VideoPlaybackQuality.creationTime - Web APIs
syntax value = videoplaybackquality.creationtime; value a domhighrestimestamp object which indicates the number of milliseconds that elapased between the time the browsing context was created and the time at which this sample of the video quality was obtained.
VideoPlaybackQuality - Web APIs
creationtime read only a domhighrestimestamp containing the time in miliseconds between the start of the navigation and the creation of the object.
VideoTrack.id - Web APIs
WebAPIVideoTrackid
syntax var trackid = videotrack.id; value a domstring which identifies the track, suitable for use when calling gettrackbyid() on an videotracklist such as the one specified by a media element's videotracks property.
VideoTrack.kind - Web APIs
WebAPIVideoTrackkind
syntax var trackkind = videotrack.kind; value a domstring specifying the type of content the media represents.
VideoTrack.label - Web APIs
WebAPIVideoTracklabel
syntax var videotracklabel = videotrack.label; value a domstring specifying the track's human-readable label, if one is available in the track metadata.
Videotrack.language - Web APIs
syntax var videotracklanguage = videotrack.language; value a domstring specifying the bcp 47 (rfc 5646) format language tag of the primary language used in the video track, or an empty string ("") if the language is not specified or known, or if the track doesn't contain speech.
getTrackById - Web APIs
syntax var thetrack = videotracklist.gettrackbyid(id); paramters id a domstring indicating the id of the track to locate within the track list.
VideoTrackList.length - Web APIs
example this snippet gets the number of video tracks in the first <video> element found in the dom by queryselector().
WEBGL_compressed_texture_astc.getSupportedProfiles() - Web APIs
syntax sequence<domstring> ext.getsupportedprofiles(); return value an array of domstring elements indicating which astc profiles are supported by the implementation.
WebGL2RenderingContext.getFragDataLocation() - Web APIs
name a domstring specifying the name of the user-defined varying out variable.
WebGL2RenderingContext.getUniformBlockIndex() - Web APIs
uniformname a domstring specifying the name of the uniform block to whose index to retrieve.
WebGL2RenderingContext.getUniformIndices() - Web APIs
uniformnames an array of domstring specifying the names of the uniforms to query.
WebGL2RenderingContext.transformFeedbackVaryings() - Web APIs
varyings an array of domstring specifying the the names of the varying variables to use.
WebGLRenderingContext.bindAttribLocation() - Web APIs
name a domstring specifying the name of the variable to bind to the generic vertex index.
WebGLRenderingContext.getAttribLocation() - Web APIs
name a domstring specifying the name of the attribute variable whose location to get.
WebGLRenderingContext.getProgramInfoLog() - Web APIs
return value a domstring that contains diagnostic messages, warning messages, and other information about the last linking or validation operation.
WebGLRenderingContext.getShaderInfoLog() - Web APIs
return value a domstring that contains diagnostic messages, warning messages, and other information about the last compile operation.
WebGLRenderingContext.getUniformLocation() - Web APIs
name a domstring specifying the name of the uniform variable whose location is to be returned.
WebGLRenderingContext.shaderSource() - Web APIs
source a domstring containing the glsl source code to set.
WebGLRenderingContext - Web APIs
working with extensions these methods manage webgl extensions: webglrenderingcontext.getsupportedextensions() returns an array of domstring elements with all the supported webgl extensions.
Clearing with colors - Web APIs
--> <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; } // run everything inside window load event handler, to make sure // dom is fully loaded and styled before trying to manipulate it, // and to not mess up the global scope.
Detect WebGL - Web APIs
<p>[ here would go the result of webgl feature detection ]</p> <button>press here to detect webglrenderingcontext</button> body { text-align : center; } button { display : block; font-size : inherit; margin : auto; padding : 0.6em; } // run everything inside window load event handler, to make sure // dom is fully loaded and styled before trying to manipulate it.
WebGL best practices - Web APIs
teximage/texsubimage uploads (particularly with videos) can cause pipeline flushes most texture uploads from dom elements will incur a processing pass that will temporarily switch gl progams internally, causing a pipeline flush.
WebGL model view projection - Web APIs
you have the freedom to place the camera essentially anywhere you wish, and to aim the camera in whichever direction you choose.
WebKitCSSMatrix - Web APIs
an alias for dommatrix.
Establishing a connection: The WebRTC perfect negotiation pattern - Web APIs
it could be as simple as assigning the polite role to the first peer to connect to the signaling server, or you could do something more elaborate like having the peers exchange random numbers and assigning the polite role to the winner.
A simple RTCDataChannel sample - Web APIs
function handlereceivemessage(event) { var el = document.createelement("p"); var txtnode = document.createtextnode(event.data); el.appendchild(txtnode); receivebox.appendchild(el); } this method simply performs some basic dom injection; it creates a new <p> (paragraph) element, then creates a new text node containing the message text, which is received in the event's data property.
WebRTC API - Web APIs
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.
WebSocket.binaryType - Web APIs
syntax var binarytype = awebsocket.binarytype; value a domstring: "blob" if blob objects are used.
WebSocket.extensions - Web APIs
syntax var extensions = awebsocket.extensions; value a domstring.
WebSocket.protocol - Web APIs
syntax var protocol = awebsocket.protocol; value a domstring.
WebSocket.url - Web APIs
WebAPIWebSocketurl
syntax var url = awebsocket.url; value a domstring.
Writing WebSocket servers - Web APIs
tip: to avoid name conflict, it's recommended to make your subprotocol name part of a domain string.
Using bounded reference spaces - Web APIs
this property contains an array of dompointreadonly objects, each of which defines one of the points making up the space's border, moving around the room in clockwise order.
Viewpoints and viewers: Simulating cameras in WebXR - Web APIs
the adjusted domxref("xrreferencespace")}} returned by this function is then passed into the xrframe method getviewerpose() to get the xrviewerpose representing the viewer's position and viewing angle.
WebXR permissions and security - Web APIs
immersive presentation of vr first, any requests to activate the immersive-vr mode are rejected if the domain issuing the request does not have permission to enable an immersive session.
WebXR Device API - Web APIs
a typical xr device can have either 3 or 6 degrees of freedom and might or might not have an external positional sensor.
Controlling multiple parameters with ConstantSourceNode - Web APIs
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.
Background audio processing using AudioWorklet - Web APIs
access the audio context's audioworklet through its audioworklet property, and call the audio worklet's domxref("worklet.addmodule", "addmodule()")}} method to install the audio worklet processor module.
Using IIR filters - Web APIs
// create a canvas element and append it to our dom const canvascontainer = document.queryselector('.filter-graph'); const canvasel = document.createelement('canvas'); canvascontainer.appendchild(canvasel); // set 2d context and set dimesions const canvasctx = canvasel.getcontext('2d'); const width = canvascontainer.offsetwidth; const height = canvascontainer.offsetheight; canvasel.width = width; canvasel.height = height; // set background fill ...
Web Audio API - Web APIs
analysernode the analysernode interface represents a node able to provide real-time frequency and time-domain analysis information, for the purposes of data analysis and visualization.
Web Crypto API - Web APIs
even assuming you use the basic cryptographic functions correctly, secure key management and overall security system design are extremely hard to get right, and are generally the domain of specialist security experts.
Using the Web Speech API - Web APIs
setting variables first of all, we capture references to all the dom elements involved in the ui, but more interestingly, we capture a reference to window.speechsynthesis.
Web Storage API - Web APIs
web storage interfaces storage allows you to set, retrieve and remove data for a specific domain and storage type (session or local.) window the web storage api extends the window object with two new properties — window.sessionstorage and window.localstorage — which provide access to the current domain's session and local storage objects respectively, and a window.onstorage event handler that fires when a storage area changes (e.g.
The structured clone algorithm - Web APIs
cloning dom nodes likewise throws a data_clone_err exception.
WheelEvent.deltaX - Web APIs
WebAPIWheelEventdeltaX
syntax var dx = event.deltax; example var syntheticevent = new wheelevent("syntheticwheel", {"deltax": 4, "deltamode": 0}); console.log(syntheticevent.deltax); specifications specification status comment document object model (dom) level 3 events specificationthe definition of 'wheelevent.deltax' in that specification.
WheelEvent.deltaY - Web APIs
WebAPIWheelEventdeltaY
syntax var dy = event.deltay; example var syntheticevent = new wheelevent("syntheticwheel", {"deltay": 4, "deltamode": 0}); console.log(syntheticevent.deltay); specifications specification status comment document object model (dom) level 3 events specificationthe definition of 'wheelevent.deltay' in that specification.
WheelEvent.deltaZ - Web APIs
WebAPIWheelEventdeltaZ
syntax var dz = event.deltaz; example var syntheticevent = new wheelevent("syntheticwheel", {"deltaz": 4, "deltamode": 0}); console.log(syntheticevent.deltaz); specifications specification status comment document object model (dom) level 3 events specificationthe definition of 'wheelevent.deltaz' in that specification.
Window.alert() - Web APIs
WebAPIWindowalert
the following text is shared between this article, dom:window.prompt and dom:window.confirm dialog boxes are modal windows - they prevent the user from accessing the rest of the program's interface until the dialog box is closed.
Window: animationend event - Web APIs
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.
Window: blur event - Web APIs
WebAPIWindowblur event
document object model (dom) level 3 events specification obsolete initial definition ...
Window.captureEvents() - Web APIs
--> <script> function reg() { window.captureevents(event.click); window.onclick = page_click; } function page_click() { alert('page click event detected!'); } </script> </head> <body onload="reg();"> <p>click anywhere on this page.</p> </body> </html> notes events raised in the dom by user activity (such as clicking buttons or shifting focus away from the current document) generally pass through the high-level window and document objects first before arriving at the object that initiated the event.
Window.confirm() - Web APIs
WebAPIWindowconfirm
example if (window.confirm("do you really want to leave?")) { window.open("exit.html", "thanks for visiting!"); } produces: notes the following text is shared between this article, dom:window.prompt and dom:window.alert dialog boxes are modal windows — they prevent the user from accessing the rest of the program's interface until the dialog box is closed.
Window.convertPointFromNodeToPage() - Web APIs
given a point specified in a particular dom node's coordinate system, the window method convertpointfromnodetopage() returns a point which specifies the same position in the page's coordinate system.
Window.convertPointFromPageToNode - Web APIs
given a point specified in the page's coordinate system, the window method convertpointfrompagetonode() returns a point object specifying the same location in the coordinate system of the specified dom node.
window.dump() - Web APIs
WebAPIWindowdump
to see the dump output you have to enable it by setting the preference browser.dom.window.dump.enabled to true.
Window: focus event - Web APIs
document object model (dom) level 3 events specification obsolete initial definition ...
Window.frames - Web APIs
WebAPIWindowframes
each item in the window.frames pseudo-array represents the window object corresponding to the given <frame>'s or <iframe>'s content, not the (i)frame dom element (i.e., window.frames[0] is the same thing as document.getelementsbytagname("iframe")[0].contentwindow).
Window.getAttention() - Web APIs
specification dom level 0.
Window.getComputedStyle() - Web APIs
working draft document object model (dom) level 2 style specificationthe definition of 'getcomputedstyle()' in that specification.
Window.home() - Web APIs
WebAPIWindowhome
syntax window.home(); example function gohome() { window.home(); } specification dom level 0.
window.location - Web APIs
WebAPIWindowlocation
though window.location is a read-only location object, you can also assign a domstring to it.
Window.locationbar - Web APIs
<!doctype html> <html lang="en"> <head> <meta charset="utf-8" /> <title>various dom tests</title> <script> var visible = window.locationbar.visible; </script> </head> <body> <p>various dom tests</p> </body> </html> specifications specification status comment html living standardthe definition of 'window.locationbar' in that specification.
Window.menubar - Web APIs
WebAPIWindowmenubar
<html> <head> <title>various dom tests</title> <script> var visible = window.menubar.visible; </script> </head> <body> <p>various dom tests</p> </body> </html> specifications specification status comment html living standardthe definition of 'window.menubar' in that specification.
Window.mozInnerScreenX - Web APIs
that means it can be affected by the zoom level; to compute the actual number of physical screen pixels, you should use the nsidomwindowutils.screenpixelspercsspixel property.
Window.mozInnerScreenY - Web APIs
that means it can be affected by the zoom level; to compute the actual number of physical screen pixels, you should use the nsidomwindowutils.screenpixelspercsspixel property.
Obsolete features - Web APIs
mozilla and firefox users can force new windows to always render the personal toolbar/bookmarks toolbar by setting dom.disable_window_open_feature.personalbar to true in about:config or in their user.js file.
Window.personalbar - Web APIs
<!doctype html> <html> <head> <title>various dom tests</title> <script> // changing bar states on the existing window netscape.security.privilegemanager.enableprivilege("universalbrowserwrite"); window.personalbar.visible = !window.personalbar.visible; </script> </head> <body> <p>various dom tests</p> </body> </html> notes when you load the example page above, the browser displays the following dialog: to toggle the visibility of these...
Window.pkcs11 - Web APIs
WebAPIWindowpkcs11
syntax objref = window.pkcs11 example window.pkcs11.addmodule(smod, secpath, 0, 0); notes see nsidompkcs11 for more information about how to manipulate pkcs11 objects.
Window: popstate event - Web APIs
this will eventually send events such as domcontentloaded and load to the window containing the document, but the steps below will continue to execute in the meantime.
Window.prompt() - Web APIs
WebAPIWindowprompt
the following text is shared between this article, dom:window.confirm and dom:window.alert dialog boxes are modal windows; they prevent the user from accessing the rest of the program's interface until the dialog box is closed.
Window.resizeBy() - Web APIs
WebAPIWindowresizeBy
// create resizable window myexternalwindow = window.open("http://myurl.domain", "mywindowname", "resizable"); // resize window to 500x500 myexternalwindow.resizeto(500, 500); // make window relatively smaller to 400x400 myexternalwindow.resizeby(-100, -100); the window you create must respect the same origin policy.
Window: resize event - Web APIs
ion reportwindowsize() { heightoutput.textcontent = window.innerheight; widthoutput.textcontent = window.innerwidth; } window.onresize = reportwindowsize; addeventlistener equivalent you could set up the event handler using the addeventlistener() method: window.addeventlistener('resize', reportwindowsize); specifications specification status document object model (dom) level 3 events specificationthe definition of 'resize' in that specification.
Window.scrollByPages() - Web APIs
example // scroll down the document by 1 page window.scrollbypages(1); // scroll up the document by 1 page window.scrollbypages(-1); specification dom level 0.
Window.scrollbars - Web APIs
WebAPIWindowscrollbars
<!doctype html> <html> <head> <title>various dom tests</title> <script> let visiblescrollbars = window.scrollbars.visible; </script> </head> <body> <p>various dom tests</p> </body> </html> specifications specification status comment html living standardthe definition of 'window.scrollbars' in that specification.
Window.sessionStorage - Web APIs
the keys and the values are always in the utf-16 domstring format, which uses two bytes per character.
Window.sizeToContent() - Web APIs
in order for it to work, the dom content should be loaded when this function is called—for example, once the domcontentloaded event has been thrown.
Window.statusbar - Web APIs
WebAPIWindowstatusbar
<!doctype html> <html lang="en"> <head> <meta charset="utf-8" /> <title>various dom tests</title> <script> // changing bar states on the existing window netscape.security.privilegemanager.enableprivilege("universalbrowserwrite"); window.statusbar.visible=!window.statusbar.visible; </script> </head> <body> <p>various dom tests</p> </body> </html> notes when you load the example page above, the browser displays the following dialog: to toggle the visibility of these bars,...
Window.toolbar - Web APIs
WebAPIWindowtoolbar
<!doctype html> <html> <head> <title>various dom tests</title> <script> // changing bar states on the existing window netscape.security.privilegemanager.enableprivilege("universalbrowserwrite"); window.toolbar.visible=!window.toolbar.visible; </script> </head> <body> <p>various dom tests</p> </body> </html> notes when you load the example page above, the browser displays the following dialog: to toggle the visibility of these bars, you...
Window.updateCommands() - Web APIs
specification dom level 0.
WindowClient.visibilityState - Web APIs
syntax var myvisstate = windowclient.visibilitystate; value a domstring (see document.visibilitystate for values).
WindowOrWorkerGlobalScope.atob() - Web APIs
exceptions domexception (name: invalidcharactererror) throws if encodeddata is not valid base64.
WindowOrWorkerGlobalScope.fetch() - Web APIs
to automatically send cookies for the current domain, this option must be provided.
WindowOrWorkerGlobalScope.setInterval() - Web APIs
living standard initial definition (dom level 0) ...
WorkerGlobalScope.importScripts() - Web APIs
syntax self.importscripts('foo.js'); self.importscripts('foo.js', 'bar.js', ...); parameters a comma-separated list of domstring objects representing the scripts to be imported.
WritableStream.WritableStream() - Web APIs
the reason parameter contains a domstring describing why the stream was aborted.
WritableStream.abort() - Web APIs
syntax var promise = writablestream.abort(reason); parameters reason a domstring providing a human-readable reason for the abort.
WritableStreamDefaultController.error() - Web APIs
syntax writablestreamdefaultcontroller.error(e); parameters e a domstring representing the error you want future interactions to fail with.
WritableStreamDefaultWriter.abort() - Web APIs
syntax var promise = writablestreamdefaultwriter.abort(reason); parameters reason optional a domstring representing a human-readable reason for the abort.
XMLHttpRequest.multipart - Web APIs
this enables support for server push; for each xml document that's written to this request, a new xml dom document is created and the onload handler is called between documents.
XMLHttpRequest.open() - Web APIs
url a domstring representing the url to send the request to.
XMLHttpRequest.overrideMimeType() - Web APIs
syntax xmlhttprequest.overridemimetype(mimetype) parameters mimetype a domstring specifying the mime type to use instead of the one specified by the server.
XMLHttpRequest.responseText - Web APIs
syntax var resulttext = xmlhttprequest.responsetext; value a domstring which contains either the textual data received using the xmlhttprequest or null if the request failed or "" if the request has not yet been sent by calling send().
XMLHttpRequest.responseType - Web APIs
text the response is a text in a domstring object.
XMLHttpRequest.setRequestHeader() - Web APIs
note: for your custom fields, you may encounter a "not allowed by access-control-allow-headers in preflight response" exception when you send requests across domains.
XMLHttpRequest.statusText - Web APIs
the read-only xmlhttprequest.statustext property returns a domstring containing the response's status message as returned by the http server.
XMLHttpRequestResponseType - Web APIs
text the response is a text in a domstring object.
XPathException.code - Web APIs
specifications specification status comment document object model (dom) level 3 xpath specificationthe definition of 'xpathexception' in that specification.
XPathNSResolver - Web APIs
specifications specification status comment document object model (dom) level 3 xpath specificationthe definition of 'xpathnsresolver' in that specification.
XPathResult.booleanValue - Web APIs
html <div>xpath example</div> <p>text is 'xpath example': <output></output></p> javascript var xpath = "//div/text() = 'xpath example'"; var result = document.evaluate(xpath, document, null, xpathresult.boolean_type, null); document.queryselector("output").textcontent = result.booleanvalue; result specifications specification status comment document object model (dom) level 3 xpath specificationthe definition of 'xpathresult.booleanvalue' in that specification.
XPathResult.invalidIteratorState - Web APIs
"invalid" : "valid"; result specifications specification status comment document object model (dom) level 3 xpath specificationthe definition of 'xpathresult.invaliditeratorstate' in that specification.
XPathResult.iterateNext() - Web APIs
> javascript var xpath = "//div"; var result = document.evaluate(xpath, document, null, xpathresult.any_type, null); var node = null; var tagnames = []; while(node = result.iteratenext()) { tagnames.push(node.localname); } document.queryselector("output").textcontent = tagnames.join(", "); result specifications specification status comment document object model (dom) level 3 xpath specificationthe definition of 'xpathresult.iteratenext()' in that specification.
XPathResult.numberValue - Web APIs
html <div>xpath example</div> <div>number of &lt;div&gt;s: <output></output></div> javascript var xpath = "count(//div)"; var result = document.evaluate(xpath, document, null, xpathresult.number_type, null); document.queryselector("output").textcontent = result.numbervalue; result specifications specification status comment document object model (dom) level 3 xpath specificationthe definition of 'xpathresult.numbervalue' in that specification.
XPathResult.resultType - Web APIs
iv> javascript var xpath = "//div"; var result = document.evaluate(xpath, document, null, xpathresult.any_type, null); document.queryselector("output").textcontent = result.resulttype >= xpathresult.unordered_node_iterator_type && result.resulttype <= xpathresult.first_ordered_node_type; result specifications specification status comment document object model (dom) level 3 xpath specificationthe definition of 'xpathresult.resulttype' in that specification.
XPathResult.singleNodeValue - Web APIs
g the text content 'xpath example': <output></output></div> javascript var xpath = "//*[text()='xpath example']"; var result = document.evaluate(xpath, document, null, xpathresult.first_ordered_node_type, null); document.queryselector("output").textcontent = result.singlenodevalue.localname; result specifications specification status comment document object model (dom) level 3 xpath specificationthe definition of 'xpathresult.singlenodevalue' in that specification.
XPathResult.snapshotItem() - Web APIs
(xpath, document, null, xpathresult.ordered_node_snapshot_type, null); var node = null; var tagnames = []; for(var i = 0; i < result.snapshotlength; i++) { var node = result.snapshotitem(i); tagnames.push(node.localname); } document.queryselector("output").textcontent = tagnames.join(", "); result specifications specification status comment document object model (dom) level 3 xpath specificationthe definition of 'xpathresult.snapshotitem()' in that specification.
XPathResult.snapshotLength - Web APIs
html <div>xpath example</div> <div>number of matched nodes: <output></output></div> javascript var xpath = "//div"; var result = document.evaluate(xpath, document, null, xpathresult.ordered_node_snapshot_type, null); document.queryselector("output").textcontent = result.snapshotlength; result specifications specification status comment document object model (dom) level 3 xpath specificationthe definition of 'xpathresult.snapshotlength' in that specification.
XPathResult.stringValue - Web APIs
html <div>xpath example</div> <div>text content of the &lt;div&gt; above: <output></output></div> javascript var xpath = "//div/text()"; var result = document.evaluate(xpath, document, null, xpathresult.string_type, null); document.queryselector("output").textcontent = result.stringvalue; result specifications specification status comment document object model (dom) level 3 xpath specificationthe definition of 'xpathresult.stringvalue' in that specification.
XPathResult - Web APIs
specifications specification status comment document object model (dom) level 3 xpath specificationthe definition of 'xpathresult' in that specification.
XRBoundedReferenceSpace - Web APIs
properties in addition to the properties of xrreferencespace, xrboundedreferencespace includes the following: boundsgeometry read only an array of dompointreadonly objects, each of which defines a vertex in the polygon defining the boundaries within which the user will be required to remain.
XRFrame.getViewerPose() - Web APIs
exceptions invalidstateerror a domexception indicating that getviewerpose() was not called within the context of a callback to a session's xrsession.requestanimationframe().
XRFrameRequestCallback - Web APIs
syntax function xrframerequestcallback(time, xrframe){ // process xrframe here } xrsession.requestanimationframe(xrframerequestcallback) parameters domhighrestimestamp a timestamp corresponding to the returned xrframe.
XRInputSource.handedness - Web APIs
syntax let hand = xrinputsource.handedness; value a domstring indicating whether the input controller is held in one of the user's hands, and if it is, which hand.
XRInputSource.profiles - Web APIs
syntax let profilelist = xrinputsource.profiles; value an array of domstring objects, each describing one configuration profile for the input device represented by the xrinputsource object.
XRInputSource.targetRayMode - Web APIs
syntax let raymode = xrinputsource.targetraymode; value a domstring taken from the xrtargetraymode enumerated type, indicating which method to use when generating and presenting the target ray to the user.
XRInputSourceEvent() - Web APIs
syntax newinputsourceevent = new xrinputsourceevent(type, eventinitdict); parameters type a domstring indicating which of the input source events the new object will represent.
XRInputSourcesChangeEvent() - Web APIs
syntax newinputsourceschangeevent = new xrinputsourceschangeevent(type, eventinitdict); parameters type a domstring indicating the type of event which has occurred.
XRPermissionDescriptor.mode - Web APIs
syntax xrpermissiondescriptor = { mode: xrsessionmode, requiredfeatures: reqfeaturelist, optionalfeatures: optfeaturelist }; xrpermissiondescriptor.mode = xrsessionmode; xrmode = xrpermissiondescriptor.mode; value a domstring whose value is one of the strings found in the xrsessionmode enumerated type: immersive-ar the session's output will be given exclusive access to the immersive device, but the rendered content will be blended with the real-world environment.
XRPermissionDescriptor - Web APIs
if the permission request promise is rejected, the error is handled (currently by just dumping it to the console using domxref("console.log()")}}).
XRPose - Web APIs
WebAPIXRPose
xrpose.emulatedposition read only a boolean value which is false if the position and orientation given by transform is obtained directly from a full six degree of freedom (6dof) xr device (that is, a device which tracks not only the pitch, yaw, and roll of the head but also the forward, backward, and side-to-side motion of the viewer).
XRReferenceSpaceEvent() - Web APIs
syntax let refspaceevent = new xrreferencespaceevent(type, eventinitdict); parameters type a domstring indicating the event type which has occurred.
XRRigidTransform.matrix - Web APIs
here px, py, and pz are the values of the x, y, and z members of the dompointreadonly position.
XRSession.onsqueezeend - Web APIs
examples this snippet of code adds a simple handler for the squeezeend event, which responds only to events on the user's dominant hand.
XRSession.onsqueezestart - Web APIs
examples this snippet of code adds a simple handler for the squeezestart event, which responds only to events on the user's dominant hand by getting the target ray, then calling a function findobjectusingray() to identify the object that the user is pointing at.
XRSession.requestAnimationFrame() - Web APIs
the callback receives as input two parameters: time a domhighrestimestamp indicating the time offset at which the updated viewer state was received from the webxr device.
XRSession.visibilityState - Web APIs
syntax visibilitystate = xrsession.visibilitystate; value a domstring containing one of the values defined in the enumerated type xrvisibilitystate; this string indicates whether or not the xr content is visible to the user and if it is, whether or not it's currently the primary focus.
XRSession - Web APIs
WebAPIXRSession
visibilitystate read only a domstring whose value is one of those found in the xrvisibilitystate enumerated type, indicating whether or not the session's imagery is visible to the user, and if so, if it's being visible but not currently the target for user events.
XRSessionEvent() - Web APIs
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.
XRView.eye - Web APIs
WebAPIXRVieweye
syntax let eye = xrview.eye; value a domstring whose value is one of the strings enumerated by the xreye type: left the xrview represents the point-of-view of the viewer's left eye.
msCaching - Web APIs
WebAPImsCaching
syntax cachestate = object.mscaching values type: domstring property value description auto disables caching for stream or ms-stream data.
msGetRegionContent - Web APIs
if an element is not a region, this method throws a domexception with the invalidaccesserror error code.
msRegionOverflow - Web APIs
syntax string = object.msregionoverflow values type:domstring overflow: the region element's content overflows the region's content box.
msWriteProfilerMark - Web APIs
notes mswriteprofilermark enables you to inject dom based performance markers in addition to existing javascript api to learn exactly when parts of the page are being rendered, building a waterfall view for every one of our impressions showing latency per object, which can be useful for more accurately debugging real users perf issues.
Using the aria-describedby attribute - Accessibility
<div id="descriptionclose">closing this window will discard any information entered and return you back to the main page</div> working examples: checkbox example uses aria-describedby tooltip example uses aria-describedby notes the aria-describedby attributed is not designed to reference descriptions on an external resource—since it is an id, it must reference an element in the same dom document.
Using the group role - Accessibility
"menuitem">custom folder 1</li> <li role="menuitem">custom folder 2</li> <li role="menuitem">custom folder 3</li> </ul> <ul role="group"> <li role="menuitem">new folder</li> </ul> </div> working examples: file directory treeview example using computed properties navigation treeview example using declared properties notes group members that are outside of the dom subtree of the group need to have explicit relationships assigned to them in order to participate in the group.
Using the link role - Accessibility
opening a page using the open() method counts as being a popup, and certain browsers may issue a warning when you try to activate it, or make you explicitly agree to allowing popups form the domain it exists on.
Using ARIA: Roles, states, and properties - Accessibility
addition of aria semantics only exposes extra information to a browser's accessibility api, and does not affect a page's dom.
How to file ARIA-related bugs - Accessibility
tbd: add proper accessibility markup to table genre software where to file notes screen readers freedom scientific jaws jaws technical support form gw micro window eyes window-eyes comments, questions, and feedback (email) non visual desktop access (nvda) file nvda bugs discuss nvda issues browsers apple safari file webkit.org bugs google chrome file chromium bugs microsoft internet explorer file i...
ARIA: Main role - Accessibility
documents and applications can be nested in the dom, which may lead to having more than one main element as dom descendants.
ARIA: tab role - Accessibility
window.addeventlistener("domcontentloaded", () => { const tabs = document.queryselectorall('[role="tab"]'); const tablist = document.queryselector('[role="tablist"]'); // add a click event handler to each tab tabs.foreach(tab => { tab.addeventlistener("click", changetabs); }); // enable arrow navigation between tabs in the tab list let tabfocus = 0; tablist.addeventlistener("keydown", e => { // mov...
ARIA: textbox role - Accessibility
associated aria properties aria-activedescendent attribute taking as 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.
ARIA - Accessibility
along with placing them directly in the markup, aria attributes can be added to the element and updated dynamically using javascript code like this: // find the progress bar <div> in the dom.
An overview of accessible web applications and widgets - Accessibility
stock tickers, live twitter feed updates, progress indicators, and similar content modify the dom in ways that an assistive technology (at) may not be aware of.
Cognitive accessibility - Accessibility
to achieve this, the dom order should match the visual order, which in turn should match the tabbing order.
:disabled - CSS: Cascading Style Sheets
WebCSS:disabled
</label> <input type="checkbox" id="billing-checkbox" checked> <br> <input type="text" placeholder="name" disabled> <input type="text" placeholder="address" disabled> <input type="text" placeholder="zip code" disabled> </fieldset> </form> css input[type="text"]:disabled { background: #ccc; } javascript // wait for the page to finish loading document.addeventlistener('domcontentloaded', function () { // attach `change` event listener to checkbox document.getelementbyid('billing-checkbox').onchange = togglebilling; }, false); function togglebilling() { // select the billing text fields var billingitems = document.queryselectorall('#billing input[type="text"]'); // toggle the billing text fields for (var i = 0; i < billingitems.length; i++) { billi...
@font-face - CSS: Cascading Style Sheets
font mime types format mime type truetype font/ttf opentype font/otf web open font format font/woff web open font format 2 font/woff2 notes web fonts are subject to the same domain restriction (font files must be on the same domain as the page using them), unless http access controls are used to relax this restriction.
Detecting CSS animation support - CSS: Cascading Style Sheets
testing for css animation support this code will check to see if css animation support is available: var animation = false, animationstring = 'animation', keyframeprefix = '', domprefixes = 'webkit moz o ms khtml'.split(' '), pfx = '', elem = document.createelement('div'); if( elem.style.animationname !== undefined ) { animation = true; } if( animation === false ) { for( var i = 0; i < domprefixes.length; i++ ) { if( elem.style[ domprefixes[i] + 'animationname' ] !== undefined ) { pfx = domprefixes[ i ]; animationstring = pfx + 'animation'; ...
Box-shadow generator - CSS: Cascading Style Sheets
a; } var value = "rgb" + a + rgb + v + ")"; return value; } color.prototype.getcolor = function getcolor() { if (this.a | 0 === 1) return this.gethexa(); return this.getrgba(); } /** * shadow object */ function shadow() { this.inset = false; this.posx = 5; this.posy = -5; this.blur = 5; this.spread = 0; this.color = new color(); var hue = (math.random() * 360) | 0; var saturation = (math.random() * 75) | 0; var value = (math.random() * 50 + 50) | 0; this.color.sethsv(hue, saturation, value, 1); } shadow.prototype.computecss = function computecss() { var value = ""; if (this.inset === true) value += "inset "; value += this.posx + "px "; value += this.posy + "px "; value += this.blur + "px "; value += this.spread + "px ...
Color picker tool - CSS: Cascading Style Sheets
de, getstep : getstep, setvalue : setvalue, subscribe : subscribe, unsubscribe : unsubscribe, setprecision : setprecision, setsensivity : setsensivity, getprecision : getprecision, createslider : createslider, }; })(); 'use strict'; window.addeventlistener("load", function() { colorpickertool.init(); }); var colorpickertool = (function colorpickertool() { /*========== get dom element by id ==========*/ function getelembyid(id) { return document.getelementbyid(id); } function allowdropevent(e) { e.preventdefault(); } /*========== make an element resizable relative to it's parent ==========*/ var uicomponent = (function uicomponent() { function makeresizable(elem, axis) { var valuex = 0; var valuey = 0; var action = 0; var resizestart = fun...
Using multi-column layouts - CSS: Cascading Style Sheets
all html, css and dom functionality is supported within columns, as are editing and printing.
CSS Containment - CSS: Cascading Style Sheets
style containment article { contain: style; } despite the name, style containment does not provide scoped styles such as you would get with the shadow dom.
CSS Generated Content - CSS: Cascading Style Sheets
generated content can be used to add content to anonymous replaced elements or replace the content of a dom node in very limited circumstances with a generated value.
CSS Properties Reference - CSS: Cascading Style Sheets
common css properties reference the following is a basic list of the most common css properties with the equivalent of the dom notation which is usually accessed from javascript: note: this list is incomplete.
Shapes From Images - CSS: Cascading Style Sheets
an image hosted on the same domain as your site should work, however if your images are hosted on a different domain such as on a cdn you should ensure that they are sending the correct headers to enable them to be used for shapes.
Using CSS transitions - CSS: Cascading Style Sheets
javascript examples care should be taken when using a transition immediately after: adding the element to the dom using .appendchild() removing an element's display: none; property.
Child combinator - CSS: Cascading Style Sheets
this is stricter than the descendant combinator, which matches all elements matched by the second selector for which there exists an ancestor element matched by the first selector, regardless of the number of "hops" up the dom.
Testing media queries programmatically - CSS: Cascading Style Sheets
the dom provides features that can test the results of a media query programmatically, via the mediaquerylist interface and its methods and properties.
Microsoft CSS extensions - CSS: Cascading Style Sheets
-scroll-translation -ms-text-autospace -ms-touch-select -ms-wrap-flow -ms-wrap-margin -ms-wrap-through zoom pseudo-elements ::-ms-browse ::-ms-check ::-ms-clear ::-ms-expand ::-ms-fill ::-ms-fill-lower ::-ms-fill-upper ::-ms-reveal ::-ms-thumb ::-ms-ticks-after ::-ms-ticks-before ::-ms-tooltip ::-ms-track ::-ms-value media features -ms-high-contrast css-related dom apis mscontentzoomfactor msgetpropertyenabled msgetregioncontent msrangecollection msregionoverflow ...
Linear-gradient Generator - CSS: Cascading Style Sheets
scribe : subscribe, unsubscribe : unsubscribe }; })(); window.addeventlistener("load", function() { lineargradienttool.init(); }); window.addeventlistener("load", function() { lineargradienttool.init(); }); var lineargradienttool = (function lineargradienttool() { 'use strict'; var radian = 180 / math.pi; var inv_radian = math.pi / 180; var units = {'%': 1, 'px' : 0}; /*========== dom methods ==========*/ function getelembyid(id) { return document.getelementbyid(id); } function allowdropevent(e) { e.preventdefault(); } function createclasselement(tag, classname, parent) { var elem = document.createelement(tag); elem.classname = classname; if (parent) parent.appendchild(elem); return elem; }; function trackmouse(elem, callback, startfunc, endfunc) { sta...
Using CSS custom properties (variables) - CSS: Cascading Style Sheets
custom property fallback values using the var() function, you can define multiple fallback values when the given variable is not yet defined; this can be useful when working with custom elements and shadow dom.
Viewport concepts - CSS: Cascading Style Sheets
if you query the width or height of the window and document in chrome or firefox, you may get: document.documentelement.clientwidth /* 1200 */ window.innerwidth /* 1200 */ window.outerwidth /* 1200 */ document.documentelement.clientheight /* 800 */ window.innerheight /* 800 */ window.outerheight /* 900 */ there are several dom properties that can help you query viewport size, and other similar lengths: the document element's element.clientwidth is the inner width of a document in css pixels, including padding (but not borders, margins, or vertical scrollbars, if present).
box-orient - CSS: Cascading Style Sheets
description html dom elements lay out their contents along the inline-axis by default.
Computed value - CSS: Cascading Style Sheets
note: the getcomputedstyle() dom api returns the resolved value, which may either be the computed value or the used value, depending on the property.
content - CSS: Cascading Style Sheets
WebCSScontent
accessibility concerns css-generated content is not included in the dom.
<easing-function> - CSS: Cascading Style Sheets
the steps() class of easing functions the steps() functional notation defines a step function dividing the domain of output values in equidistant steps.this subclass of step functions are sometimes also called staircase functions.
flex-direction - CSS: Cascading Style Sheets
accessibility concerns using the flex-direction property with values of row-reverse or column-reverse will create a disconnect between the visual presentation of content and dom order.
float - CSS: Cascading Style Sheets
WebCSSfloat
this was an exception to the rule, that the name of the dom member is the camel-case name of the dash-separated css name (due to the fact that "float" is a reserved word in javascript, as seen in the need to escape "class" as "classname" and escape <label>'s "for" as "htmlfor").
order - CSS: Cascading Style Sheets
WebCSSorder
accessibility concerns using the order property will create a disconnect between the visual presentation of content and dom order.
matrix3d() - CSS: Cascading Style Sheets
a1a2a3a4b1b2b3b4c1c2c3c4d1d2d3d4 examples cube squashing example the following example shows a 3d cube created from dom elements and transforms, which can be hovered/focused to apply a matrix3d() transform to it.
<transform-function> - CSS: Cascading Style Sheets
examples transform function comparison the following example provides a 3d cube created from dom elements and transforms, and a select menu allowing you to choose different transform functions to transform the cube with, so you can compare the effects of the different types.
Used value - CSS: Cascading Style Sheets
note: the getcomputedstyle() dom api returns the resolved value, which may either be the computed value or the used value, depending on the property.
Index - Event reference
WebEventsIndex
found 2 pages: # page tags and summary 1 event reference event, overview, reference dom events are sent to notify code of interesting things that have taken place.
Guide to Web APIs - Developer guides
WebGuideAPI
web apis from a to z aambient light eventsbbackground tasksbattery api beaconbluetooth apibroadcast channel apiccss counter stylescss font loading api cssomcanvas apichannel messaging apiconsole apicredential management apiddomeencoding apiencrypted media extensionsffetch apifile system api frame timing apifullscreen apiggamepad api geolocation apihhtml drag and drop apihigh resolution timehistory apiiimage capture apiindexeddbintersection observer apillong tasks api mmedia capabilities api media capture and streamsmedia session apimedia source extensions mediastream recordingnnavigation timingnetwork information a...
Adding captions and subtitles to HTML5 video - Developer guides
once the menu is built, it is then inserted into the dom at the bottom of the videocontainer.
Audio and Video Delivery - Developer guides
form based set up with domain specific link to cdn hosted library.
Mouse gesture events - Developer guides
gecko 1.9.1 added support for several mozilla-specific dom events used to handle mouse gestures.
Constraint validation - Developer guides
the constraint validation is done in the following ways: by a call to the checkvalidity() or reportvalidity() method of a form-associated dom interface, (htmlinputelement, htmlselectelement, htmlbuttonelement, htmloutputelement or htmltextareaelement), which evaluates the constraints only on this element, allowing a script to get this information.
Mobile Web Development - Developer guides
WebGuideMobile
working with touch screens to use a touch screen you'll need to work with dom touch events.
HTML attribute reference - HTML: Hypertext Markup Language
sizes <link>, <img>, <source> slot global attribute assigns a slot in a shadow dom shadow tree to an element.
Allowing cross-origin use of images and canvas - HTML: Hypertext Markup Language
implementing the save feature now that the server has been configured to allow retrieval of the images cross-origin, we can write the code that allows the user to save them to local local storage, just as if they were being served from the same domain the code is running on.
<a>: The Anchor element - HTML: Hypertext Markup Language
WebHTMLElementa
implicit aria role link when href attribute is present, otherwise no corresponding role permitted aria roles when href attribute is present: button checkbox menuitem menuitemcheckbox menuitemradio option radio switch tab treeitem when href attribute is not present: any dom interface htmlanchorelement examples linking to an absolute url html <a href="https://www.mozilla.com"> mozilla </a> result linking to relative urls html <a href="//example.com">scheme-relative url</a> <a href="/docs/web/html">origin-relative url</a> <a href="./p">directory-relative url</a> css a { display: block; margin-bottom: 0.5em } result linking to an element o...
<abbr>: The Abbreviation element - HTML: Hypertext Markup Language
WebHTMLElementabbr
permitted parents any element that accepts phrasing content implicit aria role no corresponding role permitted aria roles any dom interface htmlelement attributes this element only supports the global attributes.
<acronym> - HTML: Hypertext Markup Language
WebHTMLElementacronym
dom interface this element implements the htmlelement interface.
<applet>: The Embed Java Applet element - HTML: Hypertext Markup Language
WebHTMLElementapplet
dom interface htmlappletelement attributes align this attribute is used to position the applet on the page relative to content that might flow around it.
<area> - HTML: Hypertext Markup Language
WebHTMLElementarea
implicit aria role link when href attribute is present, otherwise no corresponding role permitted aria roles no role permitted dom interface htmlareaelement attributes this element's attributes include the global attributes.
<article>: The Article Contents element - HTML: Hypertext Markup Language
WebHTMLElementarticle
implicit aria role article permitted aria roles application, document, feed, main, none, presentation, region dom interface htmlelement attributes this element only includes the global attributes.
<aside>: The Aside element - HTML: Hypertext Markup Language
WebHTMLElementaside
implicit aria role complementary permitted aria roles feed, none, note, presentation, region, search dom interface htmlelement attributes this element only includes the global attributes.
<audio>: The Embed Audio element - HTML: Hypertext Markup Language
WebHTMLElementaudio
implicit aria role no corresponding role permitted aria roles application dom interface htmlaudioelement specifications specification status comment html living standardthe definition of '<audio>' in that specification.
<b>: The Bring Attention To element - HTML: Hypertext Markup Language
WebHTMLElementb
implicit aria role no corresponding role permitted aria roles any dom interface htmlelement attributes this element only includes the global attributes.
<base>: The Document Base URL element - HTML: Hypertext Markup Language
WebHTMLElementbase
implicit aria role no corresponding role permitted aria roles no role permitted dom interface htmlbaseelement attributes this element's attributes include the global attributes.
<basefont> - HTML: Hypertext Markup Language
WebHTMLElementbasefont
dom interface this element implements the htmlbasefontelement interface.
<bdi>: The Bidirectional Isolate element - HTML: Hypertext Markup Language
WebHTMLElementbdi
implicit aria role no corresponding role permitted aria roles any dom interface htmlelement attributes like all other html elements, this element 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.
<bdo>: The Bidirectional Text Override element - HTML: Hypertext Markup Language
WebHTMLElementbdo
implicit aria role no corresponding role permitted aria roles any dom interface htmlelement up to gecko 1.9.2 (firefox 4) inclusive, firefox implements the htmlspanelement interface for this element.
<big>: The Bigger Text element - HTML: Hypertext Markup Language
WebHTMLElementbig
<span class="bigger">this whole sentence is in bigger letters.</span> </p> result dom interface this element implements the htmlelement interface.
<blink>: The Blinking Text element (obsolete) - HTML: Hypertext Markup Language
WebHTMLElementblink
dom interface this element is unsupported and thus implements the htmlunknownelement interface.
<blockquote>: The Block Quotation element - HTML: Hypertext Markup Language
implicit aria role no corresponding role permitted aria roles any dom interface htmlquoteelement attributes this element's attributes include the global attributes.
<body>: The Document Body element - HTML: Hypertext Markup Language
WebHTMLElementbody
implicit aria role document permitted aria roles no role permitted dom interface htmlbodyelement the <body> element exposes the htmlbodyelement interface.
<br>: The Line Break element - HTML: Hypertext Markup Language
WebHTMLElementbr
implicit aria role no corresponding role permitted aria roles none, presentation dom interface htmlbrelement specifications specification status comment html living standardthe definition of '<br>' in that specification.
<button>: The Button element - HTML: Hypertext Markup Language
WebHTMLElementbutton
implicit aria role button permitted aria roles checkbox, link, menuitem, menuitemcheckbox, menuitemradio, option, radio, switch, tab dom interface htmlbuttonelement attributes this element's attributes include the global attributes.
<caption>: The Table Caption element - HTML: Hypertext Markup Language
WebHTMLElementcaption
implicit aria role no corresponding role permitted aria roles no role permitted dom interface htmltablecaptionelement attributes this element includes the global attributes.
<center>: The Centered Text element (obsolete) - HTML: Hypertext Markup Language
WebHTMLElementcenter
dom interface this element implements the htmlelement interface.
<cite>: The Citation element - HTML: Hypertext Markup Language
WebHTMLElementcite
implicit aria role no corresponding role permitted aria roles any dom interface htmlelement up to gecko 1.9.2 (firefox 4) inclusive, firefox implements the htmlspanelement interface for this element.
<code>: The Inline Code element - HTML: Hypertext Markup Language
WebHTMLElementcode
implicit aria role no corresponding role permitted aria roles any dom interface htmlelement up to gecko 1.9.2 (firefox 4) inclusive, firefox implements the htmlspanelement interface for this element.
<col> - HTML: Hypertext Markup Language
WebHTMLElementcol
implicit aria role no corresponding role permitted aria roles no role permitted dom interface htmltablecolelement attributes this element includes the global attributes.
<colgroup> - HTML: Hypertext Markup Language
WebHTMLElementcolgroup
implicit aria role no corresponding role permitted aria roles no role permitted dom interface htmltablecolelement attributes this element's attributes include the global attributes.
<command>: The HTML Command element - HTML: Hypertext Markup Language
WebHTMLElementcommand
dom interface htmlcommandelement attributes this element includes the global attributes.
<data> - HTML: Hypertext Markup Language
WebHTMLElementdata
implicit aria role no corresponding role permitted aria roles any dom interface htmldataelement attributes this element's attributes include the global attributes.
<datalist>: The HTML Data List element - HTML: Hypertext Markup Language
WebHTMLElementdatalist
implicit aria role listbox permitted aria roles no role permitted dom interface htmldatalistelement attributes this element has no other attributes than the global attributes, common to all elements.
<dd>: The Description Details element - HTML: Hypertext Markup Language
WebHTMLElementdd
implicit aria role definition permitted aria roles no role permitted dom interface htmlelement attributes this element's attributes include the global attributes.
<del>: The Deleted Text element - HTML: Hypertext Markup Language
WebHTMLElementdel
implicit aria role no corresponding role permitted aria roles any dom interface htmlmodelement attributes this element's attributes include the global attributes.
<details>: The Details disclosure element - HTML: Hypertext Markup Language
WebHTMLElementdetails
implicit aria role group permitted aria roles no role permitted dom interface htmldetailselement attributes this element includes the global attributes.
<dfn>: The Definition element - HTML: Hypertext Markup Language
WebHTMLElementdfn
implicit aria role term permitted aria roles any dom interface htmlelement attributes this element's attributes include the global attributes.
<dialog>: The Dialog element - HTML: Hypertext Markup Language
WebHTMLElementdialog
permitted parents any element that accepts flow content implicit aria role dialog permitted aria roles alertdialog dom interface htmldialogelement attributes this element includes the global attributes.
<dir>: The Directory element (obsolete) - HTML: Hypertext Markup Language
WebHTMLElementdir
dom interface this element implements the htmldirectoryelement interface.
<div>: The Content Division element - HTML: Hypertext Markup Language
WebHTMLElementdiv
implicit aria role no corresponding role permitted aria roles any dom interface htmldivelement attributes this element includes the global attributes.
<dt>: The Description Term element - HTML: Hypertext Markup Language
WebHTMLElementdt
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.
<em>: The Emphasis element - HTML: Hypertext Markup Language
WebHTMLElementem
implicit aria role no corresponding role permitted aria roles any dom interface htmlelement up to gecko 1.9.2 (firefox 4) inclusive, firefox implements the htmlspanelement interface for this element.
<embed>: The Embed External Content element - HTML: Hypertext Markup Language
WebHTMLElementembed
implicit aria role no corresponding role permitted aria roles application, document, img, none, presentation dom interface htmlembedelement attributes this element's attributes include the global attributes.
<fieldset>: The Field Set element - HTML: Hypertext Markup Language
WebHTMLElementfieldset
implicit aria role group permitted aria roles radiogroup, presentation, none dom interface htmlfieldsetelement specifications specification status comment html living standardthe definition of '<fieldset>' in that specification.
<figcaption>: The Figure Caption element - HTML: Hypertext Markup Language
implicit aria role no corresponding role permitted aria roles group, none, presentation dom interface htmlelement attributes this element only includes the global attributes.
<figure>: The Figure with Optional Caption element - HTML: Hypertext Markup Language
WebHTMLElementfigure
implicit aria role figure permitted aria roles with no figcaption descendant: any, otherwise no permitted roles dom interface htmlelement attributes this element only includes the global attributes.
<font> - HTML: Hypertext Markup Language
WebHTMLElementfont
dom interface this element implements the htmlfontelement interface.
<footer> - HTML: Hypertext Markup Language
WebHTMLElementfooter
implicit aria role contentinfo, or no corresponding role if a descendant of an article, aside, main, nav or section element, or an element with role=article, complementary, main, navigation or region permitted aria roles group, presentation or none dom interface htmlelement attributes this element only includes the global attributes.
<form> - HTML: Hypertext Markup Language
WebHTMLElementform
permitted parents any element that accepts flow content implicit aria role form if the form has an accessible name, otherwise no corresponding role permitted aria roles search, none or presentation dom interface htmlformelement attributes this element includes the global attributes.
<head>: The Document Metadata (Header) element - HTML: Hypertext Markup Language
WebHTMLElementhead
implicit aria role no corresponding role permitted aria roles no role permitted dom interface htmlheadelement attributes this element includes the global attributes.
<header> - HTML: Hypertext Markup Language
WebHTMLElementheader
implicit aria role banner, or no corresponding role if a descendant of an article, aside, main, nav or section element, or an element with role=article, complementary, main, navigation or region permitted aria roles group, presentation or none dom interface htmlelement usage notes the <header> element is not sectioning content and therefore does not introduce a new section in the outline.
<hgroup> - HTML: Hypertext Markup Language
WebHTMLElementhgroup
implicit aria role no corresponding role permitted aria roles any dom interface htmlelement attributes this element only includes the global attributes.
<hr>: The Thematic Break (Horizontal Rule) element - HTML: Hypertext Markup Language
WebHTMLElementhr
implicit aria role separator permitted aria roles presentation or none dom interface htmlhrelement attributes this element's attributes include the global attributes.
manifest - HTML: Hypertext Markup Language
WebHTMLElementhtmlmanifest
the manifest attribute has only effect during early stages of page load, thus changing it via regular dom interfaces has no effect, window.applicationcache interface instead.
<html>: The HTML Document / Root element - HTML: Hypertext Markup Language
WebHTMLElementhtml
implicit aria role no corresponding role permitted aria roles no role permitted dom interface htmlhtmlelement attributes this element includes the global attributes.
<i>: The Idiomatic Text element - HTML: Hypertext Markup Language
WebHTMLElementi
implicit aria role no corresponding role permitted aria roles any dom interface htmlelement attributes this element only includes the global attributes.
<img>: The Image Embed element - HTML: Hypertext Markup Language
WebHTMLElementimg
permitted aria roles with non-empty alt attribute: button checkbox link menuitem menuitemcheckbox menuitemradio option progressbar scrollbar separator slider switch tab treeitem with empty alt attribute, none or presentation with no alt attribute, no role permitted dom interface htmlimageelement specifications specification status comment referrer policythe definition of 'referrer attribute' in that specification.
<input type="color"> - HTML: Hypertext Markup Language
WebHTMLElementinputcolor
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.
<input type="reset"> - HTML: Hypertext Markup Language
WebHTMLElementinputreset
value a domstring used as the button's label events click supported common attributes type and value idl attributes value methods none value an <input type="reset"> element's value attribute contains a domstring that is used as the button's label.
<input type="submit"> - HTML: Hypertext Markup Language
WebHTMLElementinputsubmit
<input type="submit" value="send request"> value a domstring used as the button's label events click supported common attributes type and value idl attributes value methods none value an <input type="submit"> element's value attribute contains a domstring which is displayed as the button's label.
<ins> - HTML: Hypertext Markup Language
WebHTMLElementins
implicit aria role no corresponding role permitted aria roles any dom interface htmlmodelement attributes this element includes the global attributes.
<isindex> - HTML: Hypertext Markup Language
WebHTMLElementisindex
example <head> <isindex prompt="search document..." action="/search"> </head> in past browsers, this would generate, at parse time, a dom tree equivalent to the following html: <form action="/search"> <hr> <label> search document...
<kbd>: The Keyboard Input element - HTML: Hypertext Markup Language
WebHTMLElementkbd
implicit aria role no corresponding role permitted aria roles any dom interface htmlelement attributes this element only includes the global attributes.
<keygen> - HTML: Hypertext Markup Language
WebHTMLElementkeygen
permitted aria roles none dom interface htmlkeygenelement attributes this element includes the global attributes.
<label> - HTML: Hypertext Markup Language
WebHTMLElementlabel
implicit aria role no corresponding role permitted aria roles no role permitted dom interface htmllabelelement specifications specification status comment html living standardthe definition of '<label>' in that specification.
<legend> - HTML: Hypertext Markup Language
WebHTMLElementlegend
permitted parents a <fieldset> whose first child is this <legend> element implicit aria role no corresponding role permitted aria roles no role permitted dom interface htmllegendelement attributes this element only includes the global attributes.
<li> - HTML: Hypertext Markup Language
WebHTMLElementli
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.
<listing> - HTML: Hypertext Markup Language
WebHTMLElementlisting
dom interface this element implements the htmlelement interface.
<map> - HTML: Hypertext Markup Language
WebHTMLElementmap
implicit aria role no corresponding role permitted aria roles no role permitted dom interface htmlmapelement attributes this element includes the global attributes.
<marquee>: The Marquee element (Obsolete) - HTML: Hypertext Markup Language
WebHTMLElementmarquee
dom interface htmlmarqueeelement attributes behavior sets how the text is scrolled within the marquee.
<menu> - HTML: Hypertext Markup Language
WebHTMLElementmenu
implicit aria role list permitted aria roles directory, group, listbox, menu, menubar, none, presentation, radiogroup, tablist, toolbar or tree dom interface htmlmenuelement attributes this element includes the global attributes.
<menuitem> - HTML: Hypertext Markup Language
WebHTMLElementmenuitem
(if specified, the type attribute of the <menu> element must be popup; if missing, the parent element of the <menu> must itself be a <menu> in the popup menu state.) permitted aria roles none dom interface htmlmenuitemelement attributes this element includes the global attributes; in particular title can be used to describe the command, or provide usage hints.
Standard metadata names - HTML: Hypertext Markup Language
WebHTMLElementmetaname
notes: though unstandardized, this declaration is respected by most mobile browsers due to de-facto dominance.
<meta>: The Document-level Metadata element - HTML: Hypertext Markup Language
WebHTMLElementmeta
implicit aria role no corresponding role permitted aria roles no role permitted dom interface htmlmetaelement the type of metadata provided by the meta element can be one of the following: if the name attribute is set, the meta element provides document-level metadata, applying to the whole page.
<meter>: The HTML Meter element - HTML: Hypertext Markup Language
WebHTMLElementmeter
implicit aria role no corresponding role permitted aria roles no role permitted dom interface htmlmeterelement attributes this element includes the global attributes.
<nav>: The Navigation Section element - HTML: Hypertext Markup Language
WebHTMLElementnav
implicit aria role navigation permitted aria roles no role permitted dom interface htmlelement attributes this element only includes the global attributes.
<noscript> - HTML: Hypertext Markup Language
WebHTMLElementnoscript
implicit aria role no corresponding role permitted aria roles no role permitted dom interface htmlelement attributes this element only includes the global attributes.
<object> - HTML: Hypertext Markup Language
WebHTMLElementobject
implicit aria role no corresponding role permitted aria roles application, document, image dom interface htmlobjectelement attributes this element includes the global attributes.
<ol>: The Ordered List element - HTML: Hypertext Markup Language
WebHTMLElementol
implicit aria role list permitted aria roles directory, group, listbox, menu, menubar, none, presentation, radiogroup, tablist, toolbar, tree dom interface htmlolistelement attributes this element also accepts the global attributes.
<optgroup> - HTML: Hypertext Markup Language
WebHTMLElementoptgroup
implicit aria role group permitted aria roles no role permitted dom interface htmloptgroupelement note: optgroup elements may not be nested.
<option>: The HTML Option element - HTML: Hypertext Markup Language
WebHTMLElementoption
implicit aria role option permitted aria roles no role permitted dom interface htmloptionelement attributes this element includes the global attributes.
<output>: The Output element - HTML: Hypertext Markup Language
WebHTMLElementoutput
implicit aria role status permitted aria roles any dom interface htmloutputelement attributes this element includes the global attributes.
<p>: The Paragraph element - HTML: Hypertext Markup Language
WebHTMLElementp
implicit aria role no corresponding role permitted aria roles any dom interface htmlparagraphelement attributes this element only includes the global attributes.
<param>: The Object Parameter element - HTML: Hypertext Markup Language
WebHTMLElementparam
implicit aria role no corresponding role permitted aria roles no role permitted dom interface htmlparamelement attributes this element includes the global attributes.
<picture>: The Picture element - HTML: Hypertext Markup Language
WebHTMLElementpicture
implicit aria role no corresponding role permitted aria roles no role permitted dom interface htmlpictureelement attributes this element includes only global attributes.
<plaintext>: The Plain Text element (Deprecated) - HTML: Hypertext Markup Language
dom interface this element implements the htmlelement interface.
<pre>: The Preformatted Text element - HTML: Hypertext Markup Language
WebHTMLElementpre
implicit aria role no corresponding role permitted aria roles any dom interface htmlpreelement attributes this element only includes the global attributes.
<progress>: The Progress Indicator element - HTML: Hypertext Markup Language
WebHTMLElementprogress
implicit aria role progressbar permitted aria roles no role permitted dom interface htmlprogresselement attributes this element includes the global attributes.
<q>: The Inline Quotation element - HTML: Hypertext Markup Language
WebHTMLElementq
implicit aria role no corresponding role permitted aria roles any dom interface htmlquoteelement usage note: most modern browsers will automatically add quotation marks around text inside a <q> element.
<rb>: The Ruby Base element - HTML: Hypertext Markup Language
WebHTMLElementrb
permitted aria roles any dom interface htmlelement attributes this element only includes the global attributes.
<rp>: The Ruby Fallback Parenthesis element - HTML: Hypertext Markup Language
WebHTMLElementrp
implicit aria role no corresponding role permitted aria roles any dom interface htmlelement attributes this element only includes the global attributes.
<rt>: The Ruby Text element - HTML: Hypertext Markup Language
WebHTMLElementrt
implicit aria role no corresponding role permitted aria roles any dom interface htmlelement attributes this element only includes the global attributes.
<rtc>: The Ruby Text Container element - HTML: Hypertext Markup Language
WebHTMLElementrtc
permitted aria roles any dom interface htmlelement attributes this element only includes the global attributes.
<ruby> - HTML: Hypertext Markup Language
WebHTMLElementruby
implicit aria role no corresponding role permitted aria roles any dom interface htmlelement attributes this element only includes the global attributes.
<s> - HTML: Hypertext Markup Language
WebHTMLElements
implicit aria role no corresponding role permitted aria roles any dom interface htmlelement attributes this element only includes the global attributes.
<samp>: The Sample Output element - HTML: Hypertext Markup Language
WebHTMLElementsamp
implicit aria role no corresponding role permitted aria roles any dom interface htmlelement attributes this element only includes the global attributes.
<section>: The Generic Section element - HTML: Hypertext Markup Language
WebHTMLElementsection
implicit aria role region if the element has an accessible name, otherwise no corresponding role permitted aria roles alert, alertdialog, application, banner, complementary, contentinfo, dialog, document, feed, log, main, marquee, navigation, none, note, presentation, search, status, tabpanel dom interface htmlelement attributes this element only includes the global attributes.
<small>: the side comment element - HTML: Hypertext Markup Language
WebHTMLElementsmall
implicit aria role no corresponding role permitted aria roles any dom interface htmlelement attributes this element only includes the global attributes.
<source>: The Media or Image Source element - HTML: Hypertext Markup Language
WebHTMLElementsource
implicit aria role no corresponding role permitted aria roles no role permitted dom interface htmlsourceelement attributes this element includes the global attributes.
<strike> - HTML: Hypertext Markup Language
WebHTMLElementstrike
dom interface htmlelement attributes this element includes the global attributes.
<strong>: The Strong Importance element - HTML: Hypertext Markup Language
WebHTMLElementstrong
implicit aria role no corresponding role permitted aria roles any dom interface htmlelement attributes this element only includes the global attributes.
<sub>: The Subscript element - HTML: Hypertext Markup Language
WebHTMLElementsub
implicit aria role no corresponding role permitted aria roles any dom interface htmlelement attributes this element only includes the global attributes.
<summary>: The Disclosure Summary element - HTML: Hypertext Markup Language
WebHTMLElementsummary
implicit aria role button permitted aria roles no role permitted dom interface htmlelement attributes this element only includes the global attributes.
<sup>: The Superscript element - HTML: Hypertext Markup Language
WebHTMLElementsup
implicit aria role no corresponding role permitted aria roles any dom interface htmlelement attributes this element only includes the global attributes.
<table>: The Table element - HTML: Hypertext Markup Language
WebHTMLElementtable
permitted parents any element that accepts flow content implicit aria role table permitted aria roles any dom interface htmltableelement attributes this element includes the global attributes.
<tbody>: The Table Body element - HTML: Hypertext Markup Language
WebHTMLElementtbody
implicit aria role rowgroup permitted aria roles any dom interface htmltablesectionelement attributes this element includes the global attributes.
<td>: The Table Data Cell element - HTML: Hypertext Markup Language
WebHTMLElementtd
implicit aria role cell if a descendant of a <table> element permitted aria roles any dom interface htmltabledatacellelement attributes this element includes the global attributes.
<textarea> - HTML: Hypertext Markup Language
WebHTMLElementtextarea
implicit aria role textbox permitted aria roles no role permitted dom interface htmltextareaelement specifications specification status comment html living standardthe definition of '<textarea>' in that specification.
<tfoot>: The Table Foot element - HTML: Hypertext Markup Language
WebHTMLElementtfoot
implicit aria role rowgroup permitted aria roles any dom interface htmltablesectionelement attributes this element includes the global attributes.
<th> - HTML: Hypertext Markup Language
WebHTMLElementth
implicit aria role columnheader or rowheader permitted aria roles any dom interface htmltableheadercellelement attributes this element includes the global attributes.
<thead>: The Table Head element - HTML: Hypertext Markup Language
WebHTMLElementthead
implicit aria role rowgroup permitted aria roles any dom interface htmltablesectionelement attributes this element includes the global attributes.
<time> - HTML: Hypertext Markup Language
WebHTMLElementtime
implicit aria role no corresponding role permitted aria roles any dom interface htmltimeelement attributes like all other html elements, this element supports the global attributes.
<title>: The Document Title element - HTML: Hypertext Markup Language
WebHTMLElementtitle
dom interface htmltitleelement attributes this element only includes the global attributes.
<track>: The Embed Text Track element - HTML: Hypertext Markup Language
WebHTMLElementtrack
implicit aria role no corresponding role permitted aria roles no role permitted dom interface htmltrackelement attributes this element includes the global attributes.
<tt>: The Teletype Text element (obsolete) - HTML: Hypertext Markup Language
WebHTMLElementtt
permitted aria roles any dom interface htmlelement attributes this element only includes the global attributes examples basic example this example uses <tt> to show text entered into, and output by, a terminal application.
<u>: The Unarticulated Annotation (Underline) element - HTML: Hypertext Markup Language
WebHTMLElementu
implicit aria role no corresponding role permitted aria roles any dom interface htmlelement attributes this element only includes the global attributes.
<ul>: The Unordered List element - HTML: Hypertext Markup Language
WebHTMLElementul
implicit aria role list permitted aria roles directory, group, listbox, menu, menubar, none, presentation, radiogroup, tablist, toolbar, tree dom interface htmlulistelement attributes this element includes the global attributes.
<var>: The Variable element - HTML: Hypertext Markup Language
WebHTMLElementvar
implicit aria role no corresponding role permitted aria roles any dom interface htmlelement attributes this element only includes the global attributes.
<video>: The Video Embed element - HTML: Hypertext Markup Language
WebHTMLElementvideo
implicit aria role no corresponding role permitted aria roles application dom interface htmlvideoelement specifications specification feedback html living standardthe definition of '<video>' in that specification.
<wbr> - HTML: Hypertext Markup Language
WebHTMLElementwbr
implicit aria role no corresponding role permitted aria roles any dom interface htmlelement attributes this element only includes the global attributes.
<xmp> - HTML: Hypertext Markup Language
WebHTMLElementxmp
dom interface this element implements the htmlelement interface.
class - HTML: Hypertext Markup Language
classes allow css and javascript to select and access specific elements via the class selectors or functions like the dom method document.getelementsbyclassname.
contextmenu - HTML: Hypertext Markup Language
viafacebook() { window.open("https://facebook.com/sharer/sharer.php?u=" + "https://developer.mozilla.org/en/html/element/using_html_context_menus"); } function incfont() { document.getelementbyid("fontsizing").style.fontsize = "larger"; } function decfont() { document.getelementbyid("fontsizing").style.fontsize = "smaller"; } function changeimage() { var index = math.ceil(math.random() * 39 + 1); document.images[0].src = "https://developer.mozilla.org/media/img/promote/promobutton_mdn" + index + ".png"; } result specifications specification status comment html 5.1the definition of 'contextmenu' in that specification.
itemprop - HTML: Hypertext Markup Language
if the element is a meta element the value is the value of the element's content attribute if the element is an audio, embed, iframe, img, source, track, or video element the value is the resulting url string that results from parsing the value of the element's src attribute relative to the node document (part of the microdata dom api) of the element at the time the attribute is set if the element is an a, area, or link element the value is the resulting url string that results from parsing the value of the element's href attribute relative to the node document of the element at the time the attribute is set if the element is an object element the value is the resulting url string that results from ...
x-ms-format-detection - HTML: Hypertext Markup Language
links created through format detection do not appear in the dom.
Preloading content with rel="preload" - HTML: Hypertext Markup Language
for example, here we create a htmllinkelement instance, then attach it to the dom: var preloadlink = document.createelement("link"); preloadlink.href = "myscript.js"; preloadlink.rel = "preload"; preloadlink.as = "script"; document.head.appendchild(preloadlink); this means that the browser will preload the myscript.js file, but not actually use it yet.
Using the application cache - HTML: Hypertext Markup Language
on linux, you can find the setting at edit > preferences > advanced > network > offline web content and user data see also clearing the dom storage data.
Microformats - HTML: Hypertext Markup Language
these minimal patterns of html are used for marking up entities that range from fundamental to domain-specific information, such as people, organizations, events, and locations.
Identifying resources on the Web - HTTP
http/https hyper text transfer protocol (secure) javascript url-embedded javascript code mailto electronic mail address ssh secure shell tel telephone urn uniform resource names view-source source code of the resource ws/wss (encrypted) websocket connections authority www.example.com is the domain name or authority that governs the namespace.
Basics of HTTP - HTTP
choosing between www and non-www urls this article provides guidance on how to choose whether to use a www-prefixed domain or not, along with the consequences of that choice.
Reason: CORS header ‘Origin’ cannot be added - HTTP
this can happen if the javascript code is running with enhanced privileges allowing it access to multiple domains' content, for example.
Cross-Origin Resource Policy (CORP) - HTTP
the algorithm for checking if two origins are same site is defined in the html standard and involves checking the registrable domain.
CSP: frame-ancestors - HTTP
examples: http://*.example.com: matches all attempts to load from any subdomain of example.com using the http: url scheme.
CSP: upgrade-insecure-requests - HTTP
syntax content-security-policy: upgrade-insecure-requests; examples // header content-security-policy: upgrade-insecure-requests; // meta tag <meta http-equiv="content-security-policy" content="upgrade-insecure-requests"> with the above header set on a domain example.com that wants to migrate from http to https, non-navigational insecure resource requests are automatically upgraded (first-party as well as third-party requests).
Feature-Policy: autoplay - HTTP
when this policy is enabled and there were no user gestures, the promise returned by htmlmediaelement.play() will reject with a domexception.
Feature-Policy: encrypted-media - HTTP
when this policy is enabled, the promise returned by navigator.requestmediakeysystemaccess() will reject with a domexception.
Feature-Policy: midi - HTTP
when this policy is enabled, the promise returned by navigator.requestmidiaccess() will reject with a domexception.
Host - HTTP
WebHTTPHeadersHost
header type request header forbidden header name yes syntax host: <host>:<port> directives <host> the domain name of the server (for virtual hosting).
Large-Allocation - HTTP
this check can be disabled with the "dom.largeallocation.
NEL - HTTP
WebHTTPHeadersNEL
header type response header forbidden header name no syntax nel: { "report_to": "name_of_reporting_group", "max_age": 12345, "include_subdomains": false, "success_fraction": 0.0, "failure_fraction": 1.0 } specifications specification network error logging ...
Origin - HTTP
WebHTTPHeadersOrigin
<hostname> the domain name of the server (for virtual hosting) or the ip.
Server-Timing - HTTP
this interface is restricted to the same origin, but you can use the timing-allow-origin header to specify the domains that are allowed to access the server metrics.
X-Forwarded-Host - HTTP
header type request header forbidden header name no syntax x-forwarded-host: <host> directives <host> the domain name of the forwarded server.
Proxy servers and tunneling - HTTP
the example below will work in an environment where the internal dns server is set up so that it can only resolve internal host names, and the goal is to use a proxy only for hosts that aren't resolvable: function findproxyforurl(url, host) { if (isresolvable(host)) return "direct"; else return "proxy proxy.mydomain.com:8080"; } see proxy auto-configuration (pac) for more examples.
A re-introduction to JavaScript (JS tutorial) - JavaScript
this is particularly useful for dealing with tree structures, such as those found in the browser dom.
About JavaScript - JavaScript
web browsers typically use the public api to create host objects responsible for reflecting the dom into javascript.
JavaScript data types and data structures - JavaScript
usually, to bind data to a dom node, one could set properties directly on the object, or use data-* attributes.
Functions - JavaScript
for example, getting all the nodes of a tree structure (such as the dom) is easier via recursion: function walktree(node) { if (node == null) // return; // do something with node for (var i = 0; i < node.childnodes.length; i++) { walktree(node.childnodes[i]); } } compared to the function loop, each recursive call itself makes many recursive calls here.
Indexed collections - JavaScript
the simplest way to do this is as follows: let colors = ['red', 'green', 'blue'] for (let i = 0; i < colors.length; i++) { console.log(colors[i]) } if you know that none of the elements in your array evaluate to false in a boolean context—if your array consists only of dom nodes, for example—you can use a more efficient idiom: let divs = document.getelementsbytagname('div') for (let i = 0, div; div = divs[i]; i++) { /* process div in some way */ } this avoids the overhead of checking the length of the array, and ensures that the div variable is reassigned to the current item each time around the loop for added convenience.
Keyed collections - JavaScript
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.
Numbers and dates - JavaScript
random() returns a random number between 0 and 1.
Working with objects - JavaScript
examples are as follows: // four variables are created and assigned in a single go, // separated by commas var myobj = new object(), str = 'mystring', rand = math.random(), obj = new object(); myobj.type = 'dot syntax'; myobj['date created'] = 'string with space'; myobj[str] = 'string value'; myobj[rand] = 'random number'; myobj[obj] = 'object'; myobj[''] = 'even an empty string'; console.log(myobj); please note that all keys in the square bracket notation are converted to string unless th...
Private class fields - JavaScript
class classwithprivatefield { #privatefield constructor() { this.#privatefield = 42 this.#randomfield = 666 // syntax error } } const instance = new classwithprivatefield() instance.#privatefield === 42 // syntax error private methods private static methods like their public equivalent, private static methods are called on the class itself, not instances of the class.
Classes - JavaScript
a function with a superclass as input and a subclass extending that superclass as output can be used to implement mix-ins in ecmascript: let calculatormixin = base => class extends base { calc() { } }; let randomizermixin = base => class extends base { randomize() { } }; a class that uses these mix-ins can then be written like this: class foo { } class bar extends calculatormixin(randomizermixin(foo)) { } specifications specification ecmascript (ecma-262)the definition of 'class definitions' in that specification.
Error: Permission denied to access property "x" - JavaScript
this is likely an <iframe> element loaded from a different domain for which you violated the same-origin policy.
Array.prototype.reduceRight() - JavaScript
) { return a.concat(b); }, []); // flattened is [4, 5, 2, 3, 0, 1] run a list of asynchronous functions with callbacks in series each passing their results to the next const waterfall = (...functions) => (callback, ...args) => functions.reduceright( (composition, fn) => (...results) => fn(composition, ...results), callback )(...args); const randint = max => math.floor(math.random() * max) const add5 = (callback, x) => { settimeout(callback, randint(1000), x + 5); }; const mult3 = (callback, x) => { settimeout(callback, randint(1000), x * 3); }; const sub2 = (callback, x) => { settimeout(callback, randint(1000), x - 2); }; const split = (callback, x) => { settimeout(callback, randint(1000), x, x); }; const add = (callback, x, y) => { settimeout(callback, randint...
Function.prototype.bind() - JavaScript
function latebloomer() { this.petalcount = math.floor(math.random() * 12) + 1; } // declare bloom after a delay of 1 second latebloomer.prototype.bloom = function() { window.settimeout(this.declare.bind(this), 1000); }; latebloomer.prototype.declare = function() { console.log(`i am a beautiful flower with ${this.petalcount} petals!`); }; const flower = new latebloomer(); flower.bloom(); // after 1 second, calls 'flower.declare()' bound functions used ...
Intl.DateTimeFormat() constructor - JavaScript
possible values are: "long" (e.g., anno domini) "short" (e.g., ad) "narrow" (e.g., a) year the representation of the year.
Intl.Locale.prototype.region - JavaScript
for example, english is spoken in the united kingdom and the united states of america, but there are differences in spelling and other language conventions between those two countries.
Map - JavaScript
note: as of es5, this can be bypassed by using object.create(null), but this is seldom done.
Object.create() - JavaScript
note that such a different order may arise statically via disparate fixed codings such as here, but also dynamically via whatever the order any such property-adding code-branches actually get executed at runtime as depends on inputs and/or random-variables.
Object.entries() - JavaScript
examples const obj = { foo: 'bar', baz: 42 }; console.log(object.entries(obj)); // [ ['foo', 'bar'], ['baz', 42] ] // array like object const obj = { 0: 'a', 1: 'b', 2: 'c' }; console.log(object.entries(obj)); // [ ['0', 'a'], ['1', 'b'], ['2', 'c'] ] // array like object with random key ordering const anobj = { 100: 'a', 2: 'b', 7: 'c' }; console.log(object.entries(anobj)); // [ ['2', 'b'], ['7', 'c'], ['100', 'a'] ] // getfoo is property which isn't enumerable const myobj = object.create({}, { getfoo: { value() { return this.foo; } } }); myobj.foo = 'bar'; console.log(object.entries(myobj)); // [ ['foo', 'bar'] ] // non-object argument will be coerced to an object console...
Object.keys() - JavaScript
examples using object.keys // simple array const arr = ['a', 'b', 'c']; console.log(object.keys(arr)); // console: ['0', '1', '2'] // array-like object const obj = { 0: 'a', 1: 'b', 2: 'c' }; console.log(object.keys(obj)); // console: ['0', '1', '2'] // array-like object with random key ordering const anobj = { 100: 'a', 2: 'b', 7: 'c' }; console.log(object.keys(anobj)); // console: ['2', '7', '100'] // getfoo is a property which isn't enumerable const myobj = object.create({}, { getfoo: { value: function () { return this.foo; } } }); myobj.foo = 1; console.log(object.keys(myobj)); // console: ['foo'] if you want all properties—including non-enumerables—see ob...
Object.prototype.propertyIsEnumerable() - JavaScript
built-in properties: var a = ['is enumerable']; a.propertyisenumerable(0); // returns true a.propertyisenumerable('length'); // returns false math.propertyisenumerable('random'); // returns false this.propertyisenumerable('math'); // returns false direct vs.
Object.values() - JavaScript
examples using object.values const obj = { foo: 'bar', baz: 42 }; console.log(object.values(obj)); // ['bar', 42] // array-like object const arraylikeobj1 = { 0: 'a', 1: 'b', 2: 'c' }; console.log(object.values(arraylikeobj1 )); // ['a', 'b', 'c'] // array-like object with random key ordering // when using numeric keys, the values are returned in the keys' numerical order const arraylikeobj2 = { 100: 'a', 2: 'b', 7: 'c' }; console.log(object.values(arraylikeobj2 )); // ['b', 'c', 'a'] // getfoo is property which isn't enumerable const my_obj = object.create({}, { getfoo: { value: function() { return this.foo; } } }); my_obj.foo = 'bar'; console.log(object.values(my_obj))...
RegExp - JavaScript
extracting sub-domain name from url let url = 'http://xxx.domain.com' console.log(/[^.]+/.exec(url)[0].substr(7)) // logs 'xxx' instead of using regular expressions for parsing urls, it is usually better to use the browsers built-in url parser by using the url api.
String.prototype.codePointAt() - JavaScript
https://mths.be/codepointat v0.2.0 by @mathias */ if (!string.prototype.codepointat) { (function() { 'use strict'; // needed to support `apply`/`call` with `undefined`/`null` var defineproperty = (function() { // ie 8 only supports `object.defineproperty` on dom elements try { var object = {}; var $defineproperty = object.defineproperty; var result = $defineproperty(object, object, object) && $defineproperty; } catch(error) {} return result; }()); var codepointat = function(position) { if (this == null) { throw typeerror(); } var string = string(this); var size = string.len...
String.fromCodePoint() - JavaScript
depoint >> 10) + 0xd800, // highsurrogate (codepoint % 0x400) + 0xdc00 // lowsurrogate ); } if (codelen >= 0x3fff) { result += stringfromcharcode.apply(null, codeunits); codeunits.length = 0; } } return result + stringfromcharcode.apply(null, codeunits); }; try { // ie 8 only supports `object.defineproperty` on dom elements object.defineproperty(string, "fromcodepoint", { "value": fromcodepoint, "configurable": true, "writable": true }); } catch(e) { string.fromcodepoint = fromcodepoint; } }(string.fromcharcode)); examples using fromcodepoint() valid input: string.fromcodepoint(42); // "*" string.fromcodepoint(65, 90); // "az" string.fromcodepoint(0x404); //...
Symbol.toStringTag - JavaScript
ass validatorclass {} object.prototype.tostring.call(new validatorclass()); // "[object object]" custom tag with tostringtag now, with the help of tostringtag, you are able to set your own custom tag: class validatorclass { get [symbol.tostringtag]() { return 'validator'; } } object.prototype.tostring.call(new validatorclass()); // "[object validator]" tostringtag available on all dom prototype objects due to a webidl spec change in mid-2020, browsers are adding a symbol.tostringtag property to all dom prototype objects.
WeakRef() constructor - JavaScript
class counter { constructor(element) { // remember a weak reference to a dom element this.ref = new weakref(element); this.start(); } } specifications specification weakrefsthe definition of 'weakref constructor' in that specification.
WeakRef - JavaScript
examples using a weakref object this example starts a counter shown in a dom element, stopping when the element doesn't exist anymore: class counter { constructor(element) { // remember a weak reference to the dom element this.ref = new weakref(element); this.start(); } start() { if (this.timer) { return; } this.count = 0; const tick = () => { // get the element from the weak reference, if it still exists const eleme...
eval() - JavaScript
many dom apis are designed with this in mind, so you can (and should) write: // instead of settimeout(" ...
Standard built-in objects - JavaScript
for more information about the distinction between the dom and core javascript, see javascript technologies overview.
Iteration protocols - JavaScript
thus, it is seldom useful to implement the iterator protocol without also implementing iterable.
export - JavaScript
but a default export can be imported with any name for example: // file test.js let k; export default k = 12; // some other file import m from './test'; // note that we have the freedom to use import m instead of import k, because k was default export console.log(m); // will log 12 you can also rename named exports to avoid naming conflicts: export { myfunction as function1, myvariable as variable }; re-exporting / aggregating it is also possible to "import/export" from different modules in a parent module so that they are available to import from that modu...
for...of - JavaScript
const iterable = new set([1, 1, 2, 2, 3, 3]); for (const 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 nodelist: 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 nodelist.prototype[symbol.iterator] const articleparagraphs = document.queryselectorall('article > p'); for (const paragraph of articleparagraphs) { paragraph.classlist.add(...
JavaScript
for information about api specifics to web pages, please see web apis and dom.
Web audio codec guide - Web media technologies
µ-law is primarily used in north america and japan, with a-law being predominant elsewhere.
Web video codec guide - Web media technologies
it supports several hdr imiplementations, and offers substantial freedom in selecting frame rates, aspect ratios, and frame sizes.
Animation performance and frame rate - Web Performance
the predominance of green is telling us that we're spending a lot of time painting.
Add to Home screen - Progressive web apps (PWAs)
the manifest for our sample app looks like this: { "background_color": "purple", "description": "shows random fox pictures.
How to make PWAs installable - Progressive web apps (PWAs)
requirements to make the web site installable, it needs the following things in place: a web manifest, with the correct fields filled in the web site to be served from a secure (https) domain an icon to represent the app on the device a service worker registered, to allow 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.
Making PWAs work offline with Service workers - Progressive web apps (PWAs)
they run on a separate thread from the main javascript code of our page, and don't have any access to the dom structure.
Web API reference - Web technology reference
WebReferenceAPI
document object model the dom is an api that allows access to and modification of the current document.
pointer-events - SVG: Scalable Vector Graphics
the rect underneath will change color whether you are clicking on the circle or the rect itself --> <rect x="10" y="0" height="10" width="10" fill="black" /> <circle cx="15" cy="5" r="4" fill="white" pointer-events="none" /> </svg> window.addeventlistener('mouseup', (e) => { // let's pick a random color between #000000 and #ffffff const color = math.round(math.random() * 0xffffff) // let's format the color to fit css requirements const fill = '#' + color.tostring(16).padstart(6,'0') // let's apply our color in the // element we actually clicked on e.target.style.fill = fill }) as a presentation attribute, it can be applied to any element but it is mostly relevant only on ...
seed - SVG: Scalable Vector Graphics
WebSVGAttributeseed
the seed attribute represents the starting number for the pseudo random number generator of the <feturbulence> filter primitive.
stemh - SVG: Scalable Vector Graphics
WebSVGAttributestemh
the stem width refers to the dominant stem of the font.
stemv - SVG: Scalable Vector Graphics
WebSVGAttributestemv
the measurement is meant for the dominant vertical stem in the font because there might be different groupings of vertical stems (e.g., one main one, and one lighter weight one as for an uppercase "m" or "n").
<altGlyph> - SVG: Scalable Vector Graphics
WebSVGElementaltGlyph
tributes core attributes most notably: id lang styling attributes class, style conditional processing attributes most notably: requiredextensions, systemlanguage event attributes global event attributes, document element event attributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, dominant-baseline, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, text-anchor, transform, vector-effect, visibility xlink attributes xlink:href, xlink:type, xlink:role, xlink:arcrole, xlink:title, xlink:show, xlink:actuate dom inter...
<altGlyphDef> - SVG: Scalable Vector Graphics
usage context categoriestext content elementpermitted contenteither: one or more <glyphref> elements, or one or more <altglyphitem> elements attributes global attributes core attributes specific attributes none dom interface this element implements the svgaltglyphdefelement interface.
<altGlyphItem> - SVG: Scalable Vector Graphics
usage context categoriestext content elementpermitted contentone or more <glyphref> elements example attributes global attributes core attributes specific attributes none dom interface this element implements the svgaltglyphitemelement interface.
<animateColor> - SVG: Scalable Vector Graphics
entany number of the following elements, in any order:descriptive elements attributes global attributes conditional processing attributes core attributes animation event attributes xlink attributes animation attribute target attributes animation timing attributes animation value attributes animation addition attributes externalresourcesrequired specific attributes by from to dom interface this element implements the svganimatecolorelement interface.
<animateTransform> - SVG: Scalable Vector Graphics
nite"/> </polygon> </svg> live sample attributes global attributes conditional processing attributes » core attributes » animation event attributes » xlink attributes » animation attribute target attributes » animation timing attributes » animation value attributes » animation addition attributes » externalresourcesrequired specific attributes by from to type dom interface this element implements the svganimatetransformelement interface.
<color-profile> - SVG: Scalable Vector Graphics
usage context categoriesnonepermitted contentany number of the following elements, in any order:descriptive elements attributes global attributes core attributes » xlink attributes » specific attributes local name rendering-intent xlink:href dom interface this element implements the svgcolorprofileelement interface.
<cursor> - SVG: Scalable Vector Graphics
WebSVGElementcursor
usage context categoriesnonepermitted contentany number of the following elements, in any order:descriptive elements attributes global attributes conditional processing attributes core attributes xlink attributes externalresourcesrequired specific attributes x y xlink:href dom interface this element implements the svgcursorelement interface.
<feBlend> - SVG: Scalable Vector Graphics
WebSVGElementfeBlend
usage context categoriesfilter primitive elementpermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes presentation attributes filter primitive attributes class style specific attributes in in2 mode dom interface this element implements the svgfeblendelement interface.
<feColorMatrix> - SVG: Scalable Vector Graphics
usage context categoriesfilter primitive elementpermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes presentation attributes filter primitive attributes class style specific attributes in type values dom interface this element implements the svgfecolormatrixelement interface.
<feComponentTransfer> - SVG: Scalable Vector Graphics
usage context categoriesfilter primitive elementpermitted contentany number of the following elements, in any order:<fefunca>, <fefuncr>, <fefuncb>, <fefuncg> attributes global attributes core attributes presentation attributes filter primitive attributes class style specific attributes in dom interface this element implements the svgfecomponenttransferelement interface.
<feComposite> - SVG: Scalable Vector Graphics
k1, k2, k3 and k4 indicate the values of the attributes with the same name usage context categoriesfilter primitive elementpermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes » presentation attributes » filter primitive attributes » class style specific attributes in in2 operator k1 k2 k3 k4 dom interface this element implements the svgfecompositeelement interface.
<feConvolveMatrix> - SVG: Scalable Vector Graphics
(9+8+7+6+5+4+3+2+1) usage context categoriesfilter primitive elementpermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes presentation attributes filter primitive attributes class style specific attributes in order kernelmatrix divisor bias targetx targety edgemode kernelunitlength preservealpha dom interface this element implements the svgfeconvolvematrixelement interface.
<feDiffuseLighting> - SVG: Scalable Vector Graphics
attributes global attributes core attributes presentation attributes filter primitive attributes class style specific attributes in surfacescale diffuseconstant kernelunitlength dom interface this element implements the svgfediffuselightingelement interface.
<feDisplacementMap> - SVG: Scalable Vector Graphics
usage context categoriesfilter primitive elementpermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes presentation attributes filter primitive attributes class style specific attributes in in2 scale xchannelselector ychannelselector dom interface this element implements the svgfedisplacementmapelement interface.
<feDistantLight> - SVG: Scalable Vector Graphics
usage context categorieslight source elementpermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes specific attributes azimuth elevation dom interface this element implements the svgfedistantlightelement interface.
<feFlood> - SVG: Scalable Vector Graphics
WebSVGElementfeFlood
usage context categoriesfilter primitive elementpermitted contentany number of the following elements, in any order:<animate>, <animatecolor>, <set> attributes global attributes core attributes presentation attributes filter primitive attributes class style specific attributes flood-color flood-opacity dom interface this element implements the svgfefloodelement interface.
<feFuncA> - SVG: Scalable Vector Graphics
WebSVGElementfeFuncA
usage context categoriesnonepermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes transfer function attributes specific attributes none dom interface this element implements the svgfefuncaelement interface.
<feFuncB> - SVG: Scalable Vector Graphics
WebSVGElementfeFuncB
usage context categoriesnonepermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes transfer function attributes specific attributes none dom interface this element implements the svgfefuncbelement interface.
<feFuncG> - SVG: Scalable Vector Graphics
WebSVGElementfeFuncG
usage context categoriesnonepermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes transfer function attributes specific attributes none dom interface this element implements the svgfefuncgelement interface.
<feFuncR> - SVG: Scalable Vector Graphics
WebSVGElementfeFuncR
usage context categoriesnonepermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes transfer function attributes specific attributes none dom interface this element implements the svgfefuncrelement interface.
<feGaussianBlur> - SVG: Scalable Vector Graphics
usage context categoriesfilter primitive elementpermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes presentation attributes filter primitive attributes class style specific attributes in stddeviation edgemode dom interface this element implements the svgfegaussianblurelement interface.
<feImage> - SVG: Scalable Vector Graphics
WebSVGElementfeImage
ge, it is rasterized.) usage context categoriesfilter primitive elementpermitted contentany number of the following elements, in any order:<animate>, <animatetransform>, <set> attributes global attributes core attributes presentation attributes filter primitive attributes xlink attributes class style externalresourcesrequired specific attributes preserveaspectratio xlink:href dom interface this element implements the svgfeimageelement interface.
<feMerge> - SVG: Scalable Vector Graphics
WebSVGElementfeMerge
> <femerge> <femergenode in="blur2" /> <femergenode in="sourcegraphic" /> </femerge> </filter> <rect x="40" y="40" width="100" height="100" style="stroke: #000000; fill: green; filter: url(#feoffset);" /> </svg> result attributes global attributes core attributes presentation attributes filter primitive attributes class style specific attributes none dom interface this element implements the svgfemergeelement interface.
<feMergeNode> - SVG: Scalable Vector Graphics
<femergenode in="sourcegraphic" /> </femerge> </filter> <rect x="40" y="40" width="100" height="100" style="stroke: #000000; fill: green; filter: url(#feoffset);" /> <rect x="40" y="40" width="100" height="100" style="stroke: #000000; fill: green;" /> </svg> result attributes global attributes core attributes » specific attributes in dom interface this element implements the svgfemergenodeelement interface.
<feMorphology> - SVG: Scalable Vector Graphics
usage context categoriesfilter primitive elementpermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes presentation attributes filter primitive attributes class style specific attributes in operator radius dom interface this element implements the svgfemorphologyelement interface.
<feOffset> - SVG: Scalable Vector Graphics
WebSVGElementfeOffset
usage context categoriesfilter primitive elementpermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes presentation attributes filter primitive attributes class style specific attributes in dx dy dom interface this element implements the svgfeoffsetelement interface.
<fePointLight> - SVG: Scalable Vector Graphics
usage context categorieslight source elementpermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes specific attributes x y z dom interface this element implements the svgfepointlightelement interface.
<feSpecularLighting> - SVG: Scalable Vector Graphics
attributes global attributes core attributes presentation attributes filter primitive attributes class style specific attributes in surfacescale specularconstant specularexponent kernelunitlength dom interface this element implements the svgfespecularlightingelement interface.
<feSpotLight> - SVG: Scalable Vector Graphics
usage context categorieslight source elementpermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes specific attributes x y z pointsatx pointsaty pointsatz specularexponent limitingconeangle dom interface this element implements the svgfespotlightelement interface.
<feTile> - SVG: Scalable Vector Graphics
WebSVGElementfeTile
usage context categoriesfilter primitive elementpermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes presentation attributes filter primitive attributes class style specific attributes in dom interface this element implements the svgfetileelement interface.
<feTurbulence> - SVG: Scalable Vector Graphics
usage context categoriesfilter primitive elementpermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes presentation attributes filter primitive attributes class style specific attributes basefrequency numoctaves seed stitchtiles type dom interface this element implements the svgfeturbulenceelement interface.
<filter> - SVG: Scalable Vector Graphics
WebSVGElementfilter
usage context categoriesnonepermitted contentany number of the following elements, in any order:descriptive elementsfilter primitive elements<animate>, <set> attributes global attributes core attributes presentation attributes xlink attributes class style externalresourcesrequired specific attributes x y width height filterres filterunits primitiveunits xlink:href dom interface this element implements the svgfilterelement interface.
<font-face-format> - SVG: Scalable Vector Graphics
usage context categoriesfont elementpermitted contentempty attributes global attributes core attributes specific attributes string dom interface this element implements the svgfontfaceformatelement interface.
<font-face-name> - SVG: Scalable Vector Graphics
usage context categoriesnonepermitted contentempty attributes global attributes core attributes » specific attributes name dom interface this element implements the svgfontfacenameelement interface.
<font-face-src> - SVG: Scalable Vector Graphics
usage context categoriesfont elementpermitted contentone or more of the following elements, in any order:<font-face-name>, <font-face-uri> attributes global attributes core attributes specific attributes none dom interface this element implements the svgfontfacesrcelement interface.
<font-face-uri> - SVG: Scalable Vector Graphics
usage context categoriesfont elementpermitted contentany number of the following elements, in any order:<font-face-format> attributes global attributes core attributes xlink attributes specific attributes xlink:href dom interface this element implements the svgfontfaceurielement interface.
<font-face> - SVG: Scalable Vector Graphics
WebSVGElementfont-face
font-weight font-stretch font-size unicode-range units-per-em panose-1 stemv stemh slope cap-height x-height accent-height ascent descent widths bbox ideographic alphabetic mathematical hanging v-ideographic v-alphabetic v-mathematical v-hanging underline-position underline-thickness strikethrough-position strikethrough-thickness overline-position overline-thickness dom interface this element implements the svgfontfaceelement interface.
<font> - SVG: Scalable Vector Graphics
WebSVGElementfont
ext categoriesfont elementpermitted contentany number of the following elements, in any order:descriptive elements<font-face>, <glyph>, <hkern>, <missing-glyph>, <vkern> attributes global attributes core attributes presentation attributes class style externalresourcesrequired specific attributes horiz-origin-x horiz-origin-y horiz-adv-x vert-origin-x vert-origin-y vert-adv-y dom interface this element implements the svgfontelement interface.
<glyph> - SVG: Scalable Vector Graphics
WebSVGElementglyph
ef>, <clippath>, <color-profile>, <cursor>, <filter>, <font>, <font-face>, <foreignobject>, <image>, <marker>, <mask>, <pattern>, <script>, <style>, <switch>, <text>, <view> attributes global attributes core attributes presentation attributes class style specific attributes d horiz-adv-x vert-origin-x vert-origin-y vert-adv-y unicode glyph-name orientation arabic-form lang dom interface this element implements the svgglyphelement interface.
<glyphRef> - SVG: Scalable Vector Graphics
WebSVGElementglyphRef
usage context categoriestext content elementpermitted contentempty attributes global attributes core attributes » presentation attributes » xlink attributes » class style specific attributes x y dx dy glyphref format xlink:href dom interface this element implements the svgglyphrefelement interface.
<hatch> - SVG: Scalable Vector Graphics
WebSVGElementhatch
goriesnever-rendered element, paint server elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements<hatchpath>, <script>, <style> attributes global attributes core attributes global event attributes presentation attributes style attributes specific attributes x y pitch rotate hatchunits hatchcontentunits transform href dom interface this element implements the svghatchelement interface.
<hatchpath> - SVG: Scalable Vector Graphics
WebSVGElementhatchpath
usage context categoriesnonepermitted contentany number of the following elements, in any order:animation elementsdescriptive elements<script>, <style> attributes global attributes core attributes global event attributes presentation attributes style attributes specific attributes d offset dom interface this element implements the svghatchpathelement interface.
<hkern> - SVG: Scalable Vector Graphics
WebSVGElementhkern
usage context categoriesfont elementpermitted contentempty attributes global attributes core attributes specific attributes u1 g1 u2 g2 k dom interface this element implements the svghkernelement interface.
<image> - SVG: Scalable Vector Graphics
WebSVGElementimage
dom interface <image> implements the svgimageelement interface.
<metadata> - SVG: Scalable Vector Graphics
WebSVGElementmetadata
usage context categoriesdescriptive elementpermitted contentany elements or character data attributes global attributes core attributes global event attributes specific attributes none dom interface this element implements the svgmetadataelement interface.
<missing-glyph> - SVG: Scalable Vector Graphics
tsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>, <color-profile>, <cursor>, <filter>, <font>, <font-face>, <foreignobject>, <image>, <marker>, <mask>, <pattern>, <script>, <style>, <switch>, <text>, <view> attributes global attributes core attributes presentation attributes class style specific attributes d horiz-adv-x vert-origin-x vert-origin-y vert-adv-y dom interface this element implements the svgmissingglyphelement interface.
<mpath> - SVG: Scalable Vector Graphics
WebSVGElementmpath
usage context categoriesanimation elementpermitted contentany number of the following elements, in any order:descriptive elements attributes global attributes core attributes » xlink attributes » externalresourcesrequired specific attributes xlink:href dom interface this element implements the svgmpathelement interface.
<script> - SVG: Scalable Vector Graphics
WebSVGElementscript
while svg's script element is equivalent to the html <script> element, it has some discrepancies, like it uses the href attribute instead of src and it doesn't support ecmascript modules so far (see browser compatibility below for details) html,body,svg { height:100% } <svg viewbox="0 0 10 10" xmlns="http://www.w3.org/2000/svg"> <script> // <![cdata[ window.addeventlistener('domcontentloaded', () => { function getcolor () { const r = math.round(math.random() * 255).tostring(16).padstart(2,'0') const g = math.round(math.random() * 255).tostring(16).padstart(2,'0') const b = math.round(math.random() * 255).tostring(16).padstart(2,'0') return `#${r}${g}${b}` } document.queryselector('circle').addeventlistener('click', (e) => { e.ta...
<solidcolor> - SVG: Scalable Vector Graphics
dom interface this element implements the svgsolidcolorelement interface.
<switch> - SVG: Scalable Vector Graphics
WebSVGElementswitch
riescontainer elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elements<a>, <foreignobject>, <g>, <image>, <svg>, <switch>, <text>, <use> attributes global attributes conditional processing attributes core attributes graphical event attributes presentation attributes class style externalresourcesrequired transform dom interface this element implements the svgswitchelement interface.
<text> - SVG: Scalable Vector Graphics
WebSVGElementtext
attributes class, style, font-family, font-size, font-size-adjust, font-stretch, font-style, font-variant, font-weight conditional processing attributes most notably: requiredextensions, systemlanguage event attributes global event attributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, dominant-baseline, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, text-anchor, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-co...
<tref> - SVG: Scalable Vector Graphics
WebSVGElementtref
content element, text content child elementpermitted contentany number of the following elements, in any order:descriptive elements<animate>, <animatecolor>, <set> attributes global attributes conditional processing attributes core attributes graphical event attributes presentation attributes xlink attributes class style externalresourcesrequired specific attributes xlink:href dom interface this element implements the svgtrefelement interface.
<tspan> - SVG: Scalable Vector Graphics
WebSVGElementtspan
e; animatable: yes global attributes core attributes most notably: id, tabindex styling attributes class, style conditional processing attributes most notably: requiredextensions, systemlanguage event attributes global event attributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, dominant-baseline, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, text-anchor, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-co...
<view> - SVG: Scalable Vector Graphics
WebSVGElementview
alsizeview" viewbox="0 0 600 200"/> <view id="doublesizeview" viewbox="0 0 300 100"/> <a xlink:href="#halfsizeview"> <text x="5" y="20" font-size="20">half size</text> </a> <a xlink:href="#normalsizeview"> <text x="5" y="40" font-size="20">normal size</text> </a> <a xlink:href="#doublesizeview"> <text x="5" y="60" font-size="20">double size</text> </a> </svg> result dom interface this element implements the svgviewelement interface.
<vkern> - SVG: Scalable Vector Graphics
WebSVGElementvkern
usage context categoriesfont elementpermitted contentempty attributes global attributes core attributes specific attributes u1 g1 u2 g2 k dom interface this element implements the svgvkernelement interface.
Specification Deviations - SVG: Scalable Vector Graphics
note that this extension does not mean that we add a css::cssstyledeclaration 'style' property to the dom of elements that do not implement the svgstylable interface.
Getting started - SVG: Scalable Vector Graphics
finally, svg can be created dynamically with javascript and injected into the html dom.
Introduction - SVG: Scalable Vector Graphics
svg does offer benefits, some of which include having a dom interface available for it, and not requiring third-party extensions.
Paths - SVG: Scalable Vector Graphics
WebSVGTutorialPaths
<svg width="190" height="160" xmlns="http://www.w3.org/2000/svg"> <path d="m 10 80 q 52.5 10, 95 80 t 180 80" stroke="black" fill="transparent"/> </svg> both curves produce similar results, although the cubic one allows greater freedom in exactly what the curve looks like.
SVG In HTML Introduction - SVG: Scalable Vector Graphics
wards compatible to browsers that do not support svg; simply, no background appears in them it's very simple and performs very well the picture dynamically sizes itself to the required size in an intelligent way we can have declarative style rules applying to both html and svg the same script manipulates both html and svg the document is entirely standards-based to add a linked image with dom methods to an embedded svg element, one has to use setattributens to set href.
SVG fonts - SVG: Scalable Vector Graphics
k="20" /> referencing a font when you have put together your font declaration as described above, you can just use a simple font-family attribute to actually apply the font to some svg text: <font> <font-face font-family="super sans" /> <!-- and so on --> </font> <text font-family="super sans">my text uses super sans</text> however, you are free to combine several methods for great freedom of how and where to define the font.
Features restricted to secure contexts - Web security
61 15 11.1 in development (behind the dom.payments.request.enabled pref).
Securing your site - Web security
http access control the cross-origin resource sharing standard provides a way to specify what content may be loaded from other domains.
Transport Layer Security - Web security
the configuration file may need some adjustments to include custom settings, so be sure to review the generated configuration before using it; installing the configuration file without ensuring any references to domain names and the like are correct will result in a server that just doesn't work.
Tutorials
javascript patterns a javascript pattern and antipattern collection that covers function patterns, jquery patterns, jquery plugin patterns, design patterns, general patterns, literals and constructor patterns, object creation patterns, code reuse patterns, dom.
xml:base - XML: Extensible Markup Language
WebXMLxml:base
<html> <head> <base href="https://mydomain.com"> <style> .link { stroke: #999; stroke-opacity: .6; } marker#arrow { fill: black; } </style> </head> <body> <svg width="100%" height="100%" xml:base=""> <defs> <marker id="arrow" viewbox="0 -5 10 10" refx="0" refy="0" markerwidth="20" markerheight="20" orient="auto"> <path d="m0,-5l10,0l0,5"></path> </marker> </defs> <line x1="100" y1="100" x2="333...
Index - XSLT: Extensible Stylesheet Language Transformations
WebXSLTIndex
10 javascript/xslt bindings dom, javascript, xml, xslt javascript can run xslt transformations through the xsltprocessor object.
An Overview - XSLT: Extensible Stylesheet Language Transformations
:netscape's uses a structure similar to the w3c dom as its tree structure, but others are possible.
Web technology for developers
web technology references web apis reference material for each of the individual apis that comprise the web's powerful scriptability, including the dom and all of the related apis and interfaces you can use to build web content and apps.